/* =========================================================
   TRANSFLOW — design system
   ========================================================= */
:root {
  --bg: #060A11;
  --bg-2: #080D16;
  --surface: #0C1320;
  --surface-2: #101928;
  --surface-3: #152033;
  --line: #1B2638;
  --line-soft: #141D2C;
  --text: #EAF1FA;
  --muted: #8C9BB0;
  --dim: #62718A;
  --accent: #C9F75C;
  --accent-2: #A8E334;
  --accent-ink: #0A1104;
  --accent-soft: rgba(201, 247, 92, 0.12);
  --cyan: #58C8FF;
  --green: #4ADE80;
  --amber: #F5B94D;
  --red: #FF6B6B;
  --violet: #A78BFA;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  --sidebar-bg: #070B12;
  --sidebar-line: rgba(255, 255, 255, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="light"] {
  --bg: #F2F5F9;
  --bg-2: #EDF1F6;
  --surface: #FFFFFF;
  --surface-2: #F7F9FC;
  --surface-3: #EEF3F9;
  --line: #E1E7F0;
  --line-soft: #EBEFF5;
  --text: #0B1524;
  --muted: #5C6B80;
  --dim: #8291A6;
  --accent: #C9F75C;
  --accent-2: #B4E144;
  --accent-ink: #0A1104;
  --accent-soft: rgba(150, 200, 20, 0.16);
  --cyan: #0E8DC4;
  --green: #16A34A;
  --amber: #B7791F;
  --red: #DC2626;
  --violet: #7C5CFC;
  --shadow: 0 18px 44px rgba(15, 30, 55, 0.10);
  color-scheme: light;
}

* { box-sizing: border-box; }
.ic,
.nav-item > svg,
.icon-btn > svg,
.btn > svg,
.brand-mark svg,
.user-chip > svg,
.badge svg,
.chip svg,
.map-tool svg,
.segmented svg,
.alert-icon svg,
.tc-icon svg,
.doc-icon svg,
.plan li svg,
.tl-dot svg,
.send-btn svg,
.cap svg,
.toast svg,
.empty svg,
.link svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
::selection { background: var(--accent); color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--dim); background-clip: content-box; }

/* ---------------- shell ---------------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); height: 100vh; }

.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  color: #E9F0FA;
  position: relative;
  z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 20px 18px;
}
.brand-mark {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 11px;
  background: linear-gradient(145deg, #D7FF6E, #A4DD2B);
  display: grid; place-items: center;
  box-shadow: 0 0 0 1px rgba(255,255,255,.14) inset, 0 8px 24px rgba(180, 240, 60, .18);
  color: #0A1104;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: .14em; line-height: 1; }
.brand-sub { font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: #6F7F96; margin-top: 4px; }

.nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.nav-group { margin-top: 18px; }
.nav-group:first-child { margin-top: 4px; }
.nav-label {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: #5B6B82; padding: 0 10px; margin-bottom: 8px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 9px;
  color: #A9B7CA; font-size: 13px; font-weight: 500;
  border: 1px solid transparent;
  transition: background .16s, color .16s, border-color .16s;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.045); color: #EDF3FB; }
.nav-item.active { background: rgba(201,247,92,.10); color: #EAF3D2; border-color: rgba(201,247,92,.14); }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px;
  background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-item svg { width: 17px; height: 17px; opacity: .8; flex: 0 0 17px; }
.nav-item.active svg { opacity: 1; color: var(--accent); }
.nav-item .nav-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 700;
  background: rgba(201,247,92,.16); color: var(--accent);
  border-radius: 6px; padding: 1px 6px;
}
.nav-item .nav-badge.muted { background: rgba(255,255,255,.07); color: #98A8BD; }

.sidebar-foot { padding: 12px; border-top: 1px solid var(--sidebar-line); }
.plan-card { cursor: pointer;
  border: 1px solid rgba(201,247,92,.2);
  background: radial-gradient(120% 120% at 100% 0%, rgba(201,247,92,.14), transparent 55%), rgba(255,255,255,.025);
  border-radius: 12px; padding: 12px 13px; margin-bottom: 10px;
}
.plan-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-card-name { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.plan-card small { display: block; color: #7E8DA3; font-size: 10.5px; margin-top: 5px; }
.usage { height: 4px; border-radius: 99px; background: rgba(255,255,255,.09); overflow: hidden; margin-top: 9px; }
.usage > i { display: block; height: 100%; background: linear-gradient(90deg, #9AD52A, var(--accent)); border-radius: 99px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; }
.user-chip:hover { background: rgba(255,255,255,.04); }
.user-chip .avatar { width: 32px; height: 32px; font-size: 11px; }
.user-meta { min-width: 0; flex: 1; }
.user-meta b { display: block; font-size: 12.5px; font-weight: 600; color: #E7EEF8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 10.5px; color: #728198; }
.user-chip .dots { color: #728198; }

.shell { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.topbar {
  height: 66px; flex: 0 0 66px;
  display: flex; align-items: center; gap: 18px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  z-index: 30;
}
.topbar .menu-btn { display: none; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
.crumbs b { color: var(--text); font-weight: 600; font-size: 13px; }
.topbar .spacer { flex: 1; }

.global-search {
  display: flex; align-items: center; gap: 9px;
  width: 300px; height: 38px; padding: 0 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; color: var(--dim);
  transition: border-color .15s, box-shadow .15s;
}
.global-search:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.global-search svg { width: 15px; height: 15px; }
.global-search input { background: none; border: 0; outline: none; width: 100%; font-size: 12.5px; color: var(--text); }
.global-search input::placeholder { color: var(--dim); }
.kbd { font-family: var(--mono); font-size: 10px; color: var(--dim); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; background: var(--surface); }

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--muted);
  position: relative; transition: .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--dim); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--surface-2); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #25344C, #17233A);
  color: #D9E6F7; font-size: 11.5px; font-weight: 700;
  border: 1px solid var(--line); flex: 0 0 auto;
}

.view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 26px 30px 50px; scroll-behavior: smooth; }
.page { max-width: 1560px; margin: 0 auto; animation: rise .35s cubic-bezier(.2,.7,.3,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-size: 26px; line-height: 1.15; margin: 0; letter-spacing: -.02em; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 6px; }
.page-head .actions { margin-left: auto; display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.eyebrow { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-weight: 700; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--dim); background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px rgba(190,240,70,.14); }
.btn-primary:hover { background: #D6FF73; border-color: #D6FF73; }
.btn-dark { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 11.5px; border-radius: 8px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 13.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------------- cards ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  min-width: 0;
  position: relative;
}
.card-head { padding: 16px 18px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-soft); }
.card-head .card-title { font-size: 13.5px; font-weight: 650; letter-spacing: -.01em; }
.card-head .card-sub { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 10px 12px; }
.card-body.flush { padding: 0; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 13px; font-weight: 650; }
.section-title .right { margin-left: auto; }

/* ---------------- KPI ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 15px 16px 14px; position: relative; overflow: hidden;
  min-width: 0;
}
.kpi::after {
  content: ""; position: absolute; inset: 0 0 auto auto; width: 90px; height: 90px;
  background: radial-gradient(circle at top right, var(--accent-soft), transparent 70%);
  opacity: .7; pointer-events: none;
}
.kpi .k-label { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); font-weight: 500; }
.kpi .k-label svg { width: 14px; height: 14px; color: var(--dim); }
.kpi .k-value { font-family: var(--display); font-size: 27px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin-top: 9px; }
.kpi .k-value small { font-size: 13px; color: var(--dim); font-weight: 500; letter-spacing: 0; }
.kpi .k-foot { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 11px; color: var(--dim); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 650; font-size: 11px; padding: 1px 6px; border-radius: 5px; }
.delta.up { color: var(--green); background: rgba(74,222,128,.10); }
.delta.down { color: var(--red); background: rgba(255,107,107,.10); }
.delta.flat { color: var(--amber); background: rgba(245,185,77,.10); }
.kpi.accent { border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); }
.kpi.accent::after { opacity: 1; }

/* ---------------- dashboard grid ---------------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr); gap: 14px; }
.dash-3 { display: grid; grid-template-columns: 1.16fr 0.9fr 0.94fr; gap: 14px; margin-top: 14px; align-items: stretch; }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

/* ---------------- map ---------------- */
.map-card { overflow: hidden; }
.map-shell {
  position: relative; height: 520px;
  background:
    radial-gradient(80% 80% at 55% 30%, rgba(36, 74, 120, .14), transparent 60%),
    #070C15;
  overflow: hidden;
}
[data-theme="light"] .map-shell { background: radial-gradient(80% 80% at 55% 30%, #DCEAF8, transparent 62%), #EAF1F8; }
.map-shell svg.world { width: 100%; height: 100%; cursor: grab; touch-action: none; transition: transform .3s ease; }
@media (min-width: 761px) {
  .map-shell:has(.map-panel) svg.world { transform: translateX(-6%); }
}
.map-shell svg.world.dragging { cursor: grabbing; }
.geo { fill: rgba(116, 158, 212, .10); stroke: rgba(124, 167, 222, .26); stroke-width: .7; vector-effect: non-scaling-stroke; transition: fill .2s; }
[data-theme="light"] .geo { fill: rgba(120, 158, 200, .20); stroke: rgba(70, 110, 160, .34); }
.geo.active { fill: rgba(201, 247, 92, .11); stroke: rgba(201, 247, 92, .34); }
.geo:hover { fill: rgba(201, 247, 92, .16); }
[data-theme="light"] .geo:hover { fill: rgba(140, 185, 40, .24); }
.geo-label { fill: var(--dim); font-size: 8px; letter-spacing: .12em; pointer-events: none; opacity: .7; font-weight: 600; }
.map-grid-line { stroke: rgba(120, 160, 210, .07); stroke-width: .5; }
[data-theme="light"] .map-grid-line { stroke: rgba(70, 110, 160, .10); }

.map-top { position: absolute; inset: 14px 14px auto 14px; display: flex; gap: 8px; pointer-events: none; z-index: 3; }
.map-top > * { pointer-events: auto; }
.map-tools { display: flex; gap: 6px; padding: 5px; background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--line); border-radius: 10px; backdrop-filter: blur(12px); }
.map-tool {
  height: 29px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px;
  border-radius: 7px; border: 0; background: transparent; color: var(--muted);
  font-size: 11px; font-weight: 600;
}
.map-tool svg { width: 13px; height: 13px; }
.map-tool:hover { color: var(--text); background: var(--surface-2); }
.map-tool.on { background: var(--accent); color: var(--accent-ink); }
.map-zoom { position: absolute; left: 14px; top: 62px; z-index: 4; display: flex; flex-direction: column; gap: 6px; }
.map-zoom .icon-btn { background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(10px); }
.map-zoom button { width: 32px; height: 32px; }
.map-legend {
  position: absolute; left: 14px; bottom: 14px; z-index: 3;
  display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 11px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--line);
  border-radius: 9px; backdrop-filter: blur(12px); font-size: 10.5px; color: var(--muted);
}
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.map-hint { position: absolute; right: 14px; bottom: 14px; z-index: 3; font-size: 10px; color: var(--dim); background: color-mix(in srgb, var(--surface) 75%, transparent); border: 1px solid var(--line); padding: 5px 9px; border-radius: 7px; backdrop-filter: blur(8px); }

.pin { cursor: pointer; }
.pin .pulse { animation: pulse 2.8s ease-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes pulse { 0% { opacity: .55; transform: scale(.5); } 70% { opacity: 0; transform: scale(2.4); } 100% { opacity: 0; transform: scale(2.4); } }
.pin .pin-body { transition: transform .15s; }
.pin:hover .pin-body { transform: scale(1.18); }
.pin-label { font-size: 9px; font-weight: 600; fill: var(--text); paint-order: stroke; stroke: var(--bg); stroke-width: 2.5px; stroke-linejoin: round; pointer-events: none; }
.route-line { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 5 5; opacity: .85; animation: dash 26s linear infinite; vector-effect: non-scaling-stroke; }
.route-line.cyan { stroke: var(--cyan); }
.route-line.dim { stroke: var(--dim); opacity: .5; }
@keyframes dash { to { stroke-dashoffset: -400; } }
.radius-ring { fill: rgba(201,247,92,.05); stroke: rgba(201,247,92,.4); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }

/* map side panel */
.map-panel {
  position: absolute; top: 14px; right: 14px; bottom: 14px; width: 372px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line); border-radius: 13px;
  box-shadow: var(--shadow); backdrop-filter: blur(18px);
  display: flex; flex-direction: column; z-index: 6; overflow: hidden;
  animation: slidein .25s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes slidein { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.map-panel-head { padding: 12px 13px 10px; border-bottom: 1px solid var(--line-soft); }
.mp-close { position: absolute; top: 10px; right: 10px; }
.mp-title { display: flex; align-items: center; gap: 9px; padding-right: 26px; }
.mp-title h3 { margin: 0; font-family: var(--display); font-size: 16px; letter-spacing: -.01em; }
.mp-loc { color: var(--muted); font-size: 11.5px; margin-top: 5px; display: flex; align-items: center; gap: 6px; }
.mp-body { overflow-y: auto; padding: 10px 13px 12px; flex: 1; }
.mp-section { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); font-weight: 700; margin: 14px 0 8px; display: flex; align-items: center; justify-content: space-between; }
.mp-section:first-child { margin-top: 2px; }
.mp-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 9px; }
.mp-meta div { background: var(--surface-2); border-radius: 8px; padding: 6px 8px; }
.mp-meta small { display: block; font-size: 9.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.mp-meta b { font-size: 12px; font-weight: 600; }
.load-sug {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 7px;
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.load-sug:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--surface-3); }
.load-sug.best { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: linear-gradient(180deg, var(--accent-soft), transparent 65%), var(--surface-2); }
.ls-top { display: flex; align-items: center; gap: 7px; }
.ls-route { font-size: 12.5px; font-weight: 650; display: flex; align-items: center; gap: 5px; }
.ls-route svg { width: 12px; height: 12px; color: var(--dim); }
.ls-price { margin-left: auto; font-family: var(--display); font-weight: 700; font-size: 13px; }
.ls-meta { display: flex; align-items: center; gap: 10px; font-size: 10.5px; color: var(--muted); margin-top: 5px; flex-wrap: wrap; }
.ls-meta b { color: var(--text); font-weight: 600; }
.ls-foot { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.score { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 75%, var(--text)); }
.score.high { background: rgba(74,222,128,.12); color: var(--green); }
.score.mid { background: rgba(245,185,77,.12); color: var(--amber); }
.score.low { background: rgba(255,107,107,.1); color: var(--red); }
.margin-tag { font-size: 10px; color: var(--green); font-weight: 650; }
.margin-tag.neg { color: var(--red); }
.ls-why { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.why { font-size: 9px; color: var(--dim); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.mp-empty { text-align: center; color: var(--dim); font-size: 11.5px; padding: 22px 10px; }

/* ---------------- badges / pills ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 650; padding: 2px 7px; border-radius: 5px;
  background: var(--surface-3); color: var(--muted); border: 1px solid transparent; white-space: nowrap;
}
.badge svg { width: 11px; height: 11px; }
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.green { background: rgba(74,222,128,.11); color: var(--green); }
.badge.amber { background: rgba(245,185,77,.12); color: var(--amber); }
.badge.red { background: rgba(255,107,107,.11); color: var(--red); }
.badge.cyan { background: rgba(88,200,255,.11); color: var(--cyan); }
.badge.violet { background: rgba(167,139,250,.12); color: var(--violet); }
.badge.accent { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 72%, var(--text)); }
.badge.outline { background: transparent; border-color: var(--line); color: var(--muted); }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th {
  text-align: left; font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--dim); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--line-soft);
  white-space: nowrap; background: var(--surface);
}
.tbl td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl th.num { text-align: right; }
.tbl .strong { font-weight: 600; }
.tbl .sub { color: var(--dim); font-size: 10.5px; margin-top: 2px; }
.route-cell { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.route-cell .arrow { color: var(--dim); display: flex; }
.route-cell svg { width: 12px; height: 12px; }
.cell-actions { display: flex; gap: 6px; justify-content: flex-end; }
.link { color: var(--accent); font-weight: 600; font-size: 11.5px; cursor: pointer; }
[data-theme="light"] .link { color: #5A8700; }
.link:hover { text-decoration: underline; }

/* ---------------- filters ---------------- */
.filterbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 10.5px; color: var(--dim); font-weight: 600; letter-spacing: .03em; }
.input, .select, .textarea {
  height: 36px; padding: 0 11px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text); font-size: 12px; outline: none; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 74px; }
.input:focus, .select:focus, .textarea:focus { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--dim); }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238C9BB0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.searchbox { position: relative; flex: 1; min-width: 190px; max-width: 340px; }
.searchbox svg { position: absolute; left: 11px; top: 10px; width: 15px; height: 15px; color: var(--dim); }
.searchbox .input { padding-left: 33px; width: 100%; }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; gap: 2px; }
.segmented button { height: 28px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; border-radius: 6px; display: inline-flex; align-items: center; gap: 5px; }
.segmented button:hover { color: var(--text); }
.segmented button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.segmented svg { width: 13px; height: 13px; }
.chipbar { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 500; }
.chip:hover { color: var(--text); border-color: var(--dim); }
.chip.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); color: color-mix(in srgb, var(--accent) 75%, var(--text)); }
.chip svg { width: 12px; height: 12px; }
.range-wrap { display: flex; align-items: center; gap: 10px; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 99px; background: var(--line); outline: none; flex: 1; min-width: 80px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); cursor: pointer; box-shadow: 0 0 0 1px var(--accent); }
.range-val { font-size: 11px; font-weight: 700; color: var(--text); min-width: 56px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- dashboard lists ---------------- */
.alert-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.alert-item:last-child { border-bottom: 0; }
.alert-icon { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 27px; background: var(--surface-3); color: var(--muted); }
.alert-icon svg { width: 14px; height: 14px; }
.alert-icon.high { background: rgba(255,107,107,.11); color: var(--red); }
.alert-icon.warn { background: rgba(245,185,77,.11); color: var(--amber); }
.alert-icon.good { background: rgba(74,222,128,.11); color: var(--green); }
.alert-icon.info { background: rgba(88,200,255,.11); color: var(--cyan); }
.alert-body { min-width: 0; flex: 1; }
.alert-body b { font-size: 11.5px; font-weight: 600; display: block; }
.alert-body p { margin: 2px 0 0; font-size: 10.5px; color: var(--dim); line-height: 1.4; }
.alert-time { font-size: 9.5px; color: var(--dim); white-space: nowrap; }

.fleet-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); }
.fleet-row:last-child { border-bottom: 0; }
.fleet-id { font-family: var(--mono); font-size: 11px; font-weight: 600; width: 54px; }
.fleet-place { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.fleet-place .flag { font-size: 12px; }
.util { flex: 1; height: 4px; background: var(--surface-3); border-radius: 99px; overflow: hidden; min-width: 40px; }
.util > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.util > i.warn { background: var(--amber); }
.util > i.low { background: var(--red); }

.chart { width: 100%; height: auto; overflow: visible; }
.chart .bar { transition: opacity .15s; }
.chart .bar:hover { opacity: .75; }
.chart text { font-family: var(--font); }
.axis { font-size: 9px; fill: var(--dim); }
.gridline { stroke: var(--line-soft); stroke-width: 1; }
.legend { display: flex; gap: 14px; font-size: 10.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 7px; height: 7px; border-radius: 2px; }

.donut-wrap { display: flex; gap: 20px; align-items: center; }
.donut { width: 128px; height: 128px; flex: 0 0 128px; border-radius: 50%; position: relative; }
.donut::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: var(--surface); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; z-index: 2; }
.donut-center b { font-family: var(--display); font-size: 18px; letter-spacing: -.02em; }
.donut-center span { font-size: 9px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.cost-legend { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cost-legend div { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.cost-legend i { width: 7px; height: 7px; border-radius: 2px; }
.cost-legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.cost-legend span.v { color: var(--dim); min-width: 58px; text-align: right; }

/* ---------------- traffic / planning ---------------- */
.board-wrap { overflow-x: auto; }
.board { min-width: 920px; }
.board-head, .board-row { display: grid; grid-template-columns: 190px repeat(7, minmax(0, 1fr)); }
.board-head { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.board-head div { padding: 10px 10px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 650; }
.board-head div.today { color: var(--accent); }
.board-row { border-bottom: 1px solid var(--line-soft); min-height: 62px; }
.board-row:last-child { border-bottom: 0; }
.board-truck { padding: 9px 10px; border-right: 1px solid var(--line-soft); }
.board-truck b { font-family: var(--mono); font-size: 11px; font-weight: 600; display: block; }
.board-truck span { font-size: 10px; color: var(--dim); }
.board-cell { border-right: 1px solid var(--line-soft); padding: 5px; position: relative; min-height: 62px; }
.board-cell:last-child { border-right: 0; }
.board-cell.today { background: color-mix(in srgb, var(--accent) 3.5%, transparent); }
.trip-block {
  border-radius: 6px; padding: 4px 6px; font-size: 9.5px; font-weight: 600;
  border-left: 2px solid var(--accent); background: var(--accent-soft);
  color: color-mix(in srgb, var(--accent) 72%, var(--text));
  cursor: pointer; margin-bottom: 3px; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
}
.trip-block.transit { border-color: var(--cyan); background: rgba(88,200,255,.10); color: var(--cyan); }
.trip-block.delayed { border-color: var(--red); background: rgba(255,107,107,.10); color: var(--red); }
.trip-block.done { border-color: var(--dim); background: var(--surface-2); color: var(--dim); }
.trip-block.planned { border-color: var(--violet); background: rgba(167,139,250,.10); color: var(--violet); }
.trip-block small { display: block; font-weight: 500; opacity: .75; font-size: 8.5px; }

.queue-item { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); display: flex; gap: 10px; align-items: center; }
.queue-item:last-child { border-bottom: 0; }
.queue-item .qi-main { flex: 1; min-width: 0; }
.queue-item b { font-size: 11.5px; display: flex; align-items: center; gap: 5px; }
.queue-item span { font-size: 10px; color: var(--dim); display: block; margin-top: 2px; }
.queue-item .price { font-family: var(--display); font-weight: 700; font-size: 12px; white-space: nowrap; }

/* ---------------- fleet cards ---------------- */
.fleet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.truck-card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; padding: 14px; transition: border-color .15s, transform .15s; }
.truck-card:hover { border-color: var(--line); transform: translateY(-1px); }
.tc-head { display: flex; align-items: flex-start; gap: 10px; }
.tc-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); flex: 0 0 38px; }
.tc-icon svg { width: 19px; height: 19px; }
.tc-title { min-width: 0; flex: 1; }
.tc-title b { font-family: var(--mono); font-size: 12.5px; }
.tc-title span { display: block; font-size: 10.5px; color: var(--dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-status { margin-left: auto; }
.tc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 13px 0 11px; }
.tc-meta div { background: var(--surface-2); border-radius: 7px; padding: 7px 9px; }
.tc-meta small { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.tc-meta b { font-size: 11px; font-weight: 600; }
.tc-foot { border-top: 1px solid var(--line-soft); padding-top: 10px; display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--dim); }
.tc-foot .util { max-width: 70px; }
.tc-foot b { color: var(--text); font-size: 10.5px; }

/* ---------------- documents ---------------- */
.doc-row { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.doc-row:last-child { border-bottom: 0; }
.doc-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); flex: 0 0 32px; }
.doc-icon svg { width: 15px; height: 15px; }
.doc-main { flex: 1; min-width: 0; }
.doc-main b { font-size: 11.5px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-main span { font-size: 10px; color: var(--dim); }
.doc-size { font-size: 10px; color: var(--dim); white-space: nowrap; }

/* ---------------- AI ---------------- */
.ai-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; }
.chat-card { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 460px; }
.chat-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; background: radial-gradient(60% 40% at 50% 0%, var(--accent-soft), transparent 55%); }
.msg { display: flex; gap: 10px; max-width: 86%; animation: rise .25s both; }
.msg .avatar { width: 28px; height: 28px; font-size: 10px; }
.msg .bubble { background: var(--surface-2); border: 1px solid var(--line); padding: 10px 13px; border-radius: 12px; border-top-left-radius: 3px; font-size: 12.5px; line-height: 1.55; }
.msg .bubble b { color: var(--text); }
.msg .bubble ul { margin: 7px 0 0; padding-left: 16px; color: var(--muted); }
.msg .bubble li { margin: 3px 0; }
.msg .bubble .num { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.msg.user { margin-left: auto; flex-direction: row-reverse; }
.msg.user .bubble { background: var(--accent); color: var(--accent-ink); border-color: transparent; border-top-left-radius: 12px; border-top-right-radius: 3px; }
.msg.user .avatar { background: var(--surface-3); }
.ai-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 13px; }
.ai-card {
  display: flex; align-items: center; gap: 9px; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 10px; color: var(--muted); transition: .15s;
}
.ai-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--text); }
.ai-card svg { color: var(--accent); flex: 0 0 14px; }
.ai-card span { display: block; font-size: 9.5px; color: var(--dim); }
.ai-card b { display: block; font-size: 11px; font-weight: 600; margin-top: 1px; color: var(--text); }
.chat-suggest { display: flex; gap: 7px; flex-wrap: wrap; padding: 10px 16px 0; }
.chat-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line-soft); align-items: flex-end; }
.chat-input .input { flex: 1; height: 40px; }
.send-btn { width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: 0 0 40px; }
.send-btn svg { width: 17px; height: 17px; }
.ai-side .side-block { padding: 14px 15px; border-bottom: 1px solid var(--line-soft); }
.ai-side .side-block:last-child { border-bottom: 0; }
.ai-side h4 { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin: 0 0 10px; }
.cap { display: flex; gap: 9px; padding: 7px 0; font-size: 11px; color: var(--muted); border-bottom: 1px dashed var(--line-soft); }
.cap:last-child { border-bottom: 0; }
.cap svg { width: 14px; height: 14px; color: var(--accent); flex: 0 0 14px; margin-top: 1px; }
.cap b { color: var(--text); font-weight: 600; display: block; font-size: 11px; }

/* ---------------- settings ---------------- */
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.plan {
  border: 1px solid var(--line); border-radius: 12px; padding: 15px; background: var(--surface-2);
  position: relative; overflow: hidden;
}
.plan.current { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: linear-gradient(180deg, var(--accent-soft), transparent 55%), var(--surface-2); }
.plan h3 { margin: 0; font-family: var(--display); font-size: 15px; }
.plan .price { font-family: var(--display); font-size: 25px; font-weight: 700; letter-spacing: -.03em; margin: 7px 0 2px; }
.plan .price small { font-size: 11px; color: var(--dim); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 11px 0 13px; display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--muted); }
.plan li { display: flex; gap: 7px; align-items: flex-start; }
.plan li svg { width: 12px; height: 12px; color: var(--accent); margin-top: 2px; flex: 0 0 12px; }
.plan .ribbon { position: absolute; top: 12px; right: -25px; transform: rotate(35deg); background: var(--accent); color: var(--accent-ink); font-size: 8px; font-weight: 800; letter-spacing: .1em; padding: 2px 26px; }
.setting-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .sr-main { flex: 1; }
.setting-row b { font-size: 12px; font-weight: 600; display: block; }
.setting-row span { font-size: 10.5px; color: var(--dim); }
.switch { width: 38px; height: 22px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line); position: relative; cursor: pointer; transition: background .15s; flex: 0 0 38px; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: .18s; }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on::after { left: 18px; background: var(--accent-ink); }

/* ---------------- drawers / modals ---------------- */
.scrim { position: fixed; inset: 0; background: rgba(3, 7, 13, .62); backdrop-filter: blur(3px); z-index: 90; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 94vw);
  background: var(--surface); border-left: 1px solid var(--line);
  z-index: 100; display: flex; flex-direction: column;
  animation: drawer .28s cubic-bezier(.2,.7,.3,1) both;
  box-shadow: -30px 0 60px rgba(0,0,0,.28);
}
@keyframes drawer { from { transform: translateX(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-head { padding: 16px 18px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: flex-start; gap: 12px; }
.drawer-head h3 { margin: 0; font-family: var(--display); font-size: 17px; letter-spacing: -.01em; }
.drawer-head .sub { font-size: 11px; color: var(--dim); margin-top: 3px; }
.drawer-head .icon-btn { margin-left: auto; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px; }
.drawer-foot { padding: 13px 18px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface); }

.modal {
  position: fixed; z-index: 100; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(660px, 94vw); max-height: 90vh; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; animation: modal .22s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes modal { from { opacity: 0; transform: translate(-50%, -47%) scale(.98); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { margin: 0; font-family: var(--display); font-size: 18px; }
.modal-head .sub { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line-soft); display: flex; gap: 9px; justify-content: flex-end; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 700; margin: 4px 0 -2px; grid-column: 1 / -1; }

.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 9px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 10px; box-shadow: var(--shadow); font-size: 12px; max-width: 380px;
  animation: toastin .28s cubic-bezier(.2,.7,.3,1) both;
}
.toast.error { border-left-color: var(--red); }
.toast svg { width: 16px; height: 16px; color: var(--accent); flex: 0 0 16px; }
.toast.error svg { color: var(--red); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------- misc ---------------- */
.empty { text-align: center; padding: 34px 16px; color: var(--dim); font-size: 12px; }
.empty svg { width: 26px; height: 26px; margin: 0 auto 8px; opacity: .5; }
.hint { font-size: 10.5px; color: var(--dim); }
.divider { height: 1px; background: var(--line-soft); margin: 14px 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.tabular { font-variant-numeric: tabular-nums; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiny { font-size: 10px; }
.mono { font-family: var(--mono); }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.hidden { display: none !important; }

.stat-line { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 11.5px; }
.stat-line .k { color: var(--muted); flex: 1; }
.stat-line b { font-variant-numeric: tabular-nums; }
.progress-lg { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress-lg > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 11px; position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 1px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 21px; height: 21px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; color: var(--dim); flex: 0 0 21px; z-index: 1; }
.tl-dot.done { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--accent); }
.tl-dot.now { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tl-dot svg { width: 10px; height: 10px; }
.tl-main { min-width: 0; }
.tl-main b { font-size: 11.5px; display: block; font-weight: 600; }
.tl-main span { font-size: 10px; color: var(--dim); }

/* responsive */
@media (max-width: 1350px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .map-panel { width: 340px; }
}
@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-3 { grid-template-columns: 1fr 1fr; }
  .ai-layout { grid-template-columns: 1fr; }
  .ai-side { display: none; }
  .topbar { padding: 0 18px; }
  .view { padding: 22px 18px 44px; }
  .global-search { width: 230px; }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 252px; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; box-shadow: 30px 0 60px rgba(0,0,0,.5); }
  .topbar .menu-btn { display: grid; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .map-panel { width: 330px; }
}
@media (max-width: 760px) {
  .dash-3 { grid-template-columns: 1fr; }
  .global-search { display: none; }
  .topbar { gap: 10px; padding: 0 12px; }
  .topbar .avatar { display: none; }
  .topbar .icon-btn { width: 34px; height: 34px; }
  .crumbs span:first-child, .crumbs span:nth-child(2) { display: none; }
  .crumbs b { font-size: 12px; }
  .page-head h1 { font-size: 21px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .map-shell { height: 560px; }
  .map-panel { left: 10px; right: 10px; width: auto; top: auto; height: 62%; }
  .map-legend { display: none; }
  .map-hint { display: none; }
  .map-card .card-head { flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
  .view { padding: 16px 12px 40px; }
  .page-head .actions { width: 100%; margin-left: 0; }
  .page-head .actions .btn { flex: 1; }
}

.cc { font-size: 8.5px; font-weight: 700; letter-spacing: .04em; color: var(--dim); border: 1px solid var(--line); border-radius: 3px; padding: 0 3px; line-height: 1.4; vertical-align: middle; display: inline-block; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
