/* USA Dispatch portal — light, clean, calm. Shared by the admin console. */
:root {
  --bg: #f6f8fb; --card: #fff; --soft: #f1f5fb; --ink: #0f172a; --ink2: #334155; --muted: #64748b; --faint: #94a3b8; --line: #e6eaf0;
  --brand: #2563eb; --brand-ink: #1d4ed8; --brand-soft: #eaf1ff; --sky: #0ea5e9; --accent: #f97316; --accent-soft: #fff1e6;
  --good: #16a34a; --good-soft: #e9f8ee; --bad: #dc2626; --bad-soft: #fdecec; --warn: #d97706; --warn-soft: #fff6e5;
  --r: 14px; --r-sm: 10px; --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.05); --shadow-lg: 0 24px 64px rgba(15,23,42,.16);
  --side: 236px; --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14.5px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.num, td.num, .kpi b { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:where(svg[aria-hidden="true"]) { width: 18px; height: 18px; flex: none; }
.kpi span svg { width: 15px; height: 15px; }
.hero-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.hero-mini div { background: rgba(255,255,255,.8); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.hero-mini span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.hero-mini b { font-size: 18px; font-variant-numeric: tabular-nums; }
@media (max-width: 460px) { .hero-mini b { font-size: 15px; } .hero-mini div { padding: 8px 10px; } }
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- sign in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side { position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(160deg, #eef4ff 0%, #f8fbff 55%, #fff4ea 100%); }
.auth-side h2 { font-size: clamp(26px, 3vw, 38px); line-height: 1.12; max-width: 460px; }
.auth-side h2 em { font-style: normal; color: var(--brand); }
.auth-side p { color: var(--ink2); max-width: 430px; }
.auth-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 470px; margin-top: 24px; }
.auth-feats div { background: rgba(255,255,255,.75); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.auth-main { display: grid; place-items: center; padding: 32px 20px; background: #fff; }
.auth-box { width: min(380px, 100%); animation: rise .4s ease; }
.auth-box h1 { font-size: 26px; margin: 18px 0 4px; }
.auth-box .sub { color: var(--muted); margin: 0 0 22px; }
.auth-box .field { margin-bottom: 14px; }
.auth-box .btn.primary { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; margin: 18px 0; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.wa { width: 100%; justify-content: center; background: #fff; border-color: #bbf7d0; color: #15803d; }
.btn.wa:hover { background: #f0fdf4; }
.auth-note { font-size: 12.5px; color: var(--muted); margin-top: 14px; text-align: center; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--ink); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo .mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--sky)); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(37,99,235,.25); }
.logo .mark svg { width: 20px; height: 20px; }
.logo small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; background: linear-gradient(to right, #fff var(--side), var(--bg) var(--side)); }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #fff; border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.side .logo { padding: 4px 8px 18px; }
.nav-l { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--ink2); font-weight: 600; font-size: 14px; }
.nav a:hover { background: var(--soft); text-decoration: none; }
.nav a.on { background: var(--brand-soft); color: var(--brand-ink); }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a .cnt { margin-left: auto; font-size: 11px; background: var(--accent); color: #fff; border-radius: 99px; padding: 1px 7px; }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(246,248,251,.86); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.top.scrolled { border-bottom-color: var(--line); }
.top h1 { font-size: 19px; font-weight: 800; }
.top .sp { flex: 1; }
.search-btn { display: flex; align-items: center; gap: 8px; min-width: 240px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); cursor: pointer; font: inherit; }
.search-btn kbd { margin-left: auto; font: 600 11px var(--font); background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink2); }
.icon-btn:hover { background: var(--soft); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #dbeafe, #fde7d3); display: grid; place-items: center; font-weight: 800; color: var(--brand-ink); cursor: pointer; border: 0; font-family: inherit; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.view { padding: 8px 28px 48px; animation: rise .3s ease; max-width: 1360px; width: 100%; }
.as-admin { background: var(--warn-soft); color: #92400e; font-size: 13px; padding: 7px 28px; border-bottom: 1px solid #fde68a; }
.mobile-nav { display: none; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .top { padding: 10px 16px; }
  .search-btn { min-width: 0; } .search-btn span, .search-btn kbd { display: none; }
  .view { padding: 4px 16px 96px; }
  .mobile-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px; border-radius: 10px; }
  .mobile-nav a.on { color: var(--brand); }
  .mobile-nav a:hover { text-decoration: none; }
  .mobile-nav svg { width: 21px; height: 21px; }
}

/* ---------- building blocks ---------- */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .g2, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 460px) { .g4 { grid-template-columns: 1fr 1fr; gap: 10px; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card.flat { box-shadow: none; }
.card h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card h3 .sp { flex: 1; }
.card .hint, .hint { color: var(--muted); font-size: 13px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { flex: 1; }
.sec-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.sec-title h2 { font-size: 17px; font-weight: 800; flex: 1; }
.kpi { padding: 16px 18px; }
.kpi span { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi b { display: block; font-size: 24px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
.kpi small { font-size: 12px; color: var(--muted); }
.up { color: var(--good) !important; } .down { color: var(--bad) !important; }
.hero-kept { position: relative; overflow: hidden; background: linear-gradient(135deg, #ffffff 0%, #f3f8ff 60%, #fff6ee 100%); }
.hero-kept .big { font-size: clamp(34px, 4.6vw, 48px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin: 6px 0; }
.hero-kept .big.neg { color: var(--bad); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--soft); color: var(--ink2); white-space: nowrap; }
.pill.blue { background: var(--brand-soft); color: var(--brand-ink); } .pill.green { background: var(--good-soft); color: #15803d; } .pill.red { background: var(--bad-soft); color: #b91c1c; }
.pill.amber { background: var(--warn-soft); color: #b45309; } .pill.orange { background: var(--accent-soft); color: #c2410c; } .pill.grey { background: #f1f5f9; color: #475569; }
.dotc { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.tight { gap: 6px; } .sp { flex: 1; }
.stack > * + * { margin-top: 10px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .b { font-weight: 700; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty svg { width: 42px; height: 42px; color: var(--faint); margin-bottom: 6px; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* buttons & fields */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:hover { background: var(--soft); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.22); }
.btn.primary:hover { background: var(--brand-ink); }
.btn.orange { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { color: var(--bad); border-color: #fecaca; } .btn.danger:hover { background: var(--bad-soft); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .55; cursor: default; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span, .lbl { font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.field small { color: var(--muted); font-size: 12px; }
input, select, textarea { font: 14px var(--font); color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: #93b4f5; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
textarea { min-height: 80px; resize: vertical; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.fgrid .wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.seg { display: inline-flex; background: var(--soft); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { all: unset; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button { all: unset; padding: 10px 14px; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--brand-ink); border-bottom-color: var(--brand); }

/* tables */
.tbl-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid #f0f3f7; vertical-align: middle; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #fafcff; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tfoot td { font-weight: 800; border-bottom: 0; border-top: 1px solid var(--line); }
.lane { font-weight: 600; white-space: nowrap; }
.lane i { font-style: normal; color: var(--faint); margin: 0 4px; }

/* modal, drawer, toast, menu */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(15,23,42,.32); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); width: min(640px, 100%); animation: rise .2s ease; display: flex; flex-direction: column; max-height: none; }
.modal.wide { width: min(980px, 100%); } .modal.xwide { width: min(1180px, 100%); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 18px 22px 12px; }
.modal-h h2 { font-size: 18px; flex: 1; }
.modal-b { padding: 4px 22px 18px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; background: #fcfdfe; border-radius: 0 0 18px 18px; }
.modal-f .left { margin-right: auto; }
.x { all: unset; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.x:hover { background: var(--soft); }
.toasts { position: fixed; z-index: 200; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: rise .2s ease; pointer-events: auto; max-width: 92vw; }
.toast.bad { background: var(--bad); }
@media (max-width: 980px) { .toasts { bottom: 86px; } }
.menu { position: fixed; z-index: 150; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 200px; animation: rise .12s ease; }
.menu button, .menu a { all: unset; display: flex; gap: 9px; align-items: center; width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--ink2); }
.menu button:hover, .menu a:hover { background: var(--soft); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.menu .note { padding: 8px 10px; font-size: 12.5px; color: var(--muted); }

/* command menu */
.cmdk { width: min(620px, 100%); padding: 0; overflow: hidden; }
.cmdk input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 18px; font-size: 16px; box-shadow: none !important; }
.cmdk .list { max-height: min(440px, 60vh); overflow-y: auto; padding: 6px; }
.cmdk .it { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.cmdk .it.on { background: var(--brand-soft); }
.cmdk .it .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--soft); display: grid; place-items: center; flex: none; }
.cmdk .it .ic svg { width: 16px; height: 16px; }
.cmdk .it small { display: block; color: var(--muted); font-size: 12px; }
.cmdk .grp { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px 4px; }
.cmdk .foot { font-size: 12px; color: var(--muted); padding: 9px 16px; border-top: 1px solid var(--line); }

/* drop zone */
.drop { border: 2px dashed #c7d6f2; border-radius: var(--r); background: linear-gradient(180deg, #fbfdff, #f4f8ff); padding: 22px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop svg { width: 32px; height: 32px; color: var(--brand); }
.drop b { display: block; font-size: 15px; margin-top: 4px; }
.drop span { color: var(--muted); font-size: 13px; }

/* charts */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font: 11px var(--font); fill: var(--muted); }
.chart .val { font-weight: 700; fill: var(--ink2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tip { position: fixed; z-index: 300; pointer-events: none; background: var(--ink); color: #fff; font-size: 12.5px; padding: 7px 10px; border-radius: 9px; box-shadow: var(--shadow-lg); white-space: nowrap; }
.bars-h .bar { display: grid; grid-template-columns: 130px 1fr 90px; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.bars-h .track { height: 10px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.bars-h .fill { height: 100%; border-radius: 99px; background: var(--brand); transition: width .6s ease; }
.bars-h .bar b { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .bars-h .bar { grid-template-columns: 90px 1fr 72px; } }

/* lists of things */
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f0f3f7; }
.list-item:last-child { border-bottom: 0; }
.list-item .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--soft); color: var(--ink2); }
.list-item .ic svg { width: 18px; height: 18px; }
.list-item .t { flex: 1; min-width: 0; }
.list-item .t b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .t small { color: var(--muted); font-size: 12.5px; }
.ic.red { background: var(--bad-soft); color: var(--bad); } .ic.amber { background: var(--warn-soft); color: var(--warn); } .ic.green { background: var(--good-soft); color: var(--good); } .ic.blue { background: var(--brand-soft); color: var(--brand); } .ic.orange { background: var(--accent-soft); color: var(--accent); }
.left-money .list-item b.amt { font-size: 15px; font-weight: 800; }

/* documents */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 44%), 1fr)); gap: 12px; }
.cat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; position: relative; }
.cat:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #d5deea; }
.cat.on { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.cat .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 10px; }
.cat .ic svg { width: 20px; height: 20px; }
.cat b { display: block; font-size: 14.5px; } .cat small { color: var(--muted); font-size: 12.5px; }
.cat .warn { position: absolute; top: 12px; right: 12px; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.file { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.file:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.file .th { height: 118px; background: var(--soft); display: grid; place-items: center; overflow: hidden; }
.file .th img { width: 100%; height: 100%; object-fit: cover; }
.file .th svg { width: 38px; height: 38px; color: #ef4444; }
.file .meta { padding: 9px 11px; }
.file .meta b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .meta small { color: var(--muted); font-size: 11.5px; }
.viewer { background: #f1f5f9; border-radius: 12px; overflow: hidden; height: min(70vh, 760px); display: grid; place-items: center; }
.viewer iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* fleet */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.person { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.person:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.person .top-r { display: flex; gap: 12px; align-items: center; }
.person .avatar { width: 46px; height: 46px; font-size: 16px; cursor: inherit; }
.person .avatar.truck { border-radius: 12px; background: linear-gradient(135deg, #e0ecff, #f1f5f9); }
.person h4 { font-size: 15px; }
.person .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; font-size: 12.5px; }
.person .facts span { color: var(--muted); display: block; font-size: 11.5px; }
.kv { display: grid; grid-template-columns: minmax(120px, .7fr) 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { all: unset; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 99px; background: #fff; border: 1px solid var(--line); cursor: pointer; color: var(--ink2); }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.timeline .list-item .ic { width: 30px; height: 30px; }

/* map */
.map { height: 560px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: #e8eef6; z-index: 1; }
.map.sm { height: 300px; }
@media (max-width: 720px) { .map { height: 420px; } }
.leaflet-container { font-family: var(--font) !important; }
.truck-pin { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); border: 3px solid #fff; box-shadow: 0 4px 12px rgba(15,23,42,.3); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px; }
.truck-pin.old { background: var(--faint); }
.stops .stop { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; position: relative; }
.stops .stop i { width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--brand); background: #fff; justify-self: center; }
.stops .stop:last-of-type i { border-color: var(--accent); }
.ac { position: absolute; z-index: 20; top: 100%; left: 30px; right: 40px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); overflow: hidden; }
.ac button { all: unset; display: block; width: 100%; box-sizing: border-box; padding: 8px 12px; font-size: 13px; cursor: pointer; }
.ac button:hover { background: var(--soft); }

/* AI chat */
.chat { display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 460px; }
.chat-log { flex: 1; overflow-y: auto; padding: 8px 2px 16px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: min(720px, 92%); padding: 12px 16px; border-radius: 16px; line-height: 1.55; animation: rise .2s ease; }
.msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 5px; }
.msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; box-shadow: var(--shadow); }
.msg.bot a { font-weight: 700; }
.msg p { margin: 0 0 6px; } .msg p:last-child { margin: 0; }
.msg ul { margin: 4px 0; padding-left: 18px; }
.chat-hello { text-align: center; padding: 40px 10px 10px; }
.chat-hello .orb { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 12px; background: linear-gradient(135deg, var(--brand), var(--sky)); display: grid; place-items: center; color: #fff; box-shadow: 0 12px 30px rgba(37,99,235,.3); }
.chat-hello .orb svg { width: 30px; height: 30px; }
.chat-hello h2 { font-size: 24px; }
.chat-hello .chips { justify-content: center; margin-top: 18px; max-width: 760px; margin-left: auto; margin-right: auto; }
.chat-in { display: flex; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 8px; box-shadow: var(--shadow); }
.chat-in textarea { border: 0; box-shadow: none !important; min-height: 44px; max-height: 160px; padding: 10px; }
.typing span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); margin: 0 2px; animation: bob 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 50% { transform: translateY(-4px); } }

/* misc */
.week-nav { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.week-nav b { font-size: 13px; padding: 0 8px; white-space: nowrap; }
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: #f1f4f9; border-radius: var(--r); padding: 10px; min-height: 160px; }
.col h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 2px 4px 10px; display: flex; gap: 6px; }
.col.over { outline: 2px dashed var(--brand); }
.lcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; box-shadow: 0 1px 2px rgba(15,23,42,.04); font-size: 13px; }
.lcard b { display: block; }
.calc-out { background: linear-gradient(135deg, #f5f9ff, #fff7f0); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.calc-out .big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.verdict { display: inline-flex; gap: 6px; align-items: center; font-weight: 800; padding: 6px 12px; border-radius: 10px; }
.tool-frame { width: 100%; height: calc(100vh - 140px); min-height: 560px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.skeleton { background: linear-gradient(90deg, #eef2f7, #f7f9fc, #eef2f7); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
.anim-num { display: inline-block; }
.footer-note { color: var(--faint); font-size: 12px; text-align: center; margin-top: 40px; }
@media print { .side, .top, .mobile-nav { display: none !important; } .shell { display: block; } }
