/* ==========================================================================
   Operations platform demo — shared styles
   Palette follows the client apps: deep navy #111b4d, steel blue #456da8.
   No external fonts or assets. Light + dark, embedded-friendly.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  --navy: #111b4d;
  --navy-2: #0b1238;
  --steel: #456da8;
  --blue: #2f6fb3;
  --blue-ink: #1d4f85;
  --bg: #f2f5fa;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e3e8ef;
  --line-2: #eef2f7;
  --ok: #067647;
  --ok-bg: #e8f6ee;
  --warn: #b54708;
  --warn-bg: #fdf1e3;
  --bad: #b42318;
  --bad-bg: #fdeceb;
  --info: #175cd3;
  --info-bg: #eaf1fd;
  --teal: #0e7090;
  --teal-bg: #e4f4f8;
  --violet: #6941c6;
  --violet-bg: #f1ecfd;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 0.05);
  --shadow-md: 0 2px 8px -3px rgb(16 24 40 / 0.1);
  --shadow-lg: 0 12px 32px -12px rgb(16 24 40 / 0.25);
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --rail-w: 224px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0b1020;
  --panel: #121a2e;
  --panel-2: #0f1628;
  --ink: #eef2f9;
  --ink-2: #cbd5e6;
  --muted: #94a3b8;
  --faint: #6b7a90;
  --line: #22304a;
  --line-2: #1a253b;
  --navy: #0d1533;
  --navy-2: #080d21;
  --steel: #5b83bf;
  --blue: #5b9bdb;
  --blue-ink: #9cc4ec;
  --ok: #6ce9a6;
  --ok-bg: #0d2e22;
  --warn: #fdb022;
  --warn-bg: #33220a;
  --bad: #fda29b;
  --bad-bg: #3b1219;
  --info: #84adff;
  --info-bg: #102046;
  --teal: #67e3f9;
  --teal-bg: #0b2b33;
  --violet: #bdb4fe;
  --violet-bg: #241a45;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 2px 8px -3px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 12px 32px -12px rgb(0 0 0 / 0.7);
  color-scheme: dark;
}

/* ---------- reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img, svg { display: block; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- shell ---------- */
.app { display: flex; min-height: 100vh; }

.rail {
  position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 30;
  width: var(--rail-w);
  display: flex; flex-direction: column;
  background: var(--navy);
  color: #c7d2e8;
  border-inline-end: 1px solid rgb(255 255 255 / 0.06);
}

.rail-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
  color: #fff;
}
.rail-mark {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(145deg, #2b3f7a, #16204a);
  border: 1px solid rgb(255 255 255 / 0.14);
  color: #dbe6ff;
}
.rail-name { display: flex; flex-direction: column; line-height: 1.15; }
.rail-name strong {
  font-size: 13px; font-weight: 700; letter-spacing: 0.14em;
}
.rail-name span { font-size: 10.5px; color: #8fa1c4; letter-spacing: 0.08em; text-transform: uppercase; }

.rail-nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.rail-label {
  padding: 12px 8px 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: #7186ac;
}
.rail-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 13px; color: #c7d2e8;
  transition: background-color 120ms ease, color 120ms ease;
}
.rail-link .icon { color: #8fa1c4; }
.rail-link:hover { background: rgb(255 255 255 / 0.06); color: #fff; }
.rail-link[aria-current="page"] {
  background: rgb(255 255 255 / 0.1);
  color: #fff;
  box-shadow: inset 3px 0 0 #6f9bd6;
}
.rail-link[aria-current="page"] .icon { color: #b9d2f4; }
.rail-link .count {
  margin-inline-start: auto;
  min-width: 20px; padding: 0 6px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.12);
  font-size: 10.5px; text-align: center; color: #dbe6ff;
}

.rail-spacer { flex: 1; }
.rail-foot { padding: 10px; border-block-start: 1px solid rgb(255 255 255 / 0.08); }
.rail-foot .rail-link { font-size: 12px; }

.rail-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px 4px;
}
.rail-user .avatar {
  background: #24325e; color: #dbe6ff;
  border: 1px solid rgb(255 255 255 / 0.16);
}
.rail-user .who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.rail-user strong { font-size: 12px; color: #fff; font-weight: 600; }
.rail-user span { font-size: 10.5px; color: #8fa1c4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-version { padding: 6px 8px 2px; font-size: 10px; color: #5f7297; }

.shell { flex: 1; min-width: 0; margin-inline-start: var(--rail-w); display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  height: 58px; padding: 0 22px;
  background: var(--panel);
  border-block-end: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.crumbs strong { color: var(--ink); font-weight: 600; }
.crumbs .sep { color: var(--faint); }

.top-search {
  margin-inline-start: auto;
  display: flex; align-items: center; gap: 8px;
  width: min(300px, 26vw);
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--faint);
}
.top-search input {
  border: 0; background: none; outline: none; width: 100%;
  font-size: 12.5px; color: var(--ink);
}
.top-search input::placeholder { color: var(--faint); }

.top-actions { display: flex; align-items: center; gap: 8px; }
.wh-select {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel-2); font-size: 12px; color: var(--ink-2); white-space: nowrap;
}
.wh-select .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 8px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background-color 120ms ease, color 120ms ease;
}
.icon-btn:hover { background: var(--panel-2); color: var(--ink); border-color: var(--line); }

.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--info-bg); color: var(--info);
  font-size: 11.5px; font-weight: 700;
}

/* ---------- page ---------- */
.content { padding: 20px 22px 26px; }

.page-head {
  display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  margin-block-end: 16px;
}
.page-head h1 {
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
}
.page-head .sub { margin-block-start: 4px; font-size: 12.5px; color: var(--muted); }
.page-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 13px;
  border-radius: 8px; border: 1px solid transparent;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease, opacity 120ms ease;
}
.btn .icon { width: 16px; height: 16px; }
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: #1b2a6b; }
html[data-theme="dark"] .btn--primary { background: #3d63a6; }
.btn--ghost { background: var(--panel); border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--steel); color: var(--ink); }
.btn--subtle { background: var(--panel-2); border-color: var(--line-2); color: var(--ink-2); }
.btn--danger { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.input, .select, .textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-size: 12.5px;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { min-height: 64px; resize: vertical; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--muted); font-weight: 600; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px;
  border-block-end: 1px solid var(--line-2);
}
.card-head h2 { font-size: 13.5px; font-weight: 650; letter-spacing: -0.01em; }
.card-head .sub { font-size: 11.5px; color: var(--muted); }
.card-head .right { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px; }
.card-body--flush { padding: 0; }
.card-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-block-start: 1px solid var(--line-2);
}

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-split { display: grid; grid-template-columns: 370px minmax(0, 1fr); gap: 14px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.grow { flex: 1; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-block-end: 14px; }
.kpi {
  padding: 14px 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.kpi-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.kpi-top .icon { color: var(--steel); }
.kpi-value { margin-block-start: 8px; font-size: 25px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.kpi-sub { margin-block-start: 6px; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.trend { padding: 1px 6px; border-radius: 999px; font-size: 10.5px; font-weight: 700; }
.trend--up { background: var(--ok-bg); color: var(--ok); }
.trend--warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- flow + bars ---------- */
.flow { display: flex; flex-direction: column; gap: 13px; }
.flow-row { display: grid; grid-template-columns: 88px 1fr 58px; align-items: center; gap: 10px; }
.flow-name { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.flow-count { font-size: 11.5px; color: var(--muted); text-align: end; }
.track { height: 7px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.track > span { display: block; height: 100%; border-radius: 999px; background: var(--steel); }
.track > .is-ok { background: var(--ok); }
.track > .is-warn { background: var(--warn); }
.track > .is-info { background: var(--blue); }

.wh-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-block-end: 1px solid var(--line-2); }
.wh-row:last-child { border-block-end: 0; padding-block-end: 0; }
.wh-row:first-child { padding-block-start: 0; }
.wh-top { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.wh-top strong { font-weight: 600; color: var(--ink-2); }
.wh-top span { margin-inline-start: auto; color: var(--muted); font-size: 11px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { font-size: 12.5px; }
table.data th {
  padding: 9px 14px;
  text-align: start;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
  background: var(--panel-2);
  border-block-end: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 11px 14px;
  border-block-end: 1px solid var(--line-2);
  color: var(--ink-2);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-block-end: 0; }
table.data tbody tr:hover { background: var(--panel-2); }
table.data tbody tr[data-toast] { cursor: pointer; }
table.data .strong { color: var(--ink); font-weight: 600; }
table.data .num { text-align: end; font-variant-numeric: tabular-nums; }
table.data .foot { color: var(--muted); font-size: 11.5px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 650; letter-spacing: 0.01em;
  white-space: nowrap;
}
.chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chip--ok { background: var(--ok-bg); color: var(--ok); }
.chip--info { background: var(--info-bg); color: var(--info); }
.chip--warn { background: var(--warn-bg); color: var(--warn); }
.chip--bad { background: var(--bad-bg); color: var(--bad); }
.chip--muted { background: var(--panel-2); color: var(--muted); }
.chip--teal { background: var(--teal-bg); color: var(--teal); }
.chip--violet { background: var(--violet-bg); color: var(--violet); }

.avatar-sm {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--info-bg); color: var(--info);
  font-size: 9.5px; font-weight: 700; flex: none;
}

/* ---------- toolbar / filter chips ---------- */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  border-block-end: 0;
}
.toolbar .input { width: 230px; }
.filters { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.fchip {
  padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 11.5px; font-weight: 600; color: var(--muted);
}
.fchip .n { margin-inline-start: 5px; color: var(--faint); font-weight: 600; }
.fchip[aria-pressed="true"] {
  background: var(--navy); border-color: var(--navy); color: #fff;
}
html[data-theme="dark"] .fchip[aria-pressed="true"] { background: #3d63a6; border-color: #3d63a6; }
.fchip[aria-pressed="true"] .n { color: rgb(255 255 255 / 0.65); }

.pager { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.pager .btn { height: 28px; padding: 0 9px; }

/* ---------- scan ---------- */
.scanner {
  position: relative;
  aspect-ratio: 1 / 0.82;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 0%, #1c2b5f 0%, #0c1230 70%);
  display: grid; place-items: center;
  color: #dbe6ff;
}
.scanner::before, .scanner::after,
.scanner .corner::before, .scanner .corner::after {
  content: ""; position: absolute; width: 26px; height: 26px;
  border: 2px solid #7fa6dd; border-radius: 3px;
}
.scanner::before { top: 18px; inset-inline-start: 18px; border-inline-end: 0; border-block-end: 0; }
.scanner::after { top: 18px; inset-inline-end: 18px; border-inline-start: 0; border-block-end: 0; }
.scanner .corner::before { bottom: 18px; inset-inline-start: 18px; border-inline-end: 0; border-block-start: 0; }
.scanner .corner::after { bottom: 18px; inset-inline-end: 18px; border-inline-start: 0; border-block-start: 0; }
.scanner .qr-box {
  width: 116px; height: 116px; border-radius: 8px;
  background: rgb(255 255 255 / 0.06);
  display: grid; place-items: center;
  color: rgb(255 255 255 / 0.8);
}
.scanner .qr-box .icon { width: 62px; height: 62px; stroke-width: 1.2; }
.scanline {
  position: absolute; inset-inline: 16%; top: 26%;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #6fe3ff, transparent);
  box-shadow: 0 0 18px 2px rgb(111 227 255 / 0.55);
  animation: scan 2.6s ease-in-out infinite;
}
@keyframes scan {
  0%, 100% { transform: translateY(0); opacity: 0.35; }
  50% { transform: translateY(150px); opacity: 1; }
}
.scan-hint { position: absolute; inset-block-end: 14px; inset-inline: 0; text-align: center; font-size: 10.5px; color: #8fa1c4; }

.scan-form { display: flex; gap: 8px; margin-block-start: 12px; }
.scan-form .input { flex: 1; }
.last-scan {
  margin-block-start: 10px;
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
}
.last-scan strong { font-size: 12px; font-weight: 600; display: block; }
.last-scan span { font-size: 10.5px; color: var(--muted); }
.last-scan .icon { color: var(--ok); margin-inline-start: auto; }

.progress { display: flex; align-items: center; gap: 10px; }
.progress .track { flex: 1; height: 8px; }
.progress .pct { font-size: 11.5px; font-weight: 700; color: var(--ink-2); }

.qty-pill {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 20px; padding: 0 6px;
  border-radius: 5px; background: var(--panel-2);
  font-size: 11px; font-weight: 700; color: var(--ink-2);
  border: 1px solid var(--line-2);
}
.qty-pill--done { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.qty-pill--part { background: var(--warn-bg); color: var(--warn); border-color: transparent; }

/* ---------- QC ---------- */
.qc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border-block-end: 1px solid var(--line-2);
}
.qc-row:last-child { border-block-end: 0; }
.qc-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.qc-thumb {
  width: 32px; height: 32px; border-radius: 7px; flex: none;
  display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--muted);
}
.qc-name strong { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.qc-name span { display: block; font-size: 10.5px; color: var(--muted); }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.seg button {
  padding: 4px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 650; color: var(--muted);
}
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg button.pass[aria-pressed="true"] { background: var(--ok-bg); color: var(--ok); }
.seg button.flag[aria-pressed="true"] { background: var(--bad-bg); color: var(--bad); }

.otp { display: flex; gap: 6px; }
.otp input {
  width: 38px; height: 42px; text-align: center;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); font-size: 16px; font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.otp input:focus { border-color: var(--steel); outline: none; box-shadow: 0 0 0 3px rgb(69 109 168 / 0.15); }

.summary-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; font-size: 12px; border-block-end: 1px dashed var(--line-2); }
.summary-row:last-child { border-block-end: 0; }
.summary-row .k { color: var(--muted); }
.summary-row .v { font-weight: 650; }

.photo-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-block-start: 10px; }
.photo {
  aspect-ratio: 4 / 3; border-radius: 7px;
  background:
    linear-gradient(135deg, rgb(69 109 168 / 0.16), rgb(17 27 77 / 0.05));
  border: 1px dashed var(--line);
  display: grid; place-items: center; color: var(--faint);
}

/* ---------- deliveries ---------- */
.run-list { display: flex; flex-direction: column; }
.run {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-block-end: 1px solid var(--line-2);
  cursor: pointer;
}
.run:last-child { border-block-end: 0; }
.run:hover { background: var(--panel-2); }
.run[aria-selected="true"] { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--steel); }
.run .meta { min-width: 0; flex: 1; }
.run strong { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink); }
.run span { display: block; font-size: 10.5px; color: var(--muted); }
.run .right { text-align: end; }

.timeline { position: relative; padding-inline-start: 22px; }
.timeline::before {
  content: ""; position: absolute; inset-block: 8px; inset-inline-start: 7px;
  width: 2px; background: var(--line);
}
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item:last-child { padding-block-end: 0; }
.tl-item::before {
  content: ""; position: absolute; inset-inline-start: -21px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--panel); border: 2px solid var(--faint);
}
.tl-item.is-done::before { background: var(--ok); border-color: var(--ok); }
.tl-item.is-now::before { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 0 4px rgb(47 111 179 / 0.18); }
.tl-item .tl-top { display: flex; align-items: baseline; gap: 8px; }
.tl-item strong { font-size: 12.5px; font-weight: 650; color: var(--ink); }
.tl-item .time { margin-inline-start: auto; font-size: 11px; color: var(--muted); }
.tl-item p { margin-block-start: 2px; font-size: 11.5px; color: var(--muted); }

.driver-card { display: flex; align-items: center; gap: 11px; }
.driver-card .avatar { width: 38px; height: 38px; font-size: 13px; }
.driver-card strong { display: block; font-size: 13px; }
.driver-card span { display: block; font-size: 11px; color: var(--muted); }

.pod {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px dashed var(--line); border-radius: 9px;
  color: var(--muted); font-size: 11.5px;
}

/* ---------- distributor phones ---------- */
.phone-stage {
  min-height: calc(100vh - 58px);
  display: flex; align-items: center; justify-content: center; gap: 26px;
  padding: 26px;
  background:
    radial-gradient(90% 70% at 50% 0%, rgb(69 109 168 / 0.1), transparent 70%),
    var(--bg);
}
.phone {
  width: 330px; flex: none;
  border-radius: 30px;
  padding: 9px;
  background: #101a3d;
  box-shadow: 0 20px 44px -18px rgb(10 18 46 / 0.55);
  border: 1px solid rgb(255 255 255 / 0.08);
}
.phone-inner {
  border-radius: 23px; overflow: hidden;
  background: var(--panel);
  height: 648px;
  display: flex; flex-direction: column;
}
.phone-status {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 14px 4px;
  font-size: 9.5px; color: var(--muted);
  background: var(--panel);
}
.phone-status .notch { width: 58px; height: 14px; border-radius: 999px; background: #0b1238; }
.phone-bar {
  padding: 6px 14px 12px;
  border-block-end: 1px solid var(--line-2);
  background: var(--panel);
}
.phone-bar .row strong { font-size: 14px; font-weight: 700; }
.phone-body { flex: 1; overflow: hidden; background: var(--bg); padding: 11px; display: flex; flex-direction: column; gap: 9px; }
.phone-body .card { box-shadow: none; }
.phone-fab {
  position: relative; margin-block-start: auto;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; border-radius: 10px;
  background: var(--navy); color: #fff; font-size: 12.5px; font-weight: 650;
}
.phone-tabs {
  display: flex; border-block-start: 1px solid var(--line-2); background: var(--panel);
}
.phone-tabs div { flex: 1; padding: 8px 0 11px; text-align: center; font-size: 9.5px; color: var(--faint); }
.phone-tabs div.on { color: var(--steel); }
.phone-tabs .icon { margin: 0 auto 3px; width: 17px; height: 17px; }

.order-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 9px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 9px;
}
.order-item .thumb { width: 28px; height: 28px; border-radius: 6px; background: var(--panel-2); display: grid; place-items: center; color: var(--muted); }
.order-item strong { display: block; font-size: 11px; font-weight: 650; }
.order-item span { display: block; font-size: 9.5px; color: var(--muted); }
.order-item .qty { margin-inline-start: auto; font-size: 11px; font-weight: 700; }

.sync-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--ok); margin-inline-end: 4px; }
.sync-dot.off { background: var(--warn); }

/* ---------- toast ---------- */
.toast {
  position: fixed; inset-block-end: 18px; inset-inline-start: 50%;
  transform: translate(-50%, 12px);
  z-index: 100;
  max-width: min(460px, 90vw);
  padding: 10px 14px;
  border-radius: 9px;
  background: #101828; color: #f2f4f7;
  font-size: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  :root { --rail-w: 64px; }
  .rail-name, .rail-label, .rail-link span, .rail-link .count,
  .rail-user .who, .rail-version, .rail-foot .rail-link span { display: none; }
  .rail-brand { justify-content: center; padding: 16px 0 12px; }
  .rail-link { justify-content: center; padding: 9px; }
  .rail-user { justify-content: center; }
  .rail-foot .rail-link { justify-content: center; }
  .top-search { display: none; }
  .grid-2, .grid-split { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .content { padding: 14px; }
  .page-head h1 { font-size: 19px; }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .toolbar .input { width: 100%; }
  .phone-stage { flex-direction: column; gap: 18px; }
  .phone { width: min(330px, 92vw); }
  .top-actions .wh-select { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .scanline { animation: none; opacity: 0.7; }
  * { transition: none !important; }
}
