/* Product refinement on the existing native-CSS components.
   Layers: content 0, sticky tabs 2, existing global dialogs above them. */
@font-face { font-family: Onest; src: url('/ui/fonts/Onest-Variable.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
:root {
  --font-ui: Onest, system-ui, -apple-system, sans-serif;
  --bg:#f5f5f2; --surface:#fafbf8; --surface-raised:#fff; --surface-subtle:#f3f4f0;
  --text:#272d27; --text-strong:#202720; --muted:#677064; --line:#dfe3da; --line-strong:#bdc7b8;
  --accent:#285a46; --accent-strong:#214b3b; --accent-soft:#edf3ee;
  --sidebar:#1e2923; --sidebar-hover:#29372d; --sidebar-active:#344d3d;
}
body { font-family:var(--font-ui); font-size:14px; letter-spacing:0; }
button,.button-link { font-weight:550; }
input,select,textarea { font-size:14px; }
input::placeholder,textarea::placeholder { color:#6e786b; }
.page-title { font-size:28px; font-weight:600; letter-spacing:-.035em; }
.page-subtitle { font-size:13px; line-height:1.5; }
.surface h2,.surface h3,.surface-title h2,.surface-title h3,.item-title,.trip-name,.driver-table-row b,.driver-table-row strong { font-weight:550; }
.surface-subtitle,.item-meta { font-size:12px; line-height:1.5; color:var(--muted); }
.item-title { font-size:14px; line-height:1.4; }
.pill,.status { font-weight:550; border-radius:5px; }
.status:before { width:5px; height:5px; }
.surface { border-color:var(--line); }
.btn-primary,.btn-primary:hover,#loginBtn,#createTripBtn { background:var(--accent); border-color:var(--accent); color:#fff; }
#brand { background:var(--sidebar); }
#brand .brand-mark { background:#e7eae2; color:var(--sidebar); }
#nav .tab { font-size:14px; }
#nav .tab.active { background:var(--sidebar-active); }
#nav .nav-section { font-size:10px; color:#acb9ac; font-weight:500; letter-spacing:.07em; }
#who { font-size:12px; font-weight:450; }
.topbar { background:var(--surface-raised); }
.login { background:var(--bg); background-image:none; }
.login:before,.login:after { display:none; }
.login-card { box-shadow:0 12px 40px #2636240c; border:1px solid var(--line); }
.login-logo { background:var(--sidebar); }
.login-brand h1 { font-size:22px; font-weight:600; }
.login-brand p { color:var(--muted); }
.operations-dashboard { grid-template-columns:minmax(0,1.5fr) minmax(290px,.8fr); gap:20px; align-items:start; }
.attention-command,.fleet-command { min-height:0; }
.operations-dashboard>.surface { padding:22px; }
.attention-count { min-width:52px; min-height:44px; background:var(--surface-subtle); border:0; color:var(--text); }
.attention-count b { font-size:24px; font-weight:500; }
.attention-count span { font-size:11px; color:var(--muted); font-weight:400; text-transform:none; }
.attention-list .ops-action { display:grid; grid-template-columns:minmax(0,1fr) minmax(125px,.65fr) 16px; gap:16px; padding:15px 0; text-align:left; border:0; border-bottom:1px solid var(--line); border-radius:0; background:transparent; min-height:76px; }
.ops-action .item-title,.ops-action .item-meta { display:block; }
.ops-action .item-meta { margin-top:4px; }
.ops-action>svg { width:16px; color:var(--muted); }
.ops-reason { font-size:12px; line-height:1.45; color:var(--warn); font-weight:450; }
.ops-reason.problem { color:var(--danger); }
.ops-all { justify-content:flex-start; padding:14px 0 0; border:0; color:var(--accent); background:transparent; min-height:40px; font-size:13px; }
.fleet-kpis { background:transparent; border:0; gap:16px; }
.fleet-kpis button { border:0; align-items:flex-start; padding:8px 0; min-height:66px; }
.fleet-kpis b { font-size:28px; font-weight:500; }
.fleet-kpis span,.fleet-secondary span { font-size:12px; font-weight:400; }
.fleet-secondary b { font-weight:550; }
.activity-list { display:block; max-height:340px; }
.activity-list .item,.activity-list .item:nth-child(odd) { border-right:0; border-bottom:1px solid var(--line); padding:14px 0; }
.activity-list .item:last-child { border:0; }
.issues-strip { padding:0 16px; margin-bottom:20px; background:transparent; border:1px solid var(--line); }
.issues-summary { display:flex; align-items:center; gap:10px; min-height:48px; list-style:none; font-size:13px; color:var(--muted); }
.issues-summary::-webkit-details-marker { display:none; }
.issues-summary>span:first-child { color:var(--text); font-weight:550; }
.issues-summary>svg { margin-left:auto; width:16px; }
.issues-list { grid-template-columns:repeat(2,minmax(0,1fr)); padding:0 0 12px; gap:0 20px; }
.issue-item { text-align:left; border:0; border-top:1px solid var(--line); background:transparent; padding:12px 0; min-height:64px; }
.issue-item strong { font-size:13px; font-weight:500; }
.issue-item small { display:block; font-size:12px; color:var(--warn); margin-top:3px; }
.trip-workspace { display:block; }
.trip-master { padding:0; border:0; background:transparent; }
.trip-inspector { display:none; position:static; max-height:none; padding:28px; overflow:visible; margin:0 auto; max-width:1160px; }
.trip-workspace.has-detail .trip-master { display:none; }
.trip-workspace.has-detail .trip-inspector { display:block; }
#panel-trips.detail-open>.page-head,#panel-trips.detail-open .issues-strip,#panel-trips.detail-open .trip-create { display:none; }
.inspector-navigation { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:24px; }
.inspector-navigation button { border:0; background:transparent; padding:0; color:var(--muted); }
#tripInspectorTitle { font-size:26px; font-weight:550; letter-spacing:-.025em; line-height:1.25; margin:0 0 22px; outline:0; overflow-wrap:anywhere; }
.detail-tabs { position:static; margin:0 0 24px; padding:0; display:flex; gap:20px; background:transparent; }
.detail-tabs button { flex:none; min-width:0; padding:12px 0; font-size:14px; font-weight:500; }
.detail-tabs button.active { color:var(--accent); }
.trip-list-head { margin-bottom:16px; }
.trip-list-head h2 { font-size:17px; font-weight:550; }
.list-count { margin-left:8px; color:var(--muted); font-size:14px; font-weight:400; }
.dispatcher-toolbar { background:transparent; padding:0; margin-bottom:20px; grid-template-columns:minmax(200px,1fr) minmax(140px,.55fr) minmax(150px,.55fr) 40px; gap:12px; }
.dispatcher-toolbar input,.dispatcher-toolbar select { min-height:42px; background:var(--surface-raised); }
.field>span { color:var(--muted); font-size:12px; font-weight:500; }
.trip-table-wrap { overflow-x:auto; background:var(--surface-raised); border:1px solid var(--line); border-radius:7px; }
.trip-table { width:100%; table-layout:fixed; border-collapse:collapse; }
.trip-table thead { background:var(--surface-subtle); }
.trip-table th { font-size:12px; font-weight:500; color:var(--muted); padding:13px 16px; text-align:left; border-bottom:1px solid var(--line); }
.trip-table td { padding:17px 16px; vertical-align:middle; font-size:13px; border-bottom:1px solid var(--line); line-height:1.4; overflow-wrap:anywhere; }
.trip-table tbody tr { cursor:pointer; }
.trip-table tbody tr:hover { background:#f5f8f3; }
.trip-table tbody tr:last-child td { border-bottom:0; }
.trip-table th:first-child { width:29%; }
.trip-table th:nth-child(2) { width:16%; }
.trip-table th:nth-child(3) { width:19%; }
.trip-table th:nth-child(4) { width:14%; }
.trip-table th:nth-child(5) { width:17%; }
.trip-table th:last-child { width:56px; }
.trip-table td:last-child { padding-inline:8px; }
.trip-open { display:block; text-align:left; padding:0; border:0; background:transparent; font-size:14px; font-weight:550; min-height:24px; line-height:1.4; color:var(--text); }
.trip-open:hover { background:transparent; color:var(--accent); border:0; }
.trip-sub { font-size:12px; font-weight:400; margin-top:5px; line-height:1.45; }
.trip-alert { color:var(--warn); }
.trip-table .status { font-size:12px; white-space:normal; }
.trip-board { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.trip-card { padding:20px; }
.trip-card-top { gap:12px; }
.trip-card-meta { margin:12px 0 18px; font-size:13px; color:var(--muted); }
.trip-next small { display:block; color:var(--muted); font-size:12px; margin-bottom:4px; }
.trip-next strong { font-weight:500; }
.trip-card-bottom { display:grid; gap:5px; border-top:1px solid var(--line); margin-top:16px; padding-top:12px; font-size:12px; color:var(--muted); }
#tripDetail { border:0; border-radius:0; overflow:visible; }
.trip-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:24px; padding:0 0 24px; border-bottom:1px solid var(--line); }
.trip-summary-grid span { display:block; font-size:12px; color:var(--muted); margin-bottom:6px; }
.trip-summary-grid strong { display:block; font-size:15px; font-weight:500; line-height:1.5; }
.trip-detail-notice { margin:16px 0 0; padding:10px 14px; background:var(--warn-soft); color:var(--warn); border-radius:5px; font-size:13px; }
.trip-primary-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:20px 0 28px; }
.route-stops h3 { font-size:17px; font-weight:550; margin-bottom:8px; }
.route-stop { display:grid; grid-template-columns:30px minmax(0,1fr) auto; gap:14px; padding:18px 0; align-items:center; border-bottom:1px solid var(--line); }
.route-stop-number { display:grid; place-items:center; width:28px; height:28px; border:1px solid var(--line); border-radius:50%; color:var(--muted); font-size:12px; }
.route-stop strong { font-size:14px; font-weight:500; }
.route-stop p { font-size:12px; margin:5px 0 0; color:var(--muted); }
.context-actions { position:relative; border:0; margin:0; background:transparent; }
.context-actions summary { list-style:none; min-width:38px; min-height:38px; display:grid; place-items:center; border:1px solid var(--line); border-radius:5px; font-size:22px; cursor:pointer; }
.context-actions>div { position:absolute; right:0; z-index:2; display:grid; padding:6px; min-width:210px; background:var(--surface-raised); border:1px solid var(--line); box-shadow:0 6px 20px #0001; }
.context-actions button { text-align:left; border:0; }
.compact-form,.trip-access { background:transparent; border:0; border-top:1px solid var(--line); border-radius:0; margin-top:20px; }
.compact-form summary,.danger-zone summary { cursor:pointer; padding:14px 0; font-weight:500; font-size:13px; }
.compact-form .details-body { padding:6px 0 16px; }
.trip-access .details-body { display:grid; gap:18px; }
.danger-zone { display:block; border:0; border-top:1px solid var(--line); background:transparent; border-radius:0; margin-top:24px; padding:0; }
.danger-zone p { margin:0 0 12px; }
.danger-zone button { margin-bottom:12px; }
.cargo-product { border:0; border-bottom:1px solid var(--line); border-radius:0; }
.cargo-product>summary { background:transparent; padding:16px 0; }
.cargo-product-title strong { font-size:15px; font-weight:550; }
.cargo-product-body { padding:0 0 20px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.cargo-json { border:0; padding:0; background:transparent; }
.cargo-json summary { font-size:12px; color:var(--muted); padding:12px 0; }
.cargo-json textarea { font:12px/1.5 var(--font-mono); margin-top:8px; }
.section-title { border-top:0; padding-top:0; }
.shipment-overview { background:var(--surface-subtle); padding:12px; border-radius:6px; gap:16px; }
.shipment-overview>div { border:0; background:transparent; }
.shipment-overview b { font-weight:500; font-size:22px; }
.shipment-empty { padding:36px 20px; border:0; background:var(--surface-subtle); border-radius:6px; font-size:14px; }
.shipment-empty strong { display:block; font-weight:500; }
.shipment-empty p { font-size:13px; max-width:50ch; margin:8px auto 0; color:var(--muted); }
.shipment-saby-settings { padding:10px 14px; border:0; border-top:1px solid var(--line); border-radius:0; font-size:12px; color:var(--muted); }
.shipment-saby-empty { border:0; }
.shipment-card h4 { font-weight:550; }
.empty p { margin:8px 0 16px; font-size:13px; }
.empty strong { font-weight:500; color:var(--text); }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
@media(max-width:1200px) {
  .operations-dashboard { grid-template-columns:1fr; }
  .trip-board { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .trip-table { min-width:900px; }
}
@media(max-width:760px) {
  .panel,.panel:not(#panel-map) { padding:20px 16px 32px; }
  .dispatcher-toolbar { grid-template-columns:1fr 1fr; }
  .dispatcher-toolbar>.field:first-child { grid-column:1/-1; }
  .dispatcher-toolbar>.btn-icon { display:none; }
  .trip-board { grid-template-columns:1fr; }
  .trip-list-head .view-switch { display:none; }
  .trip-inspector { padding:18px; margin:0; }
  .trip-summary-grid { grid-template-columns:1fr 1fr; gap:20px; }
  .detail-tabs { gap:18px; overflow-x:auto; }
  .detail-tabs button { font-size:13px; min-height:44px; }
  .route-stop { grid-template-columns:26px 1fr; }
  .route-stop>.actions { grid-column:2; }
  .issues-list { grid-template-columns:1fr; }
  .attention-list .ops-action { grid-template-columns:1fr 16px; gap:6px 12px; }
  .ops-action .ops-reason { grid-column:1; grid-row:2; }
  .ops-action>svg { grid-column:2; grid-row:1; }
  #tripInspectorTitle { font-size:23px; }
  .operations-dashboard>.surface { padding:18px; }
  .cargo-product-body { grid-template-columns:1fr; }
  .cargo-product-body .span-2 { grid-column:auto; }
}
