/* Foxconn Broker Portal — design tokens */
/* The HTML hidden attribute must always win over display rules (e.g. .cmdk { display: grid }). */
[hidden] { display: none !important; }
:root {
  --ink: #14213D; --ink-2: #263556; --ink-3: #4A5A7C;
  --mist: #EEF1F5; --line: #D8DEE8; --paper: #FFFFFF; --paper-2: #F8F9FC; --hover: #FAFBFD;
  --fox: #E8640F; --fox-2: #FF8A3D; --fox-soft: #FDEBDD;
  --ok: #1D8A5A; --ok-soft: #DCF3E8; --warn: #B7791F; --warn-soft: #FBF0D6;
  --bad: #C8322B; --bad-soft: #FADDDB; --info: #2F6FDB; --info-soft: #E0EAFB;
  --side: #14213D; --side-text: #C7D0E3; --side-muted: #B7C2DA;
  --radius: 10px; --shadow: 0 1px 2px rgba(20,33,61,.06), 0 8px 24px -12px rgba(20,33,61,.18);
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
html[data-theme="dark"] {
  --ink: #E8EEF7; --ink-2: #C9D3E6; --ink-3: #93A1BC;
  --mist: #0F1626; --line: #26324A; --paper: #17203A; --paper-2: #1C2743; --hover: #1F2B4A;
  --fox-soft: #3A2412; --ok-soft: #123A2A; --warn-soft: #3C2F12; --bad-soft: #3D1A18; --info-soft: #16294D;
  --side: #0B1120; --side-text: #B7C2DA; --side-muted: #8593B0;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--mist); line-height: 1.5; font-variant-numeric: tabular-nums; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; font-weight: 800; } h2 { font-size: 1.15rem; font-weight: 700; } h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
.muted { color: var(--ink-3); } .small { font-size: .85rem; } .mono { font-variant-numeric: tabular-nums; }
.mt { margin-top: 1.25rem; } .mb { margin-bottom: 1.25rem; } .center { text-align: center; }
.flex { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; } .spread { justify-content: space-between; }
:focus-visible { outline: 3px solid rgba(232,100,15,.45); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.15rem; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; white-space: nowrap; transition: background .15s, transform .08s; text-decoration: none !important; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--fox); color: #fff; box-shadow: 0 6px 16px -6px rgba(232,100,15,.6); } .btn-primary:hover { background: #D45908; }
.btn-dark { background: var(--side); color: #fff; } .btn-dark:hover { opacity: .9; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); } .btn-ghost:hover { background: var(--paper); border-color: var(--ink-3); }
.btn-ok { background: var(--ok); color: #fff; } .btn-ok:hover { background: #167349; }
.btn-danger { background: var(--bad); color: #fff; } .btn-danger:hover { background: #A82822; }
.btn-sm { padding: .45rem .8rem; font-size: .85rem; } .btn-block { width: 100%; } .btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-link { background: none; border: 0; color: var(--info); font: inherit; cursor: pointer; padding: 0; font-weight: 600; }

/* Forms */
.field { margin-bottom: 1.1rem; } .field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .35rem; }
.field .hint { font-size: .8rem; color: var(--ink-3); margin-top: .3rem; } .field .err { font-size: .82rem; color: var(--bad); margin-top: .3rem; font-weight: 600; }
.input, select.input, textarea.input { width: 100%; padding: .72rem .9rem; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; font-size: .95rem;
  background: var(--paper); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: 0; border-color: var(--fox); box-shadow: 0 0 0 4px rgba(232,100,15,.15); } .input.is-invalid { border-color: var(--bad); }
textarea.input { min-height: 96px; resize: vertical; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234A5A7C' stroke-width='1.8' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .9rem center; padding-right: 2.2rem; }
.input-sm { padding: .5rem .7rem; font-size: .88rem; }
.row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.row-2 { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; } .row-3 { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 560px) { .row-2, .row-3 { grid-template-columns: 1fr; } }
.pw-wrap { position: relative; } .pw-wrap .input { padding-right: 3.2rem; }
.pw-toggle { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; color: var(--ink-3); font-size: .8rem; font-weight: 700; padding: .3rem .5rem; border-radius: 6px; }
.strength { height: 4px; border-radius: 4px; background: var(--line); margin-top: .45rem; overflow: hidden; } .strength > i { display: block; height: 100%; width: 0; background: var(--bad); transition: width .25s, background .25s; }
.check { display: flex; align-items: flex-start; gap: .55rem; font-size: .9rem; cursor: pointer; } .check input { width: 17px; height: 17px; accent-color: var(--fox); flex: none; margin-top: .15rem; }
.captcha { display: flex; gap: .8rem; align-items: center; } .captcha .img { border: 1.5px solid var(--line); border-radius: 8px; overflow: hidden; line-height: 0; background: #F3F5F9; }
.drop { position: relative; border: 1.5px dashed var(--ink-3); border-radius: var(--radius); padding: 1.1rem 1.1rem 1.1rem 4.2rem; background: var(--paper); min-height: 84px; display: flex; flex-direction: column; justify-content: center; transition: border-color .15s, background .15s; }
.drop::before { content: ""; position: absolute; left: 1.1rem; top: 50%; width: 40px; height: 40px; transform: translateY(-50%); border-radius: 10px; background: var(--fox-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23E8640F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4m0 0L7 9m5-5 5 5'/%3E%3Cpath d='M4 16v3a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-3'/%3E%3C/svg%3E") center/20px no-repeat; }
.drop.has-file { border-style: solid; border-color: var(--ok); } .drop.has-file::before { background-color: var(--ok-soft); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%231D8A5A' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E"); }
.drop.dragover { border-color: var(--fox); background: var(--fox-soft); } .drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop .drop-title { font-weight: 700; font-size: .95rem; } .drop .drop-sub { font-size: .82rem; color: var(--ink-3); } .drop .drop-file { font-size: .85rem; font-weight: 700; color: var(--ok); display: none; }
.drop.has-file .drop-file { display: block; } .drop.has-file .drop-sub { display: none; }

/* Toasts, notices, badges */
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; display: flex; flex-direction: column; gap: .5rem; max-width: 380px; }
.toast { background: var(--side); color: #fff; padding: .8rem 1rem; border-radius: 10px; box-shadow: var(--shadow); font-size: .92rem; display: flex; gap: .7rem; align-items: flex-start; animation: toast-in .25s ease-out; border-left: 4px solid var(--fox); }
.toast.success { border-left-color: #3ED598; } .toast.error { border-left-color: #FF6B63; } .toast.info { border-left-color: #7FB2FF; }
.toast a { color: #FFB27A; } .toast button { margin-left: auto; background: none; border: 0; color: #fff; opacity: .7; cursor: pointer; font-size: 1rem; line-height: 1; }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.notice { padding: .9rem 1rem; border-radius: var(--radius); border: 1px solid; font-size: .93rem; margin-bottom: 1rem; }
.notice.warn { background: var(--warn-soft); border-color: var(--warn); color: var(--ink); } .notice.bad { background: var(--bad-soft); border-color: var(--bad); color: var(--ink); }
.notice.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ink); } .notice.info { background: var(--info-soft); border-color: var(--info); color: var(--ink); }
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 800; white-space: nowrap; text-transform: capitalize; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.pending, .badge.submitted, .badge.in_transit, .badge.requested, .badge.countered, .badge.loaded, .badge.at_pickup, .badge.at_delivery, .badge.replace { background: var(--warn-soft); color: var(--warn); }
.badge.approved, .badge.paid, .badge.available, .badge.delivered, .badge.accepted { background: var(--ok-soft); color: var(--ok); }
.badge.rejected, .badge.cancelled, .badge.declined, .badge.expired { background: var(--bad-soft); color: var(--bad); }
.badge.booked, .badge.dispatched, .badge.awaiting_signature { background: var(--info-soft); color: var(--info); }
.badge.unverified, .badge.documents, .badge.withdrawn { background: var(--line); color: var(--ink-3); }

/* Auth layout */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-brand { background: #14213D; color: #fff; position: relative; overflow: hidden; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-brand .logo, .auth-brand .tagline, .auth-brand .facts { position: relative; z-index: 2; }
.auth-brand .tagline { max-width: 30rem; } .auth-brand .tagline h2 { font-size: clamp(1.7rem, 3vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 1rem; }
.auth-brand .tagline p { color: #B7C2DA; font-size: 1.05rem; } .auth-brand .facts { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.auth-brand .facts strong { display: block; font-size: 1.5rem; font-weight: 800; } .auth-brand .facts span { color: #B7C2DA; font-size: .85rem; }
.lanes { position: absolute; inset: 0; z-index: 1; } .lanes path { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 1.5; }
.lanes .route { stroke: var(--fox-2); stroke-width: 2.2; stroke-dasharray: 8 8; animation: dash 30s linear infinite; } .lanes circle { fill: var(--fox-2); } .lanes .hub { fill: #fff; }
@keyframes dash { to { stroke-dashoffset: -400; } }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 3rem 1.5rem; }
.auth-card { width: 100%; max-width: 440px; } .auth-card.wide { max-width: 600px; } .auth-card.xwide { max-width: 820px; }
.auth-card h1 { font-size: 1.85rem; margin-bottom: .35rem; } .auth-card > p.lead { color: var(--ink-3); margin-bottom: 1.8rem; }
.auth-foot { margin-top: 1.5rem; font-size: .92rem; color: var(--ink-3); text-align: center; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-brand { padding: 2rem 1.5rem; min-height: 180px; } .auth-brand .facts, .auth-brand .tagline p { display: none; } .auth-brand .tagline h2 { font-size: 1.4rem; margin: 1rem 0 0; } }
.logo { display: inline-flex; flex-direction: column; align-items: flex-start; gap: .35rem; color: inherit; text-decoration: none !important; line-height: 1; }
.logo-img { display: block; height: 20px; width: auto; max-width: 100%; }
.auth-brand .logo-img { height: 26px; }
.logo-sub { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .72; }
.logo-on-dark { display: none; }
html[data-theme="dark"] .logo-on-light { display: none; } html[data-theme="dark"] .logo-on-dark { display: block; }
.logo-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--fox); display: grid; place-items: center; flex: none; } .logo-mark svg { width: 20px; height: 20px; }
.logo small { display: block; font-size: .7rem; font-weight: 600; opacity: .7; letter-spacing: .04em; }
.code-input { font-size: 2rem; letter-spacing: .6em; text-align: center; padding: .8rem 0 .8rem .6em; font-weight: 800; }

/* App shell */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--side); color: #fff; padding: 1.4rem 1rem; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { padding: 0 .5rem .5rem; } .side nav { margin-top: 1.2rem; display: flex; flex-direction: column; gap: .15rem; }
.side nav a { display: flex; align-items: center; gap: .7rem; padding: .62rem .8rem; border-radius: 8px; color: var(--side-text); font-weight: 600; font-size: .95rem; position: relative; }
.side nav a svg { width: 18px; height: 18px; flex: none; opacity: .8; } .side nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.side nav a.active { background: rgba(255,255,255,.1); color: #fff; } .side nav a.active::before { content: ""; position: absolute; left: -1rem; top: 25%; height: 50%; width: 4px; background: var(--fox); border-radius: 0 4px 4px 0; }
.side nav a b { margin-left: auto; background: var(--fox); color: #fff; font-size: .7rem; padding: .1rem .45rem; border-radius: 999px; }
.side .prefs { display: flex; gap: .4rem; margin-top: auto; padding: .6rem .3rem; }
.side .prefs button, .side .prefs select { background: rgba(255,255,255,.08); border: 0; color: #fff; border-radius: 8px; padding: .45rem .6rem; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.side .who { padding: .9rem .8rem; background: rgba(255,255,255,.06); border-radius: 10px; font-size: .85rem; }
.side .who strong { display: block; font-size: .92rem; } .side .who span { color: var(--side-muted); } .side .who a { color: var(--fox-2); font-weight: 700; }
.side .side-legal { padding: .55rem .8rem 0; font-size: .74rem; color: var(--side-muted); } .side .side-legal a { color: var(--side-muted); } .side .side-legal a:hover { color: #fff; }
.legal-links { margin-top: .4rem; } .terms-box ul { padding-left: 1.2rem; } .terms-box li { margin: .25rem 0; }
.main { min-width: 0; } .topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.3rem 2rem .5rem; }
.topbar .crumb { color: var(--ink-3); font-size: .85rem; margin-bottom: .2rem; } .content { padding: 1rem 2rem 3rem; } .menu-btn { display: none; }
@media (max-width: 960px) { .shell { grid-template-columns: 1fr; } .side { position: fixed; z-index: 100; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vw rgba(0,0,0,.35); } .menu-btn { display: inline-flex; } .topbar, .content { padding-left: 1rem; padding-right: 1rem; } }

/* Bell */
.bell { position: relative; } .bell > button { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.bell > button svg { width: 20px; height: 20px; } .bell .dot { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--fox); color: #fff; font-size: .7rem; font-weight: 800; display: grid; place-items: center; }
.bell .drop-panel { display: none; position: absolute; right: 0; top: 48px; width: 360px; max-width: 92vw; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 90; overflow: hidden; }
.bell.open .drop-panel { display: block; } .bell .drop-panel .item { padding: .7rem .9rem; border-bottom: 1px solid var(--line); font-size: .88rem; display: block; color: var(--ink); }
.bell .drop-panel .item:hover { background: var(--hover); text-decoration: none; } .bell .drop-panel .item span { display: block; color: var(--ink-3); font-size: .78rem; }
.bell .drop-panel .foot { padding: .6rem .9rem; text-align: center; font-size: .85rem; }

/* Panels, stats, tables */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; } .panel-body { padding: 1.25rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.stat .v { font-size: 1.9rem; font-weight: 800; line-height: 1.1; } .stat .l { color: var(--ink-3); font-size: .85rem; font-weight: 600; margin-top: .3rem; }
.stat.accent { background: var(--side); color: #fff; border-color: var(--side); } .stat.accent .l { color: var(--side-muted); }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; align-items: start; } .grid-eq { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 1100px) { .grid-2, .grid-eq { grid-template-columns: 1fr; } }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-3); } .empty strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: .3rem; }
.table-wrap { overflow-x: auto; } table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th { text-align: left; font-size: .78rem; color: var(--ink-3); font-weight: 700; padding: .7rem .8rem; border-bottom: 1px solid var(--line); background: var(--paper-2); white-space: nowrap; }
table.data td { padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; } table.data td .small { white-space: normal; max-width: 220px; }
table.data tr:last-child td { border-bottom: 0; } table.data tbody tr:hover { background: var(--hover); } table.data .num { text-align: right; }
table.data tr.is-new td { background: var(--ok-soft); } table.data tr.held td { opacity: .55; }
.rate { font-weight: 800; font-size: 1.05rem; color: var(--ink); } .rpm { font-size: .78rem; color: var(--ink-3); }
.lane { display: inline-grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem; min-width: 180px; }
.lane .city { font-weight: 700; white-space: nowrap; } .lane .city small { display: block; font-weight: 600; color: var(--ink-3); font-size: .75rem; }
.lane .track { height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 10px); position: relative; min-width: 40px; }
.lane .track::before, .lane .track::after { content: ""; position: absolute; top: 50%; width: 8px; height: 8px; border-radius: 50%; transform: translateY(-50%); }
.lane .track::before { left: -3px; background: var(--ink); } .lane .track::after { right: -3px; background: var(--fox); }
.filters { display: grid; grid-template-columns: 1.6fr repeat(4, minmax(110px, 1fr)) 1.4fr 1fr auto; gap: .6rem; align-items: end; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); background: var(--paper-2); border-radius: var(--radius) var(--radius) 0 0; }
.filters .field { margin: 0; } .filters .field label { font-size: .75rem; color: var(--ink-3); } .filters .input { padding: .55rem .75rem; font-size: .9rem; }
@media (max-width: 1200px) { .filters { grid-template-columns: repeat(3, 1fr); } } @media (max-width: 600px) { .filters { grid-template-columns: 1fr 1fr; } }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; } .tabs a { padding: .5rem .9rem; border-radius: 8px; font-weight: 700; font-size: .9rem; color: var(--ink-3); }
.tabs a:hover { background: var(--paper-2); text-decoration: none; } .tabs a.active { background: var(--side); color: #fff; }
.tabs a b { margin-left: .4rem; background: rgba(255,255,255,.18); padding: .05rem .45rem; border-radius: 999px; font-size: .78rem; } .tabs a:not(.active) b { background: var(--line); color: var(--ink-3); }
.doc-list { display: grid; gap: .75rem; } .doc { display: grid; grid-template-columns: 44px 1fr auto; gap: .9rem; align-items: center; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.doc .ic { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: .72rem; background: var(--mist); color: var(--ink-2); }
.doc .ic.pdf { background: var(--bad-soft); color: var(--bad); } .doc .ic.img { background: var(--info-soft); color: var(--info); } .doc strong { display: block; } .doc span { font-size: .83rem; color: var(--ink-3); }
.doc.replace { border-color: var(--warn); } .doc.accepted { border-color: var(--ok); }
.steps { display: flex; gap: 0; margin-bottom: 1.4rem; padding: 0; } .steps li { list-style: none; flex: 1; position: relative; padding-top: 1.4rem; font-size: .8rem; font-weight: 700; color: var(--ink-3); }
.steps li::before { content: ""; position: absolute; top: .45rem; left: 0; right: 0; height: 4px; background: var(--line); border-radius: 4px; } .steps li.done::before, .steps li.now::before { background: var(--fox); }
.steps li.now { color: var(--ink); } .steps li.done { color: var(--ok); }
.progress { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; } .progress > i { display: block; height: 100%; background: var(--fox); border-radius: 8px; transition: width .4s; }
.modal { position: fixed; inset: 0; z-index: 150; display: none; align-items: center; justify-content: center; padding: 1rem; background: rgba(10,16,30,.6); backdrop-filter: blur(2px); } .modal.open { display: flex; }
.modal-box { background: var(--paper); border-radius: 14px; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); animation: pop .18s ease-out; } .modal-box.lg { max-width: 820px; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; } .modal-body { padding: 1.4rem; }
.modal-foot { padding: 1rem 1.4rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: .6rem; background: var(--paper-2); border-radius: 0 0 14px 14px; }
.x { background: none; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink-3); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1.5rem; } .kv div span { display: block; font-size: .78rem; color: var(--ink-3); font-weight: 700; } .kv div strong { font-size: .98rem; font-weight: 700; }
.kv .full { grid-column: 1 / -1; } @media (max-width: 560px) { .kv { grid-template-columns: 1fr; } }
.activity { list-style: none; margin: 0; padding: 0; } .activity li { padding: .7rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.activity li:last-child { border-bottom: 0; } .activity li span { color: var(--ink-3); font-size: .78rem; white-space: nowrap; }
.hero-status { padding: 2rem; text-align: center; } .hero-status .ring { width: 84px; height: 84px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center; }
.hero-status .ring.pending { background: var(--warn-soft); color: var(--warn); } .hero-status .ring.rejected { background: var(--bad-soft); color: var(--bad); } .hero-status .ring svg { width: 38px; height: 38px; }
.ring.pending svg { animation: spin 6s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.error-page { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 2rem; } .error-page .code { font-size: 5rem; font-weight: 800; color: var(--line); line-height: 1; }

/* Timeline (tracking) */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.4rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1rem .8rem; font-size: .9rem; } .timeline li::before { content: ""; position: absolute; left: -1.95rem; top: .3rem; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); border: 2px solid var(--paper); }
.timeline li.cancelled::before { background: var(--bad); } .timeline li span { display: block; color: var(--ink-3); font-size: .78rem; }
.stage { display: flex; gap: .25rem; margin: .4rem 0 1rem; } .stage i { flex: 1; height: 6px; border-radius: 4px; background: var(--line); } .stage i.on { background: var(--ok); } .stage i.now { background: var(--fox); }
.stops { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; } .stops li { display: grid; grid-template-columns: 78px 1fr; gap: .8rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px; font-size: .9rem; }
.stops li b { color: var(--fox); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; } .stops li span { display: block; color: var(--ink-3); font-size: .8rem; }
.hold-timer { font-weight: 800; color: var(--warn); }
#map { height: 520px; border-radius: 0 0 var(--radius) var(--radius); } .leaflet-popup-content { font-family: var(--font); font-size: .88rem; }
.view-toggle a { padding: .45rem .8rem; border: 1px solid var(--line); font-weight: 700; font-size: .85rem; color: var(--ink); } .view-toggle a:first-child { border-radius: 8px 0 0 8px; } .view-toggle a:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }
.view-toggle a.active { background: var(--side); color: #fff; border-color: var(--side); }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); font-size: .82rem; font-weight: 600; } .chip form { display: inline; } .chip button { background: none; border: 0; color: var(--ink-3); cursor: pointer; padding: 0; font-size: .9rem; }
.sign-box { border: 2px solid var(--fox); border-radius: 12px; padding: 1.2rem; background: var(--fox-soft); }
.terms-box { max-height: 340px; overflow: auto; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-2); font-size: .9rem; } .terms-box h3 { margin: .8rem 0 .3rem; font-size: .95rem; }
.live-banner { display: none; padding: .7rem 1.25rem; background: var(--ok-soft); border-bottom: 1px solid var(--ok); font-weight: 700; font-size: .9rem; } .live-banner.show { display: flex; justify-content: space-between; align-items: center; }
.print-doc { max-width: 820px; margin: 0 auto; } @media print { .side, .topbar, .toasts, .no-print { display: none !important; } .shell { display: block; } .content { padding: 0; } .panel { box-shadow: none; border: 0; } }
.driver { max-width: 520px; margin: 0 auto; padding: 1rem; } .driver .big-btn { font-size: 1.15rem; padding: 1.1rem; }
.logo-preview { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: #fff; }


.suggest { position: relative; }
.suggest-list { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); max-height: 240px; overflow: auto; }
.suggest-list.open { display: block; }
.suggest-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: .45rem .7rem; font: inherit; cursor: pointer; color: var(--ink); }
.suggest-item:hover, .suggest-item.on { background: var(--fox-soft); }
.cmdk { position: fixed; inset: 0; background: rgba(15,22,38,.45); z-index: 80; display: grid; place-items: start center; padding-top: 12vh; }
.cmdk-box { position: relative; width: min(560px, 92vw); background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); }
.cmdk-box .input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; font-size: 1.05rem; }
.cmdk-list { max-height: 360px; overflow: auto; }
.cmdk-item { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; color: var(--ink); text-decoration: none !important; }
.cmdk-item span { color: var(--ink-3); font-size: .82rem; }
.cmdk-item.on, .cmdk-item:hover { background: var(--fox-soft); }
.cmdk-empty { padding: 1rem; color: var(--ink-3); }
.cmdk-foot { display: flex; gap: 1rem; padding: .45rem 1rem; font-size: .75rem; color: var(--ink-3); border-top: 1px solid var(--line); }
.steps { display: flex; gap: .4rem; padding: .6rem 1.1rem 0; }
.step { background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: .25rem .7rem; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; color: var(--ink-3); }
.step.on { background: var(--fox); color: #fff; border-color: var(--fox); }
.item-actions { display: flex; gap: .35rem; margin-top: .4rem; }
.bell .drop-list .item { display: block; }
/* Reports: monthly bar chart */
.bars { display: flex; align-items: flex-end; gap: .5rem; height: 220px; padding-top: 1.2rem; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; position: relative; }
.bars .bar i { display: block; width: 100%; max-width: 46px; min-height: 2px; background: var(--fox, #E8640F); border-radius: 6px 6px 0 0; opacity: .88; }
.bars .bar:hover i { opacity: 1; }
.bars .bar-val { font-size: .7rem; color: var(--muted, #4A5A7C); margin-bottom: .2rem; white-space: nowrap; }
.bars .bar-lab { font-size: .7rem; color: var(--muted, #4A5A7C); margin-top: .35rem; white-space: nowrap; }
@media (max-width: 700px) { .bars .bar-val { display: none; } .bars .bar-lab { writing-mode: vertical-rl; transform: rotate(180deg); } }

.cmdk-x { position: absolute; top: .45rem; right: .5rem; border: 0; background: transparent; font-size: 1.5rem; line-height: 1; color: var(--ink-3); cursor: pointer; padding: .2rem .5rem; border-radius: 8px; }
.cmdk-x:hover { background: var(--fox-soft); color: var(--ink); }
.cmdk-box .input { padding-right: 2.8rem; }
