/* ===== شاشة المطبخ: نفس هوية موقع المنيو بالظبط =====
   نفس الخط (Cairo من الموقع نفسه)، ونفس الألوان والـ radius، ونفس مفتاح الليلي/النهاري.
   الأساسي نهاري زي المنيو، والليلي بيتحفظ لو المطبخ اختاره. كل زرار 44px على الأقل، والتأكيد 52px. */
@font-face{font-family:'Cairo';font-style:normal;font-weight:400 800;font-display:swap;src:url(assets/fonts/cairo-arabic.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:'Cairo';font-style:normal;font-weight:400 800;font-display:swap;src:url(assets/fonts/cairo-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

/* الليلي (نفس قيم المنيو) */
:root {
  --bg: #0B0B0B; --surface: #161616; --surface-2: #202020; --line: #2A2A2A; --band: #262626;
  --text: #F5F5F5; --muted: #A8A8A8;
  --brand: #FECE00; --on-brand: #0B0B0B; --brand-text: #FECE00; --brand-soft: rgba(254, 206, 0, .16);
  --danger: #FF6B6B; --danger-soft: rgba(255, 107, 107, .12); --danger-line: rgba(255, 107, 107, .4);
  --open: #34D399; --on-open: #0B0B0B; --open-soft: rgba(52, 211, 153, .14);
  --wa: #25D366;
  --warn: #FBBF24; --warn-soft: rgba(251, 191, 36, .16); --warn-line: rgba(251, 191, 36, .55);
  --shadow: 0 12px 30px rgba(0, 0, 0, .45);
  --open-text: #34D399; --sw-off: #6B6B6B;
  /* 017: المقفول رمادي وواضح */
  --closed-soft: #262626; --closed-line: #4A4A4A; --closed-text: #E0E0E0; --closed-dot: #9A9A9A;
  --pick: #7FB2FF;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Roboto Mono', 'Liberation Mono', monospace;
  --r: 16px; --r-lg: 24px;
  color-scheme: dark;
}
/* النهاري (نفس قيم المنيو): كل الكلام تباينه 4.5:1 على الأقل */
:root[data-theme="light"] {
  --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #F2F2F2; --line: #E3E3E3; --band: #E9E9E9;
  --text: #111111; --muted: #5C5C5C;
  --brand: #FECE00; --on-brand: #0B0B0B; --brand-text: #7A5900; --brand-soft: #FFF3C4;
  --danger: #C62828; --danger-soft: #FDECEC; --danger-line: #F1B5B5;
  --open: #12A150; --on-open: #FFFFFF; --open-soft: #E3F6EC;
  --warn: #9A5B00; --warn-soft: #FFF1D6; --warn-line: #F5C46B;
  --shadow: 0 12px 30px rgba(0, 0, 0, .16);
  /* الأخضر ككلام صغير محتاج يبقى أغمق عشان التباين (4.5:1) */
  --open-text: #0B6B35; --sw-off: #8A8A8A;
  --closed-soft: #ECECEC; --closed-line: #CFCFCF; --closed-text: #3D3D3D; --closed-dot: #6B6B6B;
  --pick: #1F5FBF;
  color-scheme: only light;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: 'Cairo', Tahoma, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6; font-size: 16px;
  min-height: 100vh; min-height: 100dvh;
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
input { font-size: 16px; }
button { background: none; border: 0; cursor: pointer; touch-action: manipulation; }
a { touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; }
.muted { color: var(--muted); }
.ico { flex: none; display: block; }
.small { font-size: 13px; }
.accent { color: var(--brand-text); }
.noscript { padding: 24px; text-align: center; }

/* ===== الأزرار (نفس btn-brand و btn-ghost في المنيو) ===== */
.btn {
  min-height: 48px; padding: 0 16px; border-radius: var(--r);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font-size: 16px; font-weight: 700; text-decoration: none;
}
.btn-lg { min-height: 52px; font-size: 17px; font-weight: 800; }
.btn-accent { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 800; }
.btn-good { background: var(--open); border-color: var(--open); color: var(--on-open); font-weight: 800; }
.btn-bad { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); font-weight: 800; }
.btn-bad.armed, .btn-ghost-bad.armed { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-ghost-bad { background: transparent; border-color: var(--danger-line); color: var(--danger); }
.btn-wa { color: var(--text); border-color: var(--wa); }
.btn-wa svg { color: var(--wa); }
.link-btn { min-height: 44px; padding: 0 8px; color: var(--brand-text); font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn {
  width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
}

/* ===== مفتاح الليلي/النهاري (نفس مفتاح المنيو) ===== */
.theme-btn { display: flex; align-items: center; min-height: 44px; padding: 0 2px; direction: ltr; }
.theme-track { position: relative; flex: none; width: 56px; height: 32px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); }
.theme-knob {
  position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: var(--on-brand); box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  transform: translateX(24px); transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
:root[data-theme="light"] .theme-knob { transform: translateX(0); }
.theme-knob svg { position: absolute; top: 5px; left: 5px; width: 16px; height: 16px; fill: currentColor; transition: opacity .3s ease, transform .45s ease; }
.theme-knob .i-sun { opacity: 0; transform: rotate(-120deg) scale(.4); }
:root[data-theme="light"] .theme-knob .i-sun { opacity: 1; transform: none; }
:root[data-theme="light"] .theme-knob .i-moon { opacity: 0; transform: rotate(120deg) scale(.4); }

/* ===== الدخول ===== */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 12px; padding: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.login-card { width: 100%; max-width: 380px; padding: 24px 16px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { font-size: 24px; font-weight: 800; line-height: 1.3; }
.label { font-size: 14px; font-weight: 700; }
input[type="password"], input[type="text"], input[type="search"], input[type="tel"] {
  width: 100%; min-height: 48px; padding: 0 16px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); outline: none;
}
input[type="password"]:focus, input[type="text"]:focus, input[type="search"]:focus, input[type="tel"]:focus { border-color: var(--brand-text); }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); }
.msg { min-height: 22px; font-size: 14px; font-weight: 600; color: var(--danger); }

/* ===== الشاشة ===== */
.app { max-width: 900px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.top { padding: 16px 16px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); }
.brand { display: flex; flex-direction: column; min-width: 0; }
.brand h1 { font-size: 22px; font-weight: 800; line-height: 1.3; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.sys-btn {
  min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 999px;
  font-size: 14px; font-weight: 800; background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-line);
}
.sys-btn svg { flex: none; }
.sys-btn.is-closed { background: var(--open-soft); color: var(--open); border-color: var(--open); }
.sys-btn.armed { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

.banner { margin: 12px 16px 0; border-radius: var(--r); padding: 10px 12px; font-size: 14px; line-height: 1.6; }
.banner strong { font-weight: 800; }
.banner-bad { background: var(--danger-soft); border: 1px solid var(--danger-line); color: var(--danger); }
.banner-warn { background: var(--brand-soft); border: 1px solid var(--brand); color: var(--text); }
/* 017: السيستم مقفول: رمادي وكلامه واضح */
.banner-closed { display: flex; align-items: center; gap: 12px; background: var(--closed-soft); border: 1px solid var(--closed-line); color: var(--closed-text); }
.banner-closed[hidden] { display: none; }
.banner-closed svg { flex: none; }
.banner-closed div { display: flex; flex-direction: column; }
.banner-closed strong { font-size: 17px; }
.banner-closed span { font-weight: 600; }
.closed-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; min-height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--closed-soft); border: 1px solid var(--closed-line); color: var(--closed-text); font-size: 14px; font-weight: 800; white-space: nowrap; }
.closed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--closed-dot); }

.alert {
  position: fixed; top: 76px; left: 12px; right: 12px; z-index: 10; max-width: 876px; margin: 0 auto;
  background: var(--brand); color: var(--on-brand); border-radius: var(--r-lg); padding: 14px 16px;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow);
}
.alert-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.alert-text strong { font-size: 18px; font-weight: 800; }
.alert-text span { font-size: 14px; font-weight: 600; }
.alert-hint { font-size: 12px; font-weight: 700; opacity: .75; }

/* التابات: نفس شكل أقسام المنيو (pills) */
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px 16px; }
/* 017: 7 تابات (الطيارين بقى تاب): 4 فوق (حالات الطلب) و3 تحت، وعلى الشاشة الكبيرة صف واحد */
.tabs .tab[data-tab="cancelled"] { grid-column: 1 / span 1; }
.tabs .tab[data-tab="reports"] { grid-column: span 2; }
@media (min-width: 720px) { .tabs { grid-template-columns: repeat(7, minmax(0, 1fr)); } .tabs .tab[data-tab="reports"] { grid-column: auto; } }
@media (max-width: 360px) { .tabs { gap: 6px; padding: 12px; } .tab { font-size: 13px; padding: 0 4px; } }
.tab {
  min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 6px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 700; white-space: nowrap;
}
.tab[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.badge {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; background: var(--surface-2); color: var(--muted);
}
.badge.hot { background: var(--brand); color: var(--on-brand); }
.tab[aria-pressed="true"] .badge { background: var(--on-brand); color: var(--brand); }

.main { flex: 1; padding: 4px 16px 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; }
@media (min-width: 720px) { .main.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.empty { margin-top: 64px; text-align: center; color: var(--muted); font-size: 15px; font-weight: 600; }

/* ===== كارت الطلب ===== */
.order { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.order.st-new { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.order.st-cancelled { opacity: .85; }
.order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.order-no { font-size: 20px; font-weight: 800; line-height: 1.3; }
.order-time { font-size: 13px; color: var(--muted); }
.pill { flex: none; height: 28px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 800; }
.pill-new { background: var(--brand-soft); color: var(--brand-text); }
.pill-confirmed { background: var(--open-soft); color: var(--open); }
.pill-cancelled { background: var(--danger-soft); color: var(--danger); }
.pill-ready { background: var(--warn-soft); color: var(--warn); }
.pill-done { background: var(--surface-2); color: var(--muted); }
.order.st-ready { border-color: var(--warn-line); }
.order.st-done { opacity: .9; }
.items { list-style: none; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 6px; }
.items li { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; font-weight: 600; }
.items li > span:first-child { display: flex; align-items: flex-start; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.items .qty {
  flex: none; min-width: 34px; height: 28px; padding: 0 6px; border-radius: 8px; background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; color: var(--text); font-weight: 800; font-size: 15px;
}
.items .line { color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.note { background: var(--brand-soft); color: var(--text); border-radius: var(--r); padding: 8px 12px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
/* توصيل أو استلام: تحت رقم الطلب على طول */
.ful {
  align-self: flex-start; max-width: 100%; display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 12px;
  border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-size: 14px; font-weight: 800; line-height: 1.5;
}
.ful .area { overflow-wrap: anywhere; }
.meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.meta .total { font-size: 20px; font-weight: 800; color: var(--text); }
/* ===== الدفع (015) ===== */
.pay { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.pay-row { display: flex; align-items: center; gap: 10px; }
.pay-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text); }
.pay.is-transfer .pay-ico { background: var(--brand-soft); color: var(--brand-text); }
.pay-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.5; }
.pay-text strong { font-size: 15px; font-weight: 800; }
.pay-text .num { color: var(--text); font-weight: 800; direction: ltr; unicode-bidi: isolate; letter-spacing: .5px; }
.pay-warn {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 12px;
  background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn); font-size: 14px; font-weight: 600; line-height: 1.7;
}
.pay-warn .ico { margin-top: 3px; }
.icon-btn.sq { border-radius: 12px; background: var(--surface); }
.phone-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; font-weight: 600; }
.phone-row .cust-name { min-width: 0; overflow-wrap: anywhere; }
.phone-row .num { direction: ltr; unicode-bidi: isolate; letter-spacing: .5px; }
/* 017: الرقم نفسه زرار اتصال (مكان زرار «اتصال») */
.btn-call { flex: none; min-height: 44px; padding: 0 12px; border-radius: 12px; background: var(--surface); font-size: 15px; font-weight: 800; }
.btn-call .ico { color: var(--muted); }
.phone-block { display: flex; flex-direction: column; gap: 8px; }
.phone-block .btn-wa { width: 100%; }
/* الطلب الجديد: «تأكيد وابعت للعميل» بعرض الكارت، وتحته «واتساب العميل» و«إلغاء» */
.actions-new .btn-confirm { grid-column: 1 / -1; min-height: 60px; font-size: 18px; }
.actions-new .btn-bad.wide { grid-column: 1 / -1; }
.actions-new .btn-wa { min-height: 52px; padding: 0 8px; gap: 6px; font-size: 15px; white-space: nowrap; }
.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.row-end { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.done-good { font-size: 13px; font-weight: 700; color: var(--open); }
.done-bad { font-size: 13px; font-weight: 700; color: var(--danger); }

/* ===== عمر الطلب الجديد (أخضر ← أصفر ← أحمر) ===== */
.head-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.age { height: 28px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 800; white-space: nowrap; border: 1px solid transparent; }
.age.age-fresh { background: var(--open-soft); color: var(--open); }
.age.age-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.age.age-late { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.order.st-new.age-warn { border-color: var(--warn); border-width: 2px; box-shadow: 0 0 0 3px var(--warn-soft); }
.order.st-new.age-late { border-color: var(--danger); border-width: 2px; box-shadow: 0 0 0 4px var(--danger-soft); }
@media (prefers-reduced-motion: no-preference) {
  .age.age-late { animation: pulse 1.6s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: .55; } }
}

/* ===== سبب الإلغاء ===== */
.reasons { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--r); background: var(--danger-soft); border: 1px solid var(--danger-line); }
.reasons-q { font-size: 15px; font-weight: 800; color: var(--danger); }
.reasons-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.btn-reason { min-height: 48px; padding: 0 10px; font-size: 15px; background: var(--surface); border-color: var(--danger-line); color: var(--text); }
.btn-reason:last-child:nth-child(odd) { grid-column: 1 / -1; }
.btn-back { min-height: 44px; background: transparent; border-color: var(--line); color: var(--muted); font-size: 14px; }

/* ===== التقارير ===== */
.gate { margin-top: 24px; padding: 24px 16px; display: flex; flex-direction: column; gap: 12px; }
.gate h2, .rep-head h2 { font-size: 20px; font-weight: 800; line-height: 1.4; }
.gate p { font-size: 14px; color: var(--muted); line-height: 1.7; }
.reports { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.rep-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button { min-height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; }
.seg button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { min-width: 0; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.stat .k { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat .v { font-size: clamp(20px, 6.5vw, 26px); overflow-wrap: anywhere; font-weight: 800; line-height: 1.3; }
.stat .v.good { color: var(--open); }
.stat .v.bad { color: var(--danger); }
.top-list { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.top-list strong { font-weight: 800; }
.top-row span:first-child { min-width: 0; overflow-wrap: anywhere; }
.top-row { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; font-weight: 600; }
.bar { height: 8px; margin-top: 4px; background: var(--surface-2); border-radius: 999px; }
.bar > div { height: 8px; width: 0; border-radius: 999px; background: var(--muted); opacity: .55; }
.bar > div.hot { background: var(--brand); opacity: 1; }
.warn-text { color: var(--warn); font-weight: 700; }

/* ===== تحت ===== */
.foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 16px 16px; border-top: 1px solid var(--line); }
.foot-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.link-btn { white-space: nowrap; }
.toast {
  position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); left: 12px; right: 12px; z-index: 20;
  max-width: 520px; margin: 0 auto; padding: 12px 16px; border-radius: var(--r);
  background: var(--text); color: var(--bg); font-size: 15px; font-weight: 700; box-shadow: var(--shadow);
}
.toast.bad { background: var(--danger); color: #FFFFFF; }
.toast.has-act { display: flex; align-items: center; gap: 8px; padding: 6px 16px 6px 6px; }
.toast-text { flex: 1; min-width: 0; line-height: 1.5; padding: 6px 0; }
.toast-act {
  flex: none; min-height: 44px; padding: 0 12px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand); font-weight: 800; font-size: 15px;
}
:root[data-theme="light"] .toast-act { color: var(--brand); }

/* وقت التحويل بس: الألوان بتتحول بنعومة زي المنيو */
.theme-anim, .theme-anim * { transition: background-color .35s ease, color .35s ease, border-color .35s ease !important; }
@media (prefers-reduced-motion: no-preference) {
  .alert { animation: drop .25s ease-out; }
  @keyframes drop { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) { .theme-knob, .theme-knob svg { transition: none; } }

/* ===== شاشة المدير ===== */
.mgr-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.mgr-title { font-size: 22px; font-weight: 800; line-height: 1.3; }
.mgr-lock { flex: none; min-height: 44px; }
/* التبويبات: track رمادي والمختار أبيض (segmented) */
.seg.mgr-seg { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: var(--band); }
.seg.mgr-seg button { min-height: 44px; padding: 0 2px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; white-space: nowrap; }
.seg.mgr-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 800; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.rep-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.rep-body h2 { font-size: 20px; font-weight: 800; line-height: 1.4; }

.menu-view { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); font-size: 14px; font-weight: 700; white-space: nowrap;
}
.chip-btn[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip-count { font-weight: 800; }
.chip-red { color: var(--danger); border-color: var(--danger-line); }
.chip-red .chip-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--danger); color: #FFFFFF; font-size: 12px; }
.chip-red[aria-pressed="true"] { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.menu-list { display: flex; flex-direction: column; gap: 16px; }
.menu-cat { display: flex; flex-direction: column; gap: 8px; }
.menu-cat h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 4px; font-size: 17px; font-weight: 800; }
.cat-count { font-size: 13px; font-weight: 700; color: var(--muted); }
/* ليستة في كارت واحد، والصفوف بينها خط (زي الإعدادات في الموبايل) */
.list-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.list-card > * + * { border-top: 1px solid var(--line); }
.menu-row { background: var(--surface); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.menu-view > .menu-row, .drv-list.card .menu-row { border: 1px solid var(--line); border-radius: var(--r); }
.mi-line { display: flex; align-items: center; gap: 10px; }
.mi-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mi-name { font-size: 16px; font-weight: 800; line-height: 1.4; overflow-wrap: anywhere; }
.mi-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.mi-price { font-size: 15px; font-weight: 800; color: var(--brand-text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mi-meta { font-size: 13px; color: var(--muted); }
.mi-edit { width: 44px; height: 44px; }
/* الحالة: كلام + نقطة، مش لون بس */
.st-pill { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.st-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-on { background: var(--open-soft); color: var(--open-text); }
.st-off { background: var(--danger-soft); color: var(--danger); }
.st-idle { background: var(--surface-2); color: var(--muted); }
/* المفتاح: شغّال = أخضر والدايرة ناحية الشمال (RTL)، واقف = رمادي والدايرة يمين */
.switch { flex: none; width: 60px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.sw-track { position: relative; display: block; width: 52px; height: 32px; border-radius: 16px; background: var(--sw-off); transition: background-color .2s ease; }
.sw-knob { position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: right .2s ease; }
.switch.is-on .sw-track { background: var(--open); }
.switch.is-on .sw-knob { right: 23px; }
.switch:disabled { opacity: .5; }
@media (prefers-reduced-motion: reduce) { .sw-track, .sw-knob { transition: none; } }
.menu-row.is-out .mi-name { color: var(--muted); }
.mi-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.price-form { display: flex; flex-direction: column; gap: 8px; }
.price-line { display: flex; align-items: center; gap: 8px; }
.price-input { font-variant-numeric: tabular-nums; font-size: 18px !important; font-weight: 800; }
.price-confirm { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--r); background: var(--warn-soft); border: 1px solid var(--warn-line); }
.price-confirm p { font-size: 14px; font-weight: 700; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sec-head h3 { font-size: 20px; font-weight: 800; }
.btn-pill { min-height: 44px; border-radius: 999px; padding: 0 16px; }
.hint { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.hint .ico { margin-top: 3px; }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand-text); font-size: 18px; font-weight: 800; }
.drv-row.is-out .avatar { background: var(--surface-2); color: var(--muted); }

/* ===== كلمات السر (015) ===== */
.pw-row { width: 100%; min-height: 68px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; background: var(--surface); text-align: start; color: var(--text); }
.pw-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand-text); }
.pw-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.5; }
.pw-text strong { font-size: 15px; font-weight: 800; }
.pw-row > .ico { color: var(--muted); }
.pw-form { padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); }
.pw-field { display: flex; flex-direction: column; gap: 6px; }
.pw-input { position: relative; }
.pw-input input { padding-left: 52px; }
.pw-eye { position: absolute; top: 2px; left: 2px; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.pw-rules { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 8px; }
.pw-rules li.is-ok { color: var(--open-text); }
.pw-rules li.is-info { font-weight: 600; }
.btn-text { min-height: 44px; background: transparent; border-color: transparent; }
.pw-warn {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r);
  background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn); font-size: 14px; line-height: 1.7;
}
.pw-warn .ico { margin-top: 3px; }
.pw-warn b { font-weight: 800; }

/* ===== الطيار (014) ===== */
.driver-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; border-radius: var(--r); background: var(--brand-soft); font-size: 15px; font-weight: 600;
}
.driver-chip b { font-weight: 800; }
.driver-chip .num { direction: ltr; unicode-bidi: isolate; letter-spacing: .5px; }
.driver-chip.is-empty { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); font-weight: 700; }
.btn-chip { min-height: 44px; padding: 0 14px; flex: none; font-size: 14px; }
.btn-step { min-height: 44px; padding: 0 12px; font-size: 14px; color: var(--muted); }
.picker { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--r); background: var(--open-soft); border: 1px solid var(--open); }
.picker-q { font-size: 15px; font-weight: 800; }
.picker-msg { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.picker-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.btn-driver {
  min-height: 56px; padding: 8px 12px; display: flex; flex-direction: column; align-items: stretch; gap: 2px;
  background: var(--surface); text-align: start;
}
.btn-driver.is-current { border-color: var(--open); border-width: 2px; }
.drv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.drv-name { font-size: 16px; font-weight: 800; }
.btn-driver .num { direction: ltr; unicode-bidi: isolate; font-size: 14px; color: var(--muted); }
.drv-state { font-size: 13px; font-weight: 600; color: var(--muted); }
.picker-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.drv-add { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.drv-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.drv-phone { direction: ltr; unicode-bidi: isolate; text-align: right; font-size: 14px; font-weight: 700; color: var(--muted); }

/* ===== التقارير (017): التاريخ والتقويم وأرقام بخط ثابت العرض ===== */
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.rep-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rep-body.is-loading .stats, .rep-body.is-loading .rep-card, .rep-body.is-loading .top-list, .rep-body.is-loading .split-bar { opacity: .5; transition: opacity .15s; }
.rep-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rep-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.rep-title h2 { font-size: 22px; }
.rep-date { font-size: 14px; font-weight: 700; color: var(--muted); }
.rep-cal-btn { flex: none; min-height: 44px; padding: 0 14px; border: 2px solid var(--text); background: var(--surface); font-weight: 800; }
.rep-cal-btn[aria-expanded="true"] { background: var(--text); color: var(--bg); }
.rep-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.rep-chips::-webkit-scrollbar { display: none; }
.rep-chips .chip-btn { flex: none; }

.cal { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-head b { font-size: 16px; font-weight: 800; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-day { position: relative; height: 44px; border-radius: 10px; font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums; color: var(--text); }
.cal-day:disabled { color: var(--muted); opacity: .45; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--text); font-weight: 800; }
.cal-day.in { background: var(--brand-soft); font-weight: 700; }
.cal-day.edge { background: var(--text); color: var(--bg); font-weight: 800; box-shadow: none; }
.cal-dot { position: absolute; bottom: 5px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--brand-text); }
.cal-day.edge .cal-dot { background: var(--bg); }
.cal-hint { font-size: 13px; color: var(--muted); line-height: 1.6; }

.kpi { padding: 12px 14px; gap: 2px; }
.kpi .k { font-size: 12px; font-weight: 700; }
.kpi .v { font-size: clamp(22px, 7vw, 28px); font-weight: 600; text-align: right; line-height: 1.25; }
.kpi .sub, .split .sub { font-size: 12px; color: var(--muted); }

.split { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.split-k { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; }
.split.is-del .split-k { color: var(--brand-text); }
.split.is-pick .split-k { color: var(--pick); }
.split-n { font-size: 13px; font-weight: 600; color: var(--muted); }
.split-n b { font-size: 26px; font-weight: 600; color: var(--text); }
.split-s { font-size: 14px; color: var(--muted); }
.split-s .mono { font-size: 16px; color: var(--text); }
.split-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.split-bar .sb-del { background: var(--brand); }
.split-bar .sb-pick { background: var(--pick); }
.split-bar.empty span { background: var(--surface-2); }

.rep-card { padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rep-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rep-card-head strong { font-weight: 800; }
.hchart { display: flex; align-items: stretch; gap: 3px; height: 140px; padding-top: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.hc-col { flex: 1 0 18px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.hc-n, .hc-h { font-size: 10px; line-height: 12px; color: var(--muted); height: 12px; }
.hc-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.hc-bar { width: 100%; border-radius: 4px 4px 0 0; background: var(--sw-off); opacity: .45; }
.hc-bar.hot { background: var(--brand); opacity: 1; }

.top-table { gap: 0; }
.tt-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px 76px; gap: 8px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.tt-row > span:not(:first-child) { text-align: left; }
.tt-head { border-top: 0; padding-top: 0; font-size: 12px; font-weight: 800; color: var(--muted); }
.tt-name { font-weight: 600; overflow-wrap: anywhere; }

/* ===== 018: الطيارين: فاضي / معاه طلبات، وكلمة سر شاشة الطيار ===== */
.st-busy { background: var(--brand-soft); color: var(--brand-text); }
.st-busy .st-dot { background: var(--brand-text); }
.st-warn { background: var(--warn-soft); color: var(--warn); }
.st-warn .st-dot { background: var(--warn); }
.drv-row .mi-line { align-items: flex-start; }
.drv-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.drv-side-btns { display: flex; gap: 6px; }
.drv-pw-btn { min-height: 44px; padding: 0 10px; font-size: 13px; font-weight: 800; background: var(--surface); }
.drv-pw-btn[aria-expanded="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.drv-pw { margin-top: 12px; padding: 12px; border-radius: var(--r); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.drv-pw input { min-height: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }

/* 019: الحجم والحار والإضافات تحت اسم الصنف */
.it-wrap { display: inline-flex; flex-direction: column; gap: 4px; vertical-align: top; }
.it-opts { display: flex; flex-wrap: wrap; gap: 4px; }
.it-opt { padding: 1px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; background: var(--surface-2); color: var(--text); }
.it-opt.sz { background: var(--text); color: var(--bg); }
.it-opt.orig { background: #DDF3E2; color: #1B6B33; }
.it-opt.hot { background: #FDE3D3; color: #A63A00; }
.it-opt.nash { background: #FAD4D4; color: #9B1C1C; }
.it-opt.kor { background: #EBDDF7; color: #6B2C99; }
