/* Navira — fleet console. Hand-written, no build step. */
@import url('fonts.css');

:root {
  --brand: #5B3DF5;
  --brand-ink: #ffffff;
  --brand-soft: color-mix(in srgb, var(--brand) 11%, white);
  --brand-line: color-mix(in srgb, var(--brand) 28%, white);
  --brand-hover: color-mix(in srgb, var(--brand) 86%, black);
  --bg: #F5F4FA;
  --surface: #FFFFFF;
  --surface-2: #FAF9FD;
  --ink: #15122B;
  --ink-2: #4A4768;
  --muted: #837FA3;
  --line: #E7E4F2;
  --line-2: #F0EEF8;
  --side: #14112B;
  --side-ink: #B9B5D6;
  --side-line: #26224A;
  --good: #12B76A; --good-soft: #E3F8EE;
  --warn: #F79009; --warn-soft: #FEF1DB;
  --bad: #F04438; --bad-soft: #FEE8E6;
  --info: #2E90FA; --info-soft: #E4F1FF;
  --off: #98A2B3; --off-soft: #EEF0F4;
  --shadow: 0 1px 2px rgba(21,18,43,.05), 0 6px 20px -8px rgba(21,18,43,.10);
  --shadow-lg: 0 18px 50px -12px rgba(21,18,43,.28);
  --radius: 14px;
  --radius-sm: 9px;
  --topbar: 62px;
  --side-w: 252px;
  --font: 'Plus Jakarta Sans', 'Hind Siliguri', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
html[data-theme='dark'] {
  --brand-soft: color-mix(in srgb, var(--brand) 22%, #14112B);
  --brand-line: color-mix(in srgb, var(--brand) 40%, #14112B);
  --bg: #0D0B1C;
  --surface: #17142E;
  --surface-2: #1C1938;
  --ink: #F0EEFF;
  --ink-2: #C3BFE2;
  --muted: #8F8BB2;
  --line: #2B2750;
  --line-2: #221F40;
  --side: #0A0817;
  --side-line: #1D1A38;
  --good-soft: #0F2E22; --warn-soft: #382608; --bad-soft: #3A1414; --info-soft: #11263F; --off-soft: #232137;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -10px rgba(0,0,0,.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
html[lang='bn'] body { font-size: 15px; line-height: 1.6; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted); }
.sm { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.hide { display: none !important; }
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; }
.ic.sm { width: 15px; height: 15px; }
.ic.lg { width: 22px; height: 22px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }
.sidebar { background: var(--side); color: var(--side-ink); position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 18px 14px 14px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--side-line) transparent; z-index: 40; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; color: #fff; text-decoration: none !important; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(140deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #00E0B8)); display: grid; place-items: center; flex: none; box-shadow: 0 6px 18px -6px var(--brand); overflow: hidden; }
.brand-mark svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.02em; line-height: 1.1; }
.brand-sub { font-size: 11px; color: var(--side-ink); opacity: .75; font-weight: 500; }
.nav-group { margin-top: 14px; }
.nav-title { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: #6E6A99; padding: 0 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--side-ink); font-weight: 600; font-size: 13.5px; text-decoration: none !important; position: relative; margin-bottom: 2px; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.on { background: var(--brand); color: #fff; box-shadow: 0 8px 20px -10px var(--brand); }
.nav-link .badge-n { margin-left: auto; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 99px; min-width: 19px; height: 19px; display: grid; place-items: center; padding: 0 5px; }
.side-foot { margin-top: auto; padding-top: 14px; }
.side-card { background: rgba(255,255,255,.05); border: 1px solid var(--side-line); border-radius: 12px; padding: 10px 11px; display: flex; align-items: center; gap: 10px; color: #fff; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 12.5px; display: grid; place-items: center; flex: none; }
.side-card .avatar { background: rgba(255,255,255,.12); color: #fff; }
.side-card .who { min-width: 0; line-height: 1.25; }
.side-card .who b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-card .who span { font-size: 11.5px; color: var(--side-ink); opacity: .8; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--topbar); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 0 22px; position: sticky; top: 0; z-index: 30; }
.topbar .t-title { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.search { position: relative; width: min(360px, 34vw); }
.search input { width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 12px 0 36px; outline: none; }
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--surface); }
.search .ic { position: absolute; left: 11px; top: 10px; color: var(--muted); width: 17px; height: 17px; }
.search-pop { position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; max-height: 340px; overflow: auto; }
.search-pop a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.search-pop a:hover, .search-pop a.act { background: var(--brand-soft); }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); position: relative; }
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
.icon-btn .dot { position: absolute; top: -4px; right: -4px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 99px; display: grid; place-items: center; border: 2px solid var(--surface); padding: 0 3px; }
.lang-btn { font-weight: 700; font-size: 12.5px; width: auto; padding: 0 11px; }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: 46px; min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 70; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; color: var(--ink); background: none; border: 0; cursor: pointer; text-align: left; text-decoration: none; font-weight: 500; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--brand-soft); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.bell-pop { width: 380px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; }
.bell-pop .bp-head { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 700; }
.bell-pop .bp-list { max-height: 360px; overflow: auto; }
.bell-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); text-decoration: none !important; color: var(--ink); }
.bell-item:hover { background: var(--surface-2); }
.bell-item.unread { background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.content { padding: 22px; width: 100%; max-width: 1560px; margin: 0 auto; flex: 1; }
.content.full { padding: 0; max-width: none; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 22px; font-weight: 800; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* ---------- buttons, forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid transparent; font-weight: 700; font-size: 13.5px; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: .15s; background: var(--brand); color: var(--brand-ink); }
.btn:hover { background: var(--brand-hover); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.soft:hover { background: var(--brand-line); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--brand-line); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger.soft, .btn.soft.danger { background: var(--bad-soft); color: var(--bad); }
.btn.good { background: var(--good); color: #fff; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 32px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .lbl { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--bad); font-weight: 600; }
.inp, .field input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), .field select, .field textarea {
  width: 100%; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 8px 12px; outline: none; transition: .15s; }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field input[type=color] { width: 56px; height: 40px; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.field.invalid input, .field.invalid select { border-color: var(--bad); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid .span3 { grid-column: span 2; }
.fgroup-title { grid-column: 1 / -1; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.fgroup-title:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: .2s; }
.switch i::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; left: 3px; top: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(18px); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button, .seg a { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-weight: 700; font-size: 12.5px; color: var(--ink-2); cursor: pointer; text-decoration: none !important; }
.seg .on { background: var(--surface); color: var(--brand); box-shadow: 0 1px 3px rgba(21,18,43,.12); }

/* ---------- cards, tables ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.card-h h3 { font-size: 15px; font-weight: 800; }
.card-h .r { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-b { padding: 18px; }
.card-b.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.kpi .k-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; font-size: 12.5px; }
.kpi .k-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi .k-val { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12px; color: var(--muted); }
.kpi.good .k-ico { background: var(--good-soft); color: var(--good); }
.kpi.warn .k-ico { background: var(--warn-soft); color: var(--warn); }
.kpi.bad .k-ico { background: var(--bad-soft); color: var(--bad); }
.kpi.off .k-ico { background: var(--off-soft); color: var(--off); }
.kpi.info .k-ico { background: var(--info-soft); color: var(--info); }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
table.t td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: color-mix(in srgb, var(--brand) 4%, var(--surface)); }
table.t td.actions { text-align: right; white-space: nowrap; }
table.t .sub { display: block; font-size: 12px; color: var(--muted); }
table.t.compact td { padding: 8px 14px; }
.pagination { display: flex; align-items: center; gap: 6px; padding: 14px 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pagination .pg { margin-left: auto; display: flex; gap: 4px; }
.pagination a, .pagination span.cur { min-width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; padding: 0 8px; font-weight: 600; }
.pagination span.cur { background: var(--brand); color: #fff; border-color: var(--brand); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.toolbar .search { width: 280px; max-width: 100%; }
.toolbar select, .toolbar input[type=date], .toolbar input[type=text] { height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 10px; outline: none; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic { margin: 0 auto 10px; width: 36px; height: 36px; opacity: .5; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--off-soft); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.nodot::before { display: none; }
.badge.moving, .badge.good, .badge.paid, .badge.acknowledged, .badge.active { background: var(--good-soft); color: var(--good); }
.badge.idle, .badge.warn, .badge.warning, .badge.unpaid, .badge.scheduled, .badge.pending, .badge.sent { background: var(--warn-soft); color: #B76A00; }
html[data-theme='dark'] .badge.idle, html[data-theme='dark'] .badge.warn, html[data-theme='dark'] .badge.warning, html[data-theme='dark'] .badge.unpaid, html[data-theme='dark'] .badge.pending { color: var(--warn); }
.badge.stopped, .badge.bad, .badge.critical, .badge.failed, .badge.suspended, .badge.cut, .badge.void { background: var(--bad-soft); color: var(--bad); }
.badge.offline, .badge.nodata, .badge.cancelled, .badge.off { background: var(--off-soft); color: var(--muted); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; height: 32px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 12.5px; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.chip:hover { border-color: var(--brand-line); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip b { font-variant-numeric: tabular-nums; opacity: .8; }
.sdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--off); flex: none; }
.sdot.moving { background: var(--good); } .sdot.idle { background: var(--warn); } .sdot.stopped { background: var(--bad); } .sdot.offline, .sdot.nodata { background: var(--off); }
.progress { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.alert-box { border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid; font-size: 13.5px; }
.alert-box.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--ink); }
.alert-box.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.alert-box.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.alert-box.good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.alert-box .ic { margin-top: 2px; }
.a-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--info-soft); color: var(--info); }
.a-ico.warning { background: var(--warn-soft); color: var(--warn); }
.a-ico.critical { background: var(--bad-soft); color: var(--bad); }

/* ---------- tabs, dialog, toast ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 10px 14px; border: 0; background: none; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none !important; white-space: nowrap; }
.tabs .on { color: var(--brand); border-bottom-color: var(--brand); }
dialog { border: 0; border-radius: 18px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); }
dialog::backdrop { background: rgba(14, 11, 36, .55); backdrop-filter: blur(3px); }
dialog .d-h { padding: 18px 20px 6px; display: flex; align-items: flex-start; gap: 12px; }
dialog .d-h h3 { font-size: 17px; font-weight: 800; }
dialog .d-b { padding: 10px 20px 4px; }
dialog .d-f { padding: 16px 20px 20px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.d-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.d-ico.bad { background: var(--bad-soft); color: var(--bad); }
.d-ico.good { background: var(--good-soft); color: var(--good); }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 11px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--info); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-lg); animation: tin .25s ease; }
.toast.warning { border-left-color: var(--warn); } .toast.critical, .toast.error { border-left-color: var(--bad); } .toast.good, .toast.success { border-left-color: var(--good); }
.toast b { display: block; font-size: 13.5px; } .toast span { font-size: 12.5px; color: var(--ink-2); }
@keyframes tin { from { transform: translateY(12px); opacity: 0; } }

/* ---------- charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar i { width: 100%; max-width: 44px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #00E0B8)); min-height: 4px; transition: height .5s; }
.bars .bar span { font-size: 11px; color: var(--muted); } .bars .bar b { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.donut { position: relative; width: 150px; height: 150px; flex: none; }
.donut svg { transform: rotate(-90deg); }
.donut .mid { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.donut .mid b { font-size: 26px; font-weight: 800; display: block; }
.legend { display: grid; gap: 8px; }
.legend div { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.hbar { display: flex; flex-direction: column; gap: 14px; }
.hbar .hb-top { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 5px; }

/* ---------- login ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-art { background: #0E0B22; position: relative; overflow: hidden; color: #fff; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art::before { content: ''; position: absolute; inset: 0; background: radial-gradient(900px 500px at 15% 10%, color-mix(in srgb, var(--brand) 55%, transparent), transparent 70%), radial-gradient(700px 500px at 100% 100%, rgba(0, 224, 184, .22), transparent 65%); }
.auth-art > * { position: relative; }
.auth-art svg.routes { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.auth-art h2 { font-size: 36px; line-height: 1.15; font-weight: 800; letter-spacing: -.03em; max-width: 460px; }
.auth-art p.lead { margin-top: 14px; color: #C8C4EA; max-width: 440px; font-size: 15.5px; }
.auth-points { display: grid; gap: 12px; margin-top: 26px; }
.auth-points div { display: flex; gap: 12px; align-items: center; color: #E6E3FF; font-weight: 600; }
.auth-points .ic { color: #00E0B8; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.demo-box { margin-top: 22px; border: 1px dashed var(--brand-line); background: var(--brand-soft); border-radius: 14px; padding: 14px; }
.demo-box .d-title { font-weight: 800; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); margin-bottom: 8px; }
.demo-role { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-top: 7px; cursor: pointer; text-align: left; }
.demo-role:hover { border-color: var(--brand); }

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

/* ---------- map & live ---------- */
.mapwrap { position: relative; height: calc(100dvh - var(--topbar)); display: grid; grid-template-columns: 350px minmax(0, 1fr); background: var(--surface); }
.vlist { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); z-index: 5; }
.vlist-h { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.vitems { overflow-y: auto; flex: 1; }
.vitem { display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; align-items: center; }
.vitem:hover { background: var(--surface-2); }
.vitem.sel { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.vico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--off-soft); color: var(--off); position: relative; }
.vico.moving { background: var(--good-soft); color: var(--good); } .vico.idle { background: var(--warn-soft); color: var(--warn); } .vico.stopped { background: var(--bad-soft); color: var(--bad); }
.vitem .v-name { font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vitem .v-meta { font-size: 12px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vitem .v-spd { text-align: right; flex: none; line-height: 1.2; }
.vitem .v-spd b { font-size: 16px; font-variant-numeric: tabular-nums; } .vitem .v-spd span { font-size: 11px; color: var(--muted); display: block; }
#map, .map-el { width: 100%; height: 100%; background: #e9e6f4; z-index: 1; }
.mapcol { position: relative; min-width: 0; }
.map-tools { position: absolute; top: 12px; right: 12px; z-index: 400; display: flex; flex-direction: column; gap: 8px; }
.map-btn { width: 40px; height: 40px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.map-btn:hover { color: var(--brand); } .map-btn.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.layer-pop { position: absolute; right: 50px; top: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: var(--shadow-lg); min-width: 150px; }
.layer-pop button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.layer-pop button:hover, .layer-pop button.on { background: var(--brand-soft); color: var(--brand); }
.leaflet-container { font-family: var(--font); }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 11px !important; overflow: hidden; }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line) !important; width: 40px !important; height: 38px !important; line-height: 38px !important; }
.leaflet-control-attribution { font-size: 10px !important; background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.vm { position: relative; width: 46px; height: 46px; }
.vm .halo { position: absolute; inset: 6px; border-radius: 50%; background: var(--c); opacity: .22; }
.vm.moving .halo { animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { transform: scale(.7); opacity: .4; } 100% { transform: scale(1.5); opacity: 0; } }
.vm svg.arrow { position: absolute; inset: 6px; width: 34px; height: 34px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); transition: transform .4s; }
.vm .lbl { position: absolute; left: 50%; top: 44px; transform: translateX(-50%); white-space: nowrap; background: var(--surface); color: var(--ink); border: 1px solid var(--line); font-weight: 700; font-size: 11px; padding: 1px 7px; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.vm.sel .lbl { background: var(--brand); color: #fff; border-color: var(--brand); }
.vm.sel .halo { opacity: .35; inset: 0; }
.pin { width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.pin i { width: 8px; height: 8px; background: #fff; border-radius: 50%; }
.detail { position: absolute; top: 12px; left: 12px; width: 372px; max-width: calc(100% - 76px); max-height: calc(100% - 24px); overflow: auto; z-index: 450; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); }
.detail .dh { padding: 16px 16px 12px; display: flex; gap: 12px; align-items: flex-start; }
.detail .dh h3 { font-size: 16px; font-weight: 800; }
.detail .x { margin-left: auto; }
.detail .speedo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 16px 12px; }
.mini { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 11px; }
.mini span { font-size: 11px; color: var(--muted); font-weight: 700; display: block; text-transform: uppercase; letter-spacing: .04em; }
.mini b { font-size: 17px; font-variant-numeric: tabular-nums; }
.mini b small { font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.kv { padding: 0 16px; display: grid; gap: 0; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.kv div span { color: var(--muted); } .kv div b { text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.d-actions { padding: 14px 16px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cmdline { margin: 0 16px 12px; padding: 11px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.steps { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.steps i { flex: 1; height: 5px; border-radius: 9px; background: var(--line); } .steps i.on { background: var(--brand); } .steps i.done { background: var(--good); } .steps i.fail { background: var(--bad); }
.sheet-grip { display: none; }

/* playback */
.playbar { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 450; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 12px 14px; display: grid; gap: 10px; }
.playbar input[type=range] { width: 100%; accent-color: var(--brand); }
.pb-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pb-stat { display: flex; gap: 14px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.pb-stat span { font-size: 11px; color: var(--muted); display: block; font-weight: 700; text-transform: uppercase; } .pb-stat b { font-size: 14px; }
.hist-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100dvh - var(--topbar)); }
.hist-side { overflow-y: auto; border-right: 1px solid var(--line); background: var(--surface); padding: 16px; display: grid; gap: 14px; align-content: start; }
.trip { border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; cursor: pointer; background: var(--surface); }
.trip:hover, .trip.sel { border-color: var(--brand); background: var(--brand-soft); }
.trip .tl { display: grid; grid-template-columns: 16px 1fr; gap: 4px 8px; align-items: start; margin-top: 6px; font-size: 12.5px; }
.trip .tl i { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; background: var(--good); } .trip .tl i.e { background: var(--bad); }
.spark { width: 100%; height: 56px; }
.fence-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100dvh - var(--topbar)); }
.fence-side { overflow-y: auto; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; }
.fence-item { display: flex; gap: 11px; padding: 13px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; align-items: center; }
.fence-item:hover { background: var(--surface-2); } .fence-item.sel { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.fence-ed { padding: 16px; display: grid; gap: 14px; border-top: 1px solid var(--line); background: var(--surface-2); }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.draw-hint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 460; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 99px; font-weight: 600; font-size: 12.5px; box-shadow: var(--shadow-lg); }

/* misc */
.timeline { display: grid; gap: 0; }
.timeline .ti { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); align-items: center; }
.timeline .ti:last-child { border-bottom: 0; }
.invoice { max-width: 820px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 36px; }
.inv-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.demo-lock { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.skeleton { background: linear-gradient(90deg, var(--line-2), var(--line), var(--line-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
.share-top { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 450; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow-lg); display: flex; gap: 12px; align-items: center; }
.scroll-x { overflow-x: auto; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  :root { --side-w: 74px; }
  .brand-name, .brand-sub, .nav-title, .nav-link span.lbl, .side-card .who, .nav-link .badge-n { display: none; }
  .nav-link { justify-content: center; padding: 11px 0; }
  .brand { justify-content: center; padding: 4px 0 14px; }
  .side-card { justify-content: center; padding: 8px; }
  .nav-link .badge-n.dotted { display: block; position: absolute; top: 5px; right: 12px; min-width: 9px; width: 9px; height: 9px; font-size: 0; padding: 0; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
  .mapwrap { grid-template-columns: 300px minmax(0, 1fr); }
  .hist-grid, .fence-grid { grid-template-columns: 300px minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; padding-bottom: 66px; }
  .sidebar { display: none; }
  .topbar { padding: 0 12px; } .search { display: none; }
  .content { padding: 14px 12px 24px; }
  .page-head h1 { font-size: 19px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr 1fr; }
  .g2.stay1, .g3.stay1 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; } .form-grid .span3 { grid-column: auto; }
  .kpi .k-val { font-size: 23px; } .kpi { padding: 13px 14px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--muted); text-decoration: none !important; border: 0; background: none; padding: 4px 0; position: relative; cursor: pointer; }
  .tabbar .on { color: var(--brand); }
  .tabbar .badge-n { position: absolute; top: 0; left: 55%; background: var(--bad); color: #fff; font-size: 9.5px; min-width: 16px; height: 16px; border-radius: 99px; display: grid; place-items: center; }
  .mapwrap { grid-template-columns: 1fr; height: calc(100dvh - var(--topbar) - 66px); }
  .vlist { position: absolute; left: 0; right: 0; bottom: 0; z-index: 420; height: 42%; border-right: 0; border-top: 1px solid var(--line); border-radius: 20px 20px 0 0; box-shadow: 0 -12px 30px -10px rgba(21,18,43,.3); transition: height .25s; }
  .vlist.open { height: 82%; }
  .sheet-grip { display: block; width: 44px; height: 5px; background: var(--line); border-radius: 9px; margin: 8px auto 0; cursor: pointer; }
  .vlist-h { padding: 8px 12px 8px; }
  .mapcol { position: absolute; inset: 0; }
  .detail { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-width: none; max-height: 78%; border-radius: 22px 22px 0 0; z-index: 480; }
  .map-tools { top: 10px; right: 10px; }
  .hist-grid, .fence-grid { grid-template-columns: 1fr; height: auto; }
  .hist-side, .fence-side { border-right: 0; max-height: none; }
  .hist-grid .mapcol, .fence-grid .mapcol { height: 62dvh; position: relative; inset: auto; order: -1; }
  .fence-grid .fence-side { max-height: none; }
  .playbar { left: 8px; right: 8px; bottom: 8px; padding: 10px 12px; }
  table.t.stack-m thead { display: none; }
  table.t.stack-m tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.t.stack-m td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 0; text-align: right; }
  table.t.stack-m td::before { content: attr(data-l); color: var(--muted); font-weight: 700; font-size: 12px; text-align: left; flex: none; }
  table.t.stack-m td.actions { justify-content: flex-end; }
  .auth-form { padding: 22px 18px; }
  dialog { border-radius: 20px 20px 0 0; margin: auto 0 0; width: 100%; max-width: none; }
  #toasts { bottom: 78px; }
  .toolbar .search { display: block; width: 100%; }
  .bell-pop { position: fixed; left: 8px; right: 8px; top: 66px; width: auto; }
  .brand-m { display: flex !important; }
}
.brand-m { display: none; align-items: center; gap: 9px; font-weight: 800; }
.brand-m .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.brand-m .brand-mark svg { width: 17px; height: 17px; }
@media (min-width: 761px) { .only-m { display: none !important; } }
@media (max-width: 760px) { .not-m { display: none !important; } }
@media print {
  .sidebar, .topbar, .tabbar, .no-print, #toasts { display: none !important; }
  .shell { display: block; padding: 0; } body { background: #fff; color: #000; }
  .card, .invoice { box-shadow: none; border-color: #ccc; }
}

/* dashboard helpers */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); }
a.card.kpi:hover { border-color: var(--brand-line); transform: translateY(-1px); transition: .15s; }
