/* دفتر التشغيل — ledger green on calm neutrals.
   Spacing scale: 4 · 8 · 12 · 16 · 20 · 24 · 32. Radii: 8 (controls) · 12 (tiles) · 16 (cards).
   Everything uses logical properties (inline-start/end) so Arabic (RTL) and English (LTR) both work. */
:root, [data-bs-theme="light"] {
  --app-font: "IBM Plex Sans Arabic", "Inter", "Segoe UI", Tahoma, sans-serif;
  --app-display: "Readex Pro", "IBM Plex Sans Arabic", sans-serif;
  --bs-body-font-family: var(--app-font); --bs-body-font-size: .9rem; --bs-body-color: #17201B; --bs-secondary-color: #66736C;
  --bs-primary: #0B5D45; --bs-primary-rgb: 11, 93, 69;
  --bs-primary-bg-subtle: #E3F2EA; --bs-primary-text-emphasis: #07402F; --bs-primary-border-subtle: #A8D5C1;
  --bs-link-color: #0B5D45; --bs-link-color-rgb: 11, 93, 69; --bs-link-hover-color: #07402F;
  --bs-body-bg: #F5F6F3; --bs-tertiary-bg: #F0F2EE; --bs-border-color: #E3E6E0; --bs-border-radius: 10px;
  --surface: #FFFFFF; --surface-2: #FAFBF9; --line: #E3E6E0;
  --sidebar: #0D1C17; --sidebar-2: #15291F; --sidebar-ink: #C9DAD2; --sidebar-muted: #7E958B;
  --c1: #0B5D45; --c2: #2F6FB3; --c3: #D07A2D; --c4: #8455B8; --c5: #2A9DA8; --c6: #C2457A; --c7: #7C9A2E; --c8: #8D6E4E;
  --ok: #138A5B; --ok-bg: #E2F4EB; --bad: #C8323F; --bad-bg: #FBE7E8; --warn: #B7791F; --warn-bg: #FCF1DC; --info: #2F6FB3; --info-bg: #E5EEF9; --muted-bg: #EEF0EC;
  --shadow: 0 1px 2px rgb(16 32 24 / .04), 0 2px 8px rgb(16 32 24 / .04);
  --shadow-lg: 0 12px 32px rgb(16 32 24 / .12);
}
[data-bs-theme="dark"] {
  --bs-body-color: #E3ECE7; --bs-secondary-color: #8E9C95;
  --bs-primary: #3CC08F; --bs-primary-rgb: 60, 192, 143; --bs-primary-bg-subtle: #10342A; --bs-primary-text-emphasis: #8BE3C0; --bs-primary-border-subtle: #1E5A44;
  --bs-link-color: #5ED3A6; --bs-link-color-rgb: 94, 211, 166; --bs-link-hover-color: #8BE3C0;
  --bs-body-bg: #0A0F0D; --bs-tertiary-bg: #141C18; --bs-border-color: #202B26;
  --surface: #101714; --surface-2: #131B17; --line: #202B26;
  --sidebar: #070C0A; --sidebar-2: #12201A;
  --c1: #3CC08F; --c2: #6EA6E6; --c3: #EB9E5A; --c4: #B58CE6; --c5: #5CC9D4; --c6: #EC7DAA; --c7: #AECB5A; --c8: #C9A47E;
  --ok: #4CD39B; --ok-bg: #0F3326; --bad: #F06A74; --bad-bg: #3A1519; --warn: #EDB453; --warn-bg: #3A2A0C; --info: #7DB3EE; --info-bg: #12263D; --muted-bg: #18211D;
  --shadow: none; --shadow-lg: 0 16px 40px rgb(0 0 0 / .5);
}

/* ---------- base ---------- */
body { font-family: var(--app-font); background: var(--bs-body-bg); color: var(--bs-body-color); -webkit-font-smoothing: antialiased; font-size: .9rem; line-height: 1.6; }
h1, h2, h3, .h1, .h2, .h3, .h4, .h5, .h6, .page-title, .kpi-value, .brand-name { font-family: var(--app-display); }
.num { font-variant-numeric: tabular-nums; font-family: var(--app-display); }
.min-w-0 { min-width: 0; }
a { text-decoration: none; } a:hover { text-decoration: underline; }
.btn { border-radius: 10px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn i { line-height: 1; }
.btn-sm { border-radius: 8px; }
.btn-primary { --bs-btn-bg: var(--bs-primary); --bs-btn-border-color: var(--bs-primary); --bs-btn-hover-bg: #094C38; --bs-btn-hover-border-color: #094C38; --bs-btn-active-bg: #07402F; --bs-btn-disabled-bg: var(--bs-primary); --bs-btn-disabled-border-color: var(--bs-primary); }
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #04150F; --bs-btn-hover-color: #04150F; --bs-btn-hover-bg: #5ED3A6; --bs-btn-hover-border-color: #5ED3A6; --bs-btn-active-color: #04150F; --bs-btn-disabled-color: #04150F; }
.btn-outline-primary { --bs-btn-color: var(--bs-primary); --bs-btn-border-color: var(--bs-primary-border-subtle); --bs-btn-hover-bg: var(--bs-primary); --bs-btn-hover-border-color: var(--bs-primary); --bs-btn-active-bg: var(--bs-primary); }
.btn-outline-secondary { --bs-btn-color: var(--bs-body-color); --bs-btn-border-color: var(--line); --bs-btn-bg: var(--surface); --bs-btn-hover-bg: var(--bs-tertiary-bg); --bs-btn-hover-color: var(--bs-body-color); --bs-btn-hover-border-color: var(--line); --bs-btn-active-bg: var(--bs-tertiary-bg); --bs-btn-active-color: var(--bs-body-color); }
.btn-light { --bs-btn-bg: var(--bs-tertiary-bg); --bs-btn-border-color: var(--bs-tertiary-bg); --bs-btn-color: var(--bs-body-color); --bs-btn-hover-bg: var(--muted-bg); }
.btn-tool { height: 36px; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); color: var(--bs-body-color); font-size: .85rem; white-space: nowrap; }
.btn-tool:hover, .btn-tool[aria-expanded="true"] { background: var(--bs-tertiary-bg); border-color: var(--line); color: var(--bs-body-color); }
.btn-tool kbd { font-size: 10.5px; background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; font-family: var(--app-font); }
.btn-icon { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); background: var(--surface); }
.text-bg-primary { background-color: var(--bs-primary) !important; }
.form-control, .form-select { border-radius: 10px; border-color: var(--line); background-color: var(--surface); }
.form-control-sm, .form-select-sm { border-radius: 8px; }
.input-group > :first-child { border-start-start-radius: 10px; border-end-start-radius: 10px; }
.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--bs-primary-border-subtle); box-shadow: 0 0 0 .2rem rgb(var(--bs-primary-rgb) / .16); }
.form-label { font-weight: 500; font-size: .85rem; margin-bottom: 6px; }
.form-text { font-size: .78rem; }
.progress-bar { background-color: var(--bs-primary); }
.nav-pills .nav-link.active { background: var(--bs-primary); }
[data-bs-theme="dark"] .nav-pills .nav-link.active { color: #04150F; }
.dropdown-menu { border-color: var(--line); border-radius: 12px; padding: 6px; box-shadow: var(--shadow-lg); font-size: .875rem; }
.dropdown-item { border-radius: 8px; padding: 7px 10px; display: flex; align-items: center; gap: 8px; }
.dropdown-item.active, .dropdown-item:active { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }
.badge { font-weight: 600; }
.modal-content { border-radius: 18px; border-color: var(--line); background: var(--surface); }
.modal-header, .modal-footer { border-color: var(--line); padding: 16px 20px; }
.modal-body { padding: 20px; }
.modal-footer { gap: 8px; } .modal-footer > * { margin: 0; }
[dir="ltr"] .dir-flip { transform: scaleX(-1); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: 14px 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 58px; }
.card-body { padding: 18px; }
.card-title-h { font-size: .95rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; font-family: var(--app-display); }
.card-title-h > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-title-h > i { width: 30px; height: 30px; border-radius: 9px; background: var(--bs-primary-bg-subtle); color: var(--bs-primary); display: grid; place-items: center; font-size: 13px; flex: none; }
.card-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.g-3 { --bs-gutter-x: 20px; --bs-gutter-y: 20px; }
.row.g-3 > [class*="col"] > .card + .card { margin-top: 20px; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1000px 520px at 85% -10%, rgb(var(--bs-primary-rgb) / .16), transparent 60%), var(--bs-body-bg); }
.auth-card { width: min(440px, 100%); border-radius: 22px; background: var(--surface); }
.brand-mark { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(140deg, #0B5D45, #14906A); color: #fff; display: grid; place-items: center; font-size: 24px; box-shadow: 0 8px 24px rgb(11 93 69 / .3); }
.brand-mark.sm { width: 38px; height: 38px; border-radius: 11px; font-size: 16px; box-shadow: none; flex: none; }

/* ---------- layout ---------- */
#app { display: flex; min-height: 100vh; }
.sidebar { width: 260px; flex: none; background: var(--sidebar); color: var(--sidebar-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
@media (max-width: 991.98px) { .sidebar { position: fixed; height: 100%; width: min(300px, 86vw) !important; } }
.sidebar.offcanvas-lg { background-color: var(--sidebar) !important; color: var(--sidebar-ink); }
@media (min-width: 992px) { .sidebar.offcanvas-lg { display: flex !important; flex-direction: column; } }
.sidebar-head { padding: 18px 18px 16px; border-bottom: 1px solid rgb(255 255 255 / .06); }
.brand-name { color: #fff; font-weight: 700; font-size: 16px; line-height: 1.3; }
.brand-sub { font-size: 12px; color: var(--sidebar-muted); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; scrollbar-width: thin; scrollbar-color: #24382f transparent; }
.nav-group { font-size: 11px; color: var(--sidebar-muted); padding: 16px 10px 6px; font-weight: 600; letter-spacing: .3px; }
.nav-item-link { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--sidebar-ink); text-decoration: none !important; font-weight: 500; font-size: .875rem; transition: background .15s, color .15s; margin-bottom: 2px; }
.nav-item-link i { width: 18px; text-align: center; opacity: .7; font-size: 14px; }
.nav-item-link:hover { background: var(--sidebar-2); color: #fff; }
.nav-item-link.active { background: rgb(60 192 143 / .14); color: #74E2B8; }
.nav-item-link.active i { opacity: 1; }
.nav-item-link .badge { margin-inline-start: auto; font-size: 11px; min-width: 24px; }
.sidebar-foot { padding: 14px 16px 16px; border-top: 1px solid rgb(255 255 255 / .06); color: #fff; }
.me-row { display: flex; align-items: center; gap: 10px; }
.me-role { font-size: 12px; color: var(--sidebar-muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #1f3a30; color: #8BE3C0; display: grid; place-items: center; font-weight: 700; flex: none; }
.foot-actions { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 6px; margin-top: 12px; }
.foot-btn { height: 34px; border: 0; border-radius: 9px; background: var(--sidebar-2); color: var(--sidebar-ink); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 600; transition: background .15s, color .15s; }
.foot-btn:hover { background: #1d3a2e; color: #fff; }
.foot-btn.danger:hover { background: #4a1a1f; color: #ffb3b9; }
.live-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--sidebar-muted); margin-top: 10px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3CC08F; box-shadow: 0 0 0 3px rgb(60 192 143 / .25); flex: none; }
.live-dot.off { background: #E0A84A; box-shadow: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; background: color-mix(in srgb, var(--bs-body-bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 68px; }
@media (min-width: 992px) { .topbar { padding-inline: 32px; } }
.topbar-title { flex: 1 1 200px; }
.crumb { font-size: 12px; color: var(--bs-secondary-color); line-height: 1.4; }
.crumb a { color: inherit; }
.page-title { font-weight: 700; font-size: 1.3rem; margin: 0; line-height: 1.35; }
.topbar-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-add { height: 36px; padding: 0 14px; }
.content { padding: 24px 16px 120px; display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 1600px; }
@media (min-width: 992px) { .content { padding-inline: 32px; } }
@media (max-width: 575.98px) { .topbar { padding: 10px 12px; gap: 8px; } .topbar-tools { width: 100%; } .topbar-tools > #rangeBox { flex: 1; } .page-title { font-size: 1.1rem; } .lang-btn .lang-name { display: none; } .content { padding-top: 16px; gap: 16px; } }
.range-box { display: flex; align-items: center; gap: 6px; }
.range-btn .range-dates { color: var(--bs-secondary-color); font-size: .8rem; }
.range-menu { width: 300px; }
.page-switch .btn { max-width: 220px; }
.page-switch .btn .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; flex: none; }
.dropdown-item .page-dot { margin: 0; }

/* ---------- KPI cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.kpi-grid.hero { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
@media (min-width: 1200px) { .kpi-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.kpi-grid.mini { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi-link { display: block; color: inherit; text-decoration: none !important; height: 100%; }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, transform .15s; }
.kpi-link:hover .kpi { border-color: var(--bs-primary-border-subtle); }
.kpi-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kpi-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 14px; flex: none; }
.tone-primary { background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }
.tone-success { background: var(--ok-bg); color: var(--ok); }
.tone-danger { background: var(--bad-bg); color: var(--bad); }
.tone-warning { background: var(--warn-bg); color: var(--warn); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-secondary { background: var(--muted-bg); color: var(--bs-secondary-color); }
.kpi-label { font-size: .82rem; color: var(--bs-secondary-color); font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-delta { flex: none; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; font-family: var(--app-display); white-space: nowrap; }
.delta i { font-size: 9px; }
.delta.up { background: var(--ok-bg); color: var(--ok); }
.delta.down { background: var(--bad-bg); color: var(--bad); }
.kpi-value { font-size: 1.45rem; font-weight: 700; letter-spacing: -.3px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.big { padding: 18px 20px; }
.kpi.big .kpi-value { font-size: clamp(1.5rem, 1.2rem + .9vw, 2rem); }
.kpi-grid.mini .kpi { padding: 14px 16px; gap: 6px; }
.kpi-grid.mini .kpi-value { font-size: 1.25rem; }
.cur { font-size: .52em; font-weight: 500; color: var(--bs-secondary-color); margin-inline-start: 4px; letter-spacing: 0; font-family: var(--app-font); }
.kpi-sub { font-size: .78rem; color: var(--bs-secondary-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub a { color: var(--bs-primary); }
@media (max-width: 575.98px) {
  .kpi-grid, .kpi-grid.hero, .kpi-grid.mini { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi, .kpi.big, .kpi-grid.mini .kpi { padding: 12px; gap: 6px; }
  .kpi-icon { width: 28px; height: 28px; font-size: 12px; border-radius: 8px; }
  .kpi-delta { display: none; }
  .kpi-value, .kpi.big .kpi-value, .kpi-grid.mini .kpi-value { font-size: 1.15rem; }
}
.note-line { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: .85rem; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.mini-stats > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; display: flex; flex-direction: column; font-size: .75rem; color: var(--bs-secondary-color); }
.mini-stats b { font-size: 1rem; color: var(--bs-body-color); }

/* ---------- status tiles ---------- */
.st-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.st-tile { border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; background: var(--surface); cursor: pointer; transition: transform .12s, border-color .12s; }
.st-tile:hover { transform: translateY(-2px); border-color: var(--bs-primary-border-subtle); }
.st-tile .n { font-family: var(--app-display); font-size: 1.35rem; font-weight: 700; }
.st-tile .l { font-size: .78rem; color: var(--bs-secondary-color); }

/* ---------- tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--bs-body-color); margin-bottom: 0; font-size: .86rem; }
.table > :not(caption) > * > * { padding: .7rem .9rem; border-bottom-color: var(--line); }
.table thead th { font-size: .75rem; color: var(--bs-secondary-color); font-weight: 600; white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--line); }
.table td { white-space: nowrap; vertical-align: middle; }
.table td.wrap { white-space: normal; min-width: 180px; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table-hover > tbody > tr:hover > *, tbody tr.cursor-pointer:hover > * { --bs-table-bg-state: rgb(var(--bs-primary-rgb) / .045); background-color: rgb(var(--bs-primary-rgb) / .045); }
.table tr.selected > * { --bs-table-bg-state: rgb(var(--bs-primary-rgb) / .09); }
.table-card { overflow: hidden; }
.table-scroll { overflow: auto; max-height: 70vh; }
.card-body > .table-scroll:only-child, .card-body > .table-responsive:only-child { margin: -18px; border-radius: 0 0 16px 16px; }
.card-body > .table-scroll:first-child:not(:only-child), .card-body > .table-responsive:first-child:not(:only-child) { margin: -18px -18px 0; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--bs-body-color); }
.tfoot-row td, tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); }
.st-badge { font-weight: 600; font-size: 11.5px; padding: .4em .75em; display: inline-flex; align-items: center; gap: 5px; }
.text-bg-warning.st-badge { color: #4a3300 !important; }
.row-check { width: 18px; height: 18px; cursor: pointer; }

/* ---------- orders on phones ---------- */
.o-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface); display: flex; gap: 12px; }
.o-card.selected { border-color: var(--bs-primary); box-shadow: 0 0 0 2px rgb(var(--bs-primary-rgb) / .2); }

/* ---------- filters & search ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding-block: 3px; padding-inline: 10px 6px; border-radius: 999px; background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); font-size: .78rem; font-weight: 500; }
.filter-chip button { border: 0; background: transparent; color: inherit; padding: 0 4px; opacity: .7; }
.filter-chip button:hover { opacity: 1; }
.ms-menu { min-width: 250px; max-width: 330px; }
.ms-list { max-height: 270px; overflow-y: auto; }
.ms-wrap .btn { min-width: 110px; justify-content: space-between; }
.search-box { position: relative; }
.search-box > i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--bs-secondary-color); pointer-events: none; }
.search-box > .form-control { padding-inline-start: 36px; }

/* ---------- command palette (global search) ---------- */
.cmdk .modal-dialog { max-width: 640px; margin-top: 10vh; }
.cmdk .modal-content { overflow: hidden; }
.cmdk-input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 18px 16px 18px; padding-inline-start: 48px; font-size: 1rem; background: transparent; box-shadow: none !important; }
.cmdk-head { position: relative; }
.cmdk-head > i { position: absolute; inset-inline-start: 18px; top: 50%; transform: translateY(-50%); color: var(--bs-secondary-color); }
.cmdk-list { max-height: 60vh; overflow-y: auto; padding: 8px; }
.cmdk-group { font-size: 11px; font-weight: 700; color: var(--bs-secondary-color); padding: 10px 10px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: inherit; text-decoration: none !important; }
.cmdk-item > i { width: 30px; height: 30px; border-radius: 8px; background: var(--bs-tertiary-bg); display: grid; place-items: center; font-size: 13px; color: var(--bs-secondary-color); flex: none; }
.cmdk-item .t { font-weight: 600; } .cmdk-item .s { font-size: .78rem; color: var(--bs-secondary-color); }
.cmdk-item.on { background: var(--bs-primary-bg-subtle); }
.cmdk-item.on > i { background: var(--bs-primary); color: #fff; }
.cmdk-foot { border-top: 1px solid var(--line); padding: 8px 14px; font-size: .75rem; color: var(--bs-secondary-color); display: flex; gap: 14px; }
.cmdk-foot kbd { background: var(--bs-tertiary-bg); color: inherit; border: 1px solid var(--line); font-size: 10.5px; }

/* ---------- bulk bar ---------- */
.bulk-bar { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 1050; background: #0E1F19; color: #fff; border-radius: 16px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: min(980px, calc(100% - 24px)); box-shadow: var(--shadow-lg); }
.bulk-bar .form-select { width: auto; min-width: 140px; background-color: #1a3029; color: #fff; border-color: #2c4a3f; }
.bulk-count { background: #3CC08F; color: #04150F; border-radius: 10px; padding: 4px 10px; font-weight: 700; }
@media (min-width: 992px) {
  [dir="rtl"] .bulk-bar { left: calc((100% - 260px) / 2); width: min(980px, calc(100% - 260px - 32px)); }
  [dir="ltr"] .bulk-bar { left: calc(260px + (100% - 260px) / 2); width: min(980px, calc(100% - 260px - 32px)); }
}

/* ---------- timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding-block: 0 16px; padding-inline: 30px 0; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 8px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; inset-inline-start: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; color: #fff; }

/* ---------- incentives ---------- */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 16px; padding-top: 8px; }
.podium-step { width: min(220px, 32%); display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.podium-avatar { position: relative; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 700; font-family: var(--app-display); background: var(--bs-primary-bg-subtle); color: var(--bs-primary); border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--bs-primary-border-subtle); }
.podium-step.p1 .podium-avatar { width: 80px; height: 80px; font-size: 32px; box-shadow: 0 0 0 3px #D4A017; }
.podium-step.p2 .podium-avatar { box-shadow: 0 0 0 3px #9AA5AE; } .podium-step.p3 .podium-avatar { box-shadow: 0 0 0 3px #B87333; }
.podium-crown { position: absolute; top: -22px; color: #D4A017; font-size: 22px; }
.podium-block { width: 100%; margin-top: 10px; border-radius: 12px 12px 0 0; display: grid; place-items: center; font-family: var(--app-display); font-weight: 700; font-size: 26px; color: #fff; }
.podium-step.p1 .podium-block { height: 96px; background: linear-gradient(180deg, #D4A017, #b0840f); }
.podium-step.p2 .podium-block { height: 70px; background: linear-gradient(180deg, #9AA5AE, #7b868f); }
.podium-step.p3 .podium-block { height: 52px; background: linear-gradient(180deg, #C58447, #9d6533); }
.badge-ach { font-size: 10.5px; padding: .35em .55em; }
.tier-track { position: relative; height: 8px; border-radius: 99px; background: var(--muted-bg); }
.tier-fill { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, var(--bs-primary), #5ED3A6); }
[dir="rtl"] .tier-fill { background: linear-gradient(270deg, var(--bs-primary), #5ED3A6); }
.tier-mark { position: absolute; top: -3px; width: 4px; height: 14px; border-radius: 2px; background: var(--line); transform: translateX(-50%); }
[dir="rtl"] .tier-mark { transform: translateX(50%); }
.tier-mark.on { background: #D4A017; }
.my-inc { background: linear-gradient(135deg, rgb(var(--bs-primary-rgb) / .10), transparent 60%), var(--surface); border-color: var(--bs-primary-border-subtle); }
.hall { display: flex; flex-direction: column; gap: 10px; }
.hall-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.hall-row:last-child { border-bottom: 0; padding-bottom: 0; }
.hall-m { width: 100%; }
.hall-w { font-size: .85rem; }
.rules-list li { margin-bottom: 6px; }

/* ---------- misc ---------- */
.empty-state h5 { font-size: 1rem; }
.empty-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--bs-primary-bg-subtle); color: var(--bs-primary); display: inline-grid; place-items: center; font-size: 24px; }
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 210px; }
.chart-box.lg { height: 340px; }
.list-cat { display: grid; grid-template-columns: minmax(0, 1fr) 1.6fr auto; gap: 12px; align-items: center; font-size: .85rem; padding: 7px 0; }
.alert-line { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: .85rem; }
.alert-line i { margin-top: 4px; }
.ai-out { white-space: pre-wrap; line-height: 1.9; }
.section-tabs { overflow-x: auto; flex-wrap: nowrap; gap: 4px; scrollbar-width: none; }
.section-tabs .nav-link { white-space: nowrap; color: var(--bs-secondary-color); font-weight: 600; padding: 10px 12px; display: inline-flex; align-items: center; gap: 8px; }
.section-tabs .nav-link.active, .nav-underline .nav-link.active { color: var(--bs-primary); border-bottom-color: var(--bs-primary); }
.nav-underline { --bs-nav-underline-border-width: 2px; }
.alert { border-radius: 12px; }
.toast { border-radius: 12px; }
.cursor-pointer { cursor: pointer; }
.offcanvas.order-drawer { width: min(560px, 100vw); background: var(--surface); }
.drawer-label { font-size: 12px; color: var(--bs-secondary-color); }
.dropzone { border: 2px dashed var(--line); border-radius: 16px; padding: 32px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--bs-primary); background: rgb(var(--bs-primary-rgb) / .05); }
.step-pills .badge { font-size: 12.5px; padding: .5em .9em; }
.page-card { transition: border-color .15s, transform .15s; }
.page-card:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- printable reports ---------- */
.report-sheet { background: #fff; color: #1b2420; padding: 28px; border-radius: 12px; }
.report-sheet table { font-size: 12px; }
.report-sheet .table > :not(caption) > * > * { padding: .45rem .55rem; color: #1b2420; }
.report-sheet .table thead th { background: #eef2ee; color: #3b4a43; position: static; }
.report-sheet h3 { font-size: 15px; margin: 18px 0 8px; color: #0B5D45; }
.report-head { border-bottom: 3px solid #0B5D45; padding-bottom: 12px; margin-bottom: 16px; }
.r-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.r-kpi { border: 1px solid #dfe5df; border-radius: 8px; padding: 8px 10px; }
.r-kpi .l { font-size: 11px; color: #5f6d66; } .r-kpi .v { font-size: 16px; font-weight: 700; font-family: var(--app-display); }
.pdf-mode .report-sheet { box-shadow: none; }
@media print { .sidebar, .topbar, .no-print, .bulk-bar, .toast-container { display: none !important; } .content { padding: 0 !important; } body { background: #fff; } .report-sheet { padding: 0; } }
html[lang="en"] { --app-font: "Inter", "IBM Plex Sans Arabic", "Segoe UI", sans-serif; --app-display: "Inter", "Readex Pro", sans-serif; }
html[lang="en"] .kpi-value, html[lang="en"] .page-title { letter-spacing: -.5px; }
