/* =====================================================================
   Amber 5G Router Tracker — Amber "black glass" design language
   Black background, translucent glass panels with deep shadows and a gloss
   on their corners, gold gradient actions that lift and shine on hover.
   Light mode: <html data-theme="light">. LTR + RTL via logical properties.
   ===================================================================== */
@font-face { font-family: "Zarid Sans"; src: url("../fonts/ZaridSans-Regular.woff2") format("woff2"); font-weight: 300 500; font-display: swap; }
@font-face { font-family: "Zarid Sans"; src: url("../fonts/ZaridSans-Bold.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "Zarid Display"; src: url("../fonts/ZaridDisplay-Regular.woff2") format("woff2"); font-weight: 300 500; font-display: swap; }
@font-face { font-family: "Zarid Display"; src: url("../fonts/ZaridDisplay-Bold.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #050403;
  --text: #F4EBDD; --text-soft: rgba(244,235,221,.76); --text-faint: rgba(244,235,221,.58); --heading: #F7EFE2;
  --line: rgba(255,255,255,.09); --line-2: rgba(255,255,255,.15);
  --gold: #CDA30C; --gold-hi: #EBC63A; --gold-lo: #B98F08; --gold-text: #F2D06A; --gold-soft: rgba(205,163,12,.14); --gold-ring: rgba(205,163,12,.25);
  --ok: #4CC98C; --ok-text: #9BEFC4; --ok-soft: rgba(76,201,140,.13); --ok-line: rgba(76,201,140,.34);
  --warn: #E8BA38; --warn-text: #F5D57A; --warn-soft: rgba(232,186,56,.13); --warn-line: rgba(232,186,56,.34);
  --danger: #E8624C; --danger-text: #FFAE9E; --danger-soft: rgba(232,98,76,.14); --danger-line: rgba(232,98,76,.38);
  --info: #6FA8E8; --info-text: #B9D7FF; --info-soft: rgba(111,168,232,.14); --info-line: rgba(111,168,232,.36);
  --neutral-text: rgba(244,235,221,.78); --neutral-soft: rgba(255,255,255,.07); --neutral-line: rgba(255,255,255,.14);
  --field-bg: rgba(0,0,0,.38); --field-shadow: inset 0 2px 8px rgba(0,0,0,.45);
  --well: rgba(255,255,255,.035);
  --radius: 22px; --radius-sm: 13px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --glass-bg: linear-gradient(155deg, rgba(255,255,255,.085) 0%, rgba(255,255,255,.022) 38%, rgba(255,255,255,.018) 68%, rgba(255,255,255,.05) 100%);
  --glass-shadow: 0 34px 70px -34px rgba(0,0,0,.95), 0 14px 28px -16px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.11), inset 0 -1px 0 rgba(0,0,0,.4);
  --glass-shadow-hi: 0 46px 84px -38px rgba(0,0,0,1), 0 18px 34px -16px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.16), inset 0 -1px 0 rgba(0,0,0,.4);
  --btn-bg: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.03));
  --btn-shadow: 0 12px 24px -14px rgba(0,0,0,.95), inset 0 1px 0 rgba(255,255,255,.16);
  --btn-shadow-hi: 0 18px 32px -16px rgba(0,0,0,1), inset 0 1px 0 rgba(255,255,255,.24);
  --shine: rgba(255,255,255,.28);
  --font: "Zarid Sans", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font-display: "Zarid Display", "Zarid Sans", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #FFFFFF;
  --text: #1F1A12; --text-soft: rgba(31,26,18,.76); --text-faint: rgba(31,26,18,.62); --heading: #1F1A12;
  --line: rgba(31,26,18,.10); --line-2: rgba(31,26,18,.17);
  --gold: #C29A0B; --gold-hi: #E4BE34; --gold-lo: #B98F08; --gold-text: #8A6508; --gold-soft: rgba(205,163,12,.12); --gold-ring: rgba(205,163,12,.22);
  --ok: #1F9D62; --ok-text: #137247; --ok-soft: rgba(31,157,98,.10); --ok-line: rgba(31,157,98,.34);
  --warn: #B8840C; --warn-text: #845C00; --warn-soft: rgba(212,160,23,.13); --warn-line: rgba(185,132,12,.36);
  --danger: #D2452E; --danger-text: #A8301C; --danger-soft: rgba(210,69,46,.09); --danger-line: rgba(210,69,46,.36);
  --info: #2F78C8; --info-text: #1D5A9E; --info-soft: rgba(47,120,200,.10); --info-line: rgba(47,120,200,.32);
  --neutral-text: rgba(31,26,18,.72); --neutral-soft: rgba(31,26,18,.055); --neutral-line: rgba(31,26,18,.14);
  --field-bg: #FFFFFF; --field-shadow: inset 0 1px 2px rgba(31,26,18,.06);
  --well: rgba(31,26,18,.025);
  --glass-bg: linear-gradient(155deg, #FFFFFF 0%, #FFFFFF 70%, #FEFDFB 100%);
  --glass-shadow: 0 20px 44px -30px rgba(70,52,16,.30), 0 6px 16px -10px rgba(70,52,16,.14), inset 0 1px 0 #FFFFFF;
  --glass-shadow-hi: 0 28px 56px -30px rgba(70,52,16,.38), 0 10px 22px -12px rgba(70,52,16,.18), inset 0 1px 0 #FFFFFF;
  --btn-bg: linear-gradient(180deg, #FFFFFF, #F5F2EC);
  --btn-shadow: 0 8px 18px -12px rgba(70,52,16,.35), inset 0 1px 0 #FFFFFF;
  --btn-shadow-hi: 0 14px 26px -14px rgba(70,52,16,.42), inset 0 1px 0 #FFFFFF;
  --shine: rgba(255,255,255,.65);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: var(--gold-text); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(205,163,12,.45); color: #fff; }
h1, h2, h3 { margin: 0; line-height: 1.3; font-family: var(--font-display); color: var(--heading); }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
small, .small { font-size: 13px; }
.muted { color: var(--text-soft); }
.mono { font-family: var(--mono); font-size: .92em; }
.strong { font-weight: 700; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.center { text-align: center; justify-content: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 3px; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--gold); color: #1C1404; padding: 8px 14px; border-radius: 10px; z-index: 100; font-weight: 700; }
.skip:focus { top: 8px; }
.ico { width: 20px; height: 20px; flex: none; fill: currentColor; }

/* ---------- glass ---------- */
.glass, .card, .kpi, .login-card, .hero-scan, .error-card {
  position: relative; isolation: isolate;
  background: var(--glass-bg); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%);
  box-shadow: var(--glass-shadow);
}
/* gloss on the corners: white sheen top-start, gold glint bottom-end */
.glass::before, .card::before, .kpi::before, .login-card::before, .hero-scan::before, .error-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(90% 70% at 0% 0%, rgba(255,255,255,.12), transparent 46%),
              radial-gradient(70% 60% at 100% 100%, rgba(205,163,12,.10), transparent 50%);
}
[dir="rtl"] .glass::before, [dir="rtl"] .card::before, [dir="rtl"] .kpi::before, [dir="rtl"] .login-card::before, [dir="rtl"] .hero-scan::before, [dir="rtl"] .error-card::before {
  background: radial-gradient(90% 70% at 100% 0%, rgba(255,255,255,.12), transparent 46%),
              radial-gradient(70% 60% at 0% 100%, rgba(205,163,12,.10), transparent 50%);
}
/* thin bright rim */
.glass::after, .card::after, .kpi::after, .login-card::after, .hero-scan::after, .error-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1px;
  background: linear-gradient(140deg, rgba(255,255,255,.36), rgba(255,255,255,0) 28%, rgba(255,255,255,0) 72%, rgba(233,194,78,.36));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
[data-theme="light"] .glass, [data-theme="light"] .card, [data-theme="light"] .kpi, [data-theme="light"] .login-card, [data-theme="light"] .hero-scan, [data-theme="light"] .error-card { -webkit-backdrop-filter: none; backdrop-filter: none; }
[data-theme="light"] .glass::before, [data-theme="light"] .card::before, [data-theme="light"] .kpi::before, [data-theme="light"] .login-card::before, [data-theme="light"] .hero-scan::before, [data-theme="light"] .error-card::before {
  background: radial-gradient(70% 60% at 100% 100%, rgba(205,163,12,.04), transparent 55%); }
[data-theme="light"] .glass::after, [data-theme="light"] .card::after, [data-theme="light"] .kpi::after, [data-theme="light"] .login-card::after, [data-theme="light"] .hero-scan::after, [data-theme="light"] .error-card::after {
  background: linear-gradient(140deg, rgba(205,163,12,0), rgba(205,163,12,0) 70%, rgba(205,163,12,.26)); }

/* ---------- page frame ---------- */
.shell { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: 24px; padding: 24px; min-height: 100vh; }
.sidebar { width: 264px; flex-shrink: 0; position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; border-radius: 26px; padding: 20px 14px 14px; z-index: 40;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 4px 12px 14px; color: var(--text); text-decoration: none !important; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; flex: none; position: relative; background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
  box-shadow: 0 10px 22px -12px rgba(205,163,12,.85), inset 0 1px 0 rgba(255,246,205,.7); transition: filter .4s var(--ease); }
.brand-mark::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; border: 2.5px solid #1C1404; border-top-color: transparent; transform: rotate(-45deg); }
.side-brand:hover .brand-mark { filter: drop-shadow(0 0 14px rgba(233,194,78,.45)); }
.brand-mark.lg { width: 56px; height: 56px; border-radius: 17px; }
.brand-mark.lg::after { inset: 16px; border-width: 3px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font: 700 21px/1.1 var(--font-display); color: var(--gold-text); letter-spacing: .02em; }
.brand-text small { color: var(--text-faint); font-size: 12px; }
.nav-group { margin: 16px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); }
[dir="rtl"] .nav-group { letter-spacing: 0; font-size: 12px; }
.sidebar nav > .nav-group:first-child { margin-block-start: 4px; }
.nav-sep { height: 1px; margin: 12px 10px; background: var(--line); }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 8px 12px; margin-block-end: 2px; border-radius: 12px;
  text-decoration: none !important; color: var(--text-soft); font: 500 14px var(--font); border: 0; background: transparent; cursor: pointer; text-align: start;
  transition: transform .3s var(--ease), background .3s, color .3s, box-shadow .3s; }
.nav-link .ico { width: 20px; height: 20px; }
.nav-link:hover { color: var(--text); background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.03)); transform: translateX(4px); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 10px 20px -12px rgba(0,0,0,.9); }
[dir="rtl"] .nav-link:hover { transform: translateX(-4px); }
.nav-link.active { color: var(--gold-text); background: linear-gradient(135deg, rgba(205,163,12,.27), rgba(205,163,12,.07)); box-shadow: inset 0 1px 0 rgba(255,232,150,.3), 0 12px 26px -14px rgba(205,163,12,.7); }
[data-theme="light"] .nav-link:hover { background: rgba(31,26,18,.05); box-shadow: none; }
[data-theme="light"] .nav-link.active { background: linear-gradient(135deg, rgba(205,163,12,.17), rgba(205,163,12,.05)); box-shadow: inset 0 0 0 1px rgba(205,163,12,.22), 0 10px 22px -16px rgba(185,143,8,.6); }
.sidebar form { margin: 0; }

.main { flex: 1; min-width: 0; max-width: 1560px; display: flex; flex-direction: column; gap: 22px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 16px 14px 24px; border-radius: 22px; }
[dir="rtl"] .topbar { padding: 14px 24px 14px 16px; }
.top-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.topbar h1 { font-size: 28px; line-height: 1.15; overflow-wrap: anywhere; }
.top-sub { margin: 0; font-size: 13px; color: var(--text-soft); }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lang-toggle, .theme-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(255,255,255,.045); font-weight: 700; color: var(--gold-text); text-decoration: none !important; cursor: pointer;
  transition: transform .25s var(--ease), background .25s, box-shadow .25s; }
.lang-toggle:hover, .theme-toggle:hover { transform: translateY(-2px); background: rgba(255,255,255,.09); box-shadow: 0 10px 20px -12px rgba(0,0,0,.9); }
.lang-toggle[lang="ar"] { font-family: var(--font); }
.theme-toggle .ico { width: 18px; height: 18px; transition: transform .5s var(--ease); }
.theme-toggle:hover .ico { transform: rotate(-18deg); }
.theme-toggle .ti-moon { display: none; }
[data-theme="light"] .theme-toggle .ti-sun { display: none; }
[data-theme="light"] .theme-toggle .ti-moon { display: inline-block; }
[data-theme="light"] .lang-toggle, [data-theme="light"] .theme-toggle, [data-theme="light"] .user-chip { background: #FFFFFF; box-shadow: 0 6px 14px -10px rgba(70,52,16,.30); }
.user-chip { display: flex; align-items: center; gap: 10px; color: inherit; padding: 5px 12px 5px 5px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04); }
[dir="rtl"] .user-chip { padding: 5px 5px 5px 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; }
.avatar-letter { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #1C1404; background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); box-shadow: inset 0 1px 0 rgba(255,246,205,.6); }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-name { font-weight: 700; font-size: 13px; }
.user-mail { font-size: 11.5px; color: var(--text-faint); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-tag, .tag { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--gold-text); background: var(--gold-soft); border: 1px solid rgba(205,163,12,.42); white-space: nowrap; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 13px; color: var(--text-soft); border: 1px solid var(--line-2); cursor: pointer;
  background: var(--btn-bg); box-shadow: var(--btn-shadow); transition: transform .25s var(--ease), color .25s, box-shadow .25s; }
.icon-btn:hover { color: var(--text); transform: translateY(-2px); box-shadow: var(--btn-shadow-hi); }
[dir="rtl"] .icon-btn .ico { transform: scaleX(-1); }
.logout-form { margin: 0; }
.menu-btn { display: none; }
.content { display: block; min-width: 0; outline: none; padding-bottom: 20px; }
.scrim { display: none; }

/* page enter: sections rise in one after another */
@view-transition { navigation: auto; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.content > *, .topbar, .sidebar { animation: rise .6s var(--ease) backwards; }
.sidebar { animation-duration: .5s; }
.content > *:nth-child(1) { animation-delay: .04s; } .content > *:nth-child(2) { animation-delay: .09s; }
.content > *:nth-child(3) { animation-delay: .14s; } .content > *:nth-child(4) { animation-delay: .19s; }
.content > *:nth-child(5) { animation-delay: .24s; } .content > *:nth-child(n+6) { animation-delay: .28s; }

/* ---------- page structure ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head > .head-actions:only-child { margin-inline-start: auto; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.head-status { margin-top: 2px; }
.crumbs { font-size: 13px; color: var(--text-faint); }
.crumbs a { color: var(--gold-text); font-weight: 700; }
.card { border-radius: var(--radius); padding: 22px 24px; margin-bottom: 22px; transition: box-shadow .45s var(--ease); }
.card:hover { box-shadow: var(--glass-shadow-hi); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head h2 { display: flex; align-items: center; gap: 9px; }
.card-head h2 .ico { color: var(--gold-text); }
.callout { border-color: rgba(205,163,12,.35); }
.h-sm { font-size: 16px; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; margin-bottom: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
.pad { padding: 10px 0; }
.pad-top { margin-top: 22px; }
.pad-x { margin-top: 6px; }
.footnote { font-size: 12.5px; color: var(--text-faint); margin: -6px 4px 22px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-actions.end { justify-content: flex-end; }
.row-actions form { margin: 0; }
.stack { display: grid; gap: 10px; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
.link { color: var(--gold-text); font-weight: 700; }

/* ---------- buttons ---------- */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 0 18px; border-radius: 13px; border: 1px solid var(--line-2);
  background: var(--btn-bg); color: var(--text); font: 700 14px/1 var(--font); text-decoration: none !important; cursor: pointer; white-space: nowrap; box-shadow: var(--btn-shadow);
  transition: transform .25s var(--ease), box-shadow .25s, filter .25s, background .25s, color .25s; }
.btn::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, var(--shine) 48%, transparent 64%); transform: translateX(-135%); transition: transform .75s var(--ease); }
.btn:hover::after { transform: translateX(135%); }
.btn:hover { color: var(--text); transform: translateY(-2px); box-shadow: var(--btn-shadow-hi); }
.btn:active { transform: translateY(0) scale(.96); }
.btn .ico { width: 18px; height: 18px; }
.btn-primary { color: #1C1404; border-color: rgba(255,228,130,.65); background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); box-shadow: 0 14px 28px -14px rgba(205,163,12,.85), inset 0 1px 0 rgba(255,246,205,.7); }
.btn-primary:hover { color: #1C1404; filter: brightness(1.07); box-shadow: 0 20px 34px -16px rgba(205,163,12,.9), inset 0 1px 0 rgba(255,246,205,.8); }
.btn-ghost { background: rgba(255,255,255,.03); }
[data-theme="light"] .btn-ghost { background: transparent; }
.btn-danger { color: var(--danger-text); border-color: var(--danger-line); background: linear-gradient(180deg, rgba(232,98,76,.18), rgba(232,98,76,.05)); }
.btn-danger:hover { color: var(--danger-text); background: linear-gradient(180deg, rgba(232,98,76,.28), rgba(232,98,76,.08)); }
.btn-sm { min-height: 36px; padding: 0 13px; font-size: 13px; border-radius: 11px; }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: 15px; }
.btn-xl { min-height: 58px; padding: 0 28px; font-size: 16px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .45; cursor: not-allowed; transform: none; pointer-events: none; }
.link-btn { border: 0; background: none; padding: 6px 0; color: var(--gold-text); font: 700 14px var(--font); cursor: pointer; text-align: start; }
.export-group { display: inline-flex; gap: 6px; }

/* ---------- pills / badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge-deployed { color: var(--ok-text); background: var(--ok-soft); border-color: var(--ok-line); }
.badge-in_transit { color: var(--info-text); background: var(--info-soft); border-color: var(--info-line); }
.badge-in_storage { color: var(--neutral-text); background: var(--neutral-soft); border-color: var(--neutral-line); }
.badge-unknown { color: var(--danger-text); background: var(--danger-soft); border-color: var(--danger-line); }
.badge-retired { color: var(--text-faint); background: transparent; border-color: var(--neutral-line); border-style: dashed; }
.vbadge { display: inline-flex; align-items: center; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid; }
.vb-verified { color: var(--ok-text); background: var(--ok-soft); border-color: var(--ok-line); }
.vb-needs_review { color: var(--warn-text); background: var(--warn-soft); border-color: var(--warn-line); }
.vb-unable_to_verify { color: var(--danger-text); background: var(--danger-soft); border-color: var(--danger-line); }
.vb-not_applicable { color: var(--neutral-text); background: var(--neutral-soft); border-color: var(--neutral-line); }
.act { display: inline-block; font-weight: 700; font-size: 13px; }
.act-pickup { color: var(--info-text); } .act-deploy { color: var(--ok-text); } .act-return_storage { color: var(--neutral-text); }
.act-correction { color: var(--danger-text); } .act-register { color: var(--gold-text); }

/* ---------- KPI counters ---------- */
.kpis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: var(--radius); color: inherit; text-decoration: none !important; min-height: 138px;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--glass-shadow-hi); }
.kpi-top { display: flex; align-items: flex-start; gap: 10px; }
.kpi-ic { width: 36px; height: 36px; flex: none; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid; box-shadow: inset 0 1px 0 rgba(255,255,255,.14); }
.kpi-ic .ico { width: 18px; height: 18px; }
.kpi-label { font-size: 13px; font-weight: 700; color: var(--text-soft); line-height: 1.35; }
.kpi-value { font: 700 40px/1 var(--font-display); font-variant-numeric: tabular-nums; margin-top: auto; color: var(--heading); }
.kpi-note { font-size: 11.5px; color: var(--text-faint); margin-top: -6px; }
.kpi-neutral .kpi-ic { color: var(--gold-text); background: var(--gold-soft); border-color: rgba(205,163,12,.4); } .kpi-neutral .kpi-value { color: var(--gold-text); }
.kpi-deployed .kpi-ic { color: var(--ok-text); background: var(--ok-soft); border-color: var(--ok-line); } .kpi-deployed .kpi-value { color: var(--ok-text); }
.kpi-in_transit .kpi-ic { color: var(--info-text); background: var(--info-soft); border-color: var(--info-line); } .kpi-in_transit .kpi-value { color: var(--info-text); }
.kpi-in_storage .kpi-ic { color: var(--neutral-text); background: var(--neutral-soft); border-color: var(--neutral-line); }
.kpi-unknown .kpi-ic { color: var(--danger-text); background: var(--danger-soft); border-color: var(--danger-line); } .kpi-unknown .kpi-value { color: var(--danger-text); }
.kpi-warn .kpi-ic { color: var(--warn-text); background: var(--warn-soft); border-color: var(--warn-line); } .kpi-warn .kpi-value { color: var(--warn-text); }
[data-theme="light"] .kpi-deployed .kpi-value { color: var(--ok); } [data-theme="light"] .kpi-warn .kpi-value { color: var(--warn); } [data-theme="light"] .kpi-unknown .kpi-value { color: var(--danger); }

/* ---------- alerts & messages ---------- */
.alerts { display: grid; gap: 10px; margin-bottom: 22px; }
.alert { position: relative; display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 15px; margin-bottom: 18px; font-weight: 600; border: 1px solid var(--line-2);
  background: rgba(255,255,255,.05); color: var(--text); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 16px 34px -20px rgba(0,0,0,.95);
  text-decoration: none !important; animation: pop .45s var(--ease) backwards; transition: transform .3s var(--ease); }
.alerts .alert { margin: 0; }
a.alert:hover { transform: translateY(-2px); }
.alert > span:not(.chev) { flex: 1; }
.alert .chev { font-size: 22px; line-height: 1; opacity: .7; }
[dir="rtl"] .alert .chev { transform: scaleX(-1); }
.alert-success { background: linear-gradient(160deg, rgba(76,201,140,.20), rgba(76,201,140,.06)); color: var(--ok-text); border-color: rgba(76,201,140,.38); }
.alert-error, .alert-danger { background: linear-gradient(160deg, rgba(232,98,76,.22), rgba(232,98,76,.06)); color: var(--danger-text); border-color: rgba(232,98,76,.4); }
.alert-info { background: linear-gradient(160deg, rgba(205,163,12,.20), rgba(205,163,12,.05)); color: var(--gold-text); border-color: rgba(205,163,12,.4); }
.alert-warn { background: linear-gradient(160deg, rgba(232,186,56,.18), rgba(232,186,56,.05)); color: var(--warn-text); border-color: rgba(232,186,56,.38); }
[data-theme="light"] .alert { box-shadow: 0 14px 30px -22px rgba(70,52,16,.45); -webkit-backdrop-filter: none; backdrop-filter: none; }
.demo-banner .link { color: inherit; text-decoration: underline; }
.notice { padding: 12px 14px; border-radius: 13px; background: var(--well); border: 1px dashed var(--line-2); color: var(--text-soft); font-size: 14px; }
.notice-danger { background: var(--danger-soft); border: 1px solid var(--danger-line); color: var(--danger-text); }
.form-error { padding: 12px 14px; border-radius: 13px; background: var(--danger-soft); border: 1px solid var(--danger-line); color: var(--danger-text); font-weight: 600; margin-bottom: 14px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .inline-form > label { font-size: 13px; font-weight: 700; color: var(--text-soft); }
.opt { color: var(--text-faint); font-weight: 400; }
.req { color: var(--danger-text); }
.input { font: inherit; font-size: 14.5px; color: var(--text); background: var(--field-bg); width: 100%; border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 13px; min-height: 44px;
  box-shadow: var(--field-shadow); transition: border-color .2s, box-shadow .2s, background .2s; }
.input:hover { border-color: rgba(233,194,78,.4); }
.input:focus { outline: none; border-color: var(--gold); box-shadow: var(--field-shadow), 0 0 0 3px var(--gold-ring); }
.input::placeholder { color: var(--text-faint); opacity: .7; }
textarea.input { resize: vertical; line-height: 1.5; }
select.input { appearance: none; -webkit-appearance: none; cursor: pointer; padding-inline-end: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23CDA30C' stroke-width='1.8' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; }
[dir="rtl"] select.input { background-position: left 13px center; }
select.input option { background: #15110d; color: #F4EBDD; }
[data-theme="light"] select.input option { background: #fff; color: #1F1A12; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input.readonly { display: flex; align-items: center; color: var(--gold-text); font-weight: 700; background: var(--gold-soft); border-color: rgba(205,163,12,.35); box-shadow: none; }
.input-lg { min-height: 52px; font-size: 16px; }
.input-sm { min-height: 36px; font-size: 13px; padding: 5px 10px; }
.input-icon { position: relative; }
.input-icon .ico { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-faint); pointer-events: none; }
.input-icon .input { padding-inline-start: 38px; }
.hint { font-size: 12.5px; color: var(--text-faint); line-height: 1.6; }
.field-error { font-size: 12.5px; color: var(--danger-text); font-weight: 700; }
.check { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; }
.check input { width: 19px; height: 19px; accent-color: var(--gold); cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
.span-2 { grid-column: 1 / -1; }
.form-card { max-width: 960px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-actions.span-2 { margin-top: 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px; margin: 0 0 18px; background: var(--well); border: 1px solid var(--line); border-radius: 16px; }
.filters .field { min-width: 150px; flex: 1 1 150px; }
.filters .field.grow { flex: 2 1 220px; }
.filters .field.actions { flex: 0 0 auto; min-width: 0; flex-direction: row; gap: 8px; }
.filter-hint { flex-basis: 100%; font-size: 12px; color: var(--text-faint); }
.inline-form { display: grid; gap: 7px; }
.inline-row { display: flex; gap: 10px; }
.inline-row .input { flex: 1; }
.field.inline { flex-direction: row; align-items: center; gap: 10px; }
.field.inline .input { width: 90px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 14px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; color: var(--text-faint); padding: 10px 12px; border-block-end: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 12px; border-block-end: 1px solid var(--line); vertical-align: middle; text-align: start; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: rgba(255,255,255,.035); }
[data-theme="light"] .table tbody tr:hover { background: rgba(31,26,18,.03); }
.table tbody tr:last-child td { border-block-end: 0; }
.table .num { text-align: end; font-variant-numeric: tabular-nums; }
.table.compact td, .table.compact th { padding: 8px 10px; }
.table a.sort { color: inherit; text-decoration: none; }
.table a.sort:hover, .table a.sort[aria-sort] { color: var(--gold-text); }
.table td a { font-weight: 700; }
.empty-row td { text-align: center; color: var(--text-faint); padding: 36px 16px; }
tr.is-over td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
[dir="rtl"] tr.is-over td:first-child { box-shadow: inset -3px 0 0 var(--warn); }
tr.is-muted td { opacity: .55; }
.days { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 26px; padding: 0 9px; border-radius: 999px; font-weight: 700;
  color: var(--ok-text); background: var(--ok-soft); border: 1px solid var(--ok-line); font-variant-numeric: tabular-nums; }
.days.over { color: var(--warn-text); background: var(--warn-soft); border-color: var(--warn-line); }
.notes-cell { max-width: 280px; }
.override { color: var(--warn-text); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; }
.pager-links { display: flex; align-items: center; gap: 8px; }
.pager-pos { color: var(--text-faint); }

/* ---------- detail pages ---------- */
.stat-card h3 { font-size: 13px; color: var(--text-faint); font-family: var(--font); margin-bottom: 8px; }
.stat-big { font: 700 24px/1.25 var(--font-display); color: var(--heading); margin-bottom: 4px; }
.stat-big small { font-size: 15px; color: var(--text-faint); font-weight: 600; }
.dl { display: grid; grid-template-columns: minmax(140px, 34%) 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--text-faint); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.dur-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.dur-totals > div { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--well); border: 1px solid var(--line); }
.dur-totals .badge { align-self: flex-start; }
.dur-totals strong { font: 700 17px var(--font-display); font-variant-numeric: tabular-nums; }
details > summary { cursor: pointer; list-style: none; display: flex; flex-direction: column; gap: 4px; }
details > summary::-webkit-details-marker { display: none; }
details > summary h2 { display: flex; align-items: center; gap: 10px; }
details > summary h2::before { content: "▸"; color: var(--gold-text); transition: transform .25s var(--ease); display: inline-block; }
[dir="rtl"] details > summary h2::before { content: "◂"; }
details[open] > summary h2::before { transform: rotate(90deg); }
[dir="rtl"] details[open] > summary h2::before { transform: rotate(-90deg); }
details.json summary { flex-direction: row; color: var(--gold-text); font-weight: 700; font-size: 13px; }
details.json pre { background: rgba(0,0,0,.4); border: 1px solid var(--line); color: #F7E2A8; padding: 8px; border-radius: 10px; font-size: 12px; max-width: 420px; overflow: auto; text-align: left; }
[data-theme="light"] details.json pre { background: #F7F3EA; color: #6E5106; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item { position: relative; padding-inline-start: 30px; padding-bottom: 20px; }
.tl-item::before { content: ""; position: absolute; inset-inline-start: 8px; top: 20px; bottom: -2px; width: 2px; background: var(--line-2); }
.tl-item:last-child::before { display: none; }
.tl-dot { position: absolute; inset-inline-start: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 3px solid var(--line-2); }
.tl-deploy .tl-dot { border-color: var(--ok); box-shadow: 0 0 12px rgba(76,201,140,.5); }
.tl-pickup .tl-dot { border-color: var(--info); box-shadow: 0 0 12px rgba(111,168,232,.5); }
.tl-return_storage .tl-dot { border-color: var(--neutral-text); }
.tl-correction .tl-dot { border-color: var(--danger); box-shadow: 0 0 12px rgba(232,98,76,.5); }
.tl-register .tl-dot { border-color: var(--gold); box-shadow: 0 0 12px rgba(205,163,12,.5); }
.tl-top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.tl-top time { margin-inline-start: auto; }
.tl-arrow { display: inline-flex; align-items: center; gap: 6px; }
[dir="rtl"] .tl-arrow > span[aria-hidden] { transform: scaleX(-1); display: inline-block; }
.tl-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 7px; font-size: 13px; color: var(--text-soft); align-items: center; }
.tl-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.tl-meta .ico { width: 15px; height: 15px; color: var(--gold-text); }
.tl-note { margin-top: 8px; font-size: 13.5px; background: var(--well); padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); }
.tl-override { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-text); }

/* activity list */
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li { display: grid; grid-template-columns: auto auto 1fr auto; gap: 14px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.activity-list li:last-child { border-bottom: 0; }

/* employee home */
.hero-scan { text-align: center; padding: 40px 22px 34px; border-radius: 26px; margin-bottom: 22px; display: grid; gap: 14px; justify-items: center; }
.hero-scan h1 { font-size: 26px; }

/* empty state */
.empty-state { text-align: center; padding: 40px 22px; display: grid; gap: 12px; justify-items: center; }
.empty-icon, .error-icon { width: 62px; height: 62px; border-radius: 50%; color: var(--gold-text); background: var(--gold-soft); border: 1px solid rgba(205,163,12,.4); display: grid; place-items: center; }
.empty-icon .ico, .error-icon .ico { width: 28px; height: 28px; }

/* reports */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-bottom: 18px; }
.report-card { color: inherit; display: grid; gap: 8px; margin: 0; align-content: start; text-decoration: none !important; transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s; }
.report-card:hover { transform: translateY(-3px); border-color: rgba(205,163,12,.4); }
.rc-icon { width: 40px; height: 40px; border-radius: 12px; color: var(--gold-text); background: var(--gold-soft); border: 1px solid rgba(205,163,12,.4); display: grid; place-items: center; }
.rc-icon .ico { width: 19px; height: 19px; }
.checklist { margin: 0 0 6px; padding-inline-start: 18px; display: grid; gap: 7px; font-size: 14px; color: var(--text-soft); line-height: 1.6; }

/* QR */
.qr-card { display: grid; gap: 16px; justify-items: center; text-align: center; }
.qr-box { width: 260px; height: 260px; padding: 14px; background: #fff; border-radius: 20px; display: grid; place-items: center;
  box-shadow: 0 24px 50px -24px rgba(205,163,12,.55), 0 0 0 1px rgba(205,163,12,.4); }
.qr-box svg { width: 100%; height: 100%; }
.qr-url { overflow-wrap: anywhere; }
.sticker-form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; padding: 14px; background: var(--well); border-radius: 16px; border: 1px solid var(--line); }

/* scanner */
.scan-card { max-width: 580px; margin-inline: auto; display: grid; gap: 14px; }
.viewfinder { position: relative; aspect-ratio: 1 / 1; border-radius: 20px; overflow: hidden; background: #000; border: 1px solid var(--line-2); }
.viewfinder video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vf-frame { position: absolute; inset: 16%; pointer-events: none; }
.vf-frame span { position: absolute; width: 36px; height: 36px; border: 4px solid var(--gold-hi); filter: drop-shadow(0 0 8px rgba(233,194,78,.6)); }
.vf-frame span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; }
.vf-frame span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 12px 0 0; }
.vf-frame span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 12px; }
.vf-frame span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 12px 0; }
.vf-overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: #F4EBDD; text-align: center; padding: 20px;
  background: radial-gradient(60% 60% at 50% 50%, rgba(205,163,12,.12), rgba(0,0,0,.6)); }
.scan-status { text-align: center; font-weight: 700; min-height: 1.6em; color: var(--gold-text); }
.scan-status.err { color: var(--danger-text); }

/* movement */
.mv { max-width: 780px; margin-inline: auto; }
.mv-router-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--gold-text); }
[dir="rtl"] .eyebrow { letter-spacing: 0; font-size: 12px; }
.mv-router h1 { font-size: 30px; margin: 4px 0; font-family: var(--mono); letter-spacing: -.01em; }
.mv-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.mv-facts dt { font-size: 12px; color: var(--text-faint); margin-bottom: 3px; }
.mv-facts dd { margin: 0; font-weight: 700; font-size: 14px; }
.gps-body { display: grid; gap: 12px; }
.gps-chip { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; justify-self: start; height: 34px; padding: 0 15px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: var(--neutral-soft); border: 1px solid var(--neutral-line); color: var(--text-soft); }
.gps-chip.r-verified { background: var(--ok-soft); color: var(--ok-text); border-color: var(--ok-line); box-shadow: 0 0 22px -6px rgba(76,201,140,.6); }
.gps-chip.r-needs_review { background: var(--warn-soft); color: var(--warn-text); border-color: var(--warn-line); }
.gps-chip.r-unable_to_verify { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger-line); }
.gps-facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.gps-facts li { background: var(--well); border: 1px solid var(--line); border-radius: 14px; padding: 9px 13px; font-size: 14px; }
.gps-facts li span { display: block; font-size: 12px; color: var(--text-faint); }
.gps-facts li strong { font-variant-numeric: tabular-nums; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.action-cards { display: grid; gap: 12px; margin-bottom: 18px; }
.action-card { position: relative; display: flex; align-items: center; gap: 14px; padding: 15px 16px; border: 1px solid var(--line-2); border-radius: 16px; cursor: pointer;
  background: rgba(255,255,255,.035); transition: transform .3s var(--ease), border-color .3s, background .3s, box-shadow .3s; }
.action-card:hover { transform: translateY(-2px); background: rgba(255,255,255,.07); box-shadow: 0 14px 26px -16px rgba(0,0,0,.9); }
[data-theme="light"] .action-card { background: var(--well); }
.action-card input { position: absolute; opacity: 0; pointer-events: none; }
.action-card:has(input:checked) { border-color: rgba(205,163,12,.6); background: linear-gradient(135deg, rgba(205,163,12,.22), rgba(205,163,12,.05)); box-shadow: inset 0 1px 0 rgba(255,232,150,.3), 0 14px 28px -16px rgba(205,163,12,.7); }
.action-card:has(input:focus-visible) { outline: 2px solid var(--gold-text); outline-offset: 2px; }
.ac-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; border: 1px solid; }
.ac-pickup .ac-icon { color: var(--info-text); background: var(--info-soft); border-color: var(--info-line); }
.ac-deploy .ac-icon { color: var(--ok-text); background: var(--ok-soft); border-color: var(--ok-line); }
.ac-return_storage .ac-icon { color: var(--neutral-text); background: var(--neutral-soft); border-color: var(--neutral-line); }
.ac-text { display: grid; gap: 2px; }
.ac-text strong { font-size: 15px; }
.ac-text small { color: var(--text-faint); }
.mv-form .field { margin-bottom: 16px; }
.field.override { border-inline-start: 3px solid var(--warn); padding-inline-start: 13px; }
.mv-done { text-align: center; display: grid; gap: 12px; justify-items: center; padding: 40px 22px; }
.done-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 700; color: #1C1404;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); box-shadow: 0 18px 38px -14px rgba(205,163,12,.9), inset 0 1px 0 rgba(255,246,205,.7); animation: pop .5s var(--ease) backwards; }

/* ---------- bare pages (sign-in, errors) ---------- */
body.bare { min-height: 100vh; display: flex; flex-direction: column; }
.bare-main { flex: 1; display: grid; place-items: center; padding: 24px; }
.bare-foot { text-align: center; font-size: 12.5px; color: var(--text-faint); padding: 18px; }
.login-card { width: 100%; max-width: 420px; border-radius: 26px; padding: 36px 32px 28px; display: grid; gap: 18px; animation: pop .6s var(--ease) backwards; }
.login-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.login-brand h1 { font-size: 24px; }
.login-lead { color: var(--text-soft); text-align: center; }
.gsi-wrap { display: flex; justify-content: center; min-height: 44px; }
.login-error { padding: 12px 14px; border-radius: 13px; background: var(--danger-soft); border: 1px solid var(--danger-line); color: var(--danger-text); font-size: 14px; font-weight: 600; }
.login-busy { text-align: center; }
.login-foot { font-size: 12.5px; text-align: center; color: var(--text-faint); }
.login-prefs { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.dev-login { display: grid; gap: 10px; padding: 14px; border: 1px dashed var(--danger-line); border-radius: 16px; }
.dev-tag { font-size: 11px; font-weight: 700; color: var(--danger-text); font-family: var(--mono); }
.error-card { text-align: center; max-width: 460px; margin: 40px auto; padding: 34px 28px; border-radius: 26px; display: grid; gap: 14px; justify-items: center; }
.error-code { font: 700 56px/1 var(--font-display); background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- bottom nav (phones) ---------- */
.bottom-nav { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1400px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 980px) {
  .shell { display: block; padding: 12px; }
  .sidebar { position: fixed; top: 12px; bottom: 12px; inset-inline-start: 12px; max-height: none; width: 280px; transform: translateX(calc(-100% - 24px)); transition: transform .3s var(--ease); animation: none; }
  [dir="rtl"] .sidebar { transform: translateX(calc(100% + 24px)); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
  [data-theme="light"] body.nav-open .scrim { background: rgba(31,26,18,.30); }
  .main { gap: 14px; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 14px; gap: 12px; flex-wrap: nowrap; }
  [dir="rtl"] .topbar { padding: 12px 14px; }
  .topbar h1 { font-size: 22px; }
  .user-meta, .role-tag { display: none; }
  .user-chip { padding: 3px; border: 0; background: none; }
  .card { padding: 18px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .content { padding-bottom: 110px; }
}
@media (max-width: 768px) {
  .top-actions { gap: 6px; }
  .lang-toggle, .theme-toggle { min-height: 38px; padding: 0 12px; }
  .theme-toggle .tt-label { display: none; }
  .user-chip, .logout-form { display: none; }
  .top-sub { display: none; }
  .bottom-nav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; position: fixed; inset-inline: 10px; bottom: 10px; z-index: 30;
    border-radius: 24px; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); animation: none; }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; color: var(--text-faint); font: 700 11px var(--font);
    background: none; border: 0; cursor: pointer; text-decoration: none !important; }
  .bottom-nav a.active { color: var(--gold-text); }
  .bottom-nav .ico { width: 22px; height: 22px; }
  .bottom-nav .scan-fab { transform: translateY(-18px); gap: 4px; }
  .bottom-nav .scan-fab .ico { width: 64px; height: 64px; padding: 18px; border-radius: 50%; color: #1C1404; background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
    box-shadow: 0 16px 30px -10px rgba(205,163,12,.85), inset 0 1px 0 rgba(255,246,205,.7), 0 0 0 5px var(--bg); }
  .bottom-nav .scan-fab span { color: var(--gold-text); font-size: 12px; }
  .hide-sm { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { min-height: 118px; padding: 14px; border-radius: 18px; }
  .kpi-ic { display: none; }
  .kpi-value { font-size: 32px; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { gap: 14px; }
  .dur-totals { grid-template-columns: 1fr; }
  .mv-facts { grid-template-columns: 1fr 1fr; }
  .filters { padding: 12px; }
  .filters .field { flex: 1 1 calc(50% - 12px); min-width: 130px; }
  .filters .field.grow, .filters .field.actions { flex-basis: 100%; }
  .filters .field.actions .btn { flex: 1; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .page-head { margin-bottom: 14px; }
  .alert { margin-bottom: 14px; }

  /* tables → stacked glass rows */
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { border: 1px solid var(--line); border-radius: 16px; padding: 6px 14px; margin-bottom: 10px; background: var(--well); }
  .table.rtable tbody tr:hover { background: var(--well); }
  .rtable td { display: grid; grid-template-columns: 42% 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line) !important; text-align: start !important; }
  .rtable td:last-child { border-bottom: 0 !important; }
  .rtable td::before { content: attr(data-label); font-size: 12px; color: var(--text-faint); font-weight: 700; }
  .rtable td:not([data-label])::before { content: none; }
  .rtable td:not([data-label]) { grid-template-columns: 1fr; }
  .rtable tr.empty-row td { display: block; text-align: center !important; }
  .rtable tr.empty-row td::before { content: none; }
  tr.is-over { box-shadow: inset 4px 0 0 var(--warn); }
  [dir="rtl"] tr.is-over { box-shadow: inset -4px 0 0 var(--warn); }
  tr.is-over td:first-child { box-shadow: none; }
  .activity-list li { grid-template-columns: 1fr auto; }
  .activity-list li .muted:not(.small) { grid-column: 1 / -1; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 10px; }
  .tl-top time { margin-inline-start: 0; flex-basis: 100%; }
  .tl-meta small[dir="ltr"] { display: none; }
}
@media (min-width: 769px) {
  .router-table td:nth-child(2), .router-table td:nth-child(5), .router-table td:nth-child(7) { white-space: nowrap; }
  .history-table td:nth-child(2) { white-space: nowrap; }
}
.rtable td.mono { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  @view-transition { navigation: none; }
}

/* refinements */
.filters .field:has(input[type=date]) { flex: 0 1 170px; min-width: 150px; }
@media (max-width: 768px) {
  .filters .field:has(input[type=date]) { flex: 1 1 calc(50% - 12px); }
  .bottom-nav { background: linear-gradient(180deg, rgba(22,19,15,.92), rgba(10,8,6,.96)); }
  [data-theme="light"] .bottom-nav { background: rgba(255,255,255,.96); }
}
