/* ==========================================================================
   Restaurant OS — نظام التصميم "أوبسيديان ونحاس"
   ثيم ليلي فخم + وضع نهاري، تأثيرات زجاجية، حركة زنبركية، دعم RTL كامل
   ========================================================================== */

@import url('./fonts.css');

/* ── 1. إعادة ضبط ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { min-height: 100dvh; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--gold-500); color: #0A0C0E; }

/* ── 2. الرموز التصميمية ──────────────────────────────────────────────── */
:root {
  color-scheme: dark;

  /* أساس الأوبسيديان */
  --ink-1000: #06080A;
  --ink-950:  #090B0E;
  --ink-900:  #0C0F13;
  --ink-850:  #111519;
  --ink-800:  #161B21;
  --ink-750:  #1C232A;
  --ink-700:  #232C35;
  --ink-600:  #2E3945;
  --ink-500:  #3D4A58;

  /* النحاس الذهبي — لمسة الفخامة */
  --gold-200: #F6E7C4;
  --gold-300: #EFD9A6;
  --gold-400: #E4C489;
  --gold-500: #D2A961;
  --gold-600: #B48C48;
  --gold-700: #8C6B34;

  /* هوية هيل */
  --clay-400: #F0674F;
  --clay-500: #E33B24;
  --clay-600: #BE2C18;
  --ice:      #DCEBE8;

  /* حالات */
  --ok-400:   #4CC79E; --ok-500: #2E9E7E; --ok-700: #17513F;
  --warn-400: #F0B45C; --warn-500: #DE9430; --warn-700: #6E4712;
  --bad-400:  #F4756B; --bad-500: #DF4C40; --bad-700: #71211B;
  --info-400: #6DB4EC; --info-500: #3E90D2; --info-700: #1B4468;

  /* نصوص وأسطح */
  --fg:        #EEF3F6;
  --fg-soft:   #B4C1CC;
  --fg-mute:   #7C8A97;
  --fg-faint:  #55636F;
  --bg:        var(--ink-950);
  --surface:   rgba(24, 30, 37, 0.72);
  --surface-2: rgba(31, 39, 47, 0.80);
  --surface-3: rgba(42, 52, 62, 0.85);
  --hairline:  rgba(255, 255, 255, 0.085);
  --hairline-2:rgba(255, 255, 255, 0.14);
  --focus:     var(--gold-400);

  /* تدرّجات */
  --grad-gold: linear-gradient(135deg, #F3E3BC 0%, #D2A961 42%, #A87F3E 100%);
  --grad-clay: linear-gradient(135deg, #FF7B62 0%, #E33B24 55%, #A9210F 100%);
  --grad-ink:  linear-gradient(160deg, rgba(38,47,57,.92), rgba(14,18,22,.96));
  --grad-glass:linear-gradient(150deg, rgba(255,255,255,.075), rgba(255,255,255,.012) 46%, rgba(255,255,255,0));

  /* مسافات */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px;

  /* انحناءات */
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 26px; --r-2xl: 34px; --r-pill: 999px;

  /* ظلال متعددة الطبقات */
  --sh-1: 0 1px 2px rgba(0,0,0,.36);
  --sh-2: 0 4px 14px rgba(0,0,0,.34), 0 1px 2px rgba(0,0,0,.30);
  --sh-3: 0 12px 32px rgba(0,0,0,.42), 0 3px 8px rgba(0,0,0,.28);
  --sh-4: 0 24px 60px rgba(0,0,0,.52), 0 6px 16px rgba(0,0,0,.32);
  --sh-gold: 0 8px 30px rgba(210,169,97,.24), 0 0 0 1px rgba(210,169,97,.24);
  --sh-clay: 0 8px 30px rgba(227,59,36,.30), 0 0 0 1px rgba(227,59,36,.30);

  /* حركة زنبركية */
  --e-spring: cubic-bezier(.22, 1.28, .36, 1);
  --e-out:    cubic-bezier(.22, .81, .3, 1);
  --e-in-out: cubic-bezier(.65, .05, .36, 1);
  --t-fast: 140ms; --t-base: 240ms; --t-slow: 420ms;

  /* خطوط */
  --font-display: 'Alexandria', 'Plex Arabic', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Plex Arabic', 'Alexandria', 'Segoe UI', system-ui, sans-serif;
  --font-num: 'Plex Arabic', ui-monospace, 'Cascadia Mono', monospace;

  --header-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* الوضع النهاري */
[data-theme='day'] {
  color-scheme: light;
  --fg:        #14191E;
  --fg-soft:   #414D58;
  --fg-mute:   #6B7885;
  --fg-faint:  #97A3AE;
  --bg:        #F4F1EA;
  --surface:   rgba(255, 255, 255, 0.80);
  --surface-2: rgba(255, 255, 255, 0.92);
  --surface-3: rgba(255, 255, 255, 0.98);
  --hairline:  rgba(18, 24, 30, 0.10);
  --hairline-2:rgba(18, 24, 30, 0.17);
  --focus:     #8C6B34;
  --gold-400:  #9A7738;
  --gold-500:  #8C6B34;
  --grad-ink:  linear-gradient(160deg, rgba(255,255,255,.95), rgba(246,243,235,.98));
  --grad-glass:linear-gradient(150deg, rgba(255,255,255,.85), rgba(255,255,255,.35) 46%, rgba(255,255,255,.1));
  --sh-2: 0 4px 14px rgba(28,36,44,.10), 0 1px 2px rgba(28,36,44,.07);
  --sh-3: 0 12px 32px rgba(28,36,44,.13), 0 3px 8px rgba(28,36,44,.08);
  --sh-4: 0 24px 60px rgba(28,36,44,.16), 0 6px 16px rgba(28,36,44,.09);
}

/* ── 3. الجسد والخلفية الشفقية ────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.65;
  overflow-x: hidden;
}

.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.aurora::before, .aurora::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(90px);
  opacity: .5; will-change: transform;
}
.aurora::before {
  width: 62vmax; height: 62vmax; top: -22vmax; inset-inline-end: -18vmax;
  background: radial-gradient(circle at 40% 40%, rgba(210,169,97,.34), transparent 62%);
  animation: drift-a 34s var(--e-in-out) infinite alternate;
}
.aurora::after {
  width: 54vmax; height: 54vmax; bottom: -24vmax; inset-inline-start: -16vmax;
  background: radial-gradient(circle at 60% 50%, rgba(227,59,36,.26), transparent 62%);
  animation: drift-b 41s var(--e-in-out) infinite alternate;
}
.aurora i {
  position: absolute; width: 40vmax; height: 40vmax; border-radius: 50%;
  top: 32%; inset-inline-start: 34%; filter: blur(110px); opacity: .32;
  background: radial-gradient(circle, rgba(62,144,210,.30), transparent 64%);
  animation: drift-c 47s var(--e-in-out) infinite alternate;
}
[data-theme='day'] .aurora::before { opacity: .38; }
[data-theme='day'] .aurora::after  { opacity: .22; }
[data-theme='day'] .aurora i       { opacity: .18; }

@keyframes drift-a { to { transform: translate3d(-8vmax, 10vmax, 0) scale(1.16); } }
@keyframes drift-b { to { transform: translate3d(9vmax, -8vmax, 0) scale(1.12); } }
@keyframes drift-c { to { transform: translate3d(-11vmax, -7vmax, 0) scale(1.22); } }

/* حبيبات فيلمية دقيقة تمنع تسطيح التدرّجات */
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── 4. الطباعة ───────────────────────────────────────────────────────── */
h1, h2, h3, h4, .display { font-family: var(--font-display); font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 4.4vw, 2.65rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); }
h3 { font-size: 1.1rem; }
.t-xs { font-size: .72rem; } .t-sm { font-size: .82rem; } .t-md { font-size: .92rem; }
.mute { color: var(--fg-mute); }
.soft { color: var(--fg-soft); }
.num  { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: 0; }

.gold-text {
  background: var(--grad-gold); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.eyebrow {
  font-size: .68rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-400); display: flex; align-items: center; gap: var(--s2);
}
.eyebrow::before { content: ''; width: 22px; height: 1px; background: var(--grad-gold); }

/* ── 5. الأسطح الزجاجية ───────────────────────────────────────────────── */
.glass {
  position: relative; background: var(--surface);
  backdrop-filter: blur(22px) saturate(155%); -webkit-backdrop-filter: blur(22px) saturate(155%);
  border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-2);
}
.glass::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: var(--grad-glass); opacity: .85;
}
.glass > * { position: relative; }

.panel { background: var(--grad-ink); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-3); }

/* حافة ذهبية شعرية */
.edge-gold { position: relative; }
.edge-gold::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  padding: 1px; background: var(--grad-gold); opacity: .5;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

/* ── 6. الأزرار ───────────────────────────────────────────────────────── */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s2); min-height: 44px; padding: 0 var(--s5); border-radius: var(--r-pill);
  font-weight: 600; font-size: .9rem; white-space: nowrap; cursor: pointer;
  border: 1px solid var(--hairline-2); background: var(--surface-2); color: var(--fg);
  transition: transform var(--t-fast) var(--e-spring), box-shadow var(--t-base) var(--e-out),
              background var(--t-base) var(--e-out), border-color var(--t-base) var(--e-out), opacity var(--t-base);
  overflow: hidden; -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { border-color: var(--hairline-2); box-shadow: var(--sh-2); transform: translateY(-1px); }
.btn:active { transform: scale(.965); }
.btn[disabled], .btn[aria-disabled='true'] { opacity: .45; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-gold { background: var(--grad-gold); color: #14100A; border-color: transparent; box-shadow: var(--sh-gold); }
.btn-gold:hover { box-shadow: 0 12px 36px rgba(210,169,97,.34), 0 0 0 1px rgba(210,169,97,.4); }
.btn-clay { background: var(--grad-clay); color: #fff; border-color: transparent; box-shadow: var(--sh-clay); }
.btn-ok   { background: linear-gradient(135deg,#54D6AA,#2E9E7E); color: #04231A; border-color: transparent; }
.btn-bad  { background: linear-gradient(135deg,#F4756B,#C93E33); color: #fff; border-color: transparent; }
.btn-ghost{ background: transparent; border-color: var(--hairline); }
.btn-ghost:hover { background: var(--surface); }
.btn-sm { min-height: 34px; padding: 0 var(--s3); font-size: .8rem; border-radius: var(--r-sm); }
.btn-lg { min-height: 54px; padding: 0 var(--s8); font-size: 1rem; }
.btn-icon { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; }
.btn-block { width: 100%; }

/* لمعة تمر على الأزرار الرئيسية */
.btn-gold::after, .btn-clay::after {
  content: ''; position: absolute; top: 0; inset-inline-start: -140%; width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.42), transparent);
  transform: skewX(-18deg); animation: sheen 4.6s var(--e-in-out) infinite;
}
@keyframes sheen { 0%, 62% { inset-inline-start: -140%; } 92%, 100% { inset-inline-start: 160%; } }

/* موجة اللمس */
.ripple {
  position: absolute; border-radius: 50%; transform: scale(0); pointer-events: none;
  background: rgba(255,255,255,.34); animation: ripple .58s var(--e-out) forwards;
}
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* ── 7. الحقول ────────────────────────────────────────────────────────── */
.field {
  width: 100%; min-height: 46px; padding: var(--s3) var(--s4); border-radius: var(--r-md);
  background: rgba(255,255,255,.045); border: 1px solid var(--hairline);
  color: var(--fg); transition: border-color var(--t-base), background var(--t-base), box-shadow var(--t-base);
}
[data-theme='day'] .field { background: rgba(255,255,255,.75); }
.field::placeholder { color: var(--fg-faint); }
.field:focus { outline: none; border-color: var(--gold-500); background: rgba(255,255,255,.075);
  box-shadow: 0 0 0 4px rgba(210,169,97,.14); }
[data-theme='day'] .field:focus { background: #fff; }
textarea.field { min-height: 84px; resize: vertical; line-height: 1.6; }
select.field { appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-mute) 50%), linear-gradient(135deg, var(--fg-mute) 50%, transparent 50%);
  background-position: left 18px top 50%, left 13px top 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.label { display: block; font-size: .78rem; font-weight: 600; color: var(--fg-soft); margin-bottom: var(--s2); }

/* ── 8. الشارات والوسوم ───────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px;
  border-radius: var(--r-pill); font-size: .74rem; font-weight: 600;
  background: rgba(255,255,255,.07); border: 1px solid var(--hairline); color: var(--fg-soft);
  white-space: nowrap;
}
[data-theme='day'] .chip { background: rgba(18,24,30,.05); }
.chip-gold { background: rgba(210,169,97,.15); border-color: rgba(210,169,97,.42); color: var(--gold-300); }
.chip-clay { background: rgba(227,59,36,.15); border-color: rgba(227,59,36,.42); color: var(--clay-400); }
.chip-ok   { background: rgba(46,158,126,.16); border-color: rgba(46,158,126,.44); color: var(--ok-400); }
.chip-warn { background: rgba(222,148,48,.16); border-color: rgba(222,148,48,.44); color: var(--warn-400); }
.chip-bad  { background: rgba(223,76,64,.16); border-color: rgba(223,76,64,.44); color: var(--bad-400); }
.chip-info { background: rgba(62,144,210,.16); border-color: rgba(62,144,210,.44); color: var(--info-400); }
[data-theme='day'] .chip-gold { color: #7A5D2B; }
[data-theme='day'] .chip-ok   { color: #1B6650; }
[data-theme='day'] .chip-warn { color: #8A5A14; }
[data-theme='day'] .chip-bad  { color: #96271D; }
[data-theme='day'] .chip-info { color: #235E8E; }

/* نقطة حيّة نابضة */
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.dot-live { position: relative; }
.dot-live::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid currentColor; animation: pulse-ring 1.9s var(--e-out) infinite;
}
@keyframes pulse-ring { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.9); opacity: 0; } }

/* ── 9. البطاقات ──────────────────────────────────────────────────────── */
.card {
  position: relative; border-radius: var(--r-lg); background: var(--surface);
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--hairline); box-shadow: var(--sh-2); overflow: hidden;
  transition: transform var(--t-base) var(--e-spring), box-shadow var(--t-base) var(--e-out), border-color var(--t-base);
}
.card-interactive { cursor: pointer; }
.card-interactive:hover { transform: translateY(-3px); box-shadow: var(--sh-4); border-color: rgba(210,169,97,.34); }
.card-interactive:active { transform: translateY(-1px) scale(.99); }

/* ── 10. التنبيهات المنبثقة ───────────────────────────────────────────── */
.toast-wrap {
  position: fixed; z-index: 9000; inset-block-start: var(--s4); inset-inline-end: var(--s4);
  display: flex; flex-direction: column; gap: var(--s2); width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s4);
  border-radius: var(--r-md); background: var(--surface-3); border: 1px solid var(--hairline-2);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: var(--sh-4); pointer-events: auto; overflow: hidden;
  animation: toast-in .42s var(--e-spring) both;
}
.toast.out { animation: toast-out .3s var(--e-in-out) forwards; }
.toast-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.toast-ic svg { width: 18px; height: 18px; }
.toast b { display: block; font-size: .88rem; font-weight: 600; }
.toast p { font-size: .78rem; color: var(--fg-mute); }
.toast::after {
  content: ''; position: absolute; inset-block-end: 0; inset-inline-start: 0; height: 2px;
  background: var(--grad-gold); animation: toast-bar var(--toast-life, 5s) linear forwards;
}
@keyframes toast-in  { from { opacity: 0; transform: translate3d(0, -14px, 0) scale(.96); } }
@keyframes toast-out { to   { opacity: 0; transform: translate3d(0, -10px, 0) scale(.97); } }
@keyframes toast-bar { from { width: 100%; } to { width: 0; } }

/* ── 11. الطبقات والأوراق المنزلقة ────────────────────────────────────── */
.scrim {
  position: fixed; inset: 0; z-index: 8000; background: rgba(4,6,8,.68);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  animation: fade-in var(--t-base) var(--e-out) both;
}
.sheet {
  position: fixed; z-index: 8001; inset-inline: 0; inset-block-end: 0;
  max-height: 90dvh; display: flex; flex-direction: column;
  background: var(--grad-ink); border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  border: 1px solid var(--hairline); border-block-end: 0; box-shadow: var(--sh-4);
  animation: sheet-up .46s var(--e-spring) both; padding-block-end: var(--safe-b);
}
.sheet-grip { width: 44px; height: 4px; border-radius: 99px; background: var(--ink-500); margin: 10px auto 2px; flex: none; }
.sheet.out { animation: sheet-down .28s var(--e-in-out) forwards; }
@keyframes sheet-up   { from { transform: translate3d(0, 100%, 0); } }
@keyframes sheet-down { to   { transform: translate3d(0, 100%, 0); } }
@keyframes fade-in    { from { opacity: 0; } }

/* التوسيط بالهوامش التلقائية لا بـ translate — لأن translate لا ينعكس مع RTL */
.modal {
  position: fixed; z-index: 8001; inset-block-start: 50%; inset-inline: 0;
  margin-inline: auto; transform: translateY(-50%);
  width: min(560px, calc(100vw - 32px)); max-height: 88dvh;
  display: flex; flex-direction: column; background: var(--grad-ink);
  border: 1px solid var(--hairline); border-radius: var(--r-xl); box-shadow: var(--sh-4);
  animation: modal-in .4s var(--e-spring) both;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(-46%) scale(.94); } }

@media (min-width: 720px) {
  .sheet { inset-block-start: 50%; inset-block-end: auto; inset-inline: 0;
    margin-inline: auto; transform: translateY(-50%);
    width: min(560px, calc(100vw - 40px));
    border-radius: var(--r-xl); border: 1px solid var(--hairline);
    animation: modal-in .4s var(--e-spring) both; }
  .sheet.out { animation: fade-out .24s forwards; }
  .sheet-grip { display: none; }
}
@keyframes fade-out { to { opacity: 0; transform: translateY(-50%) scale(.97); } }

/* ── 12. الوميض والهياكل العظمية ──────────────────────────────────────── */
.skeleton {
  background: linear-gradient(100deg, var(--ink-800) 20%, var(--ink-700) 38%, var(--ink-800) 56%);
  background-size: 220% 100%; animation: shimmer 1.5s linear infinite; border-radius: var(--r-sm);
}
@keyframes shimmer { to { background-position: -220% 0; } }

/* ── 13. الحركة عند الظهور ────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translate3d(0, 14px, 0); }
.reveal.in { opacity: 1; transform: none; animation: reveal .58s var(--e-spring) forwards; animation-delay: var(--d, 0ms); }
@keyframes reveal { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }

.pop { animation: pop .42s var(--e-spring) both; }
@keyframes pop { from { transform: scale(.86); opacity: 0; } }

.flash { animation: flash 1.05s var(--e-out); }
@keyframes flash {
  0%   { box-shadow: 0 0 0 0 rgba(210,169,97,.62); }
  100% { box-shadow: 0 0 0 22px rgba(210,169,97,0); }
}

.shake { animation: shake .46s var(--e-in-out); }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

.float { animation: float 4.5s var(--e-in-out) infinite alternate; }
@keyframes float { to { transform: translateY(-7px); } }

.urgent { animation: urgent 1.15s var(--e-in-out) infinite; }
@keyframes urgent {
  50% { border-color: var(--bad-400); box-shadow: 0 0 0 3px rgba(244,117,107,.22), var(--sh-3); }
}

.count-up { display: inline-block; }

/* ── 14. الأشرطة والمؤشرات ────────────────────────────────────────────── */
.rail { height: 6px; border-radius: 99px; background: rgba(255,255,255,.09); overflow: hidden; }
.rail > i { display: block; height: 100%; border-radius: 99px; background: var(--grad-gold);
  transition: width .7s var(--e-out); box-shadow: 0 0 14px rgba(210,169,97,.5); }
.rail.ok > i   { background: linear-gradient(90deg,#54D6AA,#2E9E7E); box-shadow: 0 0 14px rgba(46,158,126,.5); }
.rail.warn > i { background: linear-gradient(90deg,#F0B45C,#DE9430); box-shadow: 0 0 14px rgba(222,148,48,.5); }
.rail.bad > i  { background: linear-gradient(90deg,#F4756B,#DF4C40); box-shadow: 0 0 14px rgba(223,76,64,.5); }

/* حلقة تقدّم دائرية */
.ring { --p: 0; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--gold-500) calc(var(--p) * 1%), rgba(255,255,255,.08) 0); flex: none; }
.ring > span { width: 38px; height: 38px; border-radius: 50%; background: var(--ink-850);
  display: grid; place-items: center; font-size: .68rem; font-weight: 700; }
[data-theme='day'] .ring > span { background: #fff; }

/* ── 15. الشريط الجاري ────────────────────────────────────────────────── */
.ticker { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker > div { display: flex; gap: var(--s8); width: max-content; animation: ticker 34s linear infinite; }
.ticker:hover > div { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(50%); } }

/* ── 16. الشبكات المساعدة ─────────────────────────────────────────────── */
.wrap { width: min(1320px, 100% - 2 * var(--s4)); margin-inline: auto; }
.row  { display: flex; align-items: center; gap: var(--s3); }
.col  { display: flex; flex-direction: column; gap: var(--s3); }
.between { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.grow { flex: 1; min-width: 0; }
.wrap-x { flex-wrap: wrap; }
.grid { display: grid; gap: var(--s4); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.auto-220 { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.auto-260 { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.auto-320 { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
/* عمود رئيسي + عمود جانبي — ينهار لعمود واحد على الشاشات الضيّقة */
.g-main-side { grid-template-columns: 1.6fr 1fr; }
@media (max-width: 980px) { .g-main-side { grid-template-columns: 1fr; } }
.hide { display: none !important; }
.center { display: grid; place-items: center; }
.scroll-x { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-y { overflow-y: auto; overscroll-behavior: contain; }

@media (max-width: 900px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .g2, .g4 { grid-template-columns: 1fr; } }

/* ── 17. أشرطة التمرير ────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--ink-600) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--ink-600); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-500); background-clip: content-box; }

/* ── 18. تفضيلات الحركة ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .aurora::before, .aurora::after, .aurora i { animation: none; }
}

/* ── 19. الطباعة الورقية (الفواتير) ───────────────────────────────────── */
@media print {
  body { background: #fff; color: #000; }
  .aurora, .grain, .no-print { display: none !important; }
  .print-only { display: block !important; }
  .card, .glass, .panel { box-shadow: none; border: 1px solid #ccc; background: #fff; backdrop-filter: none; }
}
.print-only { display: none; }
