/* SilkBridge — corridor operations UI */
:root {
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e2e8f0;
  --line-soft: #eef2f6;
  --bg: #f5f6f8;
  --card: #ffffff;
  --nav: #0b1220;
  --nav-2: #111c31;
  --accent: #d97706;
  --accent-soft: #fef3c7;
  --green: #059669;
  --green-soft: #d1fae5;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --cyan: #0891b2;
  --cyan-soft: #cffafe;
  --violet: #7c3aed;
  --violet-soft: #ede9fe;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --slate-soft: #f1f5f9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -18px rgba(15, 23, 42, .25);
  --shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, .35);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
body.readonly .write-only { display: none !important; }
body.readonly select[data-doc-status] { opacity: .75; pointer-events: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; }

/* ---------- login ---------- */
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: var(--nav);
}
.login-art {
  position: relative;
  padding: 56px 64px;
  color: #e2e8f0;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(217, 119, 6, .18), transparent 60%),
    radial-gradient(700px 400px at 90% 90%, rgba(16, 185, 129, .12), transparent 60%),
    linear-gradient(160deg, #0b1220 0%, #0f1b2f 70%, #101c30 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.login-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: -.02em; font-size: 20px; color: #fff;
}
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
  background: linear-gradient(140deg, #f59e0b, #d97706 55%, #b45309);
  position: relative; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.logo-mark::after {
  content: ""; position: absolute; left: 7px; right: 7px; top: 13px; height: 4px;
  border-radius: 4px; background: #0b1220;
  transform: rotate(-28deg);
}
.login-art h1 {
  font-size: clamp(34px, 4.2vw, 54px);
  line-height: 1.05; letter-spacing: -.035em; margin: 44px 0 18px; color: #fff; max-width: 12ch;
}
.login-art > p { max-width: 48ch; color: #94a3b8; font-size: 16px; line-height: 1.6; margin: 0; }
.corridor-graphic { margin: 38px -10px 12px; }
.corridor-graphic svg { width: 100%; height: auto; display: block; }
.login-stats { display: flex; gap: 40px; margin-top: 34px; padding-top: 26px; border-top: 1px solid rgba(148,163,184,.16); }
.login-stats div { display: flex; flex-direction: column; }
.login-stats strong { font-size: 24px; color: #fff; font-weight: 650; }
.login-stats span { color: #94a3b8; font-size: 12px; letter-spacing: .02em; }
.login-panel { display: flex; align-items: center; justify-content: center; background: #fff; padding: 40px; }
.login-form { width: min(380px, 100%); }
.login-brand.mobile { display: none; color: var(--ink); margin-bottom: 28px; }
.login-form h2 { font-size: 30px; letter-spacing: -.03em; margin: 0 0 6px; }
.login-form > p { margin: 0 0 26px; }
.login-form label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 16px; }
.login-form input { display: block; width: 100%; margin-top: 6px; }
.demo-hint {
  margin-top: 26px; padding: 14px 16px; border: 1px dashed var(--line);
  border-radius: 10px; background: #fafbfc; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: 12px; color: var(--muted);
}
.demo-hint span { width: 100%; font-weight: 600; color: var(--ink-2); }
.demo-hint code { background: var(--slate-soft); border: 1px solid var(--line); padding: 2px 7px; border-radius: 5px; font-family: var(--mono); font-size: 11px; }

/* ---------- shell ---------- */
.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--nav);
  color: #cbd5e1;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 22px 16px 16px;
  z-index: 30;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; color: #fff; }
.side-brand-text { display: flex; flex-direction: column; font-weight: 650; letter-spacing: -.01em; line-height: 1.15; }
.side-brand-text small { font-weight: 500; font-size: 10px; color: #64748b; letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px; color: #94a3b8;
  font-weight: 500; font-size: 13.5px; transition: background .15s, color .15s;
}
.side-nav a:hover { background: rgba(148,163,184,.09); color: #e2e8f0; }
.side-nav a.active { background: linear-gradient(90deg, rgba(217,119,6,.18), rgba(217,119,6,.05)); color: #fbbf24; box-shadow: inset 2px 0 0 var(--accent); }
.nav-ico { width: 18px; text-align: center; opacity: .9; font-size: 14px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.corridor-status {
  display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 10px;
  background: rgba(16,185,129,.07); border: 1px solid rgba(16,185,129,.16);
}
.corridor-status strong { display: block; font-size: 11.5px; color: #a7f3d0; font-weight: 600; }
.corridor-status small { color: #64748b; font-size: 10.5px; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.5); animation: pulse 2.2s infinite; flex: 0 0 auto; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 10px 4px; border-top: 1px solid rgba(148,163,184,.12); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #1e293b; color: #fbbf24; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.side-user strong { display: block; color: #e2e8f0; font-size: 12.5px; font-weight: 600; }
.side-user small { color: #64748b; font-size: 10.5px; text-transform: capitalize; }
.side-user .icon-btn { margin-left: auto; color: #64748b; }
.side-user .icon-btn:hover { color: #f87171; background: rgba(248,113,113,.1); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; background: rgba(255,255,255,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 18px; padding: 0 28px;
  position: sticky; top: 0; z-index: 20;
}
.global-search { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 9px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 0 11px; height: 38px; color: var(--muted); }
.global-search input { border: 0; background: transparent; outline: none; flex: 1; height: 100%; font-size: 13px; }
.global-search kbd { font-size: 10px; color: var(--muted-2); border: 1px solid var(--line); background: #fff; border-radius: 4px; padding: 1px 5px; font-family: var(--font); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.top-date { font-size: 12px; color: var(--muted); }
.menu-btn { display: none; }
.view { padding: 28px 30px 48px; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ---------- primitives ---------- */
.btn {
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 8px 14px; font-weight: 600; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .15s, border-color .15s, transform .05s; white-space: nowrap;
}
.btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #e08a0b, #c96f05); border-color: #b45309; color: #fff; box-shadow: 0 1px 2px rgba(180,83,9,.3); }
.btn-primary:hover { background: linear-gradient(180deg, #d97706, #b45309); border-color: #92400e; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--slate-soft); }
.btn-danger { color: var(--red); border-color: #fecaca; background: #fff; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; padding: 10px 16px; }
.icon-btn { border: 0; background: transparent; border-radius: 7px; width: 32px; height: 32px; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); font-size: 15px; }
.icon-btn:hover { background: var(--slate-soft); color: var(--ink); }

input, select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  background: #fff; outline: none; font-size: 13px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.13); }
textarea { resize: vertical; min-height: 72px; }
label.field { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 12px; }
label.field > span { display: block; margin-bottom: 5px; }
label.field input, label.field select, label.field textarea { margin-top: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.form-error { background: var(--red-soft); color: #991b1b; border: 1px solid #fecaca; border-radius: 8px; padding: 9px 12px; font-size: 12px; margin-bottom: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 0; }
.card-head h3 { margin: 0; font-size: 13.5px; letter-spacing: -.01em; }
.card-head .sub { font-size: 11.5px; color: var(--muted); }
.card-body { padding: 16px 18px 18px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px;
  padding: 3px 9px; font-size: 11px; font-weight: 600; letter-spacing: .01em;
  background: var(--slate-soft); color: var(--muted); white-space: nowrap;
}
.chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75; }
.chip.plain::before { display: none; }
.chip-blue { background: var(--blue-soft); color: #1d4ed8; }
.chip-cyan { background: var(--cyan-soft); color: #0e7490; }
.chip-amber { background: #fef3c7; color: #b45309; }
.chip-violet { background: var(--violet-soft); color: #6d28d9; }
.chip-teal { background: #ccfbf1; color: #0f766e; }
.chip-green { background: var(--green-soft); color: #047857; }
.chip-red { background: var(--red-soft); color: #b91c1c; }
.chip-slate { background: var(--slate-soft); color: #475569; }
.chip-mode { background: #fff; border: 1px solid var(--line); color: var(--ink-2); }

.page-head { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 25px; letter-spacing: -.03em; margin: 0 0 3px; font-weight: 650; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.page-head .head-actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: linear-gradient(90deg, var(--accent), transparent); opacity: .5; }
.kpi .k-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 7px; }
.kpi .k-value { font-size: 30px; font-weight: 680; letter-spacing: -.035em; margin: 9px 0 2px; line-height: 1; }
.kpi .k-meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kpi.green .k-value { color: #047857; }
.kpi.amber .k-value { color: #b45309; }
.kpi.red .k-value { color: #b91c1c; }
.spark { display: block; width: 100%; height: 26px; margin-top: 8px; }

.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 14px; align-items: start; }
.span-8 { grid-column: span 8; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; }
.span-12 { grid-column: span 12; }

/* bars */
.bar-list { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 200px minmax(0,1fr) 52px; align-items: center; gap: 12px; font-size: 12px; }
.bar-row .bar-label { color: var(--ink-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; border-radius: 99px; background: var(--slate-soft); overflow: hidden; display: block; }
.bar-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #f59e0b, #d97706); }
.bar-row .bar-val { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* donut */
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut-legend { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; }
.donut-legend div { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.donut-legend i { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.donut-legend b { margin-left: auto; color: var(--ink); font-weight: 600; }

/* feeds */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.feed-item:last-child { border-bottom: 0; padding-bottom: 0; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex: 0 0 auto; }
.feed-item strong { font-size: 12.5px; font-weight: 600; display: block; }
.feed-item small { color: var(--muted); font-size: 11px; }
.feed-item .time { margin-left: auto; color: var(--muted-2); font-size: 10.5px; white-space: nowrap; }
.exception-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.exception-item:last-child { border-bottom: 0; }
.exception-item .ref { font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.exception-item .why { color: var(--muted); margin-left: auto; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line);
  background: #fbfcfd; white-space: nowrap;
}
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover { background: #fafbfc; }
.ref { font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--ink); }
.sub-line { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.progress-mini { height: 4px; background: var(--slate-soft); border-radius: 99px; overflow: hidden; width: 70px; }
.progress-mini > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.toolbar { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .search { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.toolbar .search input { padding-left: 32px; }
.toolbar .search span { position: absolute; left: 11px; top: 8px; color: var(--muted-2); }
.chip-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-filter { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 11px; font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.chip-filter:hover { border-color: #cbd5e1; }
.chip-filter.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.toolbar select { width: auto; min-width: 150px; }

/* ---------- detail ---------- */
.detail-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.back-link { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; margin-bottom: 7px; }
.back-link:hover { color: var(--ink); }
.detail-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-title h1 { font-size: 23px; letter-spacing: -.02em; margin: 0; font-family: var(--mono); font-weight: 650; }
.detail-sub { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.detail-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.stepper { display: flex; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; overflow-x: auto; box-shadow: var(--shadow); }
.step { flex: 1; min-width: 86px; position: relative; font-size: 10.5px; color: var(--muted-2); padding-top: 15px; text-align: center; }
.step::before { content: ""; position: absolute; top: 4px; left: 0; right: 0; height: 3px; background: var(--line); }
.step:first-child::before { border-radius: 99px 0 0 99px; }
.step:last-child::before { border-radius: 0 99px 99px 0; }
.step.done::before, .step.current::before { background: linear-gradient(90deg, #10b981, #059669); }
.step.current { color: var(--ink); font-weight: 700; }
.step.current::after { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 11px; height: 11px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(245,158,11,.3); }

.detail-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(0,1fr); gap: 14px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 10px 13px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }

/* route */
.route-visual { display: flex; align-items: center; gap: 0; padding: 10px 0 2px; }
.route-node { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 74px; text-align: center; }
.route-node .dot { width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2px solid #cbd5e1; }
.route-node.done .dot { background: var(--green); border-color: var(--green); }
.route-node.current .dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(217,119,6,.16); }
.route-node span { font-size: 10.5px; color: var(--muted); }
.route-line { flex: 1; height: 2px; background: repeating-linear-gradient(90deg, #cbd5e1 0 6px, transparent 6px 10px); margin-top: -16px; }

.kv { display: grid; grid-template-columns: 118px 1fr; gap: 8px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink-2); font-weight: 500; }
.money { font-variant-numeric: tabular-nums; }

/* timeline */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 17px 0; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -19px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid #cbd5e1; }
.tl-item.hot::before { border-color: var(--accent); background: var(--accent-soft); }
.tl-item.done::before { border-color: var(--green); background: var(--green-soft); }
.tl-item strong { font-size: 12.5px; font-weight: 600; display: block; }
.tl-item .meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tl-item .note { font-size: 11.5px; color: var(--ink-2); background: #fbfcfd; border: 1px solid var(--line-soft); border-radius: 7px; padding: 6px 9px; margin-top: 6px; }

/* docs */
.doc-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.doc-row:last-child { border-bottom: 0; }
.doc-ico { width: 28px; height: 28px; border-radius: 7px; background: var(--slate-soft); display: grid; place-items: center; font-size: 12px; flex: 0 0 auto; }
.doc-row .doc-name { flex: 1; min-width: 0; }
.doc-row .doc-name small { display: block; color: var(--muted); font-size: 10.5px; }
.req { color: var(--red); font-size: 11px; font-weight: 600; }
.ok { color: var(--green); font-size: 11px; font-weight: 600; }

/* checks */
.check-row { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.check-row:last-child { border-bottom: 0; }
.check-badge { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: 0 0 auto; }
.check-pass { background: var(--green-soft); color: #047857; }
.check-warn { background: #fef3c7; color: #b45309; }
.check-fail { background: var(--red-soft); color: #b91c1c; }
.check-row strong { font-size: 12px; display: block; text-transform: capitalize; }
.check-row p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }

/* lane cards */
.lane-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.lane-card { padding: 18px; }
.lane-top { display: flex; align-items: flex-start; gap: 12px; }
.lane-top h3 { margin: 0; font-size: 14px; letter-spacing: -.01em; line-height: 1.35; }
.lane-code { font-family: var(--mono); font-size: 10px; color: var(--muted); background: var(--slate-soft); padding: 2px 6px; border-radius: 4px; }
.lane-route { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 650; margin: 14px 0 6px; }
.lane-route .arrow { color: var(--muted-2); }
.lane-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.lane-meta div { font-size: 10.5px; color: var(--muted); }
.lane-meta strong { display: block; font-size: 14px; color: var(--ink); font-weight: 650; margin-top: 2px; }
.season-note { margin-top: 12px; font-size: 11px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 10px; }

/* empty / loading */
.loading { padding: 60px; text-align: center; color: var(--muted); font-size: 13px; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(2px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 18px 30px; overflow-y: auto; }
.modal { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: min(620px, 100%); animation: pop .16s ease-out; }
.modal.wide { width: min(780px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.modal-head .sub { font-size: 11.5px; color: var(--muted); }
.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfcfd; border-radius: 0 0 16px 16px; }

/* toast */
.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 11px 15px; border-radius: 9px; font-size: 12.5px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; max-width: 340px; }
.toast.error { background: #991b1b; }
.toast.ok { background: #065f46; }

/* ---------- public tracking ---------- */
.track-page { min-height: 100vh; background: var(--nav); padding: 0 18px 40px; }
.track-top { max-width: 900px; margin: 0 auto; padding: 24px 0; display: flex; align-items: center; gap: 12px; color: #fff; }
.track-top .spacer { margin-left: auto; font-size: 11px; color: #64748b; }
.track-wrap { max-width: 900px; margin: 0 auto; }
.track-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.track-hero { padding: 28px 30px; background: linear-gradient(140deg, #0f1b2f, #15263f); color: #fff; }
.track-hero .ref { color: #fbbf24; font-size: 13px; }
.track-hero h1 { margin: 8px 0 2px; font-size: 28px; letter-spacing: -.03em; }
.track-hero .route { color: #94a3b8; font-size: 14px; }
.track-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.track-body { display: grid; grid-template-columns: 1.5fr 1fr; gap: 0; }
.track-main { padding: 26px 30px; }
.track-side { padding: 26px 30px; background: #fbfcfd; border-left: 1px solid var(--line); }
.track-side h4 { margin: 0 0 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.track-side dl { margin: 0 0 18px; }
.track-foot { text-align: center; color: #475569; font-size: 11px; padding: 20px 0; }
.track-error { max-width: 520px; margin: 14vh auto 0; background: #fff; border-radius: 16px; padding: 40px; text-align: center; }
.track-error h1 { font-size: 22px; margin: 0 0 6px; }
.track-error p { color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .span-8, .span-7 { grid-column: span 12; }
  .span-4, .span-5 { grid-column: span 6; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 248px; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.4); }
  .menu-btn { display: inline-grid; }
  .view { padding: 20px 18px 40px; }
  .topbar { padding: 0 16px; gap: 10px; }
  .top-date { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .lane-grid { grid-template-columns: 1fr; }
  .login-screen { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-brand.mobile { display: flex; }
}
@media (max-width: 700px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .span-4, .span-5, .span-6 { grid-column: span 12; }
  .global-search { display: none; }
  .top-actions .btn-primary { font-size: 12px; padding: 7px 11px; }
  .track-body { grid-template-columns: 1fr; }
  .track-side { border-left: 0; border-top: 1px solid var(--line); }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 100px minmax(0,1fr) 46px; }
  .page-head h1 { font-size: 21px; }
  .detail-actions { margin-left: 0; width: 100%; }
}
