/* ============================================================
   VELCUN — freight middleware
   Design system: midnight navy + signal amber, industrial type
   ============================================================ */
:root {
  --bg: #05070c;
  --bg-2: #080b12;
  --panel: #0b0f18;
  --panel-2: #0e1320;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #e9edf5;
  --muted: #98a2b8;
  --dim: #5d6779;
  --amber: #ffb454;
  --orange: #ff6a3d;
  --cyan: #6ee7ff;
  --green: #4ade80;
  --red: #f87171;
  --grad: linear-gradient(92deg, #ffb454 0%, #ff6a3d 100%);
  --radius: 14px;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
::selection { background: rgba(255, 180, 84, 0.28); }

.container { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

/* ---------- type ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
}
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
}
h1 { font-size: clamp(42px, 6vw, 76px); }
h2 { font-size: clamp(30px, 4vw, 46px); }
h3 { font-size: 19px; }
.sub { color: var(--muted); font-size: 18px; max-width: 640px; }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 10px;
  font-weight: 600; font-size: 15px; font-family: var(--font-body);
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--grad); color: #140a02;
  box-shadow: 0 8px 30px -10px rgba(255, 122, 61, 0.55);
}
.btn-primary:hover { box-shadow: 0 10px 36px -8px rgba(255, 122, 61, 0.75); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.03); color: var(--text);
  border-color: var(--line-2);
}
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255,255,255,.06); }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-danger { background: rgba(248, 113, 113, 0.12); color: var(--red); border-color: rgba(248,113,113,.35); }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(5, 7, 12, 0.78);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: 0.06em; }
.logo-mark { width: 30px; height: 30px; }
.nav-links { display: flex; gap: 30px; font-size: 14.5px; color: var(--muted); font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; gap: 12px; align-items: center; }
@media (max-width: 860px) { .nav-links { display: none; } }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 96px 0 40px;
  background:
    radial-gradient(1100px 500px at 78% -10%, rgba(255, 106, 61, 0.13), transparent 60%),
    radial-gradient(800px 400px at 8% 8%, rgba(110, 231, 255, 0.07), transparent 55%),
    var(--bg);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } .hero { padding-top: 64px; } }
.hero h1 { margin: 18px 0 20px; }
.hero .sub { margin-bottom: 34px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-meta { margin-top: 30px; display: flex; gap: 26px; color: var(--dim); font-size: 13px; font-family: var(--font-mono); }
.hero-meta span { display: flex; align-items: center; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* live network card */
.net-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 26px 18px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}
.net-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.net-title { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.18em; color: var(--dim); text-transform: uppercase; }
.live-badge { font-family: var(--font-mono); font-size: 11px; color: var(--green); display: flex; gap: 7px; align-items: center; }
.net-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.net-stat { background: var(--panel-2); padding: 16px 18px; }
.net-stat .num { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.net-stat .lbl { font-size: 12px; color: var(--dim); font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 2px; }

/* animated route */
.route-svg { width: 100%; height: 120px; margin-top: 14px; }
.route-path {
  fill: none; stroke: var(--line-2); stroke-width: 2; stroke-dasharray: 5 7;
}
.route-truck {
  fill: var(--amber); filter: drop-shadow(0 0 6px rgba(255, 180, 84, 0.9));
}

/* ---------- ticker ---------- */
.ticker {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--bg-2); overflow: hidden; padding: 14px 0;
  position: relative;
}
.ticker-track { display: flex; gap: 48px; width: max-content; animation: scroll 34s linear infinite; }
.ticker span {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.2em;
  color: var(--dim); text-transform: uppercase; white-space: nowrap;
}
.ticker b { color: var(--amber); font-weight: 500; margin-right: 8px; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
section { padding: 92px 0; }
.section-head { margin-bottom: 48px; }
.section-head h2 { margin: 14px 0 14px; }
.hazard {
  height: 4px; width: 72px; border-radius: 2px; margin-top: 18px;
  background: repeating-linear-gradient(-45deg, var(--amber) 0 8px, transparent 8px 16px);
}

/* lifecycle flow */
.flow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; position: relative; }
@media (max-width: 1080px) { .flow { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .flow { grid-template-columns: repeat(2, 1fr); } }
.flow-step {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 16px; position: relative;
}
.flow-step .idx { font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
.flow-step .ic { margin: 10px 0 10px; color: var(--text); }
.flow-step h3 { font-size: 15px; margin-bottom: 6px; }
.flow-step p { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.flow-step.auto { border-color: rgba(255, 180, 84, 0.35); }
.flow-step.auto .badge-auto {
  position: absolute; top: 12px; right: 12px;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em;
  color: #140a02; background: var(--grad); border-radius: 20px; padding: 2px 8px;
}

/* modules grid */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1080px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card .ic { color: var(--amber); margin-bottom: 14px; }
.card h3 { font-size: 16px; margin-bottom: 8px; }
.card p { font-size: 13.5px; color: var(--muted); }
.card .tag {
  display: inline-block; margin-top: 12px; font-family: var(--font-mono); font-size: 10.5px;
  color: var(--cyan); letter-spacing: 0.12em; text-transform: uppercase;
}

/* audience split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.aud {
  border-radius: var(--radius); padding: 36px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  position: relative; overflow: hidden;
}
.aud::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad);
}
.aud.cool::before { background: linear-gradient(92deg, #6ee7ff, #3b82f6); }
.aud .eyebrow { color: var(--orange); }
.aud.cool .eyebrow { color: var(--cyan); }
.aud h3 { font-size: 24px; margin: 10px 0 16px; }
.aud ul { list-style: none; margin-top: 6px; }
.aud li {
  padding: 9px 0 9px 30px; position: relative; color: var(--muted); font-size: 14.5px;
  border-bottom: 1px dashed rgba(255,255,255,.06);
}
.aud li:last-child { border-bottom: none; }
.aud li::before {
  content: "→"; position: absolute; left: 2px; color: var(--amber); font-weight: 700;
}
.aud.cool li::before { color: var(--cyan); }

/* developers */
.dev { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 44px; align-items: start; }
@media (max-width: 980px) { .dev { grid-template-columns: 1fr; } }
.code {
  background: #07090f; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 30px 70px -30px rgba(0,0,0,.8);
}
.code-bar {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: var(--panel);
}
.code-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.code-name { margin-left: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--dim); }
.code pre {
  padding: 20px 22px; overflow-x: auto; font-family: var(--font-mono);
  font-size: 13px; line-height: 1.75; color: #c9d4e8;
}
.tok-c { color: #5d6779; }         /* comment */
.tok-k { color: var(--amber); }    /* keyword/method */
.tok-s { color: #9ae6a2; }         /* string */
.tok-n { color: var(--cyan); }     /* number/field */
.dev-feats { display: grid; gap: 14px; }
.dev-feat { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.dev-feat .ic { color: var(--cyan); flex-shrink: 0; margin-top: 2px; }
.dev-feat h4 { font-size: 14.5px; margin-bottom: 3px; font-family: var(--font-display); }
.dev-feat p { font-size: 13px; color: var(--muted); }

/* CTA band */
.cta-band {
  border: 1px solid var(--line-2); border-radius: 20px; padding: 64px 48px; text-align: center;
  background:
    radial-gradient(600px 240px at 50% -40%, rgba(255, 122, 61, 0.2), transparent 70%),
    var(--panel-2);
}
.cta-band h2 { margin-bottom: 14px; }
.cta-band .sub { margin: 0 auto 30px; }
.cta-band .hero-ctas { justify-content: center; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 48px 0 36px; background: var(--bg-2); }
.foot { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.foot-col h5 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); margin-bottom: 14px; }
.foot-col a { display: block; color: var(--muted); font-size: 14px; padding: 4px 0; }
.foot-col a:hover { color: var(--text); }
.foot-base {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line);
  color: var(--dim); font-size: 13px;
}
.status-pill { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--green); }

/* ============================================================
   DASHBOARD APP
   ============================================================ */
body.app { background: var(--bg); }
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 420px at 75% -10%, rgba(255, 106, 61, 0.12), transparent 60%),
    radial-gradient(700px 360px at 10% 90%, rgba(110, 231, 255, 0.06), transparent 55%),
    var(--bg);
  padding: 24px;
}
.auth-card { width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 36px; }
.auth-card .logo { justify-content: center; margin-bottom: 8px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.auth-tabs { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 22px; }
.auth-tab { flex: 1; text-align: center; padding: 10px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; background: transparent; border: none; font-family: var(--font-body); }
.auth-tab.on { background: rgba(255, 180, 84, 0.12); color: var(--amber); }

.app-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
@media (max-width: 900px) { .app-shell { grid-template-columns: 1fr; } .side { display: none; } }
.side {
  border-right: 1px solid var(--line); background: var(--bg-2);
  padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .logo { padding: 4px 10px 18px; font-size: 18px; }
.side-group { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; color: var(--dim); text-transform: uppercase; padding: 16px 12px 8px; }
.side a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
  color: var(--muted); font-size: 14px; font-weight: 500; margin-bottom: 2px;
}
.side a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.side a.on { color: var(--amber); background: rgba(255, 180, 84, 0.1); }

.main { padding: 0 32px 60px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 0; border-bottom: 1px solid var(--line); margin-bottom: 28px;
  position: sticky; top: 0; background: rgba(5,7,12,.88); backdrop-filter: blur(10px); z-index: 5;
}
.topbar h2 { font-size: 22px; }
.org-chip { display: flex; align-items: center; gap: 12px; }
.org-type {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px; border: 1px solid rgba(110, 231, 255, 0.4); color: var(--cyan);
}
.org-type.carrier { border-color: rgba(255,180,84,.5); color: var(--amber); }

/* tables & panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 15px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; padding: 11px 20px; font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); font-weight: 500;
  border-bottom: 1px solid var(--line);
}
td { padding: 13px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.045); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255, 255, 255, 0.02); }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.money { color: var(--green); font-weight: 600; font-family: var(--font-mono); font-size: 13px; }

.chip {
  display: inline-block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em;
  padding: 3px 10px; border-radius: 20px; text-transform: uppercase; font-weight: 600;
  border: 1px solid var(--line-2); color: var(--muted);
}
.chip.available, .chip.accepted { color: var(--green); border-color: rgba(74, 222, 128, 0.4); background: rgba(74,222,128,.07); }
.chip.tendered { color: var(--amber); border-color: rgba(255,180,84,.4); background: rgba(255,180,84,.07); }
.chip.dispatched, .chip.in_transit { color: var(--cyan); border-color: rgba(110,231,255,.4); background: rgba(110,231,255,.07); }
.chip.delivered, .chip.invoiced { color: #c4b5fd; border-color: rgba(196,181,253,.4); background: rgba(196,181,253,.07); }
.chip.paid, .chip.issued { color: var(--green); border-color: rgba(74,222,128,.4); }
.chip.cancelled, .chip.rejected, .chip.no_show { color: var(--red); border-color: rgba(248,113,113,.4); }
.chip.pending, .chip.scheduled { color: var(--amber); border-color: rgba(255,180,84,.4); }

/* forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input, select {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px;
  color: var(--text); padding: 10px 13px; font-size: 14px; font-family: var(--font-body);
  outline: none; transition: border-color .15s;
}
input:focus, select:focus { border-color: var(--amber); }
select { appearance: none; background-image: none; }
.filter-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--panel-2);
}
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(2, 4, 8, 0.72); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-back.open { display: flex; }
.modal {
  width: 460px; max-width: 100%; max-height: 88vh; overflow-y: auto;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 16px; padding: 28px;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9);
}
.modal h3 { margin-bottom: 18px; font-size: 18px; }
.modal .row-end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* toast */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--green);
  padding: 14px 20px; border-radius: 10px; font-size: 14px; max-width: 380px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.8); display: none;
}
.toast.err { border-left-color: var(--red); }
.toast.show { display: block; animation: slidein .25s ease; }
@keyframes slidein { from { transform: translateY(12px); opacity: 0; } }

/* timeline */
.timeline { padding: 6px 0; }
.tl-item { display: flex; gap: 16px; padding: 10px 0; }
.tl-rail { display: flex; flex-direction: column; align-items: center; width: 14px; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); margin-top: 5px; box-shadow: 0 0 8px rgba(255,180,84,.7); }
.tl-line { width: 2px; flex: 1; background: var(--line); margin-top: 4px; }
.tl-body { flex: 1; }
.tl-body b { font-size: 13.5px; font-weight: 600; }
.tl-body .meta { font-size: 12px; color: var(--dim); font-family: var(--font-mono); }

.empty { padding: 44px 20px; text-align: center; color: var(--dim); font-size: 14px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 7px 14px; font-size: 13.5px; }
.kv .k { color: var(--dim); font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; padding-top: 2px; }

/* ============================================================
   AGENT CHAT DRAWER
   ============================================================ */
.agent-fab {
  position: fixed; bottom: 26px; right: 26px; z-index: 90;
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--grad); color: #140a02; font-size: 24px;
  box-shadow: 0 12px 36px -8px rgba(255, 122, 61, 0.6);
  display: none; align-items: center; justify-content: center;
}
body.app-logged-in .agent-fab { display: flex; }
.agent-drawer {
  position: fixed; right: 26px; bottom: 96px; z-index: 95;
  width: 400px; max-width: calc(100vw - 40px); height: 520px; max-height: 70vh;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 16px;
  display: none; flex-direction: column; overflow: hidden;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9);
}
.agent-drawer.open { display: flex; }
.agent-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.agent-head b { font-family: var(--font-display); font-size: 15px; }
.agent-head .sub { font-size: 11px; color: var(--dim); font-family: var(--font-mono); }
.agent-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.agent-msg { max-width: 88%; padding: 10px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; }
.agent-msg.user { align-self: flex-end; background: rgba(255, 180, 84, 0.14); border: 1px solid rgba(255, 180, 84, 0.25); }
.agent-msg.assistant { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); }
.agent-steps { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 5px; margin-top: -4px; }
.agent-step {
  font-family: var(--font-mono); font-size: 10px; padding: 3px 8px; border-radius: 20px;
  border: 1px solid var(--line-2); color: var(--cyan);
}
.agent-step.failed { color: var(--red); border-color: rgba(248, 113, 113, 0.4); }
.agent-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--panel); }
.agent-input input { flex: 1; }
.agent-hint { padding: 8px 14px; font-size: 11.5px; color: var(--dim); background: var(--panel); border-top: 1px solid var(--line); font-family: var(--font-mono); }

/* ============================================================
   COMMAND CENTER (decision support, not data display)
   ============================================================ */
.attn-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 1100px) { .attn-grid { grid-template-columns: 1fr; } }
.attn {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; border-left: 3px solid var(--amber);
}
.attn.cool { border-left-color: var(--cyan); }
.attn.good { border-left-color: var(--green); }
.attn.bad { border-left-color: var(--red); }
.attn .ic { font-size: 20px; margin-top: 2px; }
.attn-body { flex: 1; }
.attn-body b { font-size: 14.5px; font-family: var(--font-display); }
.attn-body .why { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.attn-meta { font-family: var(--font-mono); font-size: 11px; color: var(--dim); margin-top: 6px; }
.home-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 900px) { .home-cards { grid-template-columns: repeat(2, 1fr); } }
.search-wrap { position: relative; width: 320px; }
.search-wrap input { padding-left: 34px; }
.search-wrap .mag { position: absolute; left: 11px; top: 9px; color: var(--dim); font-size: 14px; }
.all-quiet {
  border: 1px dashed var(--line-2); border-radius: 12px; padding: 40px;
  text-align: center; color: var(--dim); font-size: 14px;
}
.all-quiet b { color: var(--green); font-family: var(--font-display); font-size: 16px; display: block; margin-bottom: 4px; }

/* ---- designed loading / error / empty states (one shape everywhere) ---- */
.state-box {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px;
  border: 1px solid var(--line-2); border-left: 3px solid var(--dim);
  border-radius: 12px; background: var(--panel);
}
.state-box.loading { border-left-color: var(--cyan); }
.state-box.error { border-left-color: var(--red); }
.state-box.empty { border-left-color: var(--dim); border-style: dashed; }
.state-box .sb-icon { font-size: 16px; color: var(--dim); flex: none; width: 20px; text-align: center; }
.state-box.error .sb-icon { color: var(--red); }
.state-box .sb-text b { font-size: 14px; font-family: var(--font-display); }
.sb-spin {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--cyan);
  animation: sb-spin 0.9s linear infinite;
}
@keyframes sb-spin { to { transform: rotate(360deg); } }

/* ---- triage queue (Review now / Monitor / Stable) ---- */
.triage-grid { display: grid; grid-template-columns: 1.25fr 1.1fr 0.9fr; gap: 12px; padding: 16px 18px; }
@media (max-width: 1100px) { .triage-grid { grid-template-columns: 1fr; } }
.tri-col {
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel-2);
  padding: 12px 12px 10px; min-width: 0;
}
.tri-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tri-label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--dim);
}
.tri-count {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  border-radius: 8px; padding: 1px 8px; background: rgba(93, 103, 121, 0.15); color: var(--muted);
}
.tri-review { border-top: 2px solid var(--red); }
.tri-review .tri-count { background: rgba(248, 113, 113, 0.16); color: var(--red); }
.tri-monitor { border-top: 2px solid var(--amber); }
.tri-monitor .tri-count { background: rgba(255, 180, 84, 0.14); color: var(--amber); }
.tri-stable { border-top: 2px solid var(--green); }
.tri-stable .tri-count { background: rgba(74, 222, 128, 0.13); color: var(--green); }
.tri-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 9px 10px; border-radius: 10px; margin-bottom: 6px;
  background: var(--panel); border: 1px solid var(--line-2);
}
.tri-main { min-width: 0; }
.tri-main b { font-size: 13px; font-family: var(--font-display); }
.tri-rec { font-size: 11.5px; color: var(--amber); margin-top: 4px; line-height: 1.45; }

/* ---- AI recommendation panel (why this load) ---- */
.factor {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.factor:last-child { border-bottom: 0; }
.factor b { font-size: 13px; font-family: var(--font-display); }
.f-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; }
.f-dot.positive { background: var(--green); box-shadow: 0 0 8px rgba(74, 222, 128, 0.6); }
.f-dot.negative { background: var(--red); box-shadow: 0 0 8px rgba(248, 113, 113, 0.6); }
.f-dot.neutral { background: var(--dim); }
.conf-bar {
  display: inline-block; vertical-align: middle; width: 160px; height: 8px;
  border-radius: 6px; background: var(--line-2); overflow: hidden;
}
.conf-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--amber), var(--green)); }

/* ---- map truck marker pulse (at-risk trucks from the triage queue) ---- */
.truck-pulse { animation: truck-pulse 1.6s ease-in-out infinite; }
@keyframes truck-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.22); }
}

/* ============================================================
   LIVE MAP (freight + equipment visibility)
   ============================================================ */
.map-wrap { position: relative; }
#mapCanvas { height: 560px; border-radius: 0 0 var(--radius) var(--radius); border-top: 1px solid var(--line); z-index: 1; background: #0a0e17; }
.map-toolbar {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2);
  border-radius: var(--radius) var(--radius) 0 0;
}
.map-toolbar select { width: auto; padding: 7px 10px; font-size: 13px; }
.map-toolbar label { display: flex; gap: 7px; align-items: center; font-size: 13px; color: var(--muted); cursor: pointer; }
.map-toolbar input[type="checkbox"] { width: 15px; height: 15px; accent-color: #ffb454; }
.map-legend {
  position: absolute; right: 14px; bottom: 14px; z-index: 500;
  background: rgba(5, 7, 12, 0.9); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 10px 14px; font-size: 12px; color: var(--muted); backdrop-filter: blur(8px);
}
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; }
.map-legend .lane-swatch { display: inline-block; width: 14px; height: 0; border-top: 2px dashed #ffb454; margin-right: 7px; border-radius: 0; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #0e1320; color: var(--text); border: 1px solid var(--line-2); box-shadow: 0 12px 40px -12px rgba(0,0,0,.9); }
.leaflet-popup-content { font-family: var(--font-body); font-size: 13px; line-height: 1.5; }
.leaflet-container { background: #0a0e17; font-family: var(--font-body); }
.map-count { font-family: var(--font-mono); font-size: 11.5px; color: var(--dim); margin-left: auto; }

/* ---- onboarding checklist (signup -> first dispatched load) ---- */
.ob-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (max-width: 900px) { .ob-list { grid-template-columns: 1fr; } }
.ob-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel);
}
.ob-item.done { opacity: 0.62; }
.ob-item.done .ob-main b { text-decoration: line-through; text-decoration-color: var(--dim); }
.ob-check { flex: none; width: 22px; height: 22px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 12px;
  border: 1px solid var(--line-2); color: var(--dim); }
.ob-item.done .ob-check { border-color: var(--green); color: var(--green);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.35); }
.ob-main { flex: 1; min-width: 0; }
.ob-main b { font-size: 13px; font-family: var(--font-display); }
