/* DURUL "Liquid Glass" theme. Loaded after styles.css: it only restyles, nothing here changes behaviour.
   To go back to the old look, remove the <link> to this file from index.html and chat.html. */

@font-face { font-family: 'Cairo'; font-weight: 400; font-display: swap; src: url('/fonts/cairo/cairo-arabic-400-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Cairo'; font-weight: 500; font-display: swap; src: url('/fonts/cairo/cairo-arabic-500-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Cairo'; font-weight: 600; font-display: swap; src: url('/fonts/cairo/cairo-arabic-600-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Cairo'; font-weight: 700; font-display: swap; src: url('/fonts/cairo/cairo-arabic-700-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Cairo'; font-weight: 400; font-display: swap; src: url('/fonts/cairo/cairo-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Cairo'; font-weight: 500; font-display: swap; src: url('/fonts/cairo/cairo-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Cairo'; font-weight: 600; font-display: swap; src: url('/fonts/cairo/cairo-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Cairo'; font-weight: 700; font-display: swap; src: url('/fonts/cairo/cairo-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }

/* ---------- tokens ---------- */
:root {
  --font-sans: 'Cairo', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --color-brand-50: #eef7f1; --color-brand-100: #dcefe3; --color-brand-200: #bfe0cb; --color-brand-300: #94caa8; --color-brand-400: #63ad80;
  --color-brand-500: #3f9364; --color-brand-600: #2f7d55; --color-brand-700: #276a48; --color-brand-800: #20553a; --color-brand-900: #18402c;
  --color-accent: #2f7d55; --color-accent-strong: #276a48; --color-accent-ink: #ffffff; --color-accent-soft: #e3f1e8; --color-accent-soft-ink: #1f5a3c; --color-progress: #3d9a68;
  --color-code: #2f4aa8; --color-code-bg: #eef2fd; --color-code-edge: #d6def8;
  --color-canvas: #eef2f7; --color-panel: rgb(255 255 255 / 0.66); --color-panel-solid: #ffffff; --color-panel-2: rgb(255 255 255 / 0.5);
  --color-side: rgb(255 255 255 / 0.58); --color-side-2: rgb(255 255 255 / 0.55); --color-side-line: rgb(15 23 42 / 0.09); --color-side-text: #2a3344;
  --color-ink: #0b1220; --color-muted: #4a5466; --color-line: rgb(15 23 42 / 0.11); --color-edge: rgb(47 125 85 / 0.42);
  --color-ok: #26773f; --color-warn: #965a08; --color-bad: #c2373d; --color-info: #2f7d55;
  --radius-lg: 0.5rem; --radius-xl: 0.75rem; --radius-2xl: 1rem; --radius-3xl: 1.25rem;
  --shadow-card: inset 0 1px 0 rgb(255 255 255 / 0.85), 0 1px 2px rgb(15 23 42 / 0.06), 0 10px 28px -14px rgb(15 23 42 / 0.18);
  --shadow-pop: inset 0 1px 0 rgb(255 255 255 / 0.9), 0 18px 40px rgb(15 23 42 / 0.16), 0 2px 6px rgb(15 23 42 / 0.08);
  --slate-50: #f8fafc; --slate-100: #f1f5f9; --slate-200: #e2e8f0; --slate-300: #cbd5e1; --slate-400: #94a3b8; --slate-500: #64748b; --slate-700: #334155;
  --side-w: 256px;

  /* the old names the screens use, pointed at the theme */
  --blue-900: var(--color-brand-800); --blue-700: var(--color-accent); --blue-600: var(--color-brand-500); --blue-100: var(--color-accent-soft);
  --ink: var(--color-ink); --ink-2: var(--color-muted); --ink-3: #5b6474;
  --line: var(--color-line); --line-soft: rgb(15 23 42 / 0.077); --bg: var(--color-canvas); --panel: var(--color-panel);
  --field: var(--color-panel); --field-line: var(--color-line); --soft: rgb(241 245 249 / 0.7); --hover: rgb(238 247 241 / 0.5);
  --green: var(--color-ok); --green-bg: #ecfdf5; --amber: var(--color-warn); --amber-bg: #fffbeb; --red: var(--color-bad); --red-bg: #fef2f2;
  --radius: var(--radius-2xl);
  --pick: var(--color-accent); --pick-ink: var(--color-accent-ink); --pick-soft: var(--color-accent-soft);
}
html[data-theme=dark] {
  --color-canvas: #0d141c; --color-panel: rgb(23 33 44 / 0.72); --color-panel-solid: #17212c; --color-panel-2: rgb(23 33 44 / 0.55);
  --color-side: rgb(17 26 36 / 0.72); --color-side-2: rgb(255 255 255 / 0.06); --color-side-line: rgb(255 255 255 / 0.08); --color-side-text: #d5dde6;
  --color-ink: #e7edf4; --color-muted: #b7c3cf; --color-line: rgb(255 255 255 / 0.1); --color-edge: rgb(99 173 128 / 0.35);
  --color-accent-soft: #163a29; --color-code: #a9bdf5; --color-code-bg: #1b2440; --color-code-edge: #2b3866;
  --shadow-card: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 28px -14px rgb(0 0 0 / 0.5);
  --shadow-pop: 0 18px 40px rgb(0 0 0 / 0.45);
  --ink-3: #94a3b3; --soft: rgb(255 255 255 / 0.05); --hover: rgb(255 255 255 / 0.05); --line-soft: rgb(255 255 255 / 0.07);
  --green-bg: #123a2c; --amber-bg: #3a2c0e; --red-bg: #43201e; --green: #62d6aa; --amber: #f1c46b; --red: #ff9a91;
  --slate-50: rgb(255 255 255 / 0.04); --slate-100: rgb(255 255 255 / 0.06); --slate-200: rgb(255 255 255 / 0.08);
}

/* ---------- base ---------- */
html { font-family: var(--font-sans); background: var(--color-canvas); color: var(--color-ink); }
html:not([data-theme=dark]) { color-scheme: light; }
body {
  font: 400 13.5px/1.6 var(--font-sans); -webkit-font-smoothing: antialiased; color: var(--color-ink);
  background:
    radial-gradient(60rem 40rem at 100% -10%, rgb(186 230 214 / 0.55), transparent 60%),
    radial-gradient(50rem 36rem at -10% 10%, rgb(199 215 255 / 0.6), transparent 60%),
    radial-gradient(48rem 40rem at 50% 110%, rgb(226 214 255 / 0.45), transparent 60%),
    var(--color-canvas);
  background-attachment: fixed;
}
html[data-theme=dark] body {
  background:
    radial-gradient(60rem 40rem at 100% -10%, rgb(47 125 85 / 0.18), transparent 60%),
    radial-gradient(50rem 36rem at -10% 10%, rgb(53 89 199 / 0.16), transparent 60%),
    var(--color-canvas);
  background-attachment: fixed;
}
h1 { font-size: 19px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 14px; font-weight: 600; }
@media (min-width: 640px) { h1 { font-size: 22px; } }
a { color: var(--color-brand-600); }
:focus-visible { outline: 2px solid var(--color-brand-500); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--color-accent-soft); }
* { scrollbar-width: thin; scrollbar-color: #9d978a #e4e0d5; }
html[data-theme=dark] * { scrollbar-color: #4b5563 #111827; }
.small { font-size: 12px; }
.muted { color: var(--ink-3); }

/* glass on every card, bar and menu */
.panel, .side, .topbar, .top, .dash-tile, .dash-check, .dash-actions a, .order-card, .kanban-col, .cand, .drv-card, .drv-stats > div, .push-card,
.acc-toggle, .acc-device, .driver-chip, .results, .notif-panel, .summary div, .login-alert {
  -webkit-backdrop-filter: blur(18px) saturate(1.7); backdrop-filter: blur(18px) saturate(1.7);
}

/* ---------- cards ---------- */
.panel { background: var(--color-panel); border: 1px solid var(--color-edge); border-radius: var(--radius-2xl); box-shadow: var(--shadow-card); padding: 16px; }
@media (min-width: 640px) { .panel { padding: 20px; } }
.panel > h2 { margin-bottom: 12px; }
.content { gap: 12px; }
.grid-2, .grid-main, .dash-grid { gap: 12px; }
.order-card, .kanban-col, .summary div { border: 1px solid var(--color-edge); background: var(--color-panel); box-shadow: var(--shadow-card); }
.order-card { border-radius: var(--radius-2xl); padding: 12px 16px; }
.kanban-col { border-radius: var(--radius-2xl); }
.summary div { border-radius: var(--radius-xl); padding: 12px 16px; }
.summary b { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary span { font-size: 12px; }
.empty-state { border: 1px dashed var(--slate-300); background: rgb(255 255 255 / 0.4); border-radius: var(--radius-2xl); padding: 40px 16px; }
.empty-icon { border-radius: 999px; padding: 10px; background: var(--slate-100); color: var(--slate-500); }
.empty-icon svg { width: 20px; height: 20px; }
.empty { color: var(--color-muted); font-size: 13px; }
.error-box { background: var(--red-bg); color: var(--color-bad); border: 1px solid #fecaca; border-radius: var(--radius-lg); font-size: 14px; }
html[data-theme=dark] .error-box { border-color: #7f1d1d; }
.note-box { border-radius: var(--radius-lg); border: 1px solid #fde68a; }
html[data-theme=dark] .note-box { border-color: #78350f; }

/* ---------- buttons ---------- */
.btn {
  min-height: 36px; padding: 0 14px; gap: 6px; border-radius: var(--radius-lg); font-size: 13px; font-weight: 500;
  border: 1px solid var(--color-line); background: var(--color-panel); color: var(--color-ink); box-shadow: var(--shadow-card);
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover:not(:disabled) { border-color: var(--slate-300); background: var(--color-panel-2); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); font-weight: 600; box-shadow: 0 1px 2px rgb(47 125 85 / 0.3); }
.btn.primary:hover:not(:disabled) { background: var(--color-accent-strong); border-color: var(--color-accent-strong); }
.btn.danger { background: var(--color-bad); border-color: var(--color-bad); color: #fff; }
.btn.danger:hover:not(:disabled) { background: #b91c1c; border-color: #b91c1c; }
.btn.big { min-height: 44px; font-size: 14px; }
.btn.has-unread { background: var(--color-accent-soft); border-color: var(--color-brand-500); color: var(--color-accent-soft-ink); }
.icon-btn:hover { background: var(--red-bg); color: var(--color-bad); }
.tool { width: 36px; height: 36px; border: 1px solid var(--color-line); border-radius: var(--radius-lg); background: var(--color-panel); color: var(--color-muted); box-shadow: var(--shadow-card); }
.tool svg { width: 20px; height: 20px; }
.tool:hover { border-color: var(--slate-300); }
@media (pointer: coarse) {
  .btn { min-height: 44px; padding: 0 16px; }
  .btn.small { min-height: 40px; }
  .tool { width: 44px; height: 44px; }
}

/* ---------- fields ---------- */
label.field { gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--slate-700); }
html[data-theme=dark] label.field { color: var(--color-muted); }
input, select, textarea {
  min-height: 36px; padding: 0 12px; border: 1px solid var(--color-line); border-radius: var(--radius-lg);
  background: var(--color-panel); color: var(--color-ink); font-size: 13px; box-shadow: var(--shadow-card);
}
textarea { padding: 8px 12px; line-height: 1.6; }
select { padding-inline-end: 32px; }
input::placeholder, textarea::placeholder { color: var(--slate-500); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--color-brand-400); box-shadow: 0 0 0 4px var(--color-brand-100); }
html[data-theme=dark] :is(input, select, textarea):focus { box-shadow: 0 0 0 4px rgb(63 147 100 / 0.3); }
input:disabled, select:disabled, textarea:disabled { background: var(--slate-50); color: var(--slate-500); }
input[type=checkbox], input[type=radio] { min-height: 0; width: 16px; height: 16px; padding: 0; box-shadow: none; accent-color: var(--color-brand-600); }
input.switch { box-shadow: none; }
input[type=date], input[type=month], input[type=time], input[type=datetime-local] { min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; text-align: start; }
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select { min-height: 44px; }
  input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea, select { font-size: 16px; }
}
.pos-search input { min-height: 44px; font-size: 16px; border-color: var(--color-brand-400); }
.quick-search input { background: var(--color-side-2); border-color: var(--color-side-line); box-shadow: none; }
.form-row { gap: 12px 10px; }

/* ---------- badges ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; line-height: 1.5; white-space: nowrap; background: var(--slate-100); color: var(--slate-700);
}
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--slate-400); flex: none; }
.tag.green { background: #ecfdf5; color: #047857; } .tag.green::before { background: #10b981; }
.tag.amber { background: #fffbeb; color: #b45309; } .tag.amber::before { background: #f59e0b; }
.tag.red { background: #fef2f2; color: #b91c1c; } .tag.red::before { background: #ef4444; }
.tag.blue { background: var(--color-brand-50); color: var(--color-brand-600); } .tag.blue::before { background: var(--color-brand-500); }
.tag.grey { background: var(--slate-100); color: var(--slate-700); }
html[data-theme=dark] .tag { background: rgb(255 255 255 / 0.07); color: var(--color-muted); }
html[data-theme=dark] .tag.green { background: #123a2c; color: #7ee2b5; }
html[data-theme=dark] .tag.amber { background: #3a2c0e; color: #f5cf7a; }
html[data-theme=dark] .tag.red { background: #43201e; color: #ffaaa2; }
html[data-theme=dark] .tag.blue { background: #163a29; color: #8fd6ad; }
.nav-badge, .tool-badge { background: var(--color-bad); }

/* ---------- tables ---------- */
.table-wrap { border-radius: var(--radius-xl); }
th { font-size: 12px; font-weight: 500; color: var(--color-muted); padding: 10px 16px; background: rgb(248 250 252 / 0.7); border-bottom: 1px solid var(--color-line); }
html[data-theme=dark] th { background: rgb(255 255 255 / 0.03); }
td { font-size: 13px; font-weight: 500; padding: 12px 16px; border-bottom: 1px solid rgb(15 23 42 / 0.077); font-variant-numeric: tabular-nums; }
td.num, th.num { white-space: nowrap; }
tr.link:hover td { background: rgb(238 247 241 / 0.5); }
tbody tr:not(.link):hover td { background: rgb(248 250 252 / 0.6); }
html[data-theme=dark] tbody tr:hover td { background: rgb(255 255 255 / 0.03); }
td:first-child { font-weight: 650; color: var(--color-ink); }
.done td { color: var(--ink-3); }
@media (min-width: 761px) and (max-width: 1100px) { th, td { padding: 8px; font-size: 12.5px; } }

/* ---------- tabs and filters ---------- */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--radius-xl); background: rgb(226 232 240 / 0.6); }
html[data-theme=dark] .tabs { background: rgb(255 255 255 / 0.06); }
.tabs a { border: 0; border-radius: var(--radius-lg); padding: 6px 12px; font-size: 13px; color: var(--color-muted); font-weight: 500; }
.tabs a.on { background: var(--color-panel-solid); color: var(--color-ink); font-weight: 600; border: 0; box-shadow: var(--shadow-card); }
.segmented { border-radius: var(--radius-xl); background: rgb(226 232 240 / 0.6); }
.segmented button { border-radius: var(--radius-lg); font-size: 13px; }
.segmented button.on { background: var(--color-panel-solid); font-weight: 600; box-shadow: var(--shadow-card); }

/* ---------- page header ---------- */
.top { background: transparent; border-bottom: 0; padding: 24px 24px 0; }
.top p { font-size: 13px; color: var(--color-muted); }
.page-icon { border-radius: var(--radius-xl); background: var(--color-accent-soft); color: var(--color-accent); }
.content { padding: 12px 24px 40px; max-width: 1400px; width: 100%; margin-inline: auto; }
@media (min-width: 640px) { .content { padding-top: 24px; } }
.top { max-width: 1400px; width: 100%; margin-inline: auto; }
.page-actions { gap: 8px; }

/* top bar: sticky, glass, 56px */
.topbar { position: sticky; top: 0; z-index: 25; min-height: 56px; background: rgb(255 255 255 / 0.6); border-bottom: 1px solid var(--color-line); padding: 8px 24px; }
html[data-theme=dark] .topbar { background: rgb(17 26 36 / 0.7); }
.demo-bar { font-size: 12px; }
.alert-bar { font-size: 13.5px; }
.alert-bar.red { font-size: 14px; }

/* ---------- dialogs and toasts ---------- */
dialog { background: var(--color-panel-solid); border-radius: var(--radius-2xl); box-shadow: var(--shadow-pop); outline: 1px solid var(--color-edge); padding: 16px 20px; width: min(576px, calc(100vw - 24px)); }
dialog.wide { width: min(896px, calc(100vw - 24px)); }
dialog::backdrop { background: rgb(2 6 23 / 0.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog > .stack > h2:first-child { font-size: 15px; font-weight: 600; padding-bottom: 12px; border-bottom: 1px solid var(--color-line); }
.dialog-actions { position: sticky; bottom: -16px; margin: 4px -20px -16px; padding: 12px 20px; background: var(--slate-50); border-top: 1px solid var(--color-line); border-radius: 0 0 var(--radius-2xl) var(--radius-2xl); }
#toasts { bottom: 24px; inset-inline-start: 24px; }
.toast { background: var(--color-brand-800); border-radius: var(--radius-lg); padding: 12px 16px; font-size: 14px; box-shadow: 0 18px 40px rgb(15 23 42 / 0.25); }
.toast.err { background: var(--color-bad); }

/* ---------- dashboard ---------- */
.dash-hero.hero, .hero { background: var(--color-panel); color: var(--color-ink); border: 1px solid var(--color-edge); box-shadow: var(--shadow-card); border-radius: var(--radius-2xl); padding: 20px; -webkit-backdrop-filter: blur(18px) saturate(1.7); backdrop-filter: blur(18px) saturate(1.7); }
.hero h1 { font-size: 19px; }
@media (min-width: 640px) { .hero h1 { font-size: 22px; } }
.hero-date { background: var(--color-accent-soft); color: var(--color-accent-soft-ink); font-size: 12px; border-radius: var(--radius-lg); }
.dash-sub { color: var(--color-muted); font-size: 13px; }
.dash-tile { position: relative; overflow: hidden; background: var(--color-panel); border: 1px solid var(--color-edge); border-radius: var(--radius-2xl); box-shadow: var(--shadow-card); padding: 12px 16px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 8px; }
.dash-tile::after { content: ''; position: absolute; inset-inline: 1rem; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--kpi-bar); }
.dash-tile-icon { width: 24px; height: 24px; border-radius: 6px; background: var(--kpi-tint); color: var(--kpi-ink); align-self: start; margin-top: 2px; }
.dash-tile-icon svg { width: 14px; height: 14px; }
.dash-tile b { font-size: 19px; color: var(--color-ink); order: 2; }
.dash-tile span { color: var(--color-muted); font-size: 12px; }
.dash-tile:nth-child(1) { --kpi-tint: #e3f1e8; --kpi-ink: #276a48; --kpi-bar: #7fcca0; }
.dash-tile:nth-child(2) { --kpi-tint: #e4ecfd; --kpi-ink: #3559c7; --kpi-bar: #8fb0f7; }
.dash-tile:nth-child(3) { --kpi-tint: #fde4eb; --kpi-ink: #ad2a4f; --kpi-bar: #f59ab2; }
.dash-tile:nth-child(4) { --kpi-tint: #ece6fd; --kpi-ink: #6a48d6; --kpi-bar: #b9a4f6; }
.dash-trend { font-size: 11.5px !important; }
.dash-trend.up { background: var(--color-ok); }
.dash-trend.down { background: var(--color-bad); }
.dash-actions a { border: 1px solid var(--color-edge); border-radius: var(--radius-xl); background: var(--color-panel); box-shadow: var(--shadow-card); font-size: 13px; font-weight: 600; }
.dash-actions a span { background: var(--color-accent-soft); color: var(--color-accent); border-radius: var(--radius-lg); }
.dash-actions a.first { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.dash-actions a.first span { background: rgb(255 255 255 / 0.2); color: #fff; }
.dash-check { border: 1px solid var(--color-edge); border-radius: var(--radius-xl); background: var(--color-panel); box-shadow: var(--shadow-card); }
.dash-check b { font-size: 19px; font-variant-numeric: tabular-nums; }
.dash-check-label { font-size: 13px; font-weight: 600; }
.dash-check small { font-size: 11.5px; }
.col-track i { background: color-mix(in srgb, var(--color-progress) 55%, transparent); }
.col.today .col-track i { background: var(--color-accent); }
.dash-top .rank { background: var(--color-code-bg); color: var(--color-code); }
.dash-top li:first-child .rank { background: var(--color-accent); color: #fff; }
.dash-top .meter i { background: var(--color-progress); }
.feed-icon { background: var(--color-accent-soft); color: var(--color-accent); }
@media (min-width: 1024px) { .dash-tiles, .dash-checks { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* phone: KPI tiles become one rounded list */
@media (max-width: 639px) {
  .dash-tiles { grid-template-columns: minmax(0, 1fr) !important; gap: 0 !important; border: 1px solid var(--color-edge); border-radius: var(--radius-2xl); background: var(--color-panel); overflow: hidden; }
  .dash-tile { border: 0; border-radius: 0; box-shadow: none; background: transparent; border-bottom: 1px solid var(--color-line); grid-template-columns: auto minmax(0, 1fr) auto; padding: 10px 14px; }
  .dash-tile:last-child { border-bottom: 0; }
  .dash-tile::after { display: none; }
  .dash-tile-icon { width: 32px; height: 32px; border-radius: 8px; margin: 0; align-self: center; }
  .dash-tile-icon svg { width: 16px; height: 16px; }
  .dash-tile > div { display: contents; }
  .dash-tile-icon { grid-column: 1; grid-row: 1 / span 2; }
  .dash-tile b { grid-column: 3; grid-row: 1 / span 2; font-size: 14.5px; }
  .dash-tile > div > span:not(.dash-trend) { grid-column: 2; grid-row: 1; font-size: 12.5px; }
  .dash-tile .dash-trend { grid-column: 2; grid-row: 2; font-size: 11px !important; }
}

/* ---------- other screens ---------- */
.ddi-box { border-radius: var(--radius-lg); }
.alert-card { border-radius: var(--radius-xl); border-color: var(--color-edge); background: var(--color-panel); }
.result:hover { background: var(--color-brand-50); }
.result.on { background: var(--color-accent-soft); box-shadow: inset -3px 0 0 var(--color-accent); }
.results, .notif-panel { background: var(--color-panel-solid); border: 1px solid var(--color-edge); border-radius: var(--radius-xl); box-shadow: var(--shadow-pop); }
.support-row { border-color: var(--color-line); border-radius: var(--radius-lg); }
.support-row.on { background: var(--color-accent-soft); border-color: var(--color-brand-500); }
.chat-thread, .msg-list { background: rgb(241 245 249 / 0.6); border-radius: var(--radius-xl); }
.msg.mine { background: var(--color-accent); }
.bubble.customer { background: var(--color-accent-soft); }
.cand { border-color: var(--color-edge); border-radius: var(--radius-xl); background: var(--color-panel); }
.cand.best { border-color: var(--color-brand-500); box-shadow: 0 0 0 1px var(--color-brand-500); background: var(--color-brand-50); }
.drv-card, .drv-stats > div, .push-card, .acc-toggle, .acc-device, .driver-chip { border-color: var(--color-edge); background: var(--color-panel); box-shadow: var(--shadow-card); }
.drv-card { border-radius: var(--radius-2xl); }
.drv-card.out { border-inline-start-color: #f3cd6b; }
.drv-card:not(.out) { border-inline-start-color: var(--color-accent); }
.acc-icon { background: var(--color-accent-soft); color: var(--color-accent); border-radius: var(--radius-xl); }
.avatar { background: linear-gradient(135deg, var(--color-brand-500), #3559c7); }
input.switch:checked { background: var(--color-accent); }
.total { font-size: 28px; font-variant-numeric: tabular-nums; }
.hint-btn { border-radius: var(--radius-lg); }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* customer chat page */
.chat-page { background: transparent; }
.chat-card { background: var(--color-panel); border: 1px solid var(--color-edge); border-radius: var(--radius-2xl); box-shadow: var(--shadow-pop); -webkit-backdrop-filter: blur(18px) saturate(1.7); backdrop-filter: blur(18px) saturate(1.7); }

/* sign-in card (the moving scenes behind it stay) */
.login-card { border-radius: var(--radius-3xl); background: var(--color-panel-solid); box-shadow: var(--shadow-pop); }

/* ---------- side menu (laptop and up) ---------- */
.side {
  background: var(--color-side); color: var(--color-side-text); border-inline-end: 1px solid var(--color-line);
  padding: 14px 10px; box-shadow: none;
}
.brand { display: block; color: inherit; text-decoration: none; border-bottom: 1px solid var(--color-side-line); text-align: center; padding: 4px 8px 12px; border-radius: var(--radius-lg); }
.brand:hover strong { color: var(--color-accent); }
.brand strong { font-size: 15px; font-weight: 700; color: var(--color-ink); }
.brand span { font-size: 10.5px; letter-spacing: .12em; color: var(--color-muted); }
.nav { gap: 8px; }
.nav-group { background: transparent; border: 0; padding: 0; border-radius: 0; }
.nav-group.here { background: transparent; }
.nav-head { color: var(--color-ink); font-size: 12px; font-weight: 700; padding: 12px 10px 4px; }
.nav-head:hover { background: var(--color-side-2); }
.nav-title { color: var(--color-ink); font-size: 12px; }
.nav-count { background: var(--color-side-2); color: var(--color-side-text); border: 1px solid var(--color-side-line); font-size: 10.5px; font-weight: 600; border-radius: 6px; }
.nav-items { border-top: 0; gap: 2px; }
.nav a { color: var(--color-side-text); font-size: 13px; font-weight: 500; padding: 7px 10px; gap: 10px; border-radius: var(--radius-lg); }
.nav-items a { font-size: 13px; }
.nav a:hover { background: var(--color-side-2); }
.nav a:hover svg { filter: brightness(.9); }
.nav a.on { background: var(--color-accent); color: var(--color-accent-ink); font-weight: 600; box-shadow: 0 1px 2px rgb(47 125 85 / 0.3); }
html[dir=ltr] .nav a.on { box-shadow: 0 1px 2px rgb(47 125 85 / 0.3); }
.nav a.on svg { color: #fff; filter: none; }
.nav svg { width: 17px; height: 17px; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (pointer: coarse) { .nav a { padding: 10px; } }
/* a colour per section */
.nav-home svg { color: #059669; }
.nav-group:nth-of-type(2) svg { color: #f97316; }
.nav-group:nth-of-type(3) svg { color: #0284c7; }
.nav-group:nth-of-type(4) svg { color: #7c3aed; }
.nav-group:nth-of-type(5) svg { color: #f43f5e; }
.nav-group:nth-of-type(6) svg { color: #64748b; }
.nav-head .nav-chevron { color: var(--color-muted); }
.side-foot { border-top: 1px solid var(--color-side-line); }
.side-foot strong, .side-me { color: var(--color-ink); }
.side-me:hover { background: var(--color-side-2); }
.side-foot button { border: 1px solid var(--color-side-line); background: var(--color-side-2); color: var(--color-side-text); border-radius: var(--radius-lg); min-height: 30px; font-size: 12.5px; }
.side-foot .small { color: var(--color-muted); }
.avatar.small { box-shadow: 0 0 0 2px var(--color-panel-solid); }
.side-pin { display: none; }

@media (min-width: 1024px) {
  html:not([data-nav=top]):not([data-nav=bottom]) .shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  html[data-nav=end] .shell { grid-template-columns: minmax(0, 1fr) var(--side-w); }
  .side { transition: width .2s; }
}
/* 1024–1439px: the menu starts as icons and opens over the page on hover, unless pinned */
@media (min-width: 1024px) and (max-width: 1439px) {
  html:not([data-pinned=true]):not([data-nav=top]):not([data-nav=bottom]) { --side-w: 72px; }
  html:not([data-pinned=true]):not([data-nav=top]):not([data-nav=bottom]) .side:not(:hover):not(:focus-within) :is(.nav-label, .nav-title, .nav-count, .nav-chevron, .brand span, .side-foot > div, .side-me > span:last-child, .side-pin span) { display: none; }
  html:not([data-pinned=true]):not([data-nav=top]):not([data-nav=bottom]) .side:not(:hover):not(:focus-within) .nav-items { display: grid; }
  html:not([data-pinned=true]):not([data-nav=top]):not([data-nav=bottom]) .side:not(:hover):not(:focus-within) .nav-head { justify-content: center; padding: 4px 0; pointer-events: none; }
  html:not([data-pinned=true]):not([data-nav=top]):not([data-nav=bottom]) .side:not(:hover):not(:focus-within) .nav-head svg { display: none; }
  html:not([data-pinned=true]):not([data-nav=top]):not([data-nav=bottom]) .side:not(:hover):not(:focus-within) .nav-group + .nav-group { border-top: 1px solid var(--color-side-line); padding-top: 10px; margin-top: 2px; }
  html:not([data-pinned=true]):not([data-nav=top]):not([data-nav=bottom]) .side:not(:hover):not(:focus-within) .nav a { justify-content: center; position: relative; }
  html:not([data-pinned=true]):not([data-nav=top]):not([data-nav=bottom]) .side:not(:hover):not(:focus-within) .brand strong { font-size: 12px; }
  html:not([data-pinned=true]):not([data-nav=top]):not([data-nav=bottom]) .side:not(:hover):not(:focus-within) .nav-badge { position: absolute; top: 2px; inset-inline-end: 6px; min-width: 8px; height: 8px; padding: 0; font-size: 0; }
  html:not([data-pinned=true]):not([data-nav=top]):not([data-nav=bottom]) .side { width: 72px; z-index: 40; }
  html:not([data-pinned=true]):not([data-nav=top]):not([data-nav=bottom]) .side:is(:hover, :focus-within) { width: 256px; background: var(--color-panel-solid); box-shadow: var(--shadow-pop); }
  .side-pin { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 8px; min-height: 30px; border: 1px solid var(--color-side-line); border-radius: var(--radius-lg); background: var(--color-side-2); color: var(--color-side-text); font: inherit; font-size: 12.5px; cursor: pointer; }
  html[data-pinned=true] .side-pin { background: var(--color-accent-soft); color: var(--color-accent-soft-ink); border-color: var(--color-brand-300); }
  .side-pin svg { width: 16px; height: 16px; }
}

/* ---------- phones and tablets (under 1024px): header, drawer and bottom bar ---------- */
.bottom-bar, .side-scrim { display: none; }
@media (max-width: 1023px) {
  .shell { display: block !important; }
  .side {
    position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: space-between;
    padding: 8px 16px; min-height: 56px; overflow: visible; background: rgb(255 255 255 / 0.9); border-inline-end: 0; border-bottom: 1px solid var(--color-line);
  }
  html[data-theme=dark] .side { background: rgb(17 26 36 / 0.92); }
  /* a blur here would trap the fixed drawer inside the header */
  .side { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .brand { padding: 0; margin: 0; border: 0; text-align: start; }
  .brand strong { font-size: 15px; }
  .brand span { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; min-height: 40px; background: var(--color-panel); border: 1px solid var(--color-line); color: var(--color-ink); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 0 14px; font-size: 13px; }
  .side-body { position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(82vw, 288px); z-index: 60; background: var(--color-panel-solid); box-shadow: var(--shadow-pop);
    padding: 16px 12px calc(16px + env(safe-area-inset-bottom)); overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
    transform: translateX(105%); transition: transform .22s ease; visibility: hidden; }
  html[dir=ltr] .side-body { transform: translateX(-105%); }
  .side.open .side-body { transform: none; visibility: visible; }
  .side.open .side-body .nav, .side.open .side-body .side-foot { display: grid; margin: 0; width: 100%; }
  .side.open .side-body .side-foot { display: block; }
  .side-scrim { position: fixed; inset: 0; z-index: 55; background: rgb(0 0 0 / 0.6); }
  .side.open .side-scrim { display: block; }
  html.drawer-open, html.drawer-open body { overflow: hidden; }
  html.drawer-open .side { z-index: 70; }
  .side-pin { display: none !important; }
  .main { padding-bottom: 112px; }
  .topbar { position: static; }

  .bottom-bar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; position: fixed; z-index: 35; bottom: 0; inset-inline: 0;
    margin-inline: auto; max-width: 448px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgb(255 255 255 / 0.95); border-top: 1px solid var(--color-line); -webkit-backdrop-filter: blur(18px) saturate(1.7); backdrop-filter: blur(18px) saturate(1.7);
  }
  html[data-theme=dark] .bottom-bar { background: rgb(17 26 36 / 0.95); }
  .bottom-bar a, .bottom-bar button { display: grid; justify-items: center; gap: 2px; padding: 4px 2px; border: 0; background: none; color: var(--slate-500); font: inherit; font-size: 10.5px; text-decoration: none; cursor: pointer; min-height: 44px; }
  .bottom-bar svg { width: 20px; height: 20px; }
  .bottom-bar .on { color: var(--color-brand-600); font-weight: 600; }
  .bottom-bar .bottom-main { align-self: start; }
  .bottom-bar .bottom-main span:first-child { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: var(--color-ink); color: #fff; margin-top: -20px; box-shadow: 0 8px 20px rgb(15 23 42 / 0.3); }
  html[data-theme=dark] .bottom-bar .bottom-main span:first-child { background: var(--color-accent); }
  .bottom-bar .bottom-main svg { width: 24px; height: 24px; }
  .bottom-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  #toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
}
@media (min-width: 1024px) { .side-body { display: contents; } }

/* tablets: tables become cards side by side, at least 19rem each */
@media (min-width: 761px) and (max-width: 1023px) {
  .table-wrap { overflow: visible; }
  table.stacked thead { display: none; }
  table.stacked { display: block; width: 100%; }
  table.stacked tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 10px; }
  table.stacked tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; align-content: start; padding: 12px; border: 1px solid var(--color-edge); border-radius: var(--radius-2xl); background: var(--color-panel-solid); box-shadow: var(--shadow-card); }
  table.stacked td { display: block; padding: 6px 10px; border: 0; border-radius: var(--radius-lg); background: rgb(241 245 249 / 0.7); font-size: 13px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; text-align: start; white-space: normal; }
  html[data-theme=dark] table.stacked td { background: rgb(255 255 255 / 0.05); }
  table.stacked td:empty { display: none; }
  table.stacked td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 400; color: var(--color-muted); margin-bottom: 2px; }
  table.stacked td:first-child { grid-column: 1 / -1; background: none; padding: 0 0 4px; font-size: 13.5px; font-weight: 600; }
  table.stacked td:first-child::before { display: none; }
  table.stacked td:not([data-label]), table.stacked td.empty { grid-column: 1 / -1; background: none; padding: 4px 0 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
  table.stacked td:last-child:nth-child(even) { grid-column: 1 / -1; }
  table.stacked td.empty { justify-content: center; font-weight: 400; }
  table.stacked td input:not([type=checkbox]), table.stacked td select { width: 100%; }
  .perm td, .perm th { text-align: start; }
}
/* phones: page edges, header, tables as cards */
@media (max-width: 760px) {
  .content { padding: 12px 16px 24px; }
  .top { padding: 16px 16px 0; }
  .top p { display: none; }
  .topbar { padding: 8px 16px; }
  .panel { padding: 16px; }
  table.stacked tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 12px; border: 1px solid var(--color-edge); border-radius: var(--radius-2xl); background: var(--color-panel-solid); box-shadow: var(--shadow-card); margin-bottom: 10px; }
  table.stacked td { display: block; padding: 6px 10px; border-radius: var(--radius-lg); background: rgb(241 245 249 / 0.7); font-size: 13px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
  html[data-theme=dark] table.stacked td { background: rgb(255 255 255 / 0.05); }
  table.stacked td[data-label]::before { display: block; max-width: none; font-size: 11px; font-weight: 400; color: var(--color-muted); margin-bottom: 2px; }
  table.stacked td:first-child { grid-column: 1 / -1; background: none; padding: 0 0 4px; font-size: 13.5px; font-weight: 600; }
  table.stacked td:first-child::before { display: none; }
  table.stacked td:not([data-label]), table.stacked td.empty { grid-column: 1 / -1; background: none; padding: 4px 0 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
  table.stacked td:last-child:nth-child(even) { grid-column: 1 / -1; }
  table.stacked td.empty { justify-content: center; font-weight: 400; }
}
@media (min-width: 761px) and (max-width: 1023px) {
  .content, .top { padding-inline: 24px; }
}

/* printing: plain white paper */
@media print {
  html, body { background: #fff !important; }
  .panel, .side, .topbar, dialog { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: #fff !important; box-shadow: none !important; }
  .bottom-bar, .side-scrim { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
