/* ═══════════════════════════════════════════════════════════════
   Clopr Drive — نظام التصميم / design system  ·  «مدار»
   تركوازٌ عميق للفعل على أرضٍ خزفيّةٍ باردة، وبنفسجيٌّ ثانٍ للرسوم وحدها. ألواحٌ تطفو بظلٍّ ناعم،
   وشريطٌ جانبيٌّ بطاقةٌ عائمة، وتبويباتُ القسم كبسولات. Alexandria للعناوين والأرقام، وNoto Sans Arabic للنصّ.
   RTL أوّلًا (خصائص منطقيّة)، والهاتفُ عرضٌ أوّل، والمظهران الفاتحُ والداكن من الرموز نفسها.

   ★ كلُّ لونٍ رمزٌ (token) يُعرَّف هنا أوّلًا للفاتح، ثمّ يُعاد تعريفُه للداكن في موضعين:
     · `@media (prefers-color-scheme: dark)` على `:root:not([data-theme="light"])` — «تلقائيّ» يتبع الجهاز
     · `:root[data-theme="dark"]` — من اختار الداكن صراحةً (كوكي cd_theme يكتبه الخادم على <html>)
     لا لونَ حرفيًّا في قاعدة مكوّن ولا في style= بالصفحات (يحرسه tests/http.php وفحصُ التباين في المتصفّح).
     والاستثناءُ: علاماتُ الخريطة فوق البلاطات، وورقةُ التوقيع البيضاء، ورمزُ QR على أبيض.
   ★ أنماطُ شاشات كلّ باب في ملفّها (ops/people/setup/courier/portal/platform.css) — هذا الملفّ الأساسُ المشترك وحده.
   ═══════════════════════════════════════════════════════════════ */
:root {
    /* ── الأسطح والحبر ── */
    --bg: #EDF1F6;
    --card: #FFFFFF;
    --card-line: #E3E9F0;
    --surface-2: #F6F8FB;
    --surface-3: #E8EDF3;
    --line: #DFE5ED;
    --line-2: #C8D1DD;
    --ink: #132033;
    --ink-2: #34425A;
    --muted: #56647C;
    --faint: #8B97AA;            /* للأيقونات والفواصل وحدها — ليس لونَ نصّ (تباينه ٢٫٩) */

    /* ── الهويّة ── */
    --brand: #0E7A89;            /* الفعلُ الأساسيّ والبندُ النشط — ٤٫٩ مع الأبيض */
    --brand-hover: #0A6572;
    --brand-2: #0E7A89;
    --brand-50: #E2F1F3;
    --brand-100: #C6E5E9;
    --brand-ink: #FFFFFF;
    --link: #0B6B78;
    --accent: #6553D1;           /* الثاني: الرسومُ والشعار — لا يُستعمل فعلًا */
    --accent-50: #ECE9FB;

    /* ── السطحُ المعكوس: تلميحٌ، وشريطُ تحديد، وبندٌ نشطٌ صلب — داكنٌ في الفاتح وفاتحٌ في الداكن ── */
    --inv-bg: #132033;
    --inv-ink: #F1F5F9;
    --inv-muted: #A9B6C7;
    /* ── السطحُ العميق: وجهُ التتبّع والدخول — تركوازٌ ليليّ في المظهرين ── */
    --deep-bg: #0D4F59;
    --deep-bg-2: #0A3B43;
    --deep-ink: #F1FAFB;
    --deep-muted: #B5D9DE;
    --deep-line: rgba(255, 255, 255, .14);
    --deep-hover: rgba(255, 255, 255, .1);

    /* ── الدلالات (غيرُ لون الهويّة) ── */
    --red: #C02942;   --red-bg: #FCE8EC;   --red-line: #F4C1CB;
    --green: #18794E; --green-bg: #E1F3EA; --green-line: #B7E0CA;
    --amber: #965F00; --amber-bg: #FBF0D9; --amber-line: #EED39A;
    --blue: #2459C6;  --blue-bg: #E5EDFC;
    --indigo: #4F46C8; --indigo-bg: #EAE9FB;
    --violet: #6D3FCB; --violet-bg: #EFE8FC;
    --orange: #B4470E; --orange-bg: #FDEBDD;
    --teal: #0E7A89;  --teal-bg: #E2F1F3;
    --slate: #4B5B70; --slate-bg: #EBEFF4;

    /* ── الشريطُ الجانبيّ: بطاقةٌ عائمة ── */
    --sb-bg: #FFFFFF;
    --sb-ink: #132033;
    --sb-muted: #56647C;
    --sb-hover: #F0F4F8;
    --sb-active-bg: #E2F1F3;
    --sb-active-ink: #0A6572;
    --sb-line: #E3E9F0;

    /* ── الرسوم: سلسلتان مُتحقَّقٌ منهما (dataviz validate_palette على #FFFFFF):
          بنفسجيُّ «أُنشئت» وتركوازُ «سُلّمت» — فصلٌ ١٤ لعمى الألوان، و١٩ للعين، وتباينٌ ≥ ٣ ── */
    --chart-1: #6553D1;
    --chart-2: #008C9E;

    /* ── أشكال ── */
    --radius: 16px;
    --radius-sm: 11px;
    --radius-xs: 8px;
    --shadow: 0 1px 2px rgba(19, 32, 51, .05), 0 8px 24px -14px rgba(19, 32, 51, .2);
    --shadow-lg: 0 18px 48px -12px rgba(19, 32, 51, .28);
    --ring: 0 0 0 3px rgba(14, 122, 137, .24);
    --scrim: rgba(13, 22, 35, .48);
    --topbar-bg: rgba(237, 241, 246, .86);
    --map-filter: none;

    --sidebar-w: 236px;
    --rail-w: 72px;
    --gap-shell: 12px;
    --topbar-h: 64px;
    --tabbar-h: 66px;
    --font: "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, Tahoma, sans-serif;
    --font-head: "Alexandria", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-num: "Alexandria", system-ui, -apple-system, "Segoe UI", sans-serif;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0B1118; --card: #131B25; --card-line: #212D3D; --surface-2: #0F1620; --surface-3: #1B2533; --line: #223042; --line-2: #33455B;
        --ink: #E3EAF2; --ink-2: #BAC6D4; --muted: #93A1B4; --faint: #66758A;
        --brand: #3EC2D0; --brand-hover: #6AD3DE; --brand-2: #3EC2D0; --brand-50: rgba(62, 194, 208, .13); --brand-100: rgba(62, 194, 208, .24); --brand-ink: #04181C; --link: #6AD3DE;
        --accent: #A193F2; --accent-50: rgba(161, 147, 242, .15);
        --inv-bg: #E3EAF2; --inv-ink: #0B1118; --inv-muted: #4B5A6E;
        --deep-bg: #0C2F36; --deep-bg-2: #08222A; --deep-ink: #E8F6F8; --deep-muted: #9CC6CC; --deep-line: rgba(255, 255, 255, .1); --deep-hover: rgba(255, 255, 255, .07);
        --red: #F2788A; --red-bg: rgba(242, 120, 138, .14); --red-line: rgba(242, 120, 138, .32);
        --green: #4CC98A; --green-bg: rgba(76, 201, 138, .13); --green-line: rgba(76, 201, 138, .3);
        --amber: #F0B24A; --amber-bg: rgba(240, 178, 74, .13); --amber-line: rgba(240, 178, 74, .3);
        --blue: #8AABF6; --blue-bg: rgba(138, 171, 246, .14);
        --indigo: #A7A8FA; --indigo-bg: rgba(167, 168, 250, .14);
        --violet: #C1A8FA; --violet-bg: rgba(193, 168, 250, .15);
        --orange: #F5A06B; --orange-bg: rgba(245, 160, 107, .14);
        --teal: #5ED6E0; --teal-bg: rgba(94, 214, 224, .13);
        --slate: #AEBBCB; --slate-bg: rgba(174, 187, 203, .13);
        --sb-bg: #131B25; --sb-ink: #E3EAF2; --sb-muted: #93A1B4; --sb-hover: rgba(255, 255, 255, .05);
        --sb-active-bg: rgba(62, 194, 208, .14); --sb-active-ink: #7EDBE5; --sb-line: #212D3D;
        --chart-1: #8E80EE; --chart-2: #1FB0C0;
        --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px -16px rgba(0, 0, 0, .8);
        --shadow-lg: 0 20px 52px -14px rgba(0, 0, 0, .75);
        --ring: 0 0 0 3px rgba(62, 194, 208, .3);
        --scrim: rgba(0, 0, 0, .6);
        --topbar-bg: rgba(11, 17, 24, .84);
        --map-filter: invert(1) hue-rotate(180deg) brightness(.88) contrast(.9) saturate(.5);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #0B1118; --card: #131B25; --card-line: #212D3D; --surface-2: #0F1620; --surface-3: #1B2533; --line: #223042; --line-2: #33455B;
    --ink: #E3EAF2; --ink-2: #BAC6D4; --muted: #93A1B4; --faint: #66758A;
    --brand: #3EC2D0; --brand-hover: #6AD3DE; --brand-2: #3EC2D0; --brand-50: rgba(62, 194, 208, .13); --brand-100: rgba(62, 194, 208, .24); --brand-ink: #04181C; --link: #6AD3DE;
    --accent: #A193F2; --accent-50: rgba(161, 147, 242, .15);
    --inv-bg: #E3EAF2; --inv-ink: #0B1118; --inv-muted: #4B5A6E;
    --deep-bg: #0C2F36; --deep-bg-2: #08222A; --deep-ink: #E8F6F8; --deep-muted: #9CC6CC; --deep-line: rgba(255, 255, 255, .1); --deep-hover: rgba(255, 255, 255, .07);
    --red: #F2788A; --red-bg: rgba(242, 120, 138, .14); --red-line: rgba(242, 120, 138, .32);
    --green: #4CC98A; --green-bg: rgba(76, 201, 138, .13); --green-line: rgba(76, 201, 138, .3);
    --amber: #F0B24A; --amber-bg: rgba(240, 178, 74, .13); --amber-line: rgba(240, 178, 74, .3);
    --blue: #8AABF6; --blue-bg: rgba(138, 171, 246, .14);
    --indigo: #A7A8FA; --indigo-bg: rgba(167, 168, 250, .14);
    --violet: #C1A8FA; --violet-bg: rgba(193, 168, 250, .15);
    --orange: #F5A06B; --orange-bg: rgba(245, 160, 107, .14);
    --teal: #5ED6E0; --teal-bg: rgba(94, 214, 224, .13);
    --slate: #AEBBCB; --slate-bg: rgba(174, 187, 203, .13);
    --sb-bg: #131B25; --sb-ink: #E3EAF2; --sb-muted: #93A1B4; --sb-hover: rgba(255, 255, 255, .05);
    --sb-active-bg: rgba(62, 194, 208, .14); --sb-active-ink: #7EDBE5; --sb-line: #212D3D;
    --chart-1: #8E80EE; --chart-2: #1FB0C0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px -16px rgba(0, 0, 0, .8);
    --shadow-lg: 0 20px 52px -14px rgba(0, 0, 0, .75);
    --ring: 0 0 0 3px rgba(62, 194, 208, .3);
    --scrim: rgba(0, 0, 0, .6);
    --topbar-bg: rgba(11, 17, 24, .84);
    --map-filter: invert(1) hue-rotate(180deg) brightness(.88) contrast(.9) saturate(.5);
    color-scheme: dark;
}

/* ═══════════ الأساس ═══════════ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14.5px; line-height: 1.65; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.35; text-wrap: balance; font-family: var(--font-head); font-weight: 600; }
h2 { font-size: 1.08rem; }
h3 { font-size: .98rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
code, pre, kbd { font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; }
pre { background: var(--surface-3); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .85rem 1rem; overflow-x: auto; font-size: .8rem; margin: 0; }
pre.code-dark { background: var(--inv-bg); color: var(--inv-ink); border-color: transparent; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--brand-100); color: var(--ink); }
.muted { color: var(--muted); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.u-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.grow { flex: 1 1 auto; min-width: 0; }
.skip { position: absolute; inset-inline-start: .75rem; top: -3rem; z-index: 100; background: var(--card); color: var(--ink); padding: .5rem .9rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.skip:focus { top: .75rem; }
.kbd { font-size: .68rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 0 .38rem; color: var(--muted); background: var(--card); line-height: 1.6; white-space: nowrap; font-family: var(--font-num); }

/* ═══════════ الهيكل: شريطٌ جانبيٌّ عائمٌ بخمسة أقسام، وشريطٌ علويٌّ شفيف، وتبويباتُ القسم ═══════════ */
.shell { min-height: 100vh; }
.sidebar {
    position: fixed; inset-block: var(--gap-shell); inset-inline-start: var(--gap-shell); width: var(--sidebar-w); z-index: 40;
    background: var(--sb-bg); color: var(--sb-ink); display: flex; flex-direction: column;
    border: 1px solid var(--sb-line); border-radius: 20px; box-shadow: var(--shadow); transition: width .2s ease;
}
.brand { display: flex; align-items: center; gap: .7rem; padding: 1rem .95rem .9rem; min-height: var(--topbar-h); }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--accent)); color: var(--brand-ink); display: grid; place-items: center; font-size: 1.05rem; flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.brand-text b { color: var(--sb-ink); font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-head); font-weight: 600; }
.brand-text small { color: var(--sb-muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: .5rem .65rem 1rem; display: grid; align-content: start; gap: .2rem; scrollbar-width: thin; scrollbar-color: var(--sb-line) transparent; }
.nav-group { font-size: .7rem; letter-spacing: .04em; color: var(--sb-muted); padding: .9rem .7rem .3rem; font-weight: 700; white-space: nowrap; }
.nav-link { display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: 12px; color: var(--sb-ink); font-weight: 500; font-size: .93rem;
            white-space: nowrap; position: relative; width: 100%; background: none; border: 0; font-family: inherit; cursor: pointer; text-align: start; }
.nav-link i { font-size: 1.12rem; width: 1.3rem; text-align: center; color: var(--sb-muted); flex: 0 0 auto; }
.nav-link span { overflow: hidden; text-overflow: ellipsis; }
.nav-link:hover { background: var(--sb-hover); color: var(--sb-ink); text-decoration: none; }
.nav-link.active { background: var(--sb-active-bg); color: var(--sb-active-ink); font-weight: 700; }
.nav-link.active i { color: var(--sb-active-ink); }
.nav-badge { margin-inline-start: auto; font-size: .7rem; min-width: 1.5rem; text-align: center; padding: 0 .4rem; border-radius: 999px; background: var(--brand); color: var(--brand-ink); line-height: 1.55; font-weight: 700; }
.sidebar-foot { border-top: 1px solid var(--sb-line); padding: .55rem .65rem; display: grid; gap: .2rem; }
.sb-sub { display: flex; align-items: center; gap: .6rem; padding: .45rem .8rem; border-radius: 12px; color: var(--sb-ink); font-size: .8rem; font-weight: 600; line-height: 1.35; }
.sb-sub:hover { background: var(--sb-hover); text-decoration: none; }
.sb-sub small { display: block; color: var(--sb-muted); font-weight: 500; font-size: .72rem; }
.sb-sub .dot { width: 9px; height: 9px; flex: 0 0 auto; margin-inline: .3rem .2rem; }
.rail-toggle { color: var(--sb-muted); font-weight: 500; font-size: .85rem; }

.main { margin-inline-start: calc(var(--sidebar-w) + var(--gap-shell) * 2); min-width: 0; transition: margin .2s ease; }
.topbar {
    position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: .65rem;
    padding: 0 1.5rem; background: var(--topbar-bg); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.crumbs { display: flex; align-items: center; gap: .45rem; min-width: 0; flex: 0 1 auto; }
.crumb { color: var(--muted); font-size: .86rem; white-space: nowrap; font-weight: 500; }
a.crumb:hover { color: var(--ink); }
.crumb-sep { color: var(--faint); font-size: .68rem; }
.page-title { font-size: 1.06rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.top-search { margin-inline-start: auto; position: relative; flex: 0 1 360px; min-width: 0; }
.top-search > i { position: absolute; inset-inline-start: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.top-search input { width: 100%; height: 40px; padding: 0 .9rem; padding-inline-start: 2.35rem; padding-inline-end: 4.3rem; border: 1px solid var(--card-line); border-radius: 12px;
                    background: var(--card); color: var(--ink); font: inherit; font-size: .9rem; box-shadow: 0 1px 2px rgba(19, 32, 51, .04); }
.top-search input::placeholder { color: var(--muted); }
.top-search input:focus { outline: 0; border-color: var(--brand); box-shadow: var(--ring); }
.top-search .kbd { position: absolute; inset-inline-end: .7rem; top: 50%; transform: translateY(-50%); pointer-events: none; }
.top-search input:focus ~ .kbd { display: none; }
.topbar .search-btn { display: none; }
.topbar .menu-btn { display: none; }

/* تبويباتُ القسم: كبسولاتٌ أعلى المحتوى — النشطةُ لوحٌ طافٍ */
.hubtabs { display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; margin: 0 0 1.3rem; padding: 2px; }
.hubtabs::-webkit-scrollbar { display: none; }
.hubtabs a { display: inline-flex; align-items: center; gap: .45rem; padding: .48rem 1rem; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: .88rem; white-space: nowrap; }
.hubtabs a i { font-size: .98rem; }
.hubtabs a:hover { color: var(--ink); background: var(--surface-3); text-decoration: none; }
.hubtabs a.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.hubtabs a.active i { color: var(--brand); }
.tab-n { font-size: .68rem; min-width: 1.35rem; padding: 0 .35rem; border-radius: 999px; background: var(--brand-50); color: var(--brand); text-align: center; line-height: 1.6; }
.hubtabs a.active .tab-n { background: var(--brand); color: var(--brand-ink); }

/* لوحُ الأوامر: نتائجُ البحث تحت الحقل */
.palette { position: absolute; inset-inline: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
           padding: .35rem; max-height: min(440px, 70vh); overflow-y: auto; z-index: 60; }
.pal-group { font-size: .7rem; font-weight: 700; color: var(--muted); padding: .45rem .65rem .2rem; letter-spacing: .03em; }
.pal-item { display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; border-radius: var(--radius-xs); color: var(--ink); cursor: pointer; font-size: .9rem; }
.pal-item i { color: var(--muted); width: 1.1rem; text-align: center; }
.pal-item[aria-selected="true"] { background: var(--brand-50); color: var(--ink); text-decoration: none; }
.pal-item[aria-selected="true"] i { color: var(--brand); }
.pal-item small { margin-inline-start: auto; color: var(--muted); font-size: .74rem; }

/* القوائم المنسدلة (<details>): الانتباه وحسابي */
.menu { position: relative; flex: 0 0 auto; }
.menu > summary { list-style: none; cursor: pointer; border-radius: var(--radius-sm); }
.menu > summary::-webkit-details-marker { display: none; }
/* 🚨 Chrome يرصف محتوى <details> المغلق (::details-content) فتُعدّ عناصرُه خارج الشاشة — يُخفى صراحةً */
details.menu:not([open]) > .menu-pop { display: none; }
.menu > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.menu-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); width: 300px; max-width: calc(100vw - 1.5rem); background: var(--card); color: var(--ink);
            border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .4rem; z-index: 70; }
.menu-head { padding: .6rem .7rem .55rem; display: flex; flex-direction: column; gap: .1rem; font-weight: 700; font-size: .88rem; }
.menu-head small { font-weight: 500; font-size: .76rem; }
.menu-label { font-size: .72rem; font-weight: 700; color: var(--muted); padding: .35rem .7rem .25rem; }
.menu-item { display: flex; align-items: center; gap: .6rem; padding: .52rem .7rem; border-radius: var(--radius-xs); color: var(--ink); font-weight: 500; font-size: .9rem; }
.menu-item > i { color: var(--muted); width: 1.1rem; text-align: center; }
.menu-item:hover { background: var(--surface-3); text-decoration: none; }
.menu-item.danger, .menu-item.danger > i { color: var(--red); }
.menu-item b { font-size: .82rem; }
.menu-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.menu-sep { height: 1px; background: var(--line); margin: .35rem .2rem; }
.menu-empty { display: flex; align-items: center; gap: .55rem; padding: .7rem .7rem .8rem; color: var(--muted); font-size: .88rem; }
.menu-empty i { color: var(--green); font-size: 1.15rem; }
.attn .icon-btn { position: relative; }
.attn-n { position: absolute; top: -5px; inset-inline-end: -6px; min-width: 18px; height: 18px; border-radius: 999px; background: var(--red); color: var(--card);
          font-size: .66rem; display: grid; place-items: center; padding: 0 .3rem; border: 2px solid var(--bg); line-height: 1; font-weight: 700; }
.tone-amber { background: var(--amber-bg); color: var(--amber); } .tone-red { background: var(--red-bg); color: var(--red); }
.tone-orange { background: var(--orange-bg); color: var(--orange); } .tone-slate { background: var(--slate-bg); color: var(--slate); }
.tone-green { background: var(--green-bg); color: var(--green); } .tone-blue { background: var(--blue-bg); color: var(--blue); }
.tone-teal { background: var(--teal-bg); color: var(--teal); } .tone-violet { background: var(--violet-bg); color: var(--violet); }

.who { display: flex; align-items: center; gap: .5rem; padding: .2rem .35rem; border-radius: 12px; }
.menu > summary:hover .who { background: var(--surface-3); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; font-family: var(--font-head); }
.who-name { display: flex; flex-direction: column; font-size: .82rem; font-weight: 600; line-height: 1.25; color: var(--ink); max-width: 150px; }
.who-name small { color: var(--muted); font-weight: 500; }
.who-caret { font-size: .7rem; color: var(--muted); }

.content { padding: .35rem 1.5rem 2.75rem; max-width: 1480px; }
.scrim { display: none; }

/* الشريطُ المطويّ: أيقوناتٌ وتلميحٌ بالاسم — على الحاسوب وحده */
@media (min-width: 992px) {
    body.rail .sidebar { width: var(--rail-w); }
    body.rail .main { margin-inline-start: calc(var(--rail-w) + var(--gap-shell) * 2); }
    body.rail .brand { justify-content: center; padding-inline: .5rem; }
    body.rail .brand-text, body.rail .nav-link span, body.rail .nav-group, body.rail .sb-sub span:not(.dot) { display: none; }
    body.rail .sb-sub { justify-content: center; padding-inline: 0; }
    body.rail .nav-link { justify-content: center; padding: .7rem; }
    body.rail .nav-badge { position: absolute; top: 3px; inset-inline-end: 5px; min-width: 16px; font-size: .62rem; padding: 0 .25rem; }
    body.rail .rail-toggle i { transform: scaleX(-1); }
    body.rail .nav-link[data-tip]:hover::after, body.rail .nav-link[data-tip]:focus-visible::after {
        content: attr(data-tip); position: absolute; inset-inline-start: calc(100% + 12px); top: 50%; transform: translateY(-50%);
        background: var(--inv-bg); color: var(--inv-ink); padding: .32rem .65rem; border-radius: var(--radius-xs); font-size: .8rem; white-space: nowrap;
        box-shadow: var(--shadow-lg); pointer-events: none; z-index: 80;
    }
    body.rail .nav { overflow: visible; }
    .app-tabbar { display: none !important; }
}

/* ── البوّابة والمنصّة: شريطٌ علويّ وحده بلا شريطٍ جانبيّ ── */
.topbar-solo { padding: 0; }
.topbar-in { display: flex; align-items: center; gap: .8rem; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 1.25rem; height: 100%; }
.solo-who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.solo-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .93rem; font-family: var(--font-head); font-weight: 600; }
.solo-who small { color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.solo-nav { display: flex; gap: .25rem; margin-inline-start: auto; padding: 4px; background: var(--surface-3); border-radius: 999px; }
.solo-link { display: inline-flex; align-items: center; gap: .45rem; padding: .42rem .9rem; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: .88rem; white-space: nowrap; }
.solo-link:hover { color: var(--ink); text-decoration: none; }
.solo-link.active { color: var(--ink); background: var(--card); box-shadow: var(--shadow); }
.solo-link.active i { color: var(--brand); }
.topbar-dark .brand-mark { background: linear-gradient(135deg, var(--accent), var(--brand)); }
.content-solo { max-width: 1240px; margin: 0 auto; padding-top: 1.2rem; }
.content-wide, .platform .topbar-in { max-width: 1320px; }
.solo-title { font-size: 1.4rem; font-weight: 600; margin-bottom: 1.1rem; }
.solo-tabbar { display: none; }

/* ═══════════ الأزرار والحقول ═══════════ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem 1.05rem; border-radius: var(--radius-sm);
       border: 1px solid var(--line-2); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; background: var(--card); color: var(--ink);
       white-space: nowrap; min-height: 40px; line-height: 1.2; transition: background .12s, border-color .12s, box-shadow .12s, transform .06s; }
.btn:hover { text-decoration: none; background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 0; box-shadow: var(--ring); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 16px -10px var(--brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-amber { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber); }
.btn-amber:hover { background: var(--amber-bg); filter: brightness(.97); }
.btn-danger { background: var(--card); border-color: var(--red-line); color: var(--red); }
.btn-danger:hover { background: var(--red-bg); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-sm { padding: .36rem .8rem; min-height: 34px; font-size: .84rem; }
.btn-block { width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--card-line); background: var(--card); display: inline-grid; place-items: center;
            cursor: pointer; font-size: 1.12rem; color: var(--ink-2); flex: 0 0 auto; font-family: inherit; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.field, select.field, textarea.field {
    width: 100%; padding: .56rem .85rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font: inherit; font-size: .92rem;
    background: var(--card); color: var(--ink); min-height: 42px; transition: border-color .12s, box-shadow .12s;
}
.field::placeholder { color: var(--muted); opacity: .8; }
.field:hover { border-color: var(--faint); }
.field:focus { outline: 0; border-color: var(--brand); box-shadow: var(--ring); }
.field:disabled, .field[readonly] { background: var(--surface-2); color: var(--muted); }
textarea.field { min-height: 84px; resize: vertical; }
input[type="file"].field { padding: .45rem .6rem; }
label { font-weight: 600; font-size: .84rem; color: var(--ink-2); display: block; margin-bottom: .35rem; }
.fld { min-width: 0; }
.hint { display: block; font-size: .78rem; color: var(--muted); margin-top: .3rem; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 1rem 1.1rem; }
.form-grid .span-all { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); flex: 0 0 auto; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.1rem; }

.seg { display: inline-flex; background: var(--surface-3); border-radius: 12px; padding: 3px; gap: 2px; }
.seg > a, .seg > button { border: 0; background: transparent; padding: .4rem .75rem; border-radius: 9px; font: inherit; font-size: .82rem; font-weight: 600;
                          color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: .35rem; cursor: pointer; white-space: nowrap; }
.seg > a:hover, .seg > button:hover { color: var(--ink); text-decoration: none; }
.seg > [aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(19, 32, 51, .14); }
.seg-block { display: flex; margin: 0 .4rem .3rem; }
.seg-block > * { flex: 1; }

/* ═══════════ البطاقات والمؤشّرات ═══════════ */
.card { background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; gap: .7rem; padding: .95rem 1.2rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 58px; }
.card-head h2 { font-size: 1rem; display: flex; align-items: center; gap: .5rem; }
.card-head h2 > i { color: var(--brand); font-size: 1.02rem; }
.card-head .actions { margin-inline-start: auto; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.card-body { padding: 1.2rem; }
.grid { display: grid; gap: 1.15rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 1.1rem; }

/* المؤشّرُ عموديّ: أيقونةٌ صغيرةٌ بجانب الاسم، والرقمُ في سطره، والفرقُ تحته */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: .9rem; margin-bottom: 1.15rem; }
.stat { background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; color: var(--ink);
        display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: .6rem; row-gap: .1rem; padding: 1rem 1.1rem; }
a.stat:hover { border-color: var(--line-2); text-decoration: none; }
.stat-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 1rem; flex: 0 0 auto; background: var(--brand-50); color: var(--brand); }
.stat-icon.amber { background: var(--amber-bg); color: var(--amber); } .stat-icon.red { background: var(--red-bg); color: var(--red); }
.stat-icon.blue { background: var(--blue-bg); color: var(--blue); } .stat-icon.violet { background: var(--violet-bg); color: var(--violet); }
.stat-icon.green { background: var(--green-bg); color: var(--green); }
.stat-body { display: contents; }
.stat-label { color: var(--muted); font-size: .8rem; display: block; font-weight: 600; line-height: 1.3; }
.stat-value { grid-column: 1 / -1; margin-top: .5rem; font-size: 1.6rem; font-weight: 600; font-family: var(--font-num); font-variant-numeric: tabular-nums; display: block; line-height: 1.2;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value small { font-size: .55em; font-weight: 600; color: var(--muted); }
.stat-sub { grid-column: 1 / -1; font-size: .75rem; color: var(--muted); line-height: 1.4; }
.stat-delta { font-size: .74rem; font-weight: 700; display: inline-flex; align-items: center; gap: .15rem; }
.stat-delta.up { color: var(--green); } .stat-delta.down { color: var(--red); } .stat-delta.flat { color: var(--muted); }
.stat.warn { border-color: var(--amber-line); }
.stat.alert { border-color: var(--red-line); }

/* ═══════════ شاراتُ الحالة ═══════════ */
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .16rem .62rem; border-radius: 8px; font-size: .75rem; font-weight: 600; white-space: nowrap; background: var(--slate-bg); color: var(--slate); line-height: 1.6; }
.chip-amber { background: var(--amber-bg); color: var(--amber); } .chip-blue { background: var(--blue-bg); color: var(--blue); }
.chip-indigo { background: var(--indigo-bg); color: var(--indigo); } .chip-violet { background: var(--violet-bg); color: var(--violet); }
.chip-green { background: var(--green-bg); color: var(--green); } .chip-red { background: var(--red-bg); color: var(--red); }
.chip-orange { background: var(--orange-bg); color: var(--orange); } .chip-slate { background: var(--slate-bg); color: var(--slate); }
.chip-teal { background: var(--teal-bg); color: var(--teal); }
.chip-amber::before, .chip-blue::before, .chip-indigo::before, .chip-violet::before, .chip-green::before, .chip-red::before, .chip-orange::before, .chip-teal::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }

/* ═══════════ الجداول ═══════════ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: start; font-size: .74rem; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: .68rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .76rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .t-main { font-weight: 600; color: var(--ink); }
.table a.t-main, .table .t-main a { color: var(--link); }
.table .t-sub { display: block; font-size: .78rem; color: var(--muted); }
.table td.actions { white-space: nowrap; text-align: end; }
.card > .table-wrap:first-child .table th:first-child { border-start-start-radius: var(--radius); }
.card > .table-wrap:first-child .table th:last-child { border-start-end-radius: var(--radius); }
.row-total td { font-weight: 700; background: var(--surface-2); }
tr.is-off td { opacity: .55; }

/* ═══════════ شريطُ الترشيح والتبويبات ═══════════ */
.toolbar { display: flex; gap: .65rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1.1rem; }
.toolbar .fld { flex: 1 1 160px; }
.toolbar .fld.grow { flex: 2 1 240px; }
.tabs { display: flex; gap: .2rem; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 1.1rem; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: .7rem .95rem; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; font-size: .9rem; }
.tabs a.active { color: var(--ink); border-color: var(--brand); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs .count { background: var(--surface-3); color: var(--muted); border-radius: 999px; padding: 0 .45rem; font-size: .72rem; margin-inline-start: .35rem; font-family: var(--font-num); }
.tabs a.active .count { background: var(--brand-50); color: var(--brand); }
.card > .tabs { padding: 0 1rem; margin: 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: .85rem; }

/* ═══════════ الرسائل ═══════════ */
.flash { display: flex; align-items: center; gap: .6rem; padding: .78rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.1rem; font-weight: 600; border: 1px solid; }
.flash a { color: inherit; text-decoration: underline; }
.flash-success { background: var(--green-bg); border-color: var(--green-line); color: var(--green); }
.flash-error { background: var(--red-bg); border-color: var(--red-line); color: var(--red); }
.flash-info { background: var(--blue-bg); border-color: transparent; color: var(--blue); }
.flash-x { margin-inline-start: auto; background: none; border: 0; font-size: 1.3rem; cursor: pointer; color: inherit; line-height: 1; padding: 0 .2rem; }
.banner { display: flex; gap: .5rem; align-items: center; padding: .55rem 1rem; margin: 0 1.5rem .8rem; border-radius: var(--radius-sm); font-size: .85rem; font-weight: 600; flex-wrap: wrap; }
.banner a { color: inherit; text-decoration: underline; }
.banner-amber { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-line); }
.banner-red { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-line); }
.note { background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--radius-sm); padding: .8rem .95rem; color: var(--ink-2); font-size: .88rem; }
.empty { text-align: center; padding: 2.8rem 1rem; color: var(--muted); }
.empty i { font-size: 1.55rem; width: 60px; height: 60px; display: grid; place-items: center; margin: 0 auto .8rem; color: var(--brand); background: var(--brand-50); border-radius: 50%; }
.empty b { display: block; color: var(--ink); margin-bottom: .25rem; font-size: 1rem; font-family: var(--font-head); font-weight: 600; }
.empty p { margin: 0 auto .9rem; max-width: 44ch; }

/* ═══════════ التفاصيل والخطّ الزمنيّ ═══════════ */
.kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: .55rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .84rem; }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding-inline-start: 1.7rem; padding-bottom: 1.05rem; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: .38rem; top: .55rem; bottom: -.3rem; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 0; top: .32rem; width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 3px solid var(--brand); }
.timeline .t-when { font-size: .78rem; color: var(--muted); }
.route { display: grid; gap: .85rem; }
.route-stop { display: flex; gap: .75rem; align-items: flex-start; }
.route-stop .pin { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; font-weight: 700; font-size: .85rem; font-family: var(--font-num); }
.pin-a { background: var(--surface-3); color: var(--ink); } .pin-b { background: var(--brand); color: var(--brand-ink); }
.money-row { display: flex; justify-content: space-between; gap: 1rem; padding: .42rem 0; border-bottom: 1px dashed var(--line); }
.money-row:last-child { border-bottom: 0; }
.money-row.total { font-weight: 700; font-size: 1.05rem; border-top: 2px solid var(--line); border-bottom: 0; padding-top: .65rem; }
.pos { color: var(--green); } .neg { color: var(--red); }
.bar-track { background: var(--surface-3); border-radius: 99px; height: 8px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--brand); }
.bar-fill.over { background: var(--red); }

/* ═══════════ الخريطة ═══════════ */
.map { height: 380px; border-radius: var(--radius); border: 1px solid var(--card-line); z-index: 1; background: var(--surface-3); }
.map-lg { height: calc(100vh - var(--topbar-h) - 6rem); min-height: 420px; }
.map-sm { height: 240px; }
.leaflet-container { font-family: var(--font); }
/* ★ البلاطاتُ مرسومةٌ فاتحة: تُقلب في الداكن بمرشّح، والعلاماتُ فوقها بألوانها */
.leaflet-tile-pane { filter: var(--map-filter); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); }
.leaflet-popup-content-wrapper { border-radius: var(--radius-sm); }
.leaflet-bar a { background: var(--card); color: var(--ink); border-bottom-color: var(--line); }
.leaflet-bar a:hover { background: var(--surface-3); }
.leaflet-control-attribution { background: var(--topbar-bg) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--muted); }
/* علاماتُ الخريطة فوق البلاطات: ألوانٌ ثابتةٌ مقصودة (تُقرأ على الخريطة الفاتحة والمقلوبة) */
.mk { display: grid; place-items: center; border-radius: 50%; color: #FFFFFF; font-size: 14px; border: 2px solid #FFFFFF; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.mk-courier { background: #132033; width: 30px; height: 30px; }
.mk-courier.busy { background: #6553D1; } .mk-courier.available { background: #18794E; } .mk-courier.stale { background: #8B97AA; }
.mk-drop { background: #0E7A89; width: 24px; height: 24px; color: #FFFFFF; }
.mk-hub { background: #132033; width: 28px; height: 28px; border-radius: 8px; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.lg-available { background: #18794E; } .lg-busy { background: #6553D1; } .lg-stale { background: #8B97AA; } .lg-drop { background: #0E7A89; } .lg-hub { background: var(--ink); border-radius: 3px; }
.map-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.1rem; }
.list-compact { max-height: calc(100vh - var(--topbar-h) - 6rem); overflow-y: auto; }
.lc-item { display: flex; gap: .65rem; padding: .7rem .95rem; border-bottom: 1px solid var(--line); align-items: center; cursor: pointer; }
.lc-item:hover { background: var(--surface-2); }
.lc-btn { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; text-align: start; cursor: pointer; color: var(--ink); }
.lc-btn:hover { background: var(--surface-2); }
.lc-btn .mk { width: 30px; height: 30px; flex: 0 0 auto; }

/* ═══════════ الألواح (حوار) — تنزلق من الأسفل على الهاتف ═══════════ */
dialog.sheet { border: 1px solid var(--card-line); border-radius: 20px; padding: 0; width: min(580px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); box-shadow: var(--shadow-lg);
               background: var(--card); color: var(--ink); }
dialog.sheet::backdrop { background: var(--scrim); backdrop-filter: blur(3px); }
dialog.sheet[open] { animation: sheet-in .2s ease-out; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.sheet-head { display: flex; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); gap: .6rem; }
.sheet-head h2, .sheet-head h3 { font-size: 1.05rem; margin: 0; }
dialog.sheet > form { display: flex; flex-direction: column; max-height: calc(100vh - 2rem); }
.sheet-head .icon-btn { margin-inline-start: auto; border-color: transparent; }
.sheet-body { padding: 1.25rem; overflow-y: auto; }

/* ═══════════ الدخول: وجهٌ تركوازيٌّ ليليّ بجانب النموذج ═══════════ */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bg); }
.auth-art { background: radial-gradient(760px 460px at 80% 0%, var(--deep-hover) 0%, transparent 65%), linear-gradient(160deg, var(--deep-bg), var(--deep-bg-2)); color: var(--deep-ink);
            padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; margin: var(--gap-shell); border-radius: 24px; }
.auth-art h1 { font-size: clamp(1.6rem, 2.6vw, 2.25rem); color: var(--deep-ink); margin: 1rem 0 .6rem; font-weight: 600; max-width: 20ch; }
.auth-art p { color: var(--deep-muted); max-width: 46ch; }
.auth-art ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.auth-art li { display: flex; gap: .7rem; align-items: center; color: var(--deep-ink); }
.auth-art li i { color: var(--deep-ink); width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--deep-hover); flex: 0 0 auto; }
.auth-art .muted { color: var(--deep-muted); }
.auth-art .brand-mark { background: var(--deep-hover); color: var(--deep-ink); }
.auth-form { display: grid; place-items: center; padding: 2rem 1.25rem; background: var(--bg); }
.auth-card { width: min(410px, 100%); display: grid; gap: 1rem; }
.auth-card h2 { font-size: 1.55rem; font-weight: 600; }
.auth-solo { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: radial-gradient(800px 480px at 50% 0%, var(--deep-hover) 0%, transparent 60%), linear-gradient(170deg, var(--deep-bg), var(--deep-bg-2)); }
.auth-solo .card { width: min(420px, 100%); }
.auth-brand { border: 0; padding: 0; min-height: 0; }
.auth-sub { margin: -.4rem 0 .4rem; }
.auth-links { margin: .3rem 0 0; font-size: .85rem; color: var(--muted); text-align: center; }
.auth-solo .auth-card { width: min(420px, 100%); }
.auth-solo-head { text-align: center; display: grid; justify-items: center; gap: .5rem; }
.auth-solo-head .brand-mark { width: 58px; height: 58px; font-size: 1.55rem; }
.auth-solo-head h2 { margin: 0; }
.auth-solo-head .auth-sub { margin: 0; }

/* ═══════════ الهاتف: الكابتن والتتبّع ═══════════ */
.mobile-shell { max-width: 640px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
.m-top { position: sticky; top: 0; z-index: 30; background: var(--topbar-bg); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
         color: var(--ink); padding: .8rem 1rem; display: flex; align-items: center; gap: .7rem; border-bottom: 1px solid var(--line); }
.m-top h1 { font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.m-top .m-right { margin-inline-start: auto; display: flex; gap: .4rem; align-items: center; }
.m-top a { color: var(--ink); font-size: 1.15rem; }
.gps-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--surface-3); color: var(--ink-2); }
.gps-chip.on { background: var(--green-bg); color: var(--green); }
.gps-chip.off { background: var(--amber-bg); color: var(--amber); }
.m-body { padding: 1rem; }
.big-actions { display: grid; gap: .6rem; }
.big-actions .btn { min-height: 54px; font-size: 1.02rem; border-radius: var(--radius); }
.m-tabbar { position: fixed; bottom: 0; inset-inline: 0; background: var(--card); border-top: 1px solid var(--line); display: flex; justify-content: center; z-index: 30;
            padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -8px 24px -16px rgba(19, 32, 51, .25); }
.m-tabbar a { flex: 1; max-width: 160px; text-align: center; padding: .55rem .25rem .6rem; color: var(--muted); font-size: .74rem; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: .12rem; }
.m-tabbar a i { display: block; font-size: 1.28rem; }
.m-tabbar a:hover { text-decoration: none; color: var(--ink); }
.m-tabbar a.active { color: var(--brand); }
/* زرُّ «شحنة» في وسط شريط اللوحة: يرتفع فوقه */
.m-tabbar .tab-fab { justify-content: flex-start; padding-top: 0; }
.m-tabbar .tab-fab span { width: 52px; height: 52px; border-radius: 16px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; margin-top: -18px;
                          box-shadow: 0 10px 20px -10px var(--brand), 0 0 0 5px var(--bg); }
.m-tabbar .tab-fab span i { font-size: 1.4rem; }
.app-tabbar { display: none; }
.status-toggle { display: flex; gap: .5rem; align-items: center; padding: .75rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); font-weight: 600; }

/* ═══════════ الطباعة: فاتحةٌ دائمًا ═══════════ */
@media print {
    /* ★ معرّفٌ داخل :not() يرفع الأسبقيّة فوق قاعدتي الداكن — الورقُ أبيضُ ولو كانت الشاشةُ داكنة */
    :root:not(#print-light), :root[data-theme]:not(#print-light) {
        --bg: #FFFFFF; --card: #FFFFFF; --card-line: #DFE5ED; --surface-2: #F6F8FB; --surface-3: #E8EDF3; --line: #DFE5ED; --line-2: #C8D1DD;
        --ink: #132033; --ink-2: #34425A; --muted: #56647C; --faint: #8B97AA; --link: #132033; --map-filter: none; color-scheme: light;
    }
    .sidebar, .topbar, .no-print, .banner, .m-tabbar, .skip, .hubtabs { display: none !important; }
    .main { margin: 0 !important; }
    body { background: #FFFFFF; }
    .card { box-shadow: none; }
}

/* ═══════════ الاستجابة ═══════════ */
@media (max-width: 1100px) {
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .map-side { grid-template-columns: minmax(0, 1fr); }
    .who-name { display: none; }
}
@media (max-width: 991px) {
    /* ★ الهاتفُ واللوحيّ: لا شريطَ جانبيًّا ولا درج — الأقسامُ الأربعةُ في الشريط السفليّ، والإعدادُ من قائمة الحساب */
    .sidebar { display: none; }
    .main { margin-inline-start: 0; }
    .app-tabbar { display: flex; }
    body.app .content { padding-bottom: calc(var(--tabbar-h) + 2rem + env(safe-area-inset-bottom)); }
    .topbar { padding: 0 1rem; }
    .top-new { display: none; }
    .grid-main, .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .crumb, .crumb-sep { display: none; }
    .banner { margin-inline: 1rem; }
}
@media (max-width: 720px) {
    .content { padding: .25rem .9rem 2rem; }
    .topbar { padding: 0 .75rem; gap: .45rem; height: 58px; }
    :root { --topbar-h: 58px; }
    .top-search { display: none; position: absolute; inset-inline: .6rem; top: 50%; transform: translateY(-50%); flex: none; z-index: 5; }
    body.searching .top-search { display: block; }
    body.searching .top-search .kbd { display: none; }
    .topbar .search-btn { display: inline-grid; margin-inline-start: auto; }
    .hubtabs { margin: 0 -.9rem 1rem; padding: 2px .9rem; }
    .hubtabs a { padding: .42rem .85rem; font-size: .84rem; }
    .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
    .stat { padding: .78rem .82rem; }
    .stat-icon { width: 28px; height: 28px; font-size: .9rem; }
    .stat-value { font-size: 1.22rem; margin-top: .3rem; }
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth-art { display: none; }
    .map { height: 300px; }
    .kv { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
    .kv dd { margin-bottom: .5rem; }
    .banner { margin-inline: .9rem; }
    .card-head { padding: .85rem 1rem; }
    .card-body { padding: 1rem; }
    /* اللوحُ على الهاتف ينزلق من الأسفل بعرض الشاشة */
    dialog.sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92vh; border-bottom: 0; }
    dialog.sheet > form { max-height: 92vh; }
    dialog.sheet[open] { animation: sheet-up .22s ease-out; }
    .sheet-body { padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
    /* ★ الجدول بطاقاتٌ على الهاتف: الأسماء من رؤوس الأعمدة (app.js) */
    .table.cards thead { display: none; }
    .table.cards, .table.cards tbody, .table.cards tr, .table.cards td { display: block; width: 100%; }
    .table.cards tr { border-bottom: 1px solid var(--line); padding: .65rem .2rem; }
    .table.cards tbody tr:hover { background: transparent; }
    .table.cards td { border: 0; padding: .22rem .8rem; display: flex; gap: .8rem; justify-content: space-between; align-items: center; text-align: end; min-width: 0; }
    .table.cards td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; font-weight: 600; text-align: start; flex: 0 0 auto; }
    .table.cards td[data-label=""]::before { display: none; }
    .table.cards td.t-first { display: block; text-align: start; padding-top: .35rem; }
    .table.cards td.t-first::before { display: none; }
    .table.cards td.actions { justify-content: flex-end; }
    .table.cards td > * { min-width: 0; overflow-wrap: anywhere; }
    /* البوّابة والمنصّة: التبويباتُ إلى أسفل الشاشة، والشريطُ العلويّ للهويّة والحساب */
    .topbar-in { padding: 0 .75rem; gap: .55rem; }
    .portal .solo-nav { display: none; }
    .portal .solo-who { margin-inline-end: auto; }
    .portal .solo-tabbar { display: flex; }
    .portal .content-solo { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
    .platform .solo-link span { display: none; }
    .platform .solo-who small { display: none; }
    .solo-title { font-size: 1.2rem; margin-bottom: .85rem; }
    /* القوائمُ المنسدلة على الهاتف بعرض الشاشة تحت الشريط: لا تخرج من حافّتها أيًّا كان موضعُ زرّها */
    .topbar .menu-pop { position: fixed; inset-inline: .75rem; top: calc(var(--topbar-h) + 6px); width: auto; max-width: none; }
    /* قائمةٌ داخل الصفحة: بعرض بطاقتها تحت زرّها (top:auto = موضعُها الطبيعيّ) لا تحت الشريط */
    .hero .menu { position: static; }
    .hero .menu-pop { inset-inline: 1rem; top: auto; width: auto; max-width: none; margin-top: .4rem; }
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
/* ── لوحٌ لاصقٌ على الحاسوب وحده: على الهاتف يُكدَّس فلا يلتصق ما هو أطول من الشاشة ── */
@media (min-width: 1101px) { .sticky-side { position: sticky; top: calc(var(--topbar-h) + 1rem); align-self: start; } }

/* ── لوحُ التوقيع: لمسٌ بلا تمرير. ★ الورقةُ بيضاءُ في المظهرين: التوقيعُ مستندٌ يُطبع ويُرسل ── */
.sign-pad { border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--card); padding: .4rem; display: grid; gap: .4rem; }
.sign-pad canvas { width: 100%; height: 150px; touch-action: none; display: block; background: #FFFFFF; border-radius: 10px; }
.sign-pad [data-sign-clear] { justify-self: start; }
.pod-thumbs { display: flex; gap: .6rem; flex-wrap: wrap; }
.pod-thumbs a { display: block; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #FFFFFF; }
.pod-thumbs img { display: block; height: 110px; width: auto; max-width: 100%; object-fit: cover; }

/* ── أسطرُ المحتويات تبقى جدولًا يُمرَّر داخل غلافه على الهاتف ── */
.intl-items td { padding: .3rem; } .intl-items .field { padding: .45rem .55rem; }
@media (max-width: 720px) {
    .intl-items thead { display: none; }
    .intl-items tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem; padding: .4rem 0; border-bottom: 1px dashed var(--line); }
    .intl-items td { padding: 0; border: 0; } .intl-items td:first-child { grid-column: 1 / -1; }
    .intl-items .field { min-width: 0 !important; width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════
   المكوّناتُ المشتركة — تستعملها الشاشاتُ ولا تبني مثلها
   ═══════════════════════════════════════════════════════════════ */

/* ── رأسُ الصفحة: سطرُ تعريفٍ وأفعالٌ في مكانٍ واحدٍ ثابت ── */
.page-head { display: flex; align-items: center; gap: .8rem 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-head-main { min-width: 0; flex: 1 1 18rem; }
.page-head h2 { font-size: 1.35rem; font-weight: 600; }
.page-head p { margin: .15rem 0 0; color: var(--muted); }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ── خطُّ العمل: الشحناتُ المفتوحة حسب مرحلتها — شريطٌ مقسّمٌ وتسمياتٌ تحته ── */
.pipe { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--card); }
.pipe span { min-width: 4px; }
.pipe-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr)); gap: .5rem .9rem; margin-top: .9rem; }
.pipe-legend a { display: flex; align-items: center; gap: .5rem; color: var(--ink-2); font-size: .85rem; padding: .3rem .45rem; border-radius: var(--radius-xs); }
.pipe-legend a:hover { background: var(--surface-3); text-decoration: none; }
.pipe-legend i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.pipe-legend b { margin-inline-start: auto; font-family: var(--font-num); }
.pc-pending { background: var(--amber); } .pc-assigned { background: var(--blue); } .pc-moving { background: var(--indigo); }
.pc-out { background: var(--violet); } .pc-failed { background: var(--red); } .pc-returning { background: var(--orange); }

/* ── رسمُ الأعمدة: أعمدةٌ ≤ ٢٢ بكسل، نهايةٌ دائريّة ٤ بكسل ومربّعةٌ عند الخطّ، فجوةٌ ٢ بكسل، وتلميحٌ لكلّ يوم ── */
.chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 .5rem; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; height: 160px; font-size: .7rem; color: var(--muted); text-align: end; font-family: var(--font-num); }
.chart-y span { transform: translateY(-50%); }
.chart-y span:last-child { transform: translateY(50%); }
.chart-plot { position: relative; height: 160px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; }
.chart-plot::before { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(var(--line), var(--line)) top / 100% 1px no-repeat, linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat; }
.chart-plot::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px; background: var(--line-2); }
.chart-day { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-radius: var(--radius-xs); cursor: default; }
.chart-day:hover, .chart-day:focus-visible { background: var(--surface-2); outline: 0; }
.chart-col { width: min(18px, 34%); height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; }
.chart.one .chart-col { width: min(22px, 62%); }
.chart-bar { width: 100%; border-radius: 4px 4px 0 0; min-height: 2px; position: relative; z-index: 1; }
.chart-bar.s1 { background: var(--chart-1); } .chart-bar.s2 { background: var(--chart-2); }
.chart-val { text-align: center; font-size: .7rem; font-weight: 700; color: var(--ink); font-family: var(--font-num); margin-bottom: 3px; white-space: nowrap; }
.chart-tip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--inv-bg); color: var(--inv-ink); padding: .38rem .65rem;
             border-radius: var(--radius-xs); font-size: .76rem; white-space: nowrap; z-index: 5; box-shadow: var(--shadow-lg); pointer-events: none; display: none; line-height: 1.5; }
.chart-day:hover .chart-tip, .chart-day:focus-visible .chart-tip { display: block; }
.chart-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-inline-end: .3rem; }
.chart-x { grid-column: 2; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); font-size: .7rem; color: var(--muted); text-align: center; margin-top: .35rem; font-family: var(--font-num); }
.chart-x span { white-space: nowrap; }
.chart-x .today { color: var(--ink); font-weight: 700; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend .s1, .sw-s1 { background: var(--chart-1); } .legend .s2, .sw-s2 { background: var(--chart-2); }
.sw-s1, .sw-s2 { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-inline-end: .3rem; }
.tbl-toggle { margin-top: .8rem; font-size: .82rem; }
.tbl-toggle summary { cursor: pointer; color: var(--muted); }
.hbar { display: grid; grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr) auto; gap: .7rem; align-items: center; margin-bottom: .6rem; font-size: .88rem; }
.hbar:last-child { margin-bottom: 0; }
.hbar > b { min-width: 2.5rem; text-align: end; }

/* ── شريطُ الحركة ── */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: .7rem; padding: .68rem 1.2rem; border-bottom: 1px solid var(--line); align-items: flex-start; }
.feed li:last-child { border-bottom: 0; }
.feed-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; font-size: .85rem; }
.feed-body { min-width: 0; flex: 1; font-size: .88rem; }
.feed-body small { display: block; color: var(--muted); font-size: .76rem; }
.feed-when { font-size: .74rem; color: var(--muted); white-space: nowrap; }

/* ── الشخص: كابتنٌ بحالته وحمولته ── */
.person { display: flex; gap: .7rem; align-items: center; padding: .68rem 1.2rem; border-bottom: 1px solid var(--line); color: var(--ink); }
.person:last-child { border-bottom: 0; }
a.person:hover { background: var(--surface-2); text-decoration: none; }
.person-av { position: relative; }
.person-av .dot { position: absolute; bottom: 0; inset-inline-end: 0; width: 10px; height: 10px; border: 2px solid var(--card); }
.st-available { color: var(--green); } .st-busy { color: var(--violet); } .st-offline { color: var(--faint); }
.person-body { flex: 1; min-width: 0; line-height: 1.35; }
.person-body b { display: block; font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-body small { color: var(--muted); font-size: .76rem; }
.load { width: 64px; flex: 0 0 auto; text-align: end; font-size: .74rem; color: var(--muted); }
.load .bar-track { height: 5px; margin-top: .2rem; }

/* ── مسارُ الحالة: محطّاتٌ بأوقاتها، والمسارُ البديل (تعذّر/إرجاع/إلغاء) نهايةٌ ملوّنة ── */
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stepper.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stepper li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35rem; padding: 0 .25rem; min-width: 0; }
.stepper li::before { content: ""; position: absolute; top: 15px; inset-inline-start: calc(-50% + 18px); inset-inline-end: calc(50% + 18px); height: 2px; background: var(--line); border-radius: 2px; }
.stepper li:first-child::before { display: none; }
.stepper li.done::before, .stepper li.now::before { background: var(--brand); }
.stepper .sd { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); background: var(--card); color: var(--muted); font-size: .95rem; position: relative; z-index: 1; }
.stepper li.done .sd { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.stepper li.now .sd { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 5px var(--brand-50); }
.stepper li.bad .sd { background: var(--red); border-color: var(--red); color: var(--card); }
.stepper li.warn .sd { background: var(--orange); border-color: var(--orange); color: var(--card); }
.stepper b { font-size: .82rem; font-weight: 600; color: var(--ink); }
.stepper li.todo b { color: var(--muted); font-weight: 500; }
.stepper small { font-size: .72rem; color: var(--muted); font-family: var(--font-num); }
@media (max-width: 380px) { .stepper b { font-size: .72rem; } .stepper .sd { width: 28px; height: 28px; font-size: .85rem; } .stepper li::before { top: 13px; } }

/* ── البطل: الهويّةُ والمسارُ والفعلُ التالي في بطاقةٍ واحدة (الشحنة والملفّات) ── */
.hero { padding: 1.25rem 1.3rem; display: grid; gap: 1.2rem; position: relative; margin-bottom: 1.15rem; }
.hero-top { display: flex; gap: .8rem 1rem; flex-wrap: wrap; align-items: flex-start; }
.hero-id { min-width: 0; flex: 1 1 16rem; display: grid; gap: .45rem; }
.hero-id h2 { font-size: 1.45rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-family: var(--font-num); }
.hero-chips { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.hero-route { display: flex; align-items: center; gap: .5rem; color: var(--ink-2); font-size: .9rem; flex-wrap: wrap; }
.hero-route i { color: var(--faint); }
.hero-act { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.hero-act form { margin: 0; }
.hero + .stats, .hero + .grid { margin-top: 1.15rem; }
.avatar-lg { width: 58px; height: 58px; font-size: 1.35rem; border-radius: 18px; }
.profile .person-av .dot { width: 14px; height: 14px; border-width: 3px; }
.profile .hero-top { align-items: center; }
.profile .hero-id h2 { font-family: var(--font-head); }
.copy-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: .2rem; border-radius: var(--radius-xs); font-size: .95rem; }
.copy-btn:hover { color: var(--ink); background: var(--surface-3); }
.copy-btn.done { color: var(--green); }
.next-bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .85rem 1rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.next-bar > b { font-size: .85rem; color: var(--muted); margin-inline-end: .2rem; font-weight: 600; }
.next-bar .end { margin-inline-start: auto; }
.menu-pop form { margin: 0; }
.menu-pop button.menu-item { width: 100%; background: none; border: 0; font: inherit; cursor: pointer; text-align: start; }

/* المبلغُ المطلوب: رقمُ الصفحة الأهمّ للكابتن والمكتب */
.collect-card { padding: 1.2rem; display: grid; gap: .3rem; text-align: center; background: var(--brand-50); border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line); }
.collect-card span { color: var(--ink-2); font-size: .85rem; font-weight: 600; }
.collect-card b { font-size: 1.95rem; font-weight: 600; font-family: var(--font-num); line-height: 1.2; }
.collect-card small { color: var(--muted); }
.who-card { display: flex; gap: .75rem; align-items: center; }
.who-card .grow b { display: block; }
.who-card .grow small { color: var(--muted); }

/* ── الترشيح: بحثٌ ظاهر، والمزيدُ مطويّ، وما فُعّل منه شاراتٌ تُزال ── */
.filterbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: .9rem; }
.filterbar .search, .search { flex: 1 1 16rem; position: relative; min-width: 0; }
.search i { position: absolute; inset-inline-start: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .field { padding-inline-start: 2.35rem; }
.filters { width: 100%; }
.filters > summary { display: none; }
.filters-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: .6rem; padding: .95rem; background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); margin-bottom: .9rem; box-shadow: var(--shadow); }
.filters-body .fld label { font-size: .76rem; margin-bottom: .2rem; }
.filters-body .form-actions { margin: 0; align-self: end; }
.active-filters { display: flex; gap: .4rem; flex-wrap: wrap; margin: -.3rem 0 .9rem; }
.af { display: inline-flex; align-items: center; gap: .35rem; padding-block: .2rem; padding-inline: .7rem .35rem; border-radius: 999px; background: var(--brand-50); color: var(--ink); font-size: .8rem; font-weight: 600; }
.af a { color: var(--muted); width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; }
.af a:hover { background: var(--card); color: var(--ink); text-decoration: none; }
.filter-toggle .badge { background: var(--brand); color: var(--brand-ink); border-radius: 999px; font-size: .68rem; padding: 0 .4rem; font-family: var(--font-num); }
/* شرائحُ ترشيحٍ سريعة بعددها (الكلّ، في الطريق، تعذّر…): روابطُ تُمرَّر أفقيًّا على الهاتف */
.chips-row { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; margin-bottom: .9rem; padding: 2px; }
.chips-row::-webkit-scrollbar { display: none; }
.chips-row a { display: inline-flex; align-items: center; gap: .4rem; padding: .38rem .85rem; border-radius: 999px; background: var(--card); border: 1px solid var(--card-line); color: var(--ink-2);
               font-size: .84rem; font-weight: 600; white-space: nowrap; }
.chips-row a:hover { border-color: var(--line-2); text-decoration: none; }
.chips-row a b { font-family: var(--font-num); color: var(--muted); font-weight: 600; }
.chips-row a.active, .chips-row a[aria-current] { background: var(--inv-bg); border-color: var(--inv-bg); color: var(--inv-ink); }
.chips-row a.active b, .chips-row a[aria-current] b { color: var(--inv-muted); }

/* شريطُ التحديد: يظهر ما دام شيءٌ محدّدًا */
.bulkbar { position: sticky; bottom: 1rem; z-index: 20; display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; padding-block: .65rem; padding-inline: 1rem .8rem;
           background: var(--inv-bg); color: var(--inv-ink); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.bulkbar b { font-family: var(--font-num); }
.bulkbar .btn-ghost { color: var(--inv-ink); }
.bulkbar .btn-ghost:hover { background: transparent; text-decoration: underline; }
.bulkbar .end { margin-inline-start: auto; display: flex; gap: .4rem; flex-wrap: wrap; }

/* ── شريطُ الفعل السفليّ على الهاتف: فعلُ الصفحة الأساسيّ تحت الإبهام (الشحنة، الملفّ، النموذج) ── */
.action-bar { display: none; }
@media (max-width: 720px) {
    .action-bar { display: flex; position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 25; margin: 1rem -.9rem -2rem; padding: .65rem .9rem;
                  background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -8px 20px -14px rgba(19, 32, 51, .3); align-items: center; gap: .6rem; }
    .action-bar .btn { flex: 1; min-height: 46px; }
    body:not(.app) .action-bar { bottom: 0; padding-bottom: calc(.65rem + env(safe-area-inset-bottom)); }
}

/* ── قائمةُ الشحنات: جدولٌ على الحاسوب، وبطاقةٌ مصمَّمة على الهاتف ── */
.ship-rows .c-check { width: 1%; }
.ship-rows .c-money { text-align: end; }
.ship-rows .t-trk { font-family: var(--font-num); font-weight: 600; }
.ship-rows tr.is-sel td { background: var(--brand-50); }
.flag { display: inline-flex; align-items: center; gap: .2rem; font-size: .72rem; color: var(--muted); }
.c-client-m { display: none; }
@media (max-width: 991px) { .ship-rows .c-client-m { display: inline; } .ship-rows .c-client { display: none; } }
@media (max-width: 720px) {
    .ship-rows.table.cards tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "chk trk st" "chk rcp rcp" "chk meta money"; gap: .2rem .6rem; padding: .85rem .8rem; }
    .ship-rows.table.cards td { display: block; padding: 0; text-align: start; }
    .ship-rows.table.cards td::before { display: none; }
    .ship-rows .c-check { grid-area: chk; padding-top: .15rem !important; }
    .ship-rows .c-trk { grid-area: trk; }
    .ship-rows .c-st { grid-area: st; text-align: end !important; }
    .ship-rows .c-rcp { grid-area: rcp; }
    .ship-rows .c-client { display: none !important; }
    .ship-rows .c-courier { grid-area: meta; font-size: .8rem; color: var(--muted); }
    .ship-rows .c-money { grid-area: money; text-align: end !important; }
    .ship-rows .c-fee { display: none !important; }
    .filters > summary { display: inline-flex; }
    .filters:not([open]) .filters-body { display: none; }
    .filters[open] > summary { margin-bottom: .6rem; }
    .bulkbar { bottom: .6rem; }
    body.app .bulkbar { bottom: calc(var(--tabbar-h) + .6rem + env(safe-area-inset-bottom)); }
}

/* ── اختيارٌ ببطاقات (الخدمة) وبأزرارٍ متّصلة — حقولُ راديو حقيقيّة تعمل بلا سكربت ── */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(132px, 100%), 1fr)); gap: .55rem; }
.choice { position: relative; display: flex; flex-direction: column; gap: .2rem; padding: .78rem .9rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
          background: var(--card); cursor: pointer; margin: 0; font-weight: 600; color: var(--ink); transition: border-color .12s, background .12s; }
.choice:hover { border-color: var(--line-2); }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice i { font-size: 1.15rem; color: var(--muted); }
.choice small { font-weight: 500; color: var(--muted); font-size: .75rem; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.choice:has(input:checked) i { color: var(--brand); }
.choice:has(input:focus-visible) { box-shadow: var(--ring); }
.choice:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.seg-radio { display: flex; background: var(--surface-3); padding: 3px; border-radius: 12px; gap: 2px; }
.seg-radio label { flex: 1; margin: 0; position: relative; text-align: center; padding: .46rem .6rem; border-radius: 9px; cursor: pointer; font-size: .85rem; color: var(--muted); }
.seg-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-radio label:has(input:checked) { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(19, 32, 51, .14); }
.seg-radio label:has(input:focus-visible) { box-shadow: var(--ring); }
@media (max-width: 720px) {
    .choice { flex-direction: row; align-items: center; gap: .55rem; padding: .62rem .78rem; }
    .choice small { display: none; }
}

/* ── النموذجُ بأقسامٍ مرقّمة: الترتيبُ هنا معلومة (خدمة ← مستلم ← طرد ← مراجعة) ── */
.fsec .card-head h2 { gap: .6rem; }
.fsec-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); font-size: .8rem; font-weight: 700; font-family: var(--font-num); }
.fsec.complete .fsec-n { background: var(--green); color: var(--card); }
.fold { border-top: 1px dashed var(--line); }
.fold > summary { cursor: pointer; padding: .8rem 1.2rem; color: var(--ink-2); font-weight: 600; font-size: .88rem; list-style: none; display: flex; align-items: center; gap: .5rem; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after, .fold-head::after { content: "\F282"; font-family: "bootstrap-icons"; margin-inline-start: auto; color: var(--muted); transition: transform .15s; }
.fold[open] > summary::after, details[open] > .fold-head::after { transform: rotate(180deg); }
.fold > summary small { color: var(--muted); font-weight: 500; }
.fold-body { padding: 0 1.2rem 1.2rem; }
.fold-head { list-style: none; cursor: pointer; border-bottom: 0; }
.fold-head::-webkit-details-marker { display: none; }
details[open] > .fold-head { border-bottom: 1px solid var(--line); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; font-size: .86rem; }
.checklist li { display: flex; align-items: center; gap: .5rem; color: var(--muted); }
.checklist li i { color: var(--faint); }
.checklist li.ok { color: var(--ink); }
.checklist li.ok i { color: var(--green); }
.summary-bar { display: none; }
@media (max-width: 1100px) {
    .summary-bar { display: flex; position: sticky; bottom: 0; z-index: 25; margin: 1rem -.9rem -2rem; padding: .7rem .9rem calc(.7rem + env(safe-area-inset-bottom));
                   background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -8px 20px -14px rgba(19, 32, 51, .3); align-items: center; gap: .7rem; }
    .summary-bar .grow small { display: block; color: var(--muted); font-size: .74rem; }
    .summary-bar .grow b { font-size: 1.12rem; font-family: var(--font-num); }
}
@media (max-width: 991px) {
    body.app .summary-bar { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: .7rem; }
}

/* ── الإسناد: طابورٌ مجمَّعٌ بالعجلة، وكباتنٌ بحمولتهم ── */
.dq-group { padding: .55rem 1.2rem; font-size: .76rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); display: flex; gap: .5rem; align-items: center; }
.dq-group b { margin-inline-start: auto; font-family: var(--font-num); }
.dq { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .3rem .75rem; align-items: center; padding: .78rem 1.2rem; border-bottom: 1px solid var(--line); margin: 0; font-weight: 500; cursor: pointer; }
.dq:hover { background: var(--surface-2); }
.dq:has(input:checked) { background: var(--brand-50); }
.dq input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.dq-main { min-width: 0; }
.dq-main b { font-family: var(--font-num); font-weight: 600; }
.dq-main small { display: block; color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dq-sug .btn { font-weight: 600; }
.roster { display: grid; }
.rk { display: flex; gap: .7rem; align-items: center; padding: .72rem 1.2rem; border-bottom: 1px solid var(--line); margin: 0; cursor: pointer; font-weight: 500; }
.rk:hover { background: var(--surface-2); }
.rk:has(input:checked) { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand); }
[dir="rtl"] .rk:has(input:checked) { box-shadow: inset -3px 0 0 var(--brand); }
.rk input { width: 18px; height: 18px; accent-color: var(--brand); flex: 0 0 auto; }
.assign-bar { padding: .9rem 1.2rem; border-top: 1px solid var(--line); display: grid; gap: .5rem; position: sticky; bottom: 0; background: var(--card); border-radius: 0 0 var(--radius) var(--radius); }
.assign-bar .hint { margin: 0; text-align: center; }
@media (max-width: 720px) {
    .dq { grid-template-columns: auto minmax(0, 1fr); }
    .dq-sug { grid-column: 2; }
}

/* ── الخريطةُ الحيّة: الخريطةُ الشاشةُ كلُّها، واللوحُ يطفو فوقها على الحاسوب ── */
.map-wrap { position: relative; }
.map-wrap .map-lg { border-radius: var(--radius); }
.map-panel { display: grid; gap: .8rem; }
.map-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.map-stats div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .65rem; }
.map-stats small { display: block; color: var(--muted); font-size: .72rem; font-weight: 600; }
.map-stats b { font-size: 1.15rem; font-family: var(--font-num); font-weight: 600; }
.layer-toggles { display: flex; gap: .4rem; flex-wrap: wrap; }
.layer-toggles label { margin: 0; display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; font-weight: 600; cursor: pointer; background: var(--card); }
.layer-toggles label:has(input:not(:checked)) { color: var(--muted); background: var(--surface-2); }
.layer-toggles input { accent-color: var(--brand); }
@media (min-width: 1101px) {
    .map-wrap .map-panel { position: absolute; top: 1rem; inset-inline-end: 1rem; width: 330px; max-height: calc(100% - 2rem); z-index: 500; overflow: hidden; display: flex; flex-direction: column; }
    .map-wrap .map-panel .list-compact { flex: 1; min-height: 0; max-height: none; }
}
.label-like { font-weight: 600; font-size: .84rem; color: var(--ink-2); display: block; margin-bottom: .35rem; }

/* ── أدواتُ البطاقة، وشريطُ المعلومات، والمدّة ── */
.card-tools { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; padding: .85rem 1.2rem; border-bottom: 1px solid var(--line); }
.card-tools .field { width: auto; flex: 0 1 auto; }
.card-tools .grow { flex: 1 1 auto; }
.info-strip { display: flex; gap: .4rem 1.2rem; flex-wrap: wrap; align-items: center; font-size: .86rem; color: var(--ink-2); }
.info-strip b, .info-strip .ltr { font-family: var(--font-num); }
code.reveal { font-size: 1.05rem; font-weight: 700; background: var(--card); color: var(--ink); padding: .1rem .5rem; border-radius: var(--radius-xs); border: 1px solid var(--line); }
.period { align-items: center; }
.period-range { display: inline-flex; align-items: center; gap: .4rem; flex: 0 1 auto; }
.period-range .field { width: auto; }
.period-range i { color: var(--faint); }
@media (max-width: 720px) {
    /* ★ أربعُ مدّاتٍ لا تتّسع لسطرٍ على ٣٢٠ — شبكةٌ ٢×٢ */
    .period .seg { display: grid; grid-template-columns: 1fr 1fr; flex: 1 1 100%; min-width: 0; }
    /* 🚨 حقلُ التاريخ له عرضٌ ذاتيٌّ كبير لا يتنازل عنه المرنُ إلّا بعرض صفر — فاض ٣٦ بكسلًا على ٣٢٠ */
    .period-range { flex: 1 1 100%; min-width: 0; }
    .period-range .field { flex: 1 1 0; width: 0; min-width: 0; }
    .hbar { grid-template-columns: minmax(0, 7rem) minmax(0, 1fr) auto; }
}

/* ── أقراصُ تنقّلٍ داخل صفحة (تختلف عن تبويبات القسم في الرأس) ── */
.subnav { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; margin-bottom: 1.2rem; padding-bottom: .1rem; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { display: inline-flex; align-items: center; gap: .4rem; padding: .42rem .85rem; border-radius: 999px; border: 1px solid var(--card-line); background: var(--card);
            color: var(--ink-2); font-weight: 600; font-size: .84rem; white-space: nowrap; }
.subnav a i { color: var(--muted); }
.subnav a:hover { border-color: var(--line-2); text-decoration: none; }
.subnav a.active { background: var(--inv-bg); border-color: var(--inv-bg); color: var(--inv-ink); }
.subnav a.active i { color: var(--inv-muted); }

/* ── مفتاحُ تشغيلٍ لخيارٍ نعم/لا (خانةُ اختيارٍ حقيقيّة تعمل بلا سكربت) ── */
.toggle { display: flex; gap: .9rem; align-items: flex-start; padding: .9rem 0; border-bottom: 1px solid var(--line); margin: 0; font-weight: 500; cursor: pointer; }
.toggle:last-child { border-bottom: 0; }
.toggle .grow b { display: block; font-weight: 600; color: var(--ink); font-size: .92rem; }
.toggle .grow small { color: var(--muted); font-size: .8rem; }
.toggle input { appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer;
                transition: background .15s; margin: .1rem 0 0; }
.toggle input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: inset-inline-start .15s; }
.toggle input:checked { background: var(--brand); }
.toggle input:checked::after { inset-inline-start: 21px; }
.toggle input:focus-visible { outline: 0; box-shadow: var(--ring); }
.savebar { position: sticky; bottom: 0; z-index: 20; display: flex; gap: .7rem; align-items: center; justify-content: flex-end; padding: .8rem 1rem; margin-top: 1.1rem;
           background: var(--topbar-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--card-line); border-radius: var(--radius); box-shadow: var(--shadow); }
.savebar .hint { margin-block: 0; margin-inline: 0 auto; }
@media (max-width: 991px) { body.app .savebar { bottom: calc(var(--tabbar-h) + .5rem + env(safe-area-inset-bottom)); } }

/* ── بطاقاتُ الأدوار والاختيار ── */
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: .8rem; }
.role-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1rem; display: grid; gap: .3rem; background: var(--surface-2); }
.role-card b { display: flex; align-items: center; gap: .45rem; }
.role-card p { margin: 0; color: var(--muted); font-size: .84rem; }
.role-card .n { margin-inline-start: auto; font-family: var(--font-num); font-size: .78rem; color: var(--muted); font-weight: 600; }
form.inline { display: inline; }
.settings-form { max-width: 920px; }
.scan-box { margin-bottom: 1.1rem; border-style: dashed; border-color: var(--line-2); }
.scan-row { display: flex; gap: .5rem; margin-top: .5rem; }
.scan-row .field { flex: 1; font-size: 1.05rem; font-family: var(--font-num); }
.company-pick { width: min(640px, 100%); }
.pick-item { display: flex; gap: .7rem; align-items: center; padding: .72rem .95rem; border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 0; }
.pick-item:hover { background: var(--surface-2); }

/* ── يحتاج انتباهك (صفحة) ── */
.attn-list { display: grid; gap: .6rem; }
.attn-row { display: flex; align-items: center; gap: .85rem; padding: .9rem 1.1rem; color: var(--ink); }
.attn-row:hover { text-decoration: none; border-color: var(--line-2); }
.attn-row .grow b { font-weight: 600; }
.attn-count { font-size: 1.3rem; font-weight: 600; }
.attn-go { color: var(--faint); }

/* ═══════════════ عناصرُ الهاتف المشتركة (الكابتن والتتبّع) ═══════════════ */
.m-big { min-height: 52px; font-size: 1rem; border-radius: var(--radius); }
.m-profile { display: flex; gap: .9rem; align-items: center; }
.m-profile .grow b { display: block; font-size: 1.1rem; }
.m-profile .grow small { display: block; color: var(--muted); }
.m-prefs .seg-block { margin: 0 0 .4rem; }
.m-prefs .menu-label { padding-inline: 0; }
.m-prefs .menu-item { padding-inline: 0; }
.m-section-title { font-size: .95rem; font-weight: 600; margin: .4rem 0 .6rem; display: flex; align-items: center; gap: .5rem; font-family: var(--font-head); }
.m-section-title .count { margin-inline-start: auto; font-size: .78rem; color: var(--muted); font-family: var(--font-num); }
.duty { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); margin: 0; }
.duty .grow b { display: block; font-size: .95rem; }
.duty .grow small { color: var(--muted); font-size: .8rem; }
.duty-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 1.15rem; flex: 0 0 auto; }
.duty.on .duty-ic { background: var(--green-bg); color: var(--green); }
.duty.off .duty-ic { background: var(--slate-bg); color: var(--slate); }
/* بطاقةُ المهمّة: الرقمُ والحالة، ثمّ المستلمُ والعنوان، ثمّ المبلغ — شريطُ لونٍ بحالتها */
.task { position: relative; display: grid; gap: .3rem; background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); padding: .95rem 1.05rem .95rem 1.1rem;
        margin-bottom: .75rem; color: var(--ink); box-shadow: var(--shadow); }
.task:hover { text-decoration: none; border-color: var(--brand); }
.task::before { content: ""; position: absolute; inset-block: .75rem; inset-inline-start: 0; width: 4px; border-radius: 0 4px 4px 0; background: var(--line-2); }
[dir="rtl"] .task::before { border-radius: 4px 0 0 4px; }
.task.t-out_for_delivery::before { background: var(--violet); } .task.t-picked_up::before, .task.t-in_transit::before { background: var(--indigo); }
.task.t-assigned::before { background: var(--blue); } .task.t-failed::before { background: var(--red); } .task.t-returning::before { background: var(--orange); }
.task.t-delivered::before { background: var(--green); }
.task-top { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.task-trk { font-family: var(--font-num); font-weight: 600; display: inline-flex; align-items: center; gap: .4rem; }
.seq { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--inv-bg); color: var(--inv-ink); font-size: .74rem; font-weight: 700; font-family: var(--font-num); }
.task-name { font-weight: 600; font-size: .98rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.task-addr { display: flex; gap: .45rem; color: var(--ink-2); font-size: .9rem; }
.task-addr i { color: var(--muted); }
.task-money { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .3rem; padding-top: .55rem; border-top: 1px dashed var(--line); }
.task-money span { color: var(--muted); font-size: .82rem; }
.task-money b { font-size: 1.05rem; font-family: var(--font-num); }
.task .chev { position: absolute; top: 50%; inset-inline-end: .7rem; transform: translateY(-50%); color: var(--faint); }
.m-amount { text-align: center; padding: 1rem; border-radius: var(--radius-sm); background: var(--brand-50); }
.m-amount span { display: block; color: var(--ink-2); font-size: .85rem; font-weight: 600; }
.m-amount b { display: block; font-size: 2rem; font-weight: 600; font-family: var(--font-num); line-height: 1.2; }
.m-amount small { color: var(--muted); }
.m-meta { color: var(--muted); font-size: .85rem; margin: 0; }
.m-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.m-quick .btn { flex-direction: column; gap: .15rem; min-height: 58px; font-size: .8rem; }
.m-quick .btn i { font-size: 1.2rem; }
.reason-list { display: grid; gap: .45rem; }
.reason-list .choice { flex-direction: row; align-items: center; gap: .6rem; padding: .78rem .9rem; }

/* ── التتبّعُ العامّ: وجهُ الشركة أمام المستلم ── */
.track-shell { padding-bottom: 2rem; }
.track-hero { background: linear-gradient(160deg, var(--deep-bg), var(--deep-bg-2)); color: var(--deep-ink); padding: 1.4rem 1rem 3.2rem; }
.track-hero a { color: var(--deep-ink); }
.track-hero .muted { color: var(--deep-muted); }
.track-hero .brand-mark, .track-hero .brand-mark.brand-soft { background: var(--deep-hover); color: var(--deep-ink); }
.track-brand { display: flex; align-items: center; gap: .6rem; }
.track-lang { margin-inline-start: auto; font-size: .85rem; }
.track-search { display: flex; gap: .5rem; margin-top: 1rem; }
.track-search .field { flex: 1; background: var(--card); }
.track-card { margin: -2.2rem 1rem 1rem; }
.track-head { display: flex; gap: .8rem; align-items: flex-start; }
.track-head h1 { font-size: 1.22rem; font-weight: 600; margin: .1rem 0 .2rem; }
.track-head small { color: var(--muted); font-weight: 600; }
.track-head .duty-ic { width: 44px; height: 44px; }
.track-live { margin: 0 0 .7rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 var(--green-bg); animation: live 1.6s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 var(--green-line); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.track-contact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.track-foot { text-align: center; color: var(--muted); font-size: .78rem; margin: .5rem 0 0; }
.track-status .stepper small { font-size: .66rem; }
.qr-box { margin-top: .6rem; text-align: center; background: #FFFFFF; border-radius: var(--radius-sm); padding: .6rem; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .3rem; margin: .8rem 0; }
.steps span { height: 6px; border-radius: 3px; background: var(--line); }
.steps span.on { background: var(--brand); }
.step-on { color: var(--brand); } .step-off { color: var(--muted); }

/* ═══ المستلمُ يعدّل موعده ومكانه ═══ */
.recip-card { margin-bottom: 1.1rem; }
.recip-card.unseen { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.recip-note { border-style: solid; border-color: var(--blue-bg); background: var(--blue-bg); color: var(--ink); }
.recip-form .choice-grid { grid-template-columns: repeat(auto-fill, minmax(min(96px, 100%), 1fr)); }
.recip-form .choice { padding: .55rem .6rem; text-align: center; align-items: center; font-size: .85rem; }
.recip-form .choice small { display: block; }
.recip-form .choice:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.recip-done { display: flex; gap: .6rem; align-items: center; }

/* ═══ مواعيدُ التوصيل ═══ */
.slot-picker { display: grid; gap: .8rem; }
.slot-grid { grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr)); }
.slot-grid .choice { text-align: center; align-items: center; }
.slot-grid .choice small { display: block !important; }
.choice.is-full { border-style: dashed; }
.choice.is-full small { color: var(--red); font-weight: 700; }
.slot-override { display: grid; gap: .5rem; padding: .75rem; border-radius: var(--radius-sm); background: var(--amber-bg); border: 1px solid var(--amber-line); }
.slot-override .check { margin: 0; color: var(--ink); }
.occ th, .occ td { text-align: center; }
.occ th:first-child, .occ td:first-child { text-align: start; }
.occ-cell { min-width: 92px; }
.occ-cell small { color: var(--muted); margin-inline-start: .2rem; }
.occ-cell .bar-track { height: 5px; margin: .35rem auto 0; max-width: 80px; }
.occ-cell.full b { color: var(--red); }
.occ-cell.past { opacity: .5; }
.day-grid { grid-template-columns: repeat(auto-fill, minmax(min(78px, 100%), 1fr)); }
.day-grid .choice { padding: .5rem; text-align: center; align-items: center; font-size: .82rem; }
.zone-cap { display: grid; grid-template-columns: minmax(0, 1fr) 7rem; gap: .5rem; align-items: center; margin-top: .4rem; font-size: .88rem; }
.occ-days { flex-wrap: wrap; }
@media (max-width: 720px) {
    .occ-days { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
    .card-head .actions:has(.occ-days) { width: 100%; margin-inline-start: 0; }
    .occ-cell { min-width: 0; text-align: end !important; }
    .occ-cell .bar-track { margin: .25rem 0 0; display: block; width: 80px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ★ «hidden» يغلب كلَّ display: قسمٌ مخفيٌّ بصنفٍ يعلن grid يظهر وإلّا — آخرُ قاعدةٍ في الملفّ، لا تُحذف */
[hidden] { display: none !important; }
