﻿/* ═══════════════════════════════════════════════════════════════
   Avocato App — منسوخ من ثيم توأم Work Hub (أصله Next POS). ⏳ ألوان ThemeHelper بتاع ديسكتوب أفوكاتو (ThemeAccent …) بتتظبط مع أول شاشة
   الوضعان: <html data-theme="dark|light"> والاتجاه dir="rtl|ltr"
   ═══════════════════════════════════════════════════════════════ */

:root, html[data-theme="dark"] {
  /* 🎨 2026-11-22 (المهندس): نفس ThemeHelper.cs فى ديسكتوب أفوكاتو (الغامق: ذهبى بدل الأزرق) */
  --bg:        #0F172A;
  --header-bg: #1E293B;
  --footer-bg: #0B1220;
  --card-bg:   #1E293B;
  --field-bg:  #0F172A;
  --text:      #FFFFFF;
  --muted:     #94A3B8;
  --accent:    #C9A227;
  --border:    #475569;
  --nav-bg:    #1E293B;
  --nav-header:#0F172A;
  --nav-field: #0F172A;
  --nav-text:  #FFFFFF;
  --nav-muted: #94A3B8;
  --success:   #22C55E;
  --warning:   #F59E0B;
  --danger:    #EF4444;
  --info:      #3B82F6;
  --overlay:   rgba(0,0,0,.55);
}

html[data-theme="light"] {   /* 🎨 نفس ThemeHelper.cs (الفاتح): خلفية دافية + كحلى #1E3A5F */
  --bg:        #F4F4F1;
  --header-bg: #FFFFFF;
  --footer-bg: #E4E2DC;
  --card-bg:   #FFFFFF;
  --field-bg:  #FFFFFF;
  --text:      #23303F;
  --muted:     #6E6A62;
  --accent:    #1E3A5F;
  --border:    #D9D5CC;
  --nav-bg:    #F4F4F1;
  --nav-header:#EDEEE9;
  --nav-field: #FFFFFF;
  --nav-text:  #23303F;
  --nav-muted: #6E6A62;
  --overlay:   rgba(0,0,0,.35);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: 'Segoe UI', 'Cairo', 'Tahoma', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 15px;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
}

#app { height: 100%; display: flex; flex-direction: column; }

/* الهيكل: قائمة جانبية + عمود محتوى */
.np-shell { display: flex; height: 100%; overflow: hidden; }
.np-content { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; overflow: hidden; }

/* ═══ عناصر عامة ═══ */
.np-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: #fff; border: none; border-radius: 10px;
  padding: 12px 18px; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: filter .12s;
}
.np-btn:active { filter: brightness(.85); }
.np-btn:disabled { opacity: .45; pointer-events: none; }
.np-btn.secondary { background: var(--card-bg); color: var(--text); border: 1px solid var(--border); }
.np-btn.success { background: var(--success); }
.np-btn.danger  { background: var(--danger); }
.np-btn.warning { background: var(--warning); }
.np-btn.ghost   { background: transparent; color: var(--accent); border: 1px dashed var(--accent); }
.np-btn.big     { padding: 16px 22px; font-size: 17px; border-radius: 14px; }

.np-input, .np-select {
  width: 100%; background: var(--field-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 12px; font-size: 15px; outline: none;
  font-family: inherit;
}
.np-input:focus, .np-select:focus { border-color: var(--accent); }
.np-label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }

.np-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px;
}

.np-error { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 18px; }
.np-badge {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 700; color: #fff;
}

/* جداول */
.np-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.np-table th {
  background: var(--header-bg); color: var(--muted); text-align: start;
  padding: 9px 8px; border-bottom: 2px solid var(--border);
  position: sticky; top: 0; font-weight: 600; white-space: nowrap;
}
.np-table td { padding: 9px 8px; border-bottom: 1px solid var(--border); }
.np-table tr:active td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.np-table .num { text-align: end; font-variant-numeric: tabular-nums; direction: ltr; }

/* ═══ التخطيط الرئيسي ═══ */
.np-topbar {
  display: flex; align-items: center; gap: 10px;
  background: var(--header-bg); border-bottom: 1px solid var(--border);
  padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top));
  flex: 0 0 auto;
}
.np-topbar .title { font-size: 17px; font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-topbar .sub { font-size: 11px; color: var(--muted); }
.np-iconbtn {
  background: transparent; border: none; color: var(--text);
  font-size: 22px; padding: 6px 10px; border-radius: 10px; cursor: pointer;
}
.np-iconbtn:active { background: color-mix(in srgb, var(--accent) 18%, transparent); }

.np-main { flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; }

.np-footer {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  background: var(--footer-bg); border-top: 1px solid var(--border);
  padding: 6px 12px; padding-bottom: calc(6px + env(safe-area-inset-bottom));
  font-size: 12px; color: var(--muted);
}
.np-sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.np-sync-dot.off { background: var(--muted); }
.np-sync-dot.err { background: var(--danger); }

/* ═══ القائمة الجانبية (شجرة الديسكتوب بالبادجات الملوّنة) ═══ */
.np-drawer-overlay {
  position: fixed; inset: 0; background: var(--overlay); z-index: 40;
  opacity: 0; pointer-events: none; transition: opacity .18s;
}
.np-drawer-overlay.open { opacity: 1; pointer-events: auto; }

.np-drawer {
  position: fixed; top: 0; bottom: 0; width: min(320px, 86vw); z-index: 41;
  background: var(--nav-bg); border-inline-end: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform .2s ease; overflow: hidden;
}
html[dir="rtl"] .np-drawer { right: 0; transform: translateX(100%); }
html[dir="ltr"] .np-drawer { left: 0;  transform: translateX(-100%); }
.np-drawer.open { transform: translateX(0); }

/* ═══ ترويسة القائمة — نفس NavigationControl: لوجو + اسم البرنامج + سطر فرعي accent ═══ */
.np-drawer-head {
  flex: 0 0 auto;
  background: var(--nav-header); padding: 15px;
  padding-top: calc(15px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 12px;
}
.np-drawer-head .logo {
  width: 48px; height: 48px; border-radius: 10px; object-fit: contain;
  display: block; flex: 0 0 auto;
}
.np-drawer-head .brand { font-size: 20px; font-weight: 700; color: var(--nav-text); }
.np-drawer-head .brand-sub { font-size: 10px; color: var(--accent); margin-top: -2px; }

/* بطاقة المستخدم — التدرج البرتقالي زي الديسكتوب */
.np-user-card {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 10px 5px; padding: 12px; border-radius: 8px;
  background: linear-gradient(135deg, #1E3A5F, #2C4A6E);
}
.np-user-card .avatar {
  width: 38px; height: 38px; border-radius: 19px; background: rgba(255,255,255,.19);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.np-user-card .nm { font-size: 13px; font-weight: 600; color: #fff; }
.np-user-card .co { font-size: 11px; color: #DBEAFE; }

/* صندوق البحث — NavFieldBg بحدود accent */
.np-drawer-search {
  display: flex; align-items: center; gap: 8px;
  margin: 5px 10px; padding: 0 10px; height: 42px; border-radius: 8px;
  background: var(--nav-field); border: 1px solid var(--accent);
}
.np-drawer-search .mag { color: var(--accent); font-size: 15px; }
.np-drawer-search input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--nav-text); font-size: 13px; font-family: inherit;
}
.np-drawer-search input::placeholder { color: var(--nav-muted); }
.np-drawer-search .clr {
  background: transparent; border: none; color: var(--nav-muted);
  font-size: 14px; cursor: pointer; padding: 2px 4px;
}

.np-drawer-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 4px 4px 20px; }

/* ═══ الشجرة — نفس TreeView الديسكتوب: صف شفاف + بادج مربع ملوّن + سهم دوّار ═══ */
.np-row {
  display: flex; align-items: center; width: calc(100% - 8px);
  background: transparent; border: none; border-radius: 8px;
  margin: 2px 4px; padding: 8px 10px; cursor: pointer;
  text-align: start; font-family: inherit; color: var(--nav-text);
}
.np-row:active { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.np-row .badge {
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: #fff; flex: 0 0 auto; margin-inline-end: 8px;
  /* line-height: 1 — الإيموچى بيتمركز على صندوق السطر بتاعه لا على المربع.
     مع الارتفاع الافتراضى (1.5×) كان بينزاح لتحت شعرة داخل البادج، والانزياح
     ده بيبان أكتر كل ما الخط كبر. */
  line-height: 1;
}
.np-row .txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-row .arrow {
  font-size: 10px; color: var(--nav-muted); margin-inline-start: 5px;
  transition: transform .15s;
}
.np-row.open .arrow { transform: rotate(-90deg); }
html[dir="ltr"] .np-row .arrow { transform: rotate(180deg); }
html[dir="ltr"] .np-row.open .arrow { transform: rotate(90deg); }

/* المستويات الثلاثة — **مقاسات المربعات نفس BadgeHeader بالظبط** (بلا تغيير:
   دى مرآة الديسكتوب، وأى تعديل فيها بيفكّ التطابق ويزحلق ارتفاع الصفوف).

   🔴 اللى اتغيّر: **حجم الخط جوّه المربع بس.** الإيموچى كان ١٦ فى مربع ٣٢
   (نُصّ المساحة بالظبط) فبيبان صغيراً وسط لونه — وده اللى واضح أكتر فى أقسام
   التقارير لأنها المستوى الأوسط (📊 بـ١٤ فى مربع ٢٨). الإيموچى بيتقرا صح عند
   ~٦٥٪ من حاويته، فالمقاسات اترفعت للنسبة دى.

   ✅ والمربعات ما اتلمستش ⇒ **صفر إزاحة**: ارتفاع الصفوف ومحاذاة النص
      والمسافات كلها زى ما هى بالظبط، اللى كبر هو الرسمة نفسها. */
.np-row.cat  .badge { width: 32px; height: 32px; border-radius: 8px; font-size: 20px; }
.np-row.cat  .txt   { font-size: 15px; font-weight: 600; }
.np-row.sub  .badge { width: 28px; height: 28px; border-radius: 6px; font-size: 18px; }
.np-row.sub  .txt   { font-size: 14px; font-weight: 500; }
.np-row.leaf .badge { width: 25px; height: 25px; border-radius: 5px; font-size: 16px; }
.np-row.leaf .txt   { font-size: 13px; color: var(--nav-muted); }

/* الشاشة المفتوحة: خلفية برتقالية + نص أبيض (NavItemSelected) */
.np-row.leaf.active { background: linear-gradient(135deg, #D97706, #F59E0B); }   /* NavItemSelectedBrush فى الديسكتوب */
.np-row.leaf.active .txt { color: #fff; font-weight: 600; }

/* تعشيش المستويات — ItemsHost Margin 14 */
.np-lvl { margin-inline-start: 14px; }

.np-drawer-foot {
  flex: 0 0 auto; flex-wrap: wrap;
  display: flex; align-items: center; background: var(--nav-header);
  padding: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom));
  gap: 6px;
}
.np-drawer-foot button {
  flex: 1; background: var(--nav-field); border: none; border-radius: 8px;
  color: var(--nav-text); padding: 9px 4px; font-size: 16px;
  cursor: pointer; font-family: inherit;
}
.np-drawer-foot button.lang { color: var(--accent); font-size: 12px; font-weight: 700; }

/* أزرار الويندوز — نفس دايرتي التصغير/الإغلاق في فوتر الديسكتوب */
.np-drawer-foot button.winmin {
  flex: 0 0 38px; height: 38px; border-radius: 19px; color: #fff;
  background: linear-gradient(135deg, #D97706, #F59E0B); font-size: 13px;
}
.np-drawer-foot button.winclose {
  flex: 0 0 38px; height: 38px; border-radius: 19px; color: #fff;
  background: var(--danger); font-size: 14px; font-weight: 700;
}

/* ═══ الشاشات الواسعة (ويندوز/تابلت): القائمة مثبتة على الجنب زي الديسكتوب ═══
   العتبة 768 (قرار بشمهندس — القايمة المثبتة جزء من هوية الشاشة ومش بتتحوّل لدرج).
   ⚠️ ومعناها إن عرض المحتوى = عرض الشاشة − 280 من 768 وطالع، فأى شاشة بتعيش جوّه
   `.np-main` لازم تحسب حساب الـ280 دى فى عتباتها — شوف عتبات الكاشير تحت. ═══ */
@media (min-width: 768px) {
  .np-drawer {
    position: static; transform: none !important;
    width: 280px; flex: 0 0 280px;
    border-inline-end: 1px solid var(--border);
  }
  .np-drawer-overlay { display: none !important; }
  .np-menu { display: none; }   /* مفيش زر ☰ — القائمة ظاهرة دايماً */

  /* ═══ 🖥️ أى شاشة مفتوحة = كل العرض ═══
     القائمة المثبتة بتاخد 280px. على شاشة ديسكتوب دى نسبة مهملة، وعلى تابلت ٧–٨ بوصة
     دى **تلت العرض** — فكل شاشة فيها جدول بتتقصّ، مش الكاشير وحده. فبتختفى مع أى شاشة
     وبترجع على الرئيسية.
     🔴 والقائمة مش بتتقفل: بترجع **درجاً** بزرار ☰ فوق الشاشة، فالتنقّل لسه ممكن من
        غير ما يقفل اللى هو فيه. والحالة كلها مشتقّة من المسار، فالخروج بيرجّعها لوحده. */
  .np-shell.np-full .np-drawer {
    position: fixed; top: 0; bottom: 0; z-index: 41;
    width: min(320px, 86vw); flex: 0 0 auto;
  }
  /* ⚠️ !important لازمة: قاعدة الشاشات الواسعة فوق فيها transform: none !important */
  html[dir="rtl"] .np-shell.np-full .np-drawer { right: 0; transform: translateX(100%) !important; }
  html[dir="ltr"] .np-shell.np-full .np-drawer { left: 0;  transform: translateX(-100%) !important; }
  .np-shell.np-full .np-drawer.open { transform: translateX(0) !important; }
  .np-shell.np-full .np-drawer-overlay { display: block !important; }
  /* الزرار زرار عادى (display الافتراضى) — inline-flex كانت هتغيّر شكله عن باقى الأزرار */
  .np-shell.np-full .np-menu { display: revert; }
}

/* ═══ شاشات الدخول والتفعيل — نفس تصميم LoginWindow في الديسكتوب ═══ */
.np-auth {
  min-height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 28px 22px; gap: 6px;
}
.np-auth .logo { font-size: 52px; }
.np-auth h1 { font-size: 24px; margin: 6px 0 2px; }
.np-auth .sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; text-align: center; }
.np-auth .np-card { width: 100%; max-width: 380px; }

/* الشاشة كلها: يسار = برanding على تدرّج غامق، يمين = فورم أبيض (زي الديسكتوب)
   🎨 2026-11-22 (المهندس): نفس ألوان LoginWindow.xaml فى الديسكتوب بالظبط — بنى غامق + ذهبى/كهرمانى بدل الأزرق. */
.np-login {
  height: 100%; display: flex; overflow: hidden;
  background: linear-gradient(135deg, #1a1410 0%, #2d1f10 50%, #3d2a18 100%);
}

/* ── اللوحة اليسرى: اللوجو + الاسم + المزايا ── */
.np-login-brand {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 60px; color: #fff; text-align: center; min-width: 0;
}
.np-login-brand .logo-ring {   /* دائرتين عنابى شفاف ورا اللوجو (Ellipse #450d25 15% و#5f1132 30%) */
  width: 180px; height: 180px; border-radius: 50%; margin-bottom: 30px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle closest-side, rgba(95, 17, 50, .30) 0 80%, rgba(69, 13, 37, .15) 80% 100%, transparent 100%);
}
.np-login-brand .logo-ring img { width: 75%; height: 75%; object-fit: contain; display: block; }
.np-login-brand .app-name { font-size: 54px; font-weight: 700; line-height: 1.15; margin: 0; text-shadow: 0 0 20px rgba(251, 191, 36, .8); }
.np-login-brand .edition { font-size: 18px; color: #FBBF24; margin: 10px 0 36px; max-width: 460px; }
.np-login-brand .feat { display: flex; align-items: center; gap: 15px; margin: 9px 0; font-size: 17px; opacity: .95; }
.np-login-brand .feat .ic { font-size: 22px; }
.np-login-brand .support { margin-top: 30px; font-size: 13px; color: #94a3b8; opacity: .9; }

/* ── اللوحة اليمنى: الفورم الأبيض ── */
.np-login-form {
  flex: 0 0 560px; background: #fff; color: #1a1410; box-shadow: 0 0 30px rgba(0, 0, 0, .3);
  padding: 20px 60px; display: flex; flex-direction: column; justify-content: center;
  overflow: auto;
}
.np-login-form .lock {
  width: 70px; height: 70px; border-radius: 35px; background: #FFF7ED;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; margin: 0 auto 12px;
}
.np-login-form h2 { font-size: 32px; font-weight: 700; text-align: center; margin: 0 0 4px; color: #1a1410; }
.np-login-form .sub2 { font-size: 15px; color: #64748B; text-align: center; margin: 0 0 4px; }
.np-login-form .srv { font-size: 11px; color: #94A3B8; text-align: center; margin: 0 0 20px; }
.np-login-form label { display: block; font-size: 14px; font-weight: 600; color: #1a1410; margin: 0 0 6px; }
.np-login-form .fld { margin-bottom: 16px; }
.np-login-form input, .np-login-form select {
  width: 100%; height: 50px; border-radius: 8px; padding: 0 15px;
  background: #f8f9fa; border: 2px solid #e0e0e0; color: #1a1410;
  font-size: 16px; font-family: inherit; outline: none;
}
.np-login-form input:focus, .np-login-form select:focus { border-color: #F59E0B; }
.np-login-form .pass-wrap { position: relative; }
.np-login-form .pass-wrap input { padding-inline-end: 46px; }
.np-login-form .pass-eye {
  position: absolute; inset-inline-end: 6px; top: 0; height: 50px; width: 38px;
  background: transparent; border: none; font-size: 16px; opacity: .5; cursor: pointer;
}
.np-login-form .btn-login {
  width: 100%; height: 50px; border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, #B45309 0%, #D97706 50%, #F59E0B 100%);
  color: #fff; font-size: 20px; font-weight: 700; font-family: inherit;
}
.np-login-form .btn-login:disabled { opacity: .6; }
.np-login-form .link {
  display: block; text-align: center; margin-top: 14px;
  font-size: 12px; color: #F59E0B; text-decoration: underline;
  background: none; border: none; cursor: pointer; font-family: inherit; width: 100%;
}
.np-login-form .err { font-size: 12px; color: #EF4444; text-align: center; margin-top: 10px; min-height: 16px; }

/* ⚠ بطاقة خطأ الدخول — فوق زر الدخول لا تحته.
   السطر الصغير تحت الرابط كان المستخدم مابيبصّش له أصلاً: يدوس «دخول» وما يشوفش تغيير
   فى المكان اللى عينه فيه فيفتكر البرنامج معلّق. الحركة هى اللى بيلتقطها النظر لما
   يكون مستقر على مكان واحد — عشان كده فيه هزّة مش لون بس. */
.np-login-form .np-login-err {
  display: flex; gap: 8px; align-items: center;
  background: #FEF2F2; border: 1.5px solid #EF4444; color: #B91C1C;
  font-size: 14px; font-weight: 600; border-radius: 8px;
  padding: 10px 12px; margin: 0 0 14px; text-align: start;
  animation: np-shake .32s ease;
}
@keyframes np-shake {
  0%   { transform: translateX(0); }
  15%  { transform: translateX(-7px); }
  30%  { transform: translateX(7px); }
  45%  { transform: translateX(-5px); }
  60%  { transform: translateX(5px); }
  75%  { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}
/* إشارتان أحسن من واحدة: إطار حقل كلمة المرور بيتلوّن مع البطاقة */
.np-login-form .pass-wrap.err input { border-color: #EF4444; }

/* ♿ اللى بيقفلوا الحركة فى النظام: البطاقة تفضل ظاهرة بلا هزّة */
@media (prefers-reduced-motion: reduce) {
  .np-login-form .np-login-err { animation: none; }
}
.np-login-form .copy { font-size: 12px; color: #F59E0B; text-align: center; margin-top: 18px; }

/* شاشة ضيقة (تابلت بالطول): اللوحة اليسرى تختفي والفورم بيملأ */
@media (max-width: 900px) {
  .np-login-brand { display: none; }
  .np-login-form { flex: 1; padding: 24px 28px; }
}

/* ═══ الرئيسية — بلاطات الموديولات (ألوان المنيو نفسها) ═══ */
.np-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 14px; }
@media (min-width: 640px) { .np-tiles { grid-template-columns: repeat(3, 1fr); } }
.np-tile {
  border: none; border-radius: 16px; padding: 18px 14px; color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.np-tile .ico { font-size: 34px; }
.np-tile:active { filter: brightness(.85); }

/* ═══ حوارات ═══ */
.np-dialog-overlay {
  position: fixed; inset: 0; background: var(--overlay); z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 640px) { .np-dialog-overlay { align-items: center; } }
.np-dialog {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 18px 18px 0 0; width: 100%; max-width: 560px;
  max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
}
@media (min-width: 640px) { .np-dialog { border-radius: 18px; } }
.np-dialog-head {
  display: flex; align-items: center; padding: 14px 16px;
  border-bottom: 1px solid var(--border); font-weight: 800; font-size: 16px;
}
.np-dialog-head .x { margin-inline-start: auto; }
.np-dialog-body { padding: 14px 16px; overflow: auto; }
.np-dialog-foot { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); }
.np-dialog-foot .np-btn { flex: 1; }

/* ═══ شاشات المستندات — نفس تخطيط الديسكتوب: شريط مستند + جريد إدخال ═══ */
.np-doc-toolbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; margin: 10px;
}
.np-doc-toolbar .fld { display: flex; flex-direction: column; gap: 3px; }
.np-doc-toolbar .fld > span { font-size: 12px; color: var(--muted); }
.np-doc-toolbar .fld .np-input, .np-doc-toolbar .fld .np-select { padding: 8px 10px; font-size: 14px; }
.np-doc-toolbar .grow { flex: 1; min-width: 140px; }

/* جريد الإدخال — مرآة DataGrid بتاع الديسكتوب: خلايا بتتكتب جوّاها + صف ذيل فاضي */
.np-grid-wrap { margin: 0 10px 10px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.np-grid { width: 100%; border-collapse: collapse; font-size: 13.5px; table-layout: fixed; min-width: 900px; }
.np-grid th {
  background: var(--header-bg); color: var(--muted); font-weight: 600;
  padding: 8px 6px; border: 1px solid var(--border); text-align: center;
  position: sticky; top: 0; z-index: 2; white-space: nowrap;
}
.np-grid td { border: 1px solid var(--border); padding: 0; height: 38px; }
.np-grid td.ro { background: color-mix(in srgb, var(--border) 22%, transparent); color: var(--text); padding: 0 6px; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.np-grid td.name { text-align: start; padding: 0 8px; }
.np-grid td input, .np-grid td select {
  width: 100%; height: 100%; border: none; outline: none; background: transparent;
  color: var(--text); font-family: inherit; font-size: 13.5px; text-align: center; padding: 0 6px;
}
.np-grid td input:focus, .np-grid td select:focus { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.np-grid tr.tail td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.np-grid tr.total td { background: var(--header-bg); font-weight: 700; padding: 8px 6px; text-align: center; }
.np-grid td .cellbtn {
  background: transparent; border: none; color: var(--accent); cursor: pointer;
  font-size: 13px; padding: 0 4px;
}
.np-grid tr.warn td { background: color-mix(in srgb, var(--danger) 12%, transparent); }

/* 🔍 خانة الاختيار فى الجريد = كنترول بحث لا قائمة منسدلة (توأم ElementStyle=PickCell
   فى الديسكتوب): بتتعرض نصاً بلا سهم، والضغط/الإنتر عليها بيفتح حوار البحث NpPick.
   ⚠️ زرار مش <select> عمداً — عشان محرك الإنتر (npEnter) يفرّق بين «خانة بحث»
   و«قائمة عادية»، و data-np-pick هو العلامة اللى بيقرأها. */
.np-grid td .np-pick, .np-table td .np-pick {
  width: 100%; height: 100%; border: none; outline: none; background: transparent;
  color: var(--text); font-family: inherit; font-size: 13.5px; text-align: center;
  padding: 0 6px; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.np-grid td .np-pick:focus, .np-table td .np-pick:focus { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.np-grid td .np-pick.empty, .np-table td .np-pick.empty { color: var(--muted); }
/* صف الذيل: زرار «سطر جديد» بعرض الخانة */
.np-grid tr.tail td .np-pick { color: var(--accent); font-weight: 700; }

/* شريط أزرار المستند السفلي (حفظ/حذف/طباعة + الإجمالي) — زي الديسكتوب */
.np-doc-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 10px 14px;
}
.np-doc-actions .total-box {
  background: var(--field-bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 18px; font-size: 17px; font-weight: 700; min-width: 110px; text-align: center;
}

/* شاشة قيد النقل */
.np-todo { text-align: center; padding: 60px 24px; color: var(--muted); }
.np-todo .ico { font-size: 56px; margin-bottom: 12px; }

/* سبينر */
.np-spin {
  width: 26px; height: 26px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: npspin .8s linear infinite; margin: 20px auto;
}
@keyframes npspin { to { transform: rotate(360deg); } }

/* ═══ الكاشير — نفس تخطيط الديسكتوب ═══
   مرآة CashierPage.xaml: عمودان (الفاتورة 3* / لوحة اللمس 2* بحد أدنى 430px)،
   نفس ارتفاعات وألوان الأزرار والبلاطات ولوحة الأرقام. الألوان الوظيفية
   (أزرار الوظائف/التحديد/لوحة الأرقام) نفس أكواد الديسكتوب حرفياً، والباقي
   من متغيرات الثيم فيشتغل في الفاتح والغامق. كل الاتجاهات منطقية (RTL/LTR). */

.cash-root {
  --cash-amber: #FBBF24;   /* رقم الصافي وشاشة لوحة الأرقام (نفس #FBBF24) */
  --cash-neg:   #F87171;   /* قيمة الخصم (نفس #F87171) */
  --cash-sel:   #3B82F6;   /* تحديد صف السلة (نفس #553B82F6) */
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(430px, 2fr);
  gap: 10px; padding: 10px; height: 100%; overflow: hidden;
}
html[data-theme="light"] .cash-root { --cash-amber: #B45309; --cash-neg: #DC2626; }

.cash-root .ltr { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }

/* 📑 تبويب الشاشات الضيقة — مخفى تماماً على الشاشات الواسعة (العمودان بيظهروا مع بعض) */
.cash-tabs { display: none; }
.cash-tab {
  flex: 1 1 0; min-width: 0; height: 46px; border: none; border-radius: 10px;
  background: var(--field-bg); color: var(--text); font-family: inherit;
  font-size: 14px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.cash-tab.on { background: #3B82F6; color: #fff; }
.cash-tab .b {
  font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
}
.cash-tab.on .b { background: rgba(255,255,255,.22); }

/* ═══ 📏 وضع التابلت الصغير (أقل من ٩ بوصة) — تبويب بدل عمودين ═══
   الكلاس بيتحط من C# (`AppState.IsSmallTablet`) لا من `@media`، والسبب إن
   **الـCSS مايعرفش البوصة**: تابلت ٧٫٦ بوصة بكثافة عالية بيقول 1150dp، وآيباد ١١ بوصة
   بيقول 1194dp — فرق ٤٤ بكسل بين جهازين المفروض يتعاملوا بالعكس تماماً. أى عتبة عرض
   هنا بتحكم غلط، فالقرار اتاخد من المقاس المادى وخلاص.
   🔵 وبكلاسّين (`.cash-root.narrow`) فبيغلب قواعد الميديا فوق مهما كان عرض النافذة. */
.cash-root.narrow { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
.cash-root.narrow .cash-tabs { display: flex; gap: 6px; }
.cash-root.narrow.t-inv .cash-pad  { display: none; }
.cash-root.narrow.t-pad .cash-pane { display: none; }

.cash-pane { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.cash-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; flex: 0 0 auto;
}

/* ── الهيدر: بادج + عنوان + العميل وبيانات الوردية + وضع المرتجع/مساعدة/إغلاق ── */
.cash-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; }
.cash-h-id { display: flex; align-items: center; gap: 12px; }
.cash-h-badge {
  width: 48px; height: 48px; border-radius: 10px; background: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 24px; flex: 0 0 auto;
}
.cash-h-title { display: block; font-size: 20px; font-weight: 700; color: var(--text); }
.cash-h-sub   { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.cash-h-mid   { flex: 1 1 240px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.cash-h-end   { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }

.cash-lbl { font-size: 14px; color: var(--muted); white-space: nowrap; }
.cash-chip {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  background: var(--field-bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 10px; font-size: 12.5px; color: var(--muted);
}
.cash-chip.on { border-color: var(--accent); color: var(--accent); font-weight: 700; }

.cash-hbtn {
  width: 44px; height: 44px; flex: 0 0 auto; border: none; border-radius: 8px;
  color: #fff; font-size: 16px; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.cash-hbtn:active { filter: brightness(.85); }
.cash-btn.cash-modebtn { height: 44px; min-width: 120px; font-size: 14px; }

/* ── شريط الباركود ── */
.cash-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; }
.cash-inp  { height: 44px; padding: 0 12px; font-size: 16px; border-radius: 8px; }
.cash-bc   { flex: 1 1 220px; min-width: 140px; }
.cash-cust { width: 230px; flex: 0 0 auto; }
.cash-num  { text-align: center; direction: ltr; }
.cash-w90  { width: 90px; flex: 0 0 auto; }
.cash-w80  { width: 80px; flex: 0 0 auto; }

/* ── جريد السلة (نفس أعمدة dgCart) ── */
.cash-cart { flex: 1 1 auto; min-height: 0; padding: 2px; display: flex; }
.cash-cart .np-grid-wrap { margin: 0; flex: 1 1 auto; min-height: 0; border: none; border-radius: 10px; }
.cash-grid { min-width: 560px; font-size: 14px; }
.cash-grid th { height: 42px; padding: 0 6px; background: var(--field-bg); color: var(--text); }
.cash-grid td { height: 52px; }
.cash-grid td.ro { background: transparent; }
.cash-grid td input { font-size: 14px; }
.cash-grid td.ro.tot {
  text-align: end; padding-inline-end: 10px; font-weight: 700;
  direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums;
}
.cash-grid tbody tr:active td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.cash-grid tbody tr.sel td    { background: color-mix(in srgb, var(--cash-sel) 33%, transparent); font-weight: 600; }
.cash-grid tr.cash-empty td   { height: 64px; color: var(--muted); text-align: center; }

.cash-nmwrap { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cash-nm  { flex: 1 1 auto; min-width: 0; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cash-note { flex: 0 0 auto; font-size: 12px; }
.cash-edit { flex: 0 0 auto; font-size: 15px; min-width: 38px; min-height: 44px; }

.cash-pmcell { text-align: center; }
.cash-pm {
  width: 44px; height: 44px; border: none; border-radius: 8px; color: #fff;
  font-size: 20px; font-weight: 700; font-family: inherit; cursor: pointer;
}
.cash-pm:active { filter: brightness(.85); }
.cash-pm.minus { background: #EF4444; }
.cash-pm.plus  { background: #3B82F6; margin-inline-start: 6px; }

/* ↺ استدعاء فاتورة (بلاغ #110): السطر المرجعى باهت ومائل = «ده مرجع مش سطر فاتورة»،
   والسطر الراجع للمخزن جوّه فاتورة بيع (استبدال) بلون تحذيرى — الشكل بيقول القاعدة
   قبل ما الرسالة ترميها. */
.cash-pm.back  { background: #0891B2; width: auto; padding: 0 10px; font-size: 13px; white-space: nowrap; }
.np-grid tr.cash-ref  > td { background: rgba(8,145,178,.10); color: #0891B2; font-style: italic; }
.np-grid tr.cash-back > td { color: #EF4444; font-weight: 600; }

/* ── الإجماليات ── */
.cash-tot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; }
.cash-tot-left { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.cash-tot-left .k { font-size: 14px; color: var(--muted); }
.cash-tot-left .v { font-size: 14px; font-weight: 600; color: var(--text); margin-inline-end: 14px; }
.cash-tot-left .v.dis { color: var(--cash-neg); }
.cash-tot-net { display: flex; align-items: baseline; gap: 8px; margin-inline-start: auto; }
.cash-tot-net .k { font-size: 20px; font-weight: 700; color: var(--muted); }
.cash-tot-net .v { font-size: 28px; font-weight: 700; color: var(--cash-amber); }

/* ── شريط الحالة + أزرار الوظائف ── */
.cash-actions { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.cash-status {
  flex: 0 1 220px; max-inline-size: 220px; font-size: 13px; color: var(--muted);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.cash-btnbar { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.cash-btn {
  height: 56px; min-width: 110px; padding: 8px 12px; border: none; border-radius: 10px;
  background: #3B82F6; color: #fff; font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.cash-btn:active   { filter: brightness(.85); }
.cash-btn:disabled { opacity: .45; pointer-events: none; }

/* ألوان أزرار الديسكتوب حرفياً (الترتيب زي WrapPanel بتاع CashierPage.xaml) */
.cash-root .b-clear     { background: #64748B; }   /* مسح */
.cash-root .b-remove    { background: #EF4444; }   /* حذف صف / إغلاق */
.cash-root .b-hold      { background: #D97706; }   /* ⏸ تعليق */
.cash-root .b-resume    { background: #0D9488; }   /* ▶ استرجاع */
.cash-root .b-recall    { background: #0891B2; }   /* ↺ استدعاء فاتورة (#110) */
.cash-root .b-tables    { background: #7C3AED; }   /* 🍽 الطاولات (مؤجل) */
.cash-root .b-savetable { background: #B45309; }   /* 🪑 حفظ للطاولة (مؤجل) */
.cash-root .b-delivery  { background: #0E7490; }   /* 🛵 توصيل (مؤجل) */
.cash-root .b-apporders { background: #334155; }   /* 📱 طلبات التطبيق (مؤجل) */
.cash-root .b-card      { background: #7C3AED; }   /* 🎟 كارت (مؤجل) */
.cash-root .b-measure   { background: #0891B2; }   /* 📐 تفصيل (مؤجل) */
.cash-root .b-modifiers { background: #DB2777; }   /* 🧂 وصفات/أحجام (مؤجل) */
.cash-root .b-note      { background: #0891B2; }   /* 📝 ملاحظة */
.cash-root .b-course    { background: #0F766E; }   /* ➖ كورس (مؤجل) */
.cash-root .b-serve     { background: #DC2626; }   /* ⚡ قدّم الآن (مؤجل) */
.cash-root .b-invoice   { background: #8B5CF6; }   /* 🖨 فاتورة (مؤجل) */
.cash-root .b-reprint   { background: #6366F1; }   /* 🖨 إعادة طباعة */
.cash-root .b-session   { background: #B45309; }   /* 🔒 اقفال وردية */
.cash-root .b-split     { background: #9333EA; }   /* 🧾 تقسيم (مؤجل) */
.cash-root .b-pay       { background: #3B82F6; }   /* 💳 دفع */
.cash-root .b-cardpay   { background: #2563EB; }   /* 💳 بطاقة — سداد مباشر */
.cash-root .b-cash      { background: #10B981; }   /* 💵 نقدي */
.cash-root .b-help      { background: #0EA5E9; }   /* ❓ مساعدة */

/* ── لوحة اللمس: بحث + تصنيفات + بلاطات + لوحة أرقام ── */
.cash-pad { display: flex; flex-direction: column; gap: 8px; padding: 10px; min-width: 0; min-height: 0; }
.cash-search { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.cash-search .np-input { flex: 1 1 auto; min-width: 0; }
.cash-mag { font-size: 18px; }

.cash-cats {
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px;
  max-height: 150px; overflow-y: auto; flex: 0 0 auto;
}
.cash-subcats { max-height: 130px; }
.cash-cat {
  min-height: 48px; min-width: 88px; padding: 4px 12px; border: none; border-radius: 10px;
  background: var(--footer-bg); color: var(--text); font-family: inherit;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.cash-cat:active { filter: brightness(.9); }
.cash-cat.sub { min-height: 44px; min-width: 92px; font-size: 13px; }
.cash-cat.on     { background: #3B82F6; color: #fff; }
.cash-cat.sub.on { background: #0D9488; color: #fff; }

.cash-tiles {
  flex: 1 1 auto; min-height: 0; overflow: auto; padding: 2px;
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px;
}
.cash-tile {
  width: 138px; height: 140px; flex: 0 0 auto; padding: 4px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--field-bg);
  color: var(--text); font-family: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.cash-tile:active { filter: brightness(.9); border-color: var(--accent); }
.cash-tile .nm {
  font-size: 12.5px; font-weight: 600; text-align: center; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
/* 🏷️ ٥ سطور لا ٣ (٢٠٢٦-٠٩-٢٨): «24 GEL NAIL…» على أربع بلاطات والفرق بينهم فى آخر الاسم.
   البلاطة من غير صورة فاضية تحت الاسم أصلاً، فالسطور الزيادة مابتكبّرش البلاطة. */
.cash-tile .pr { font-size: 12px; font-weight: 700; color: var(--accent); direction: ltr; }
/* 🖼 بلاطة بصورة: الصورة بتاخد النصيب الأكبر والاسم بيقلّ لسطرين — البلاطة نفس المقاس
   بالظبط عشان الشبكة ما تتزحلقش بين صنف بصورة وصنف من غيرها. */
.cash-tile.has-img .nm { -webkit-line-clamp: 2; font-size: 11.5px; }
.cash-tile-img {
  flex: 1 1 auto; min-height: 0; width: 100%; object-fit: contain;
  border-radius: 6px; background: var(--card-bg);
}
.cash-notiles { width: 100%; text-align: center; color: var(--muted); padding: 26px 10px; font-size: 13px; }

.cash-keys { flex: 0 0 auto; background: var(--footer-bg); border-radius: 10px; padding: 6px; }
.cash-kdisp { display: flex; align-items: center; gap: 8px; margin: 0 2px 4px; }
.cash-kval {
  flex: 1 1 auto; min-width: 0; height: 44px; display: flex; align-items: center;
  justify-content: flex-start; background: var(--card-bg); border-radius: 8px; padding: 0 10px;
  font-size: 22px; font-weight: 700; color: var(--cash-amber);
  direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums;
}
.cash-khint { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cash-kgrid { display: grid; grid-template-columns: repeat(4, 1fr) 1.4fr; gap: 4px; }
.cash-key {
  width: 100%; height: 48px; border: none; border-radius: 8px;
  background: var(--card-bg); color: var(--text); font-family: inherit;
  font-size: 18px; font-weight: 700; cursor: pointer;
}
.cash-key:active { filter: brightness(.85); }
.cash-key0 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.cash-key.act { font-size: 14px; color: #fff; }
.cash-key.k-qty   { background: #10B981; }
.cash-key.k-price { background: #3B82F6; }
.cash-key.k-dis   { background: #D97706; }

/* حوار المساعدة */
.cash-help { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; line-height: 1.6; }

/* ── تابلت بالطول / شاشة ضيقة: العمودان يبقوا فوق بعض بنفس الترتيب ──
   🔴 العتبة 1040 والرقم محسوب لا مُخمَّن: العمودان محتاجان 560px (أقل عرض لجدول
   السلة) + 430px (أقل عرض للوحة اللمس) + الفواصل ≈ 1040px.
   ⚠️ وماعادش بنزوّد الـ280 بتاعة القايمة: القايمة بقت تختفى مع **أى** شاشة مفتوحة
   (np-full)، فعرض المحتوى = عرض الشاشة. آيباد ١١ بوصة بالعرض (1194) بيعدّى العتبة
   ⇒ عمودان زى الديسكتوب بالظبط.

   ⚠️ والسبب الجذرى إن `@media` بتقيس **الشاشة** والكاشير عايش جوّه `.np-main`
   بعد ما القايمة خدت نصيبها — فالشرط بيقيس حاجة والقرار بيتاخد على حاجة تانية.
   الحل الأنظف هو استعلامات الحاوية (`container-type: inline-size` على `.np-main`)،
   **واتجنّبناها عن قصد**: `container-type` بيفعّل احتواء التخطيط، واحتواء التخطيط
   بيخلّى العنصر كتلة احتواء لأى `position: fixed` جوّاه ⇒ كل الحوارات والأوفرلايات
   (`.np-dialog-overlay`) كانت هتتقيّد بمنطقة المحتوى بدل الشاشة كلها. العتبة
   المحسوبة بتدّى نفس النتيجة بلا الأثر الجانبى ده، لأن عتبة القايمة نفسها معروفة.
   ── */
@media (max-width: 1040px) {
  /* نافذة ضيقة على شاشة كبيرة: العمودان فوق بعض بنصيبين (الوضع العادى المكدّس).
     التبويب مالوش دخل هنا — هو مربوط بالمقاس **المادى** لا بعرض النافذة، شوف تحت. */
  .cash-root { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1.45fr) minmax(0, 1fr); }

  /* 🔴🔴 العطل اللى كان بيخفى السلة خالص: `.cash-pane` عمود مرن، وكل إخوته
     (الرأس · الباركود · الإجماليات · شريط الأزرار) ارتفاعهم **ثابت**، والسلة وحدها
     `flex: 1 1 auto` — يعنى هى **الوحيدة اللى بتدفع الفاتورة** لما المساحة تقلّ،
     فبتنكمش لصفر وتختفى تماماً بينما الباقى سليم. وشريط الأزرار كان بيلفّ لسطر
     تانى يطلع بره الصف ويركب على لوحة البلاطات تحته (زرار «إعادة طباعة» الطاير).
     العلاج بندين: أرضية للسلة، وحدّ للعمود نفسه عشان اللى يفيض يسكرول جوّاه
     بدل ما يركب على جاره. */
  /* 🔴 تصحيح: `overflow: auto` على العمود كانت غلطة — العمود بقى وعاء تمرير،
     فالإجماليات وشريط الأزرار (آخر عنصرين) خرجوا تحت حدّ الرؤية ولازم تسكرول
     عشان توصلهم. فى شاشة كاشير ده أسوأ من الاختفاء: الرقم الصافى **لازم** يكون
     مشوفاً بلا أى حركة. العمود رجع محجوزاً، والمرونة اتحطّت على السلة وحدها. */
  .cash-pane { overflow: hidden; }

  /* 🔑 `flex-basis: 0` لا `auto`: بـauto السلة بتبدأ بارتفاع محتواها **وبعدين** تكبر،
     فمجموع العمود يقدر يتخطّى الصف ويدفع اللى تحته بره. بـ0 السلة بتاخد **الفاضل
     بالظبط** — لا أكتر — فالإجماليات والأزرار مضمونين مكانهم دايماً.
     والأرضية 120px بتمنع رجوع العطل الأصلى (السلة تنكمش لصفر). */
  .cash-cart { flex: 1 1 0; min-height: 120px; }
  .cash-h-mid { justify-content: flex-start; }
  .cash-btn   { height: 50px; min-width: 96px; font-size: 14px; }
  .cash-tile  { width: 116px; height: 122px; }
  .cash-cats  { max-height: 108px; }
  .cash-tot-net .v { font-size: 24px; }
}

/* ── شاشة ضيقة فعلاً (تابلت ٧–٨ بوصة): الارتفاع هو المورد النادر لا العرض ──
   🔴 العتبة 860 محسوبة على **أسوأ حالة**: القايمة مثبتة من 768 وبتاخد 280، فعند
   عرض شاشة 768 مايفضلش غير 488px للمحتوى — وده أضيق من الحد الأدنى العادى للجدول
   (560). الوضع ده بينزّل الحد الأدنى لـ460 فيدخل. و860 (⇒ 580 محتوى) هامش أمان
   فوق النقطة اللى الجدول العادى بيبتدى يدخل عندها.
   الرأس وصفّ الباركود بيعيشوا فوق السلة فى نفس الصف، وكل بكسل بياخدوه بيتخصم
   من سطور الفاتورة — وهى الحاجة الوحيدة اللى الكاشير مايشتغلش من غير رؤيتها.
   فبنضغطهم بدل ما نضغطها. ── */
@media (max-width: 860px) {
  .cash-h-sub   { display: none; }            /* «نقطة بيع» تحت العنوان — تكرار للعنوان نفسه */
  .cash-h-title { font-size: 17px; }
  .cash-head    { padding: 6px 10px; gap: 6px; }
  .cash-h-badge { transform: scale(.85); }
  .cash-bar     { padding: 8px; gap: 6px; }
  .cash-inp     { height: 40px; font-size: 15px; }

  /* 🔴 أقل عرض للجدول بيقلّ بإخفاء العمود الاختيارى «بعد الخصم» (op7) —
     العمود ده مشتقّ من السعر والخصم، فإخفاؤه مابيضيّعش معلومة مش موجودة فى غيره. */
  /* ⚠️ الإخفاء على th/td لا على col: المتصفحات مابتحترمش display:none على <col>
     بشكل موثوق — العمود بيختفى فعلاً لما خلاياه تختفى. */
  .cash-grid th.cash-c-net, .cash-grid td.cash-c-net, .cash-grid col.cash-c-net { display: none; }
  .cash-grid { min-width: 460px; font-size: 13.5px; }
  .cash-grid th { height: 38px; }
  .cash-grid td { height: 46px; }

  .cash-tile { width: 104px; height: 108px; }
  .cash-tile .nm { -webkit-line-clamp: 4; font-size: 11.5px; }
  /* 🔴 التصنيفات والتصنيفات الفرعية `flex: 0 0 auto` — يعنى بتاخد ارتفاعها كامل
     والبلاطات (`flex: 1 1 auto`) هى اللى بتدفع الفاتورة. على ٧ بوصة كانوا بياكلوا
     اللوحة كلها وتفضل البلاطات شريطاً مقصوصاً. سقف أوطى + تمرير داخلى. */
  .cash-cats    { max-height: 62px; }
  .cash-subcats { max-height: 58px; }
  .cash-tiles   { min-height: 130px; }
  .cash-key  { height: 40px; font-size: 16px; }
  .cash-kval { height: 38px; font-size: 19px; }
  .cash-pad  { gap: 6px; padding: 8px; }

  /* شريط الأزرار: أصغر وسطر واحد قدر الإمكان — كل سطر بيلفّ بياكل من السلة */
  .cash-actions { padding: 6px 8px; gap: 6px; }
  .cash-status  { flex: 0 1 130px; max-inline-size: 130px; font-size: 12px; -webkit-line-clamp: 1; }
  .cash-btnbar  { gap: 6px; }
  .cash-btn     { height: 42px; min-width: 78px; font-size: 12.5px; padding: 0 8px; }
  .cash-tot     { padding: 6px 10px; gap: 6px; }
  .cash-tot-net .v { font-size: 22px; }
  .cash-tot-net .k { font-size: 16px; }
}

/* ═══ مصمم الطاولات / الصالة — مرآة TableSettingPage.xaml ═══
   نفس مناطق الديسكتوب: كارت بيانات الطابق بشريط قسم accent، ثم شبكة
   عمودين (لوحة عناصر 270px + مخطط الطابق) وكانفاس ثابت 1160×600 داخل
   إطار مدوّر. كل الألوان من متغيرات الثيم (فاتح/غامق) والاتجاهات منطقية. */

.tblx-root { padding: 10px 10px 24px; display: flex; flex-direction: column; gap: 14px; }

.tblx-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; box-shadow: 0 1px 10px rgba(0,0,0,.15);
  min-width: 0;
}

/* شريط عنوان القسم (Style x:Key="Section": accent + زوايا 8 + بادينج 12,7) */
.tblx-sec {
  display: flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; border-radius: 8px;
  padding: 7px 12px; margin-bottom: 14px; font-size: 14px; font-weight: 600;
}
.tblx-sec .ico { font-size: 15px; }
.tblx-sec .cnt { margin-inline-start: auto; font-size: 12px; font-weight: 500; }

/* صف حقول الطابق — نفس أعمدة الديسكتوب (MaxWidth 260 لكل حقل + الأزرار في الآخر) */
.tblx-setup { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.tblx-setup .fld { display: flex; flex-direction: column; gap: 5px; flex: 1 1 200px; max-width: 260px; min-width: 150px; }
.tblx-setup .fld > span { font-size: 12px; color: var(--muted); }
.tblx-setup .fld .np-input, .tblx-setup .fld .np-select { height: 40px; padding: 8px 10px; font-size: 14px; }

.tblx-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-inline-start: auto; }
.tblx-acts .np-btn { height: 44px; min-width: 110px; border-radius: 10px; font-weight: 600; }
.tblx-new { background: #B8860B; color: #fff; }   /* نفس لون زر «جديد» في الديسكتوب */

.tblx-hint { font-size: 11px; color: var(--muted); margin-top: 10px; }
.tblx-ok { font-size: 13px; color: var(--success); margin-top: 8px; }

/* شبكة الصف الأخير: لوحة العناصر 270 + مخطط الطابق */
.tblx-main { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 14px; align-items: start; }
.tblx-pal, .tblx-plan { display: flex; flex-direction: column; min-width: 0; }

/* تابات لوحة العناصر (Style x:Key="Tab": زوايا علوية 8 والمحدد accent أبيض) */
.tblx-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
.tblx-tab {
  border: none; background: transparent; color: var(--text); font-family: inherit;
  font-size: 13.5px; padding: 8px 14px; border-radius: 8px 8px 0 0; cursor: pointer;
}
.tblx-tab.on { background: var(--accent); color: #fff; font-weight: 600; }

/* WrapPanel الخلايا (سكرول رأسي زي ScrollViewer في التاب) */
.tblx-cells {
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px;
  padding-top: 10px; max-height: 520px; overflow-y: auto;
}
.tblx-bak {
  flex: 0 0 auto; width: 96px; height: 64px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; color: #fff; font-family: inherit; font-weight: 700; font-size: 14px;
}
.tblx-bak.on { border-color: var(--accent); }
.tblx-cell {
  flex: 0 0 auto; width: 72px; height: 46px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--field-bg); color: var(--text);
  font-family: inherit; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.tblx-cell:active, .tblx-bak:active { filter: brightness(.9); }

/* مخطط الطابق — canvasHost: مقاس ثابت متمركز داخل سكرول */
.tblx-canvas-wrap { overflow: auto; display: flex; justify-content: center; }
.tblx-canvas {
  position: relative; flex: 0 0 auto; direction: ltr;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; touch-action: none;
}

/* الديكور 104×104 والطاولة 132 عرض بمقبض شكل 76 (نفس مقاسات الديسكتوب) */
.tblx-decor {
  position: absolute; width: 104px; height: 104px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; cursor: move; touch-action: none; user-select: none;
}
.tblx-table {
  position: absolute; width: 132px; padding: 5px; border-radius: 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.tblx-table .glyph {
  position: relative; height: 76px; display: flex; align-items: center; justify-content: center;
  font-size: 32px; cursor: move; touch-action: none; user-select: none;
}
.tblx-table .cap {
  height: 24px; padding: 2px 6px; font-size: 12px; text-align: center;
  background: rgba(15,23,42,.55); color: #fff; border: 0; border-radius: 6px;
}
.tblx-table .cap::placeholder { color: rgba(255,255,255,.6); }
.tblx-tags {
  font-size: 10px; color: #fff; background: rgba(15,23,42,.62);
  border-radius: 6px; padding: 1px 4px; text-align: center;
}
.tblx-x { position: absolute; top: 0; inset-inline-end: 0; }
.tblx-gear { position: absolute; top: 0; inset-inline-start: 0; }

/* موبايل / تابلت بالطول: العمودان فوق بعض ولوحة العناصر أقصر */
@media (max-width: 900px) {
  .tblx-main { grid-template-columns: 1fr; }
  .tblx-cells { max-height: 210px; }
  .tblx-acts { margin-inline-start: 0; width: 100%; }
  .tblx-acts .np-btn { flex: 1 1 100px; min-width: 96px; }
}

/* ═══ 📐 حوار مقاسات التفصيل — مرآة CashierMeasureDialog.xaml ═══
   عمودان زي الأصل: لوحة بيانات العميل/الطلب 340px + ورقة الباترون بخانات
   المقاسات فوقها. ألوان الأزرار نفس أكواد الديسكتوب حرفياً، والباقي متغيرات
   الثيم (فاتح/غامق) وكل الاتجاهات منطقية. */

.msr-dlg { max-width: 1000px; width: min(1000px, 96vw); max-height: 94vh; }
.msr-cust { font-size: 12px; font-weight: 500; color: var(--muted); margin-inline-start: 12px; }

.msr-body { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: stretch; }

/* ── اللوحة اليسرى: بيانات العميل والطلب ثم الأزرار (DockPanel في الأصل) ── */
.msr-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.msr-fields { display: flex; flex-direction: column; }
.msr-lbl { font-size: 13px; color: var(--muted); margin: 8px 0 3px; }
.msr-fields > .msr-lbl:first-child { margin-top: 0; }
.msr-inp { height: 38px; padding: 6px 10px; font-size: 15px; }
.msr-num { text-align: center; direction: ltr; font-variant-numeric: tabular-nums; }
.msr-bal { color: var(--warning); font-weight: 700; }
.msr-note { min-height: 70px; resize: vertical; padding: 8px 10px; font-size: 14px; font-family: inherit; }

.msr-foot { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.msr-status { font-size: 12px; color: var(--warning); }
.msr-row2  { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.msr-row21 { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.msr-btn { height: 48px; padding: 8px 10px; border-radius: 10px; font-size: 15px; font-weight: 700; color: #fff; }

/* ألوان أزرار الديسكتوب حرفياً */
.msr-side .b-saveorder { background: #0D9488; }   /* 🧾 حفظ طلب + عربون */
.msr-side .b-oldorder  { background: #B45309; }   /* 📂 تفصيل قديم */
.msr-side .b-payrest   { background: #DC2626; }   /* 💵 دفع الباقى */
.msr-side .b-savecust  { background: #10B981; }   /* 💾 حفظ للعميل */
.msr-side .b-printcut  { background: #8B5CF6; }   /* 🖨 طباعة للتفصيل */
.msr-side .b-closecut  { background: #64748B; }   /* ✕ إغلاق */

/* ── الورقة: متصفّح الباترون + الكانفاس بخانات المقاسات ── */
.msr-pattern { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.msr-nav { display: flex; align-items: center; justify-content: center; gap: 10px; }
.msr-navbtn { width: 40px; min-width: 40px; height: 40px; padding: 0; background: #334155; color: #fff; font-size: 20px; }
.msr-patname { font-size: 16px; font-weight: 700; min-width: 150px; text-align: center; color: var(--text); }

.msr-paper { background: #fff; border-radius: 6px; overflow: auto; max-height: 62vh; }
.msr-canvas { position: relative; direction: ltr; }
.msr-frame { position: absolute; border: 1px dashed #94A3B8; border-radius: 6px; }
.msr-frame span { position: absolute; left: 6px; top: 4px; font-size: 11px; color: #94A3B8; }
.msr-box {
  position: absolute; border: 1px solid #000; background: #fff; color: #000;
  text-align: center; font-size: 12px; padding: 0 2px; font-family: inherit;
  direction: ltr; border-radius: 0; outline: none;
}
.msr-box:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.msr-box::placeholder { color: #B6BDC6; font-size: 10px; }

@media (max-width: 900px) {
  .msr-body { grid-template-columns: 1fr; }
  .msr-paper { max-height: 44vh; }
  .msr-btn { height: 44px; font-size: 14px; }
}

/* ═══ صور مصمم الطاولات — منقولة من فولدر Image بتاع الديسكتوب ═══ */
.tblx-cell img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tblx-decor img,
.tblx-table .glyph img {
  width: 100%; height: 100%; object-fit: contain;
  display: block; pointer-events: none; user-select: none;
}
.tblx-decor, .tblx-table .glyph { font-size: 0; }   /* الرمز الاحتياطي ما ياخدش مساحة */
/* صورة الباترون في حوار التفصيل */
.msr-frame { position: relative; }
.msr-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.msr-frame span { position: absolute; inset-inline-start: 4px; top: 4px; font-size: 10px; color: var(--muted); }

/* ═══ 🍽 خريطة الطاولات — مرآة CashierTablesDialog.xaml ═══
   حوار عريض بأربع مناطق زى الأصل: هيدر (بادچ + عنوان/تلميح + نقل/دمج/إغلاق)، شريط طوابق،
   مخطط الطابق (كانفاس 1160×600 بصورة الأرضية والديكور والبلاطات) وفوقه أوفرلاي عدد الضيوف،
   ثم فوتر (مفتاح الألوان + سطر الحالة). ألوان الأزرار وحالات الطاولة نفس أكواد الديسكتوب. */

.ctbl-dlg { max-width: 1250px; width: min(1250px, 98vw); max-height: 96vh; }

.ctbl-head { gap: 10px; flex-wrap: wrap; }
.ctbl-badge {
  width: 46px; height: 46px; border-radius: 10px; background: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 22px;
}
.ctbl-titles { display: flex; flex-direction: column; }
.ctbl-title { font-size: 19px; font-weight: 800; color: var(--text); }
.ctbl-hint  { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.ctbl-acts  { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: 8px; }

.ctbl-top {
  height: 46px; min-width: 120px; padding: 6px 12px; border: 0; border-radius: 10px;
  background: var(--accent); color: #fff; font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.ctbl-top:active { filter: brightness(.85); }
.ctbl-top.b-transfer { background: #0D9488; }
.ctbl-top.b-merge    { background: #8B5CF6; }
.ctbl-top.b-exit     { background: #EF4444; min-width: 90px; }
.ctbl-top.b-ok       { background: #10B981; }
.ctbl-top.b-cancel   { background: #64748B; }
.ctbl-top.on         { background: #F59E0B; }   /* وضع النقل/الدمج شغّال — نفس تبديل لون الأصل */

.ctbl-body { display: flex; flex-direction: column; gap: 8px; min-height: 0; }

.ctbl-floors { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.ctbl-floor {
  flex: 0 0 auto; height: 42px; min-width: 88px; padding: 6px 12px; border: 0; border-radius: 10px;
  background: #334155; color: #fff; font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.ctbl-floor.on { background: var(--accent); }

.ctbl-map { position: relative; background: var(--card-bg); border-radius: 12px; padding: 4px; min-height: 0; }
.ctbl-canvas { background-color: #0F1D33; }

.ctbl-decor {
  position: absolute; width: 104px; height: 104px; z-index: 0; pointer-events: none;
  display: flex; align-items: center; justify-content: center; font-size: 40px;
}
.ctbl-decor img { width: 100%; height: 100%; object-fit: contain; display: block; }

.ctbl-table {
  position: absolute; z-index: 1; width: 116px; min-height: 108px; padding: 4px;
  border: 0; border-radius: 12px; background: transparent; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.ctbl-table:active { filter: brightness(.85); }
.ctbl-table.sel { outline: 3px solid #F59E0B; }
.ctbl-table .glyph {
  position: relative; width: 100%; height: 64px; font-size: 28px;
  display: flex; align-items: center; justify-content: center;
}
.ctbl-table .glyph img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ctbl-table .glyph .tm { position: absolute; top: 0; inset-inline-end: 0; font-size: 12px; }
.ctbl-table .cap {
  max-width: 92px; padding: 1px 6px; border-radius: 6px; background: rgba(15,23,42,.59);
  color: #fff; font-size: 13px; font-weight: 700; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ctbl-table .sub {
  max-width: 106px; color: #fff; font-size: 10.5px; opacity: .92; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px rgba(15,23,42,.9);
}
.ctbl-fb { display: none; }   /* الرمز الاحتياطى — الصور الحقيقية هى الأصل */

.ctbl-guest {
  position: absolute; inset: 0; z-index: 5; border-radius: 12px; background: rgba(15,23,42,.8);
  display: flex; align-items: center; justify-content: center;
}
.ctbl-guest-box {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; min-width: min(340px, 90%);
}
.ctbl-guest-title { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.ctbl-num { height: 46px; font-size: 20px; text-align: center; direction: ltr; }
.ctbl-lock { display: flex; gap: 10px; margin-top: 10px; }
.ctbl-lock .fld { flex: 1 1 140px; }
.ctbl-guest-btns { display: flex; gap: 12px; margin-top: 16px; }
.ctbl-guest-btns .ctbl-top { flex: 1; min-width: 0; }

.ctbl-foot { align-items: center; flex-wrap: wrap; }
.ctbl-legend { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.ctbl-legend .sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.ctbl-legend span + .sw { margin-inline-start: 10px; }
.ctbl-status { margin-inline-start: auto; font-size: 13px; color: var(--warning); }

/* شارة الطاولة المفتوحة فى شريط أزرار الكاشير (مكافئ tableBadge فى هيدر الديسكتوب) */
.cash-tablebadge {
  display: inline-flex; align-items: center; height: 32px; padding: 0 10px; border-radius: 8px;
  background: rgba(124,58,237,.16); color: var(--text); font-size: 13px; font-weight: 700;
}
.cash-root .b-parktable { background: #B45309; }   /* 🪑 حفظ للطاولة */

@media (max-width: 900px) {
  .ctbl-top { height: 42px; min-width: 96px; font-size: 13px; }
  .ctbl-title { font-size: 16px; }
  .ctbl-acts { width: 100%; margin-inline-start: 0; }
}

/* ═══ 📑 شريط تابات عام لشاشات الخيارات — نفس TabControl/TabItem فى الديسكتوب ═══ */
.np-tabs {
  display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--border);
  padding: 0 10px; margin-top: 10px;
}
.np-tab {
  height: 42px; min-width: 110px; padding: 6px 16px; border: 0;
  border-radius: 8px 8px 0 0; background: var(--field-bg); color: var(--text);
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.np-tab:active { filter: brightness(.9); }
.np-tab.on { background: var(--accent); color: #fff; font-weight: 700; }

/* لوحة الخيارات: أقسام (GroupBox) وصفوف الخيارات جوّه كل تاب */
.np-opt-page { padding: 10px 10px 24px; display: flex; flex-direction: column; gap: 12px; }
.np-opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.np-opt-box {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
}
.np-opt-box > h4 {
  margin: 0 0 8px; font-size: 14px; font-weight: 800; color: var(--accent);
  border-bottom: 1px solid var(--border); padding-bottom: 6px;
}
.np-opt-row { display: flex; align-items: center; gap: 8px; min-height: 38px; }
.np-opt-row > span.lbl { flex: 1 1 auto; font-size: 13px; color: var(--text); }
.np-opt-row .np-input, .np-opt-row .np-select { flex: 0 0 auto; width: 130px; height: 36px; padding: 4px 8px; font-size: 13px; }
.np-opt-row .wide { width: 100%; flex: 1 1 auto; }
.np-opt-chk { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 13px; color: var(--text); cursor: pointer; }
.np-opt-chk input { width: 20px; height: 20px; flex: 0 0 auto; }
.np-opt-full { grid-column: 1 / -1; }

/* أعمدة شاشات الخيارات — مرآة Grid بأعمدة * فى الديسكتوب (بتتكوّم عمود واحد على الموبايل) */
.np-opt-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.np-opt-col  { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.np-opt-note { font-size: 12px; color: var(--muted); line-height: 1.6; }
.np-opt-list { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 2px; border-bottom: 1px solid var(--border); }
.np-opt-pick { display: flex; gap: 6px; }
.np-opt-pick .np-select { flex: 1; min-width: 0; }

/* شريط قسم داخل الكارت — مرآة استايل Section فى شاشات الديسكتوب (شريط بلون البراند ونص أبيض).
   بيستخدمه: إدارة المستخدمين (بيانات المستخدم / قائمة المستخدمين / صلاحيات الشاشات). */
.np-sec {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 13.5px;
  border-radius: 9px; padding: 8px 10px; margin: -2px 0 10px;
}
.np-sec .cnt { font-size: 12px; font-weight: 600; opacity: .9; }
.np-sec .np-input { margin-inline-start: auto; height: 30px; padding: 2px 8px; font-size: 12.5px; width: 150px; flex: 0 0 auto; }

/* ═══ الداش بورد — مرآة Controls/DashboardControl.xaml ═══ */
.dash { padding: 12px 12px 90px; display: flex; flex-direction: column; gap: 12px; }

.dash-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--header-bg); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px;
}
.dash-head .ico {
  width: 52px; height: 52px; border-radius: 13px; flex: 0 0 auto;
  background: var(--accent); color: #fff; font-size: 26px;
  display: flex; align-items: center; justify-content: center;
}
.dash-head .t { font-size: 20px; font-weight: 800; color: var(--text); }
.dash-head .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dash-head .upd { font-size: 11px; color: var(--muted); }

/* صف الكروت — 6 على الشاشة الواسعة، وبيتكوّموا لوحدهم على الضيقة */
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 10px; }
.dash-kpi {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; min-width: 0;
}
.dash-kpi .hd { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.dash-kpi .hd .ic { font-size: 14px; }
.dash-kpi .hd span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-kpi .val { font-size: 20px; font-weight: 800; color: var(--text); margin: 6px 0 2px; }
.dash-kpi .dlt { font-size: 11px; color: var(--muted); }
.dash-kpi.inv .val { font-size: 19px; }
.dash-kpi.link { cursor: pointer; border-color: var(--accent); }
.dash-kpi.link:active { filter: brightness(1.15); }

/* صفوف الكروت الكبيرة — عمودان على الواسعة وعمود على الضيقة */
.dash-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.dash-chart { grid-column: span 1; }
@media (min-width: 900px) { .dash-row > .dash-chart { grid-column: span 1; } }

.dash-cap {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 10px;
}
.dash-cap .mx { margin-inline-start: auto; font-size: 10px; font-weight: 600; color: var(--muted); }
.dash-cap .badge {
  margin-inline-start: auto; border-radius: 9px; padding: 2px 9px;
  font-size: 10px; font-weight: 700; color: #fff;
}
.dash-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 22px 0; }

/* أعمدة الرسم — نفس فكرة Borders فى الأصل: ارتفاع نسبى وآخر عمود بوضوح كامل */
.dash-chart .bars { display: flex; align-items: flex-end; gap: 4px; height: 178px; padding: 0 2px; }
.dash-chart .col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.dash-chart .bar { background: var(--accent); border-radius: 4px 4px 0 0; opacity: .55; margin: 0 3px; }
.dash-chart .bar.last { opacity: 1; }
.dash-chart .bar.zero { background: var(--border); opacity: 1; }
.dash-chart .lbl { font-size: 9.5px; color: var(--muted); text-align: center; margin-top: 4px; }

/* كارت الوردية */
.dash-session .who { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.dash-session .ln {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; color: var(--text); padding: 7px 0; border-bottom: 1px solid var(--border);
}
.dash-session .ln:last-of-type { border-bottom: none; }
.dash-session .ln b { font-weight: 800; }

/* صفوف الأعلى مبيعاً / أفضل الزبائن */
.dash-top {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12.5px;
}
.dash-top:last-child { border-bottom: none; }
.dash-top .rk {
  width: 22px; height: 22px; border-radius: 6px; flex: 0 0 auto;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.dash-top .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.dash-top .qt { flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.dash-top .vl { flex: 0 0 auto; font-weight: 800; color: var(--text); }

/* شريط حالة النظام */
.dash-sys {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--footer-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 12px; font-size: 11px; color: var(--muted);
}

/* اختيار المخزن فى هيدر الداش بورد + شريط التقييد (مستخدم «مخزنى فقط») */
.dash-store { width: auto; min-width: 120px; max-width: 200px; padding: 7px 10px; font-size: 13px; margin-inline-end: 10px; }
.dash-store:disabled { opacity: .75; cursor: not-allowed; }
.dash-lock {
    margin: -4px 0 10px; padding: 7px 12px; border-radius: 8px; font-size: 12px;
    background: var(--field-bg); color: var(--muted); border: 1px solid var(--border);
}


/* ═══ 📋 نسخ الجدول للحافظة (np-gridcopy.js) ═══
   الغلاف نسبى عشان الزرار يعوم فوق الجدول بلا ما يدخل تخطيط الصفحة. */
.np-copy-wrap { position: relative; }
.np-copy-btn {
    position: absolute; top: 2px; inset-inline-start: 2px;
    width: 22px; height: 22px; padding: 0; line-height: 1;
    border-radius: 4px; border: 1px solid rgba(0,0,0,.25);
    background: rgba(255,255,255,.92); color: #111;
    font-size: 12px; cursor: pointer; opacity: .55; z-index: 5;
}
.np-copy-btn:hover { opacity: 1; }
.np-copy-toast {
    position: fixed; inset-inline-start: 50%; transform: translateX(-50%);
    bottom: 28px; z-index: 9999; padding: 8px 14px; border-radius: 8px;
    background: rgba(17,17,17,.92); color: #fff; font-size: 13px;
    transition: opacity .4s; pointer-events: none;
}
.np-copy-toast.gone { opacity: 0; }

/* 🔴 صندوق خطأ ErrorBoundary — بيعرض الاستثناء الحقيقى بدل جملة «حدث خطأ غير متوقع»
   العامة. الرسالة العامة كانت بتخلّى البلاغ يوصل صورة شاشة بلا سبب، والتشخيص تخمين. */
.np-err-box{margin:16px;padding:14px 16px;border-radius:10px;
  background:#FEF2F2;border:1.5px solid #EF4444;color:#7F1D1D;
  font-size:13px;line-height:1.7;direction:ltr;text-align:left}
.np-err-head{display:flex;align-items:center;justify-content:space-between;gap:12px;
  font-weight:700;font-size:15px;margin-bottom:8px;direction:inherit}
.np-err-type{font-family:Consolas,monospace;font-size:12px;color:#B91C1C;font-weight:700}
.np-err-msg{margin:4px 0 8px;white-space:pre-wrap;word-break:break-word}
.np-err-stack{margin:0;padding:8px 10px;border-radius:8px;background:#fff;
  border:1px solid #FCA5A5;font-family:Consolas,monospace;font-size:11px;
  white-space:pre-wrap;word-break:break-word;max-height:220px;overflow:auto}
@media (prefers-color-scheme: dark){
  .np-err-box{background:#2A1212;border-color:#B91C1C;color:#FECACA}
  .np-err-stack{background:#1A0C0C;border-color:#7F1D1D;color:#FCA5A5}
  .np-err-type{color:#FCA5A5}
}

/* ═══ 📦 زرّ وحدة السطر فى الكاشير (بلاغ #205) ═══
   🔴 الخانة صفٌّ واحدٌ فيه حقلُ الكمّية والزرّ معاً: فصلُهما عمودَين كان يسرق عرضاً
      من عمود اسم الصنف — وهو الأضيق أصلاً على الموبايل.
   🔴 والزرّ يُظهر اسم الوحدة نصّاً لا أيقونةً: الكاشير يقرأ «علبة» أو «شريط»
      ولا يحزر، والحالة الفرعيّة مميّزةٌ باللون فتُرى من بعيد. */
.qtycell { display: flex; align-items: center; gap: 4px; }
.qtycell input { flex: 1 1 auto; min-width: 0; }
.np-unitbtn {
  flex: 0 0 auto;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--text);
  font-size: 11px; font-weight: 700;
  padding: 4px 6px; border-radius: 8px; cursor: pointer;
  max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.np-unitbtn.sub {
  background: color-mix(in srgb, #F59E0B 18%, transparent);
  border-color: color-mix(in srgb, #F59E0B 45%, transparent);
}
.np-unitbtn:active { transform: scale(0.96); }

/* ═══════════════════════════════════════════════════════════════
   🖥️ 2026-11-22 (المهندس: «مش الألوان بس — التصميم»): شكل ديسكتوب أفوكاتو
   القيم منقولة بالحرف من App.xaml فى الديسكتوب: Card · Act · HdrBtn · Section/SectionTitle ·
   AccentGradient · Fld · Dt · Lbl · Grd/GridHdr. الماك (pointer: fine) بمقاسات الديسكتوب بالظبط؛
   الآيباد باللمس فاضل بمقاساته الكبيرة.
   ═══════════════════════════════════════════════════════════════ */
:root, html[data-theme="dark"] { --card2: #334155; --accent-grad: linear-gradient(135deg, #16324F 0%, #1E3A5F 50%, #33587E 100%); }
html[data-theme="light"]       { --card2: #FAFAF8; }

/* Card: ThemeHeaderBg · زوايا 12 · حشوة 14 · إطار رفيع #2664748B من غير ظل (#445/#446) */
.np-card { background: var(--header-bg); border: 1px solid rgba(100, 116, 139, .15); border-radius: 12px; padding: 14px; }

/* Act: 13 SemiBold · زوايا 10 · حشوة 0×16 — الثانوى ThemeCard2 بنص ThemeText */
.np-btn { border-radius: 10px; font-weight: 600; }
.np-btn:hover { filter: none; opacity: .88; }
.np-btn.secondary { background: var(--card2); color: var(--text); border: 1px solid var(--border); }
/* ألوان أزرار الديسكتوب حسب الوظيفة */
.np-btn.c-accent { background: var(--accent); color: #fff; }
.np-btn.c-green  { background: #10B981; color: #fff; }
.np-btn.c-teal   { background: #0F766E; color: #fff; }
.np-btn.c-slate  { background: #475569; color: #fff; }
.np-btn.c-gray   { background: #64748B; color: #fff; }
.np-btn.c-indigo { background: #6366F1; color: #fff; }
.np-btn.c-pink   { background: #EC4899; color: #fff; }
.np-btn.c-yellow { background: #EAB308; color: #fff; }
.np-btn.c-cyan   { background: #06B6D4; color: #fff; }
.np-btn.c-blue   { background: #2563EB; color: #fff; }
.np-btn.c-sky    { background: #0EA5E9; color: #fff; }
.np-btn.c-purple { background: #8B5CF6; color: #fff; }
.np-btn.c-red    { background: #EF4444; color: #fff; }
.np-btn.c-amber  { background: #F59E0B; color: #fff; }
.np-btn[class*=" c-"] { border: none; }

/* Fld / Cmb: زوايا 8 · إطار ThemeBorder · التركيز بلون ThemeAccent */
.np-input, .np-select { border-radius: 8px; }
/* Lbl: ThemeMuted · 12 · مسافة 5 تحت */
.np-lbl { display: block; font-size: 12px; color: var(--muted); margin: 0 0 5px; }

/* ═══ رأس الشاشة (PageHead) — نفس «Header Card»: أيقونة 46×46 بتدرّج AccentGradient + عنوان 17 Bold + وصف 11.5 ═══ */
.dk-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dk-head .dk-ico {
  flex: 0 0 46px; width: 46px; height: 46px; border-radius: 12px; background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.dk-head .dk-tt { flex: 1 1 200px; min-width: 0; }
.dk-head .dk-title { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.25; }
.dk-head .dk-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.dk-head .dk-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-inline-start: auto; }
/* HdrBtn: مربع 34 · زوايا 9 · لون حسب الوظيفة */
.dk-hbtn {
  min-width: 34px; height: 34px; border-radius: 9px; border: none; cursor: pointer; color: #fff; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; background: var(--card2); padding: 0 9px; font-family: inherit; white-space: nowrap;
}
.dk-hbtn:hover { opacity: .85; }
.dk-hbtn.c-sky { background: #0EA5E9; } .dk-hbtn.c-blue { background: #3B82F6; }
.dk-hbtn.c-purple { background: #8B5CF6; } .dk-hbtn.c-red { background: #EF4444; }
.dk-hbtn.c-green { background: #10B981; } .dk-hbtn.c-amber { background: #F59E0B; } .dk-hbtn.c-slate { background: #64748B; } .dk-hbtn.c-teal { background: #0F766E; }

/* Section: شريط بتدرّج AccentGradient · زوايا 8 · حشوة 7×10 · عنوان أبيض Bold 13 */
.dk-sec {
  background: var(--accent-grad); border-radius: 8px; padding: 7px 10px; color: #fff;
  font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.dk-sec .dk-sec-acts { margin-inline-start: auto; display: flex; gap: 6px; align-items: center; font-weight: 600; }

/* Grd / GridHdr: إطار ThemeBorder · خطوط أفقية ورأسية · صف متبادل #0D3B82F6 · رأس ThemeFieldBg بلون ThemeAccent Bold 12 فى النص */
.np-table { border: 1px solid var(--border); font-size: 12.5px; }
.np-table th {
  background: var(--field-bg); color: var(--accent); font-weight: 700; font-size: 12px; text-align: center;
  border: 0; border-inline-end: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 9px 8px;
}
.np-table td { border-bottom: 1px solid var(--border); border-inline-end: 1px solid var(--border); padding: 6px; }
.np-table tbody tr:nth-child(even) td { background: rgba(59, 130, 246, .05); }
.np-table tbody tr:hover td { background: color-mix(in srgb, var(--accent) 8%, transparent); }

@media (pointer: fine) {
  html, body { font-size: 13px; }
  .np-btn { padding: 0 16px; height: 36px; font-size: 13px; }
  .np-btn.big { height: 40px; font-size: 14px; }
  .dk-head .dk-acts .np-btn { height: 34px; font-size: 12px; padding: 0 10px; }
  .np-input, .np-select { padding: 0 8px; font-size: 13px; height: 36px; }
  textarea.np-input { height: auto; padding: 6px 8px; }
  .np-label { font-size: 12px; margin: 8px 0 3px; }
  .np-table th, .np-table td { line-height: 1.35; }
  .np-iconbtn { font-size: 18px; padding: 4px 8px; border-radius: 6px; }
  .np-topbar { padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 8px; }
  .np-topbar .title { font-size: 16px; }
}

/* ═══ ⭐ شريط اختصاراتي البنى — توأم shortcutsBar فى desktop.xaml (2026-11-22) ═══
   خلفية #3a2a15 · العنوان ذهبى #FBBF24 · الشريحة ShortcutChip: زوايا 15 · خلفية #22FFFFFF · إطار #66FBBF24 · hover تدرّج كهرمانى
   ShortcutEditBtn: نص ذهبى · إطار #5AFBBF24 · hover #33FBBF24 */
.dk-scbar {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px; background: #3a2a15;
  position: relative; z-index: 45; min-height: 38px; flex: 0 0 auto;
}
.dk-sclbl { color: #FBBF24; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.dk-scchips {
  flex: 1; min-width: 0; display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.dk-chip {
  flex: 0 0 auto; height: 28px; padding: 0 12px; border-radius: 15px; cursor: pointer; white-space: nowrap;
  background: rgba(255, 255, 255, .13); border: 1px solid rgba(251, 191, 36, .4); color: #fff;
  font-family: inherit; font-size: 12px; font-weight: 600;
}
.dk-chip:hover { background: linear-gradient(135deg, #F59E0B, #D97706); border-color: #FBBF24; }
.dk-schint { color: rgba(255, 255, 255, .6); font-size: 11.5px; white-space: nowrap; }
.dk-scedit {
  flex: 0 0 auto; height: 28px; padding: 0 10px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  background: transparent; border: 1px solid rgba(251, 191, 36, .35); color: #FBBF24;
  font-family: inherit; font-size: 12px; font-weight: 600;
}
.dk-scedit:hover { background: rgba(251, 191, 36, .2); }
.dk-scmenu {
  position: absolute; top: calc(100% + 4px); inset-inline-end: 0; z-index: 50; min-width: 240px; max-width: 86vw;
  max-height: 65vh; overflow: auto; padding: 6px; border-radius: 10px;
  background: var(--card-bg); border: 1px solid var(--border); box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
}
.dk-scmenu-g { font-size: 11px; font-weight: 700; color: var(--accent); padding: 8px 8px 3px; }
.dk-scmenu-i {
  display: block; width: 100%; text-align: start; padding: 7px 10px; border: 0; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--text); font-family: inherit; font-size: 12.5px; white-space: nowrap;
}
.dk-scmenu-i:hover { background: rgba(251, 191, 36, .18); }
.dk-scmenu-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.dk-scmenu-empty { padding: 10px; color: var(--muted); font-size: 12px; }

/* ═══ 🗂️ شريط التبويبات — توأم tabsBar فى desktop.Tabs.cs ═══
   خلفية #2a1d10 · تبويب ارتفاع 24 (هنا 28 للمس) · زوايا 6,6,0,0 · خط 11.5 · أقصى عرض 150
   النشط: خلفية الصفحة + خط ذهبى 2px فوق · العادى: #22FFFFFF نص #E5E7EB hover #44FFFFFF · ✕ رمادى #9CA3AF أحمر عند المرور */
.dk-tabs {
  display: flex; align-items: flex-end; gap: 3px; padding: 5px 8px 0; background: #2a1d10; flex: 0 0 auto;
  overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.dk-tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 28px; max-width: 170px; padding: 0 10px;
  border-radius: 6px 6px 0 0; border-top: 2px solid transparent; cursor: pointer; user-select: none;
  background: rgba(255, 255, 255, .13); color: #E5E7EB; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.dk-tab:hover { background: rgba(255, 255, 255, .27); }
.dk-tab.on { background: var(--bg); color: var(--text); border-top-color: #FBBF24; }
.dk-tabt { overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.dk-tabx { font-size: 9.5px; color: #9CA3AF; padding: 2px 3px; border-radius: 4px; line-height: 1; }
.dk-tabx:hover { color: #EF4444; background: rgba(239, 68, 68, .15); }
.dk-tabs-others {
  flex: 0 0 auto; align-self: center; margin-inline-start: auto; padding: 2px 8px; font-size: 11px; cursor: pointer;
  color: #9CA3AF; border-radius: 6px;
}
.dk-tabs-others:hover { color: #EF4444; background: rgba(239, 68, 68, .15); }

/* ═══ ❓ نافذة المساعدة — توأم SimpleDefinitionHelpWindow: رأس بلون أيقونة الشاشة + بطاقة لكل قسم ═══ */
.np-dialog.dk-help { max-width: 640px; width: 96vw; }
.dk-help-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: #fff; }
.dk-help-ico {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 11px; background: rgba(255, 255, 255, .2);
  display: flex; align-items: center; justify-content: center; font-size: 21px;
}
.dk-help-t { font-size: 16px; font-weight: 700; }
.dk-help-s { font-size: 11.5px; opacity: .85; margin-top: 2px; }
.dk-help-body { padding: 12px 14px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.dk-help-sec { margin: 0; padding: 11px 13px; }
.dk-help-h { font-weight: 700; font-size: 13.5px; color: var(--accent); margin-bottom: 5px; }
.dk-help-b { font-size: 12.5px; color: var(--text); line-height: 1.7; white-space: pre-wrap; }
.dk-help-foot { display: flex; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid var(--border); }

/* ═══ 🎓 الجولة التعريفية — توأم Controls/TourOverlay.cs (np-tour.js) ═══
   تعتيم #B8000000 · فتحة حوالين العنصر بإطار ذهبى #FBBF24 بينبض (1 ⇐ .45 كل .9 ث) · الفقاعة 340 زوايا 12
   فاتح: أبيض ونص #1F2937 · غامق: #2A1E12 ونص أبيض · الأساسى كهرمانى #F59E0B */
.npt-root { position: fixed; inset: 0; z-index: 2000; }
.npt-root.npt-nohole { background: rgba(0, 0, 0, .72); }
.npt-block { position: absolute; inset: 0; }
.npt-hole {
  position: fixed; border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .72);
  transition: left .18s, top .18s, width .18s, height .18s;
}
.npt-hole::after {
  content: ""; position: absolute; inset: 0; border-radius: 10px; border: 2.5px solid #FBBF24;
  box-shadow: 0 0 18px rgba(245, 158, 11, .9); animation: npt-pulse .9s ease-in-out infinite alternate;
}
@keyframes npt-pulse { from { opacity: 1; } to { opacity: .45; } }
.npt-card {
  position: fixed; box-sizing: border-box; padding: 16px 18px 14px; border-radius: 12px;
  background: #fff; color: #1F2937; border: 1px solid rgba(245, 158, 11, .5);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .45); font-family: inherit;
}
html[data-theme="dark"] .npt-card { background: #2A1E12; color: #fff; }
.npt-card.npt-in { animation: npt-fade .22s ease-out; }
@keyframes npt-fade { from { opacity: 0; } to { opacity: 1; } }
.npt-arrow {
  position: absolute; width: 18px; height: 18px; background: inherit; border: inherit; transform: rotate(45deg);
}
.npt-a-below { top: -10px; border-right: 0 !important; border-bottom: 0 !important; }
.npt-a-above { bottom: -10px; border-left: 0 !important; border-top: 0 !important; }
.npt-a-right { left: -10px; border-top: 0 !important; border-right: 0 !important; }
.npt-a-left { right: -10px; border-bottom: 0 !important; border-left: 0 !important; }
.npt-counter { font-size: 11.5px; font-weight: 600; color: #6B7280; margin-bottom: 4px; position: relative; }
html[data-theme="dark"] .npt-counter { color: #CBD5E1; }
.npt-title { font-size: 16.5px; font-weight: 700; margin-bottom: 6px; position: relative; }
.npt-body { font-size: 13.5px; line-height: 1.65; opacity: .92; white-space: pre-wrap; margin-bottom: 12px; position: relative; }
.npt-track { height: 4px; border-radius: 2px; background: #E5E7EB; margin-bottom: 12px; overflow: hidden; position: relative; }
html[data-theme="dark"] .npt-track { background: rgba(255, 255, 255, .2); }
.npt-fill { height: 100%; border-radius: 2px; background: #F59E0B; transition: width .2s; }
.npt-row { display: flex; align-items: center; gap: 8px; position: relative; }
.npt-sp { flex: 1; }
.npt-row button {
  height: 34px; padding: 0 14px; border-radius: 8px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: inherit; white-space: nowrap;
}
.npt-row button:hover { opacity: .85; }
.npt-skip { color: #6B7280 !important; padding: 0 4px !important; }
html[data-theme="dark"] .npt-skip { color: #CBD5E1 !important; }
.npt-back { border-color: rgba(245, 158, 11, .4) !important; }
.npt-next { background: #F59E0B !important; border-color: #F59E0B !important; color: #fff !important; }
.npt-toast {
  position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%); z-index: 2100; padding: 10px 18px; border-radius: 10px;
  background: #2A1E12; color: #fff; font-size: 13px; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); transition: opacity .4s;
}
.npt-toast.gone { opacity: 0; }

/* ═══ 📚 مركز التدريب — توأم Controls/AcademyOverlay.cs + Windows/AcademyWindow.cs (np-academy.js · AcademyDialog) — 2026-11-27
   نفس ألوان الجولة: تعتيم .72 · إطار ذهبى #FBBF24 بينبض · الفقاعة 380 · الأساسى كهرمانى #F59E0B.
   الفرق عن .npt-*: الحواجز أربع قطع حوالين الفتحة (.npa-block) ⇒ اللمس جوه الفتحة بيوصل للعنصر. ═══ */
.npa-root { position: fixed; inset: 0; z-index: 2050; pointer-events: none; }
.npa-block { position: fixed; pointer-events: auto; background: transparent; }
.npa-root.npt-nohole .npa-block { background: rgba(0, 0, 0, .72); }
.npa-hole {
  position: fixed; border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .72);
  transition: left .18s, top .18s, width .18s, height .18s;
}
.npa-hole::after {
  content: ""; position: absolute; inset: 0; border-radius: 10px; border: 2.5px solid #FBBF24;
  box-shadow: 0 0 18px rgba(245, 158, 11, .9); animation: npt-pulse .9s ease-in-out infinite alternate;
}
.npa-card {
  position: fixed; box-sizing: border-box; padding: 14px 18px 14px; border-radius: 12px; pointer-events: auto;
  background: #fff; color: #1F2937; border: 1px solid rgba(245, 158, 11, .5);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .45); font-family: inherit;
}
html[data-theme="dark"] .npa-card { background: #2A1E12; color: #fff; }
.npa-card.npt-in { animation: npt-fade .22s ease-out; }
.npa-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; position: relative; }
.npa-lesson { flex: 1; min-width: 0; font-size: 11.5px; font-weight: 600; color: #F59E0B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.npa-counter { font-size: 11.5px; color: #6B7280; white-space: nowrap; }
html[data-theme="dark"] .npa-counter { color: #CBD5E1; }
.npa-card .npt-body { margin-bottom: 8px; }
.npa-wait { font-size: 12px; color: #F59E0B; margin-bottom: 6px; position: relative; }
.npa-menu { font-size: 12.5px; font-weight: 700; color: #F59E0B; margin-bottom: 6px; position: relative; }
.npa-hint { font-size: 12.5px; color: #6B7280; margin-bottom: 8px; line-height: 1.6; position: relative; }
html[data-theme="dark"] .npa-hint { color: #CBD5E1; }
.npa-audio { display: flex; gap: 6px; margin-bottom: 8px; position: relative; }
.npa-audio button {
  min-width: 34px; height: 28px; padding: 0 8px; border-radius: 8px; border: 1px solid rgba(245, 158, 11, .25);
  background: transparent; color: inherit; font-family: inherit; font-size: 12.5px; cursor: pointer;
}
.npa-card .npt-row { flex-wrap: wrap; }
.npa-card .npt-skip { text-decoration: underline; }

/* ── نافذة مركز التدريب ── */
.np-dialog.ac-dlg { max-width: 760px; }
.ac-bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .25); margin-top: 7px; overflow: hidden; }
.ac-fill { height: 100%; background: #fff; border-radius: 3px; transition: width .3s; }
.ac-track { padding: 0 !important; overflow: hidden; }
.ac-thead {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: none; background: transparent;
  color: var(--text); font-family: inherit; cursor: pointer;
}
.ac-ticon { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 19px; background: color-mix(in srgb, var(--accent) 15%, transparent); }
.ac-tdesc { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ac-count { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.ac-count.full { color: #16A34A; }
.ac-arrow { font-size: 10px; color: var(--muted); transition: transform .2s; }
html[dir="ltr"] .ac-arrow { transform: rotate(180deg); }
.ac-track.open .ac-arrow { transform: rotate(-90deg); }
.ac-lessons { border-top: 1px solid var(--border); padding: 4px 0; }
.ac-lesson { display: flex; align-items: center; gap: 10px; padding: 8px 13px; }
.ac-lesson + .ac-lesson { border-top: 1px dashed var(--border); }
.ac-licon { flex: 0 0 26px; text-align: center; font-size: 16px; }
.ac-ltitle { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.ac-lmeta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ac-st.done { color: #16A34A; font-weight: 700; }
.ac-st.upd { color: #0EA5E9; font-weight: 700; }
.ac-st.start { color: #F59E0B; font-weight: 700; }
.ac-go { flex: 0 0 auto; min-width: 84px; height: 34px; padding: 0 12px; }

/* ── رأس وجسم وذيل نافذة مركز التدريب (توأم أفوكاتو مافيهوش ScreenHelpDialog فالتنسيق ده مش موجود) — نفس توائم Work Hub/Next ── */
.np-dialog.sh-dlg { max-width: 640px; width: 96vw; }
.sh-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: #fff; background: var(--accent); }
.sh-ico { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; background: rgba(255, 255, 255, .2); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.sh-t { font-size: 16px; font-weight: 700; }
.sh-s { font-size: 11.5px; opacity: .85; margin-top: 2px; }
.sh-body { padding: 12px 14px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.sh-sec { margin: 0; padding: 11px 13px; }
.sh-h { font-weight: 700; font-size: 13.5px; color: var(--accent); margin-bottom: 5px; }
.sh-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
