/* ANEW IMS — design tokens, the app shell (sidebar from 1024px) and the overview widgets.
   Light first; dark follows Tailwind's `.dark` class on <html>. No JS needed for the layout:
   the sidebar is the same #main-nav (tab buttons, roles and badges unchanged), restyled. */
:root {
  --brand: #184e7c;
  --brand-600: #1d5f97;
  --brand-50: #eaf2fb;
  --accent: #f59e0b;
  --accent-50: #fff6e5;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --glass: rgba(255, 255, 255, 0.78);
  --border: #e4e9f2;
  --text: #0f1b2d;
  --muted: #64748b;
  --success: #0f9f6e;
  --success-50: #e7f7f0;
  --danger: #dc3545;
  --danger-50: #fdecee;
  --info: #2563eb;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.04), 0 8px 24px rgba(15, 27, 45, 0.06);
  --sidebar: 248px;
  --sidebar-mini: 72px;
  --grad: linear-gradient(135deg, #184e7c 0%, #2563a6 100%);
  --ease: cubic-bezier(.22, .61, .36, 1);
}
/* Dark: the Nimbus palette — deep night blue, glass panels, blue → violet accent. */
.dark {
  --brand: #6d8bff;
  --brand-600: #8ea4ff;
  --brand-50: rgba(109, 139, 255, 0.14);
  --grad: linear-gradient(135deg, #6d8bff 0%, #b06dff 100%);
  --accent: #fbbf24;
  --accent-50: rgba(251, 191, 36, 0.14);
  --bg: #070912;
  --surface: rgba(22, 27, 48, 0.55);
  --glass: rgba(14, 18, 34, 0.62);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8ecff;
  --muted: #9aa3c7;
  --success: #34d399;
  --success-50: #0f2a22;
  --danger: #f87171;
  --danger-50: #2c1518;
  --info: #7aa2ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

/* ---------------------------------------------------------------- page, cards, dark-mode safety net */
/* Ambient light behind everything: three large blurred glows drifting slowly (<div class="bg-blobs">).
   Light mode: soft brand tints; dark mode: the Nimbus blue / violet / sky glows. */
body { background: var(--bg) !important; color: var(--text); }
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.dark .bg-blobs { background: radial-gradient(120% 120% at 100% 0%, #0c1020 0%, #070912 55%); }
.bg-blobs i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .28; animation: blob-float 24s ease-in-out infinite; }
.bg-blobs i:nth-child(1) { width: 480px; height: 480px; background: #7aa7d6; top: -140px; inset-inline-start: -80px; }
.bg-blobs i:nth-child(2) { width: 520px; height: 520px; background: #f6c77a; bottom: -180px; inset-inline-end: -80px; animation-delay: -8s; opacity: .22; }
.bg-blobs i:nth-child(3) { width: 360px; height: 360px; background: #9ec5ff; top: 40%; left: 45%; animation-delay: -16s; opacity: .18; }
.dark .bg-blobs i { opacity: .5; }
.dark .bg-blobs i:nth-child(1) { background: #3b5bff; }
.dark .bg-blobs i:nth-child(2) { background: #9b3bff; opacity: .42; }
.dark .bg-blobs i:nth-child(3) { background: #00d4ff; opacity: .26; }
@keyframes blob-float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(30px, -20px); } }

.app-card { background: var(--surface) !important; border-color: var(--border) !important; box-shadow: var(--shadow); }
/* Dark: frosted glass panels over the glows (blur kept moderate for older PCs and phones). */
.dark .app-card, .dark .ov-card, .dark .modal-sheet, .dark #erp-modal-panel { backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%); }
.dark .modal-sheet, .dark #erp-modal-panel { background: rgba(16, 20, 38, 0.92) !important; border-color: var(--border) !important; }
.dark .app-card:hover, .dark .ov-card:hover { border-color: rgba(255, 255, 255, 0.14) !important; }
/* Older markup without dark: variants — light text on light ground was unreadable. */
.dark .bg-white:not(.mobile-nav-scan), .dark .bg-slate-50, .dark .bg-slate-100, .dark .bg-gray-50, .dark .bg-gray-100 { background-color: var(--surface) !important; }
.dark .text-slate-900, .dark .text-slate-800, .dark .text-slate-700, .dark .text-gray-900, .dark .text-gray-800, .dark .text-gray-700, .dark .text-black { color: var(--text) !important; }
.dark .text-slate-600, .dark .text-slate-500, .dark .text-gray-600, .dark .text-gray-500 { color: var(--muted) !important; }
.dark .border-slate-100, .dark .border-slate-200, .dark .border-slate-300, .dark .border-gray-200, .dark .divide-slate-100 > * + *, .dark .divide-slate-200 > * + * { border-color: var(--border) !important; }
.dark input, .dark select, .dark textarea { color: var(--text); }
/* Coloured text written for a light page (no dark: variant of its own) is lightened in dark mode. */
.dark [class*="text-brand-6"]:not([class*="dark:text-"]), .dark [class*="text-brand-7"]:not([class*="dark:text-"]), .dark [class*="text-brand-8"]:not([class*="dark:text-"]) { color: #8fbdec !important; }
.dark [class*="text-blue-6"]:not([class*="dark:text-"]), .dark [class*="text-blue-7"]:not([class*="dark:text-"]), .dark [class*="text-blue-8"]:not([class*="dark:text-"]) { color: #93b4ff !important; }
.dark [class*="text-emerald-6"]:not([class*="dark:text-"]), .dark [class*="text-emerald-7"]:not([class*="dark:text-"]), .dark [class*="text-emerald-8"]:not([class*="dark:text-"]), .dark [class*="text-green-7"]:not([class*="dark:text-"]) { color: #5ee0aa !important; }
.dark [class*="text-amber-6"]:not([class*="dark:text-"]), .dark [class*="text-amber-7"]:not([class*="dark:text-"]), .dark [class*="text-amber-8"]:not([class*="dark:text-"]), .dark [class*="text-orange-7"]:not([class*="dark:text-"]) { color: #fcc95a !important; }
.dark [class*="text-rose-6"]:not([class*="dark:text-"]), .dark [class*="text-rose-7"]:not([class*="dark:text-"]), .dark [class*="text-rose-8"]:not([class*="dark:text-"]), .dark [class*="text-red-6"]:not([class*="dark:text-"]), .dark [class*="text-red-7"]:not([class*="dark:text-"]) { color: #fb9aa4 !important; }
.dark [class*="text-purple-7"]:not([class*="dark:text-"]), .dark [class*="text-violet-7"]:not([class*="dark:text-"]), .dark [class*="text-indigo-7"]:not([class*="dark:text-"]) { color: #c4b5fd !important; }
.dark [class*="text-slate-4"]:not([class*="dark:text-"]) { color: #8494aa !important; }
/* Light tinted chips (bg-*-50 / -100) without a dark variant become a soft dark tint. */
.dark [class*="bg-blue-50"]:not([class*="dark:bg-"]), .dark [class*="bg-brand-50"]:not([class*="dark:bg-"]), .dark [class*="bg-blue-100"]:not([class*="dark:bg-"]), .dark [class*="bg-sky-100"]:not([class*="dark:bg-"]) { background-color: rgba(122, 162, 255, 0.14) !important; }
.dark [class*="bg-emerald-50"]:not([class*="dark:bg-"]), .dark [class*="bg-green-50"]:not([class*="dark:bg-"]), .dark [class*="bg-emerald-100"]:not([class*="dark:bg-"]), .dark [class*="bg-green-100"]:not([class*="dark:bg-"]) { background-color: rgba(52, 211, 153, 0.14) !important; }
.dark [class*="bg-amber-50"]:not([class*="dark:bg-"]), .dark [class*="bg-orange-50"]:not([class*="dark:bg-"]), .dark [class*="bg-yellow-50"]:not([class*="dark:bg-"]), .dark [class*="bg-amber-100"]:not([class*="dark:bg-"]), .dark [class*="bg-yellow-100"]:not([class*="dark:bg-"]) { background-color: rgba(251, 191, 36, 0.14) !important; }
.dark [class*="bg-rose-50"]:not([class*="dark:bg-"]), .dark [class*="bg-red-50"]:not([class*="dark:bg-"]), .dark [class*="bg-rose-100"]:not([class*="dark:bg-"]), .dark [class*="bg-red-100"]:not([class*="dark:bg-"]) { background-color: rgba(248, 113, 113, 0.14) !important; }
.dark [class*="bg-violet-100"]:not([class*="dark:bg-"]), .dark [class*="bg-purple-100"]:not([class*="dark:bg-"]), .dark [class*="bg-indigo-100"]:not([class*="dark:bg-"]) { background-color: rgba(167, 139, 250, 0.14) !important; }
.dark table thead, .dark .bg-slate-50\/60 { background-color: rgba(255, 255, 255, 0.03) !important; }
/* Light mode: the faint helper greys and white-on-light-amber were below readable contrast (WCAG AA). */
html:not(.dark) .text-slate-400, html:not(.dark) .text-gray-400 { color: #687789 !important; }
html:not(.dark) .text-slate-300, html:not(.dark) .text-gray-300 { color: #8593a6 !important; }
html:not(.dark) .bg-amber-500.text-white, html:not(.dark) .bg-amber-400.text-white { background-color: #b45309 !important; }
html:not(.dark) .text-emerald-500, html:not(.dark) .text-green-500 { color: #047857 !important; }
html:not(.dark) .text-amber-500, html:not(.dark) .text-amber-600 { color: #b45309 !important; }
html:not(.dark) .hover\:bg-amber-600.text-white:hover { background-color: #92400e !important; }
/* The phone «المسح» button sits in the middle of its column, not at its start. */
.mobile-nav-scan { justify-self: center; align-self: start; }
.dark .mobile-nav-scan { border-color: var(--bg) !important; }
/* Phone: the header has no room for the theme button — it is in «المزيد». It still works there (clicked by id). */
@media (max-width: 640px) { #theme-toggle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
@media (max-width: 640px) { body { background: var(--bg) !important; } .dark .mobile-bottom-nav { background: rgba(11, 18, 32, 0.96) !important; border-color: var(--border) !important; } }

/* ---------------------------------------------------------------- sidebar (≥1024px) */
.nav-group-label { display: none; }
#nav-collapse { display: none; }
@media (min-width: 1024px) {
  body.with-sidebar > header, body.with-sidebar > main, body.with-sidebar > footer { margin-inline-start: var(--sidebar); transition: margin .2s ease; }
  body.with-sidebar.nav-mini > header, body.with-sidebar.nav-mini > main, body.with-sidebar.nav-mini > footer { margin-inline-start: var(--sidebar-mini); }
  /* main is w-full + mx-auto in the markup: next to the sidebar it takes the rest of the width. */
  body.with-sidebar > main { width: auto !important; max-width: none !important; margin-inline-end: 0 !important; }
  /* …but the content keeps a readable width on wide screens instead of stretching edge to edge. */
  body.with-sidebar > main > * { max-width: 1320px; margin-inline: auto; }
  body.with-sidebar > header > div:first-child { max-width: none; }

  body.with-sidebar #main-nav {
    position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar); z-index: 40;
    overflow-y: auto; overflow-x: hidden; border: 0; border-inline-end: 1px solid var(--border);
    background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    transition: width .2s ease;
  }
  body.with-sidebar.nav-mini #main-nav { width: var(--sidebar-mini); }
  body.with-sidebar #main-nav > div { flex-direction: column; gap: 2px; padding: 16px 12px; max-width: none; margin: 0; min-height: 100%; }
  body.with-sidebar #main-nav .nav-brand { display: flex; }
  body.with-sidebar .nav-group-label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); padding: 12px 12px 4px; }
  body.with-sidebar .nav-group-label.empty { display: none; }
  body.with-sidebar #main-nav .tab-btn, body.with-sidebar #nav-collapse {
    width: 100%; border: 0 !important; border-radius: 10px; padding: 9px 12px; font-size: 13.5px; font-weight: 600;
    color: var(--text) !important; gap: 12px; text-align: start;
  }
  body.with-sidebar #nav-collapse { display: flex; align-items: center; background: transparent; cursor: pointer; }
  body.with-sidebar #main-nav .tab-btn i, body.with-sidebar #nav-collapse i { width: 20px; text-align: center; color: var(--muted); font-size: 15px; }
  body.with-sidebar #main-nav .tab-btn:hover { background: var(--brand-50); }
  /* The active tab: app.js marks it with border-amber-500 (kept for the horizontal bar). */
  body.with-sidebar #main-nav .tab-btn.border-amber-500 { background: var(--brand); color: #fff !important; }
  body.with-sidebar #main-nav .tab-btn.border-amber-500 i { color: #fff; }
  .dark body.with-sidebar #main-nav .tab-btn.border-amber-500, .dark body.with-sidebar #main-nav .tab-btn.border-amber-500 i { color: #0b1220 !important; }
  body.with-sidebar #main-nav .tab-btn > span[id$="-nav-badge"] { margin-inline-start: auto; }
  body.with-sidebar #nav-collapse { display: flex; margin-top: auto; border-top: 1px solid var(--border) !important; border-radius: 0; padding-top: 12px; }
  body.with-sidebar #nav-collapse i { transition: transform .2s ease; }
  body.with-sidebar.nav-mini #nav-collapse i { transform: rotate(180deg); }

  body.with-sidebar.nav-mini #main-nav .tab-btn, body.with-sidebar.nav-mini #nav-collapse { justify-content: center; padding: 10px; font-size: 0; }
  body.with-sidebar.nav-mini #main-nav .tab-btn i { font-size: 16px; }
  body.with-sidebar.nav-mini #main-nav .tab-btn > span[id$="-nav-badge"] { position: absolute; transform: translate(-14px, -12px); font-size: 10px; }
  body.with-sidebar.nav-mini .nav-group-label, body.with-sidebar.nav-mini .nav-brand-text { display: none !important; }
  body.with-sidebar.nav-mini #main-nav .tab-btn { position: relative; }

  /* The header becomes a light top bar next to the sidebar; the logo lives in the sidebar.
     No backdrop-filter on the header: it would make the fixed sidebar (inside it) relative to it. */
  body.with-sidebar > header { background: var(--surface) !important; box-shadow: none !important; border-color: var(--border) !important; }
  body.with-sidebar > header #app-logo-header { display: none; }
  /* The brand is in the sidebar: the header keeps only its actions. */
  body.with-sidebar > header > div:first-child > div:first-child { visibility: hidden; }
}
.nav-brand { display: none; align-items: center; gap: 10px; padding: 2px 8px 10px; }
.nav-brand img { height: 32px; width: auto; }
.nav-brand b { display: block; font-size: 14px; line-height: 1.2; color: var(--text); }
.nav-brand small { color: var(--muted); font-size: 11px; }

/* ---------------------------------------------------------------- overview widgets (ov-) */
.ov { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.ov > *, .ov-2 > *, .ov-2b > * { min-width: 0; }
.ov-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); }
.ov-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.ov-h h3 { margin: 0; font-size: 15px; font-weight: 800; }
.ov-h small { color: var(--muted); font-size: 12px; }
.ov-b { padding: 14px 18px 18px; }
#rpt-dash:not(:empty), #rpt-stock:not(:empty) { margin-top: 20px; }
.rpt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.rpt-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: right; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.rpt-tile:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.rpt-tile:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.rpt-tile .ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); font-size: 16px; }
.rpt-tile b { display: block; font-size: 13px; font-weight: 800; }
.rpt-tile small { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; margin-top: 2px; }
/* «الموظفون» */
.emp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; }
.emp-tile { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease; }
.emp-tile:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.emp-tile.off { opacity: .6; }
.emp-tile .ph { flex: none; width: 52px; height: 62px; border-radius: 10px; overflow: hidden; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-weight: 800; border: 2px solid #f59e0b; }
.emp-tile .ph img { width: 100%; height: 100%; object-fit: cover; }
.emp-tile b { font-size: 14px; font-weight: 800; }
.emp-tile small { color: var(--muted); font-size: 12px; }
.emp-tile .no { display: inline-block; margin-top: 4px; margin-inline-end: 4px; padding: 1px 8px; border-radius: 999px; background: var(--brand-50); color: var(--brand); font-size: 11px; font-weight: 700; direction: ltr; }
.emp-tile .no.off { background: var(--danger-50); color: var(--danger); direction: rtl; }
.emp-tile .no.ok { background: rgba(16, 185, 129, .12); color: #047857; direction: rtl; }
.emp-pick { position: absolute; top: 8px; left: 8px; padding: 4px; }
.emp-pick input { width: 18px; height: 18px; accent-color: var(--brand); }
.emp-big { width: 150px; height: 180px; border-radius: 16px; overflow: hidden; border: 3px solid #f59e0b; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-size: 34px; font-weight: 800; margin-inline: auto; }
.emp-big.sm { width: 84px; height: 100px; font-size: 22px; margin: 0; }
.emp-big img { width: 100%; height: 100%; object-fit: cover; }
.emp-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.emp-dl dt { color: var(--muted); }
.emp-dl dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.rpt-tile .go { margin-inline-start: auto; color: var(--muted); font-size: 11px; }
.ov-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--brand-50); color: var(--brand); white-space: nowrap; }
.ov-badge.warn { background: var(--accent-50); color: #b45309; }
.dark .ov-badge.warn { color: var(--accent); }
.ov-badge.ok { background: var(--success-50); color: var(--success); }
.ov-badge.bad { background: var(--danger-50); color: var(--danger); }
.ov-hello { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.ov-hello h2 { margin: 0; font-size: 22px; font-weight: 800; color: var(--text); }
.ov-hello p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.ov-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ov-kpi { padding: 16px 18px; display: grid; gap: 6px; }
.ov-kpi .top { display: flex; align-items: center; justify-content: space-between; }
.ov-kpi .label { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.ov-kpi .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); font-size: 17px; }
.ov-kpi .value { font-size: 24px; font-weight: 800; }
.ov-kpi .value small { font-size: 13px; color: var(--muted); font-weight: 700; margin-inline-start: 4px; }
.ov-kpi .foot { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ov-kpi svg { width: 100%; height: 36px; display: block; }
.ov-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.ov-2b { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ov-inbox a, .ov-inbox button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 18px; border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--text); text-align: start; cursor: pointer; font: inherit; }
.ov-inbox > :first-child { border-top: 0; }
.ov-inbox button:hover { background: var(--brand-50); }
.ov-inbox .n { min-width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--accent-50); color: #b45309; }
.dark .ov-inbox .n { color: var(--accent); }
.ov-inbox .n.zero { background: var(--success-50); color: var(--success); }
.ov-inbox b { display: block; font-size: 13.5px; }
.ov-inbox small { color: var(--muted); font-size: 12px; }
.ov-inbox .go { margin-inline-start: auto; color: var(--muted); }
.ov-bars { display: grid; gap: 12px; }
.ov-bar .t { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.ov-bar .t b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-track { height: 8px; border-radius: 99px; background: var(--brand-50); overflow: hidden; margin-top: 4px; }
.ov-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-600), var(--brand)); }
.ov-empty { color: var(--muted); text-align: center; padding: 24px 12px; font-size: 13px; }
.ov-skel { background: linear-gradient(90deg, var(--border), var(--bg), var(--border)); background-size: 200% 100%; animation: ov-sk 1.2s infinite; border-radius: 8px; height: 14px; }
@keyframes ov-sk { to { background-position: -200% 0; } }
/* Welcome banner, coloured KPI tiles, hover lift, entrance, segmented control, table. */
.ov-hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 22px 24px; color: #fff;
  background: linear-gradient(120deg, #123c61 0%, #184e7c 45%, #2563a6 100%);
  box-shadow: 0 10px 30px rgba(24, 78, 124, 0.25);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.ov-hero::after { content: ''; position: absolute; width: 320px; height: 320px; border-radius: 50%; inset-inline-end: -80px; top: -140px; background: radial-gradient(circle, rgba(245, 158, 11, 0.35), transparent 65%); }
.ov-hero::before { content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%; inset-inline-start: -60px; bottom: -150px; background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 65%); }
.ov-hero > * { position: relative; z-index: 1; }
.ov-hero h2 { margin: 0; font-size: 23px; font-weight: 800; color: #fff; }
.ov-hero p { margin: 4px 0 0; color: rgba(255, 255, 255, 0.78); font-size: 13px; }
.ov-hero .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ov-hero .act { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px; font-weight: 700; font-size: 13px; cursor: pointer; border: 1px solid rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.12); color: #fff; backdrop-filter: blur(6px); }
.ov-hero .act:hover { background: rgba(255, 255, 255, 0.22); }
.ov-hero .act.main { background: #f59e0b; border-color: #f59e0b; color: #1f1300; }
.ov-hero .pending { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-size: 12px; font-weight: 700; }
.dark .ov-hero { background: linear-gradient(120deg, #0f2a45 0%, #143a5f 50%, #1b4c7c 100%); }

.ov-kpi { transition: transform .25s var(--ease), box-shadow .25s var(--ease); position: relative; overflow: hidden; }
.ov-kpi:hover { box-shadow: 0 12px 28px -14px var(--tone-2, rgba(15, 27, 45, 0.25)); }
/* Solid gradient icon tiles (Nimbus). */
.ov-kpi .ico { background: var(--tone-grad, var(--grad)); color: #fff; box-shadow: 0 8px 20px -8px var(--tone-2); }
.ov-kpi.t-blue { --tone: #4f6dff; --tone-2: #6d8bff; --tone-grad: linear-gradient(135deg, #6d8bff, #4f6dff); }
.ov-kpi.t-green { --tone: #10b981; --tone-2: #34d399; --tone-grad: linear-gradient(135deg, #34d399, #10b981); }
.ov-kpi.t-amber { --tone: #f59e0b; --tone-2: #fbbf24; --tone-grad: linear-gradient(135deg, #fbbf24, #f59e0b); }
.ov-kpi.t-violet { --tone: #8b5cf6; --tone-2: #b06dff; --tone-grad: linear-gradient(135deg, #b06dff, #8b5cf6); }
/* Sparkline that draws itself, with a soft area under it. */
.ov-kpi svg .line { fill: none; stroke: var(--tone-2); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: ov-draw 1.1s var(--ease) .3s forwards; }
.ov-kpi svg .area { fill: var(--tone-2); opacity: 0; animation: ov-fade .8s var(--ease) .7s forwards; }
@keyframes ov-draw { to { stroke-dashoffset: 0; } }
@keyframes ov-fade { to { opacity: .16; } }
.dark .ov-hero { background: linear-gradient(120deg, rgba(59, 91, 255, 0.55) 0%, rgba(109, 139, 255, 0.35) 50%, rgba(155, 59, 255, 0.45) 100%); border: 1px solid rgba(255, 255, 255, 0.10); backdrop-filter: blur(18px); box-shadow: 0 20px 40px -20px rgba(59, 91, 255, 0.5); }
.dark .ov-seg button.on, .dark body.with-sidebar #main-nav .tab-btn.border-amber-500 { background: var(--grad) !important; color: #fff !important; box-shadow: 0 8px 22px -10px #6d8bff; }
.dark body.with-sidebar #main-nav .tab-btn.border-amber-500 i { color: #fff !important; }
.dark .ov-track i { background: var(--grad); }

.ov-in { opacity: 0; transform: translateY(10px); animation: ov-rise .45s ease forwards; }
@keyframes ov-rise { to { opacity: 1; transform: none; } }

.ov-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); }
.ov-seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 8px; font: inherit; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.ov-seg button.on { background: var(--surface); color: var(--brand); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

.ov-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ov-table th { text-align: start; color: var(--muted); font-weight: 700; font-size: 12px; padding: 10px 18px; border-bottom: 1px solid var(--border); }
.ov-table td { padding: 11px 18px; border-bottom: 1px solid var(--border); color: var(--text); }
.ov-table tr:last-child td { border-bottom: 0; }
.ov-table tbody tr { cursor: pointer; }
.ov-table tbody tr:hover td { background: var(--brand-50); }
.ov-table .end { text-align: end; }
.ov-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 6px; }

/* «الحركة»: an operation switcher, one card at a time at full width (tablet / desktop). */
.op-tabs { display: none; }
@media (min-width: 641px) {
  .op-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
  .dark .op-tabs { backdrop-filter: blur(18px); }
  .op-tabs button { flex: 1 1 150px; display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
  .op-tabs button:hover { background: var(--brand-50); color: var(--brand); }
  .op-tabs button.on { background: var(--grad); color: #fff; box-shadow: 0 8px 20px -10px rgba(24, 78, 124, 0.6); }
  .op-tabs button:not([data-op]) { flex: 0 1 auto; padding: 0 16px; }
  /* The forms' two-column grids become one column; only the chosen operation shows. */
  #tab-content-storekeeper[data-op] .grid:has(> .operation-card) { display: block; }
  #tab-content-storekeeper[data-op] .operation-card { display: none; }
  #tab-content-storekeeper[data-op="issue"] .op-issue,
  #tab-content-storekeeper[data-op="transfer"] .op-transfer,
  #tab-content-storekeeper[data-op="return"] .op-return { display: block; max-width: 1100px; animation: ov-rise .35s var(--ease) both; }
}

/* Sidebar foot: who is signed in. */
.nav-user { display: none; }
@media (min-width: 1024px) {
  body.with-sidebar .nav-user { display: flex; align-items: center; gap: 10px; padding: 10px; margin-top: 8px; border-radius: 12px; background: var(--brand-50); }
  body.with-sidebar .nav-user .av { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), #2563a6); flex: none; }
  body.with-sidebar .nav-user b { display: block; font-size: 13px; color: var(--text); line-height: 1.2; }
  body.with-sidebar .nav-user small { font-size: 11px; color: var(--muted); }
  body.with-sidebar.nav-mini .nav-user { justify-content: center; padding: 6px; }
  body.with-sidebar.nav-mini .nav-user div { display: none; }
  body.with-sidebar #main-nav .tab-btn.border-amber-500 { background: linear-gradient(135deg, var(--brand), #2563a6); box-shadow: 0 6px 16px rgba(24, 78, 124, 0.25); }
}
@media (prefers-reduced-motion: reduce) {
  .ov-in { animation: none; opacity: 1; transform: none; } .ov-kpi { transition: none; } .bg-blobs i { animation: none; }
  .ov-kpi svg .line { animation: none; stroke-dashoffset: 0; } .ov-kpi svg .area { animation: none; opacity: .16; }
}

@media (max-width: 1200px) { .ov-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ov-2, .ov-2b { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .ov-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .ov-kpi { padding: 14px !important; } .ov-kpi svg { display: none; } .ov-hero { padding: 18px; } .ov-hero h2 { font-size: 19px; } }
@media (prefers-reduced-motion: reduce) { .ov-skel { animation: none; } body.with-sidebar > header, body.with-sidebar > main, body.with-sidebar #main-nav { transition: none !important; } }
