
:root, html[data-theme="light"], html[data-theme="light"] .app-page {
  color-scheme:light; --brand:#ad2723; --brand-hover:#90211d; --brand-yellow:#d2ab24;
  --app-bg:#f4f5f7; --surface:#fff; --surface-muted:#f6f7f9; --surface-hover:#edf0f3;
  --sidebar:#fff; --text:#262b33; --text-muted:#626b78; --border:#dfe3e8;
  --control-border:#a6aeb9; --link:#a02a24; --focus:#8b6500;
  --positive:#276b46; --warning:#795800; --negative:#a52b25; --info:#32647e;
  --map-bg:#e5e8e2; --danger-bg:#faeeeb; --danger-text:var(--negative);
  --success-bg:#edf5ee; --success-text:var(--positive);
  --red-600:var(--brand); --red-700:var(--brand-hover); --yellow-400:var(--brand-yellow);
  --neutral-950:var(--text); --neutral-700:var(--text-muted); --neutral-500:var(--text-muted);
  --neutral-300:var(--border); --neutral-100:var(--app-bg); --shadow-lg:0 8px 32px #20251e14;
}
html[data-theme="dark"], html[data-theme="dark"] .app-page {
  color-scheme:dark; --app-bg:#191c21; --surface:#23272e; --surface-muted:#2a2f37; --surface-hover:#323943;
  --sidebar:#1f2329; --text:#eceff3; --text-muted:#adb6c3; --border:#3b434e;
  --control-border:#748091; --link:#efa296; --focus:#e8c864;
  --positive:#a0d6b0; --warning:#e5c66f; --negative:#f0aaa0; --info:#a2c8da;
  --map-bg:#293030; --danger-bg:#382a28; --success-bg:#25372b; --shadow-lg:0 8px 32px #0004;
}
html { scroll-padding-top:24px; }
body, button, input, select, textarea { font-family:"Segoe UI",system-ui,-apple-system,BlinkMacSystemFont,sans-serif; }
body { background:var(--app-bg); color:var(--text); font-size:14px; line-height:1.5; }
button, a, input, select, textarea, summary { touch-action:manipulation; }
:focus-visible { outline:2px solid var(--focus); outline-offset:3px; }
::selection { color:var(--text); background:color-mix(in srgb,var(--brand-yellow) 35%,var(--surface)); }
h1 { margin:0; font-size:27px; line-height:1.25; font-weight:600; letter-spacing:-.025em; }
h2 { font-size:17px; font-weight:600; letter-spacing:-.012em; }
h3 { font-size:14px; font-weight:600; letter-spacing:0; }
strong, b { font-weight:600; }
small { font-size:12px; }
a { color:var(--link); text-underline-offset:3px; }
button:disabled { cursor:default; }
[hidden] { display:none !important; }


.app-header { position:fixed; inset:0 auto 0 0; z-index:50; width:214px; min-height:0; padding:25px 16px 18px; display:flex; flex-direction:column; align-items:stretch; gap:0; background:var(--sidebar); border:0; border-right:1px solid var(--border); box-shadow:none; backdrop-filter:none; }
.app-logo { gap:10px; font-size:21px; font-weight:650; letter-spacing:-.05em; padding:0 7px; }
.app-logo > span:last-child span { color:var(--link); }
.brand-logo { display:block; width:39px; height:39px; flex:0 0 39px; border-radius:6px; object-fit:contain; }
.nav-toggle { display:none; }
.main-nav { position:static; display:flex; flex:1; flex-direction:column; align-items:stretch; width:100%; height:auto; margin:30px 0 20px; padding:0; gap:3px; overflow-y:auto; overscroll-behavior:contain; }
.main-nav__link { display:flex; align-items:center; justify-content:flex-start; gap:10px; flex-shrink:0; min-height:42px; padding:10px 11px; border-radius:6px; font-size:13px; font-weight:400; color:var(--text-muted); }
.main-nav__link svg { width:18px; height:18px; flex:0 0 18px; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; }
.main-nav__link:hover { color:var(--text); background:var(--surface-hover); }
.main-nav__link.is-active { color:var(--link); background:color-mix(in srgb,var(--link) 8%,var(--sidebar)); font-weight:600; }
.main-nav__link::after { display:none; }
.nav-divider { border-top:1px solid var(--border); margin:14px 10px 10px; }
.header-actions { display:flex; align-items:center; flex-wrap:wrap; gap:5px; margin-top:auto; padding:15px 4px 0; border-top:1px solid var(--border); }
.sidebar-account { flex-basis:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; margin:0 4px 8px; font-size:12px; color:var(--text-muted); }
.icon-button { display:grid; width:38px; height:38px; min-width:38px; min-height:38px; padding:0; border:0; border-radius:4px; color:var(--text-muted); background:transparent; }
.icon-button:hover { background:var(--surface-hover); color:var(--text); }
.icon-button:focus-visible { outline:2px solid var(--focus); outline-offset:3px; }
.theme-icon, .alert-sound-icon { width:18px; height:18px; }
html .theme-icon--sun { display:none; }
html .theme-icon--moon { display:block; }
html[data-theme="dark"] .theme-icon--sun { display:block; }
html[data-theme="dark"] .theme-icon--moon { display:none; }
.alert-sound-badge { top:-2px; right:-1px; min-width:17px; height:17px; font-size:10px; background:var(--brand); }
.profile-menu { margin-left:auto; padding-left:0; border:0; }
.profile-menu summary { min-width:44px; min-height:44px; padding:5px; gap:5px; border-radius:5px; }
.profile-avatar { width:34px; height:34px; flex:0 0 34px; border:1px solid var(--control-border); color:var(--text-muted); background:var(--surface); }
.profile-avatar svg { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.profile-menu summary:hover, .profile-menu[open] summary { background:var(--surface-hover); }
.profile-menu summary:hover .profile-avatar, .profile-menu[open] .profile-avatar { color:var(--text); }
.profile-copy { display:none; }
.profile-menu summary > svg { width:13px; }
.profile-menu[open] summary > svg { transform:rotate(180deg); }
.profile-dropdown { top:auto; bottom:52px; left:-112px; right:auto; width:248px; max-height:calc(100dvh - 110px); overflow-y:auto; padding:6px; border-radius:6px; background:var(--surface); border:1px solid var(--border); box-shadow:var(--shadow-lg); }
.profile-dropdown a, .profile-dropdown button { min-height:44px; margin:0; padding:10px 12px; border-radius:4px; font-size:13px; font-weight:400; }
.action-dropdown button { min-height:39px; padding:9px 11px; border-radius:3px; font-size:13px; font-weight:400; }
.profile-dropdown .profile-identity { margin:0 4px 5px; padding:11px 8px 13px; gap:4px; }
.profile-identity strong { line-height:1.4; }
.profile-identity span { white-space:nowrap; }
.profile-identity small { color:var(--text-muted); font-size:11px; }
.profile-dropdown form { padding-top:5px; margin-top:5px; border-top:1px solid var(--border); }
.profile-dropdown form button { color:var(--negative); }
.action-dropdown { padding:5px; border-radius:4px; box-shadow:var(--shadow-lg); }


.app-workspace .page-shell { width:calc(100% - 214px); max-width:1600px; margin:0 0 0 214px; padding:35px 34px 55px; }
.page-heading { align-items:center; margin-bottom:28px; gap:20px; }
.page-heading p { margin:5px 0 0; font-size:13px; }
.page-heading .page-date { color:var(--text-muted); font-size:12px; }
.actions, .page-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.card { min-width:0; padding:22px 23px; margin-bottom:22px; border:1px solid var(--border); border-radius:8px; box-shadow:0 2px 3px #17283003; background:var(--surface); }
.section-heading { margin-bottom:17px; gap:14px; }
.section-heading h2, .section-heading h3 { margin:0; }
.section-heading > a:not(.button) { font-size:12px; font-weight:400; text-decoration:none; }
.section-heading > a:not(.button):hover { text-decoration:underline; }
.section-heading p { font-size:12px; }
.section-count { margin-left:7px; font-size:12px; font-weight:400; color:var(--text-muted); vertical-align:middle; letter-spacing:0; font-variant-numeric:tabular-nums; }
.compact-disclosure { margin:12px 0; font-size:12px; color:var(--text-muted); }
.compact-disclosure > summary { padding:7px 0; cursor:pointer; font-weight:400; }
.compact-disclosure > summary:hover { color:var(--text); }
.compact-disclosure p { margin:8px 0; line-height:1.6; }
.date-chip { padding:0; border:0; background:transparent; border-radius:0; font-size:12px; color:var(--text-muted); }
.metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; margin-bottom:24px; border:1px solid var(--border); border-radius:8px; overflow:hidden; background:var(--surface); }
.metric { min-width:0; padding:17px 20px; gap:6px; border:0; border-left:1px solid var(--border); border-radius:0; background:transparent; box-shadow:none; }
.metric:first-child { border-left:0; }
.metric > span { font-size:12px; color:var(--text-muted); }
.metric > strong { font-size:27px; font-weight:600; line-height:1.25; letter-spacing:-.03em; font-variant-numeric:tabular-nums; }
.metric small { font-size:11px; }
.two-columns { gap:24px; }
.dashboard-grid { display:grid; grid-template-columns:minmax(0,1fr) 270px; gap:24px; align-items:start; }
.dashboard-alerts { padding:20px; }
.dashboard-alerts .empty { padding:24px 0; text-align:left; }
.list-preview-footer { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; padding-top:13px; margin-top:14px; border-top:1px solid var(--border); font-size:12px; color:var(--text-muted); }
.list-preview-footer a { text-decoration:none; }
.list-preview-footer a:hover { text-decoration:underline; }
.empty { padding:24px 10px; font-size:13px; font-weight:400; color:var(--text-muted); }
.section-disclosure { padding:0; margin-bottom:22px; border:1px solid var(--border); border-radius:8px; background:var(--surface); }
.section-disclosure > summary { cursor:pointer; padding:17px 21px; font-size:15px; font-weight:600; color:var(--text); }
.section-disclosure > summary h2, .section-disclosure > summary h3 { display:inline; margin:0; font-size:inherit; }
.section-disclosure .disclosure-body { padding:0 21px 20px; }
.record-heading { display:flex; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; gap:16px; margin-bottom:22px; }
.record-heading h2 { margin-bottom:5px; }
.record-meta { display:flex; flex-wrap:wrap; gap:8px 20px; color:var(--text-muted); font-size:13px; }
.field-note { display:block; margin-top:5px; color:var(--text-muted); font-size:12px; font-weight:400; }
.form-section { padding:0 0 20px; margin:0 0 20px; border-bottom:1px solid var(--border); }
.form-section:last-child { border-bottom:0; margin-bottom:0; }


.collection-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.filters { gap:12px; }
.filters.list-toolbar { margin-bottom:22px; }
.filters.card { padding:17px 19px; border-radius:8px; }
.filters label { font-size:12px; font-weight:500; gap:6px; }
.filters.collection-toolbar { justify-content:flex-start; align-items:flex-end; }
.filters.collection-toolbar label { flex:1 1 130px; min-width:130px; }
.filters.collection-toolbar .collection-search { flex:1.7 1 200px; }
.collection-count { margin:0; color:var(--text-muted); font-size:12px; }
table { font-size:13px; }
thead th { padding-top:12px; padding-bottom:12px; color:var(--text-muted); background:var(--surface-muted); font-size:12px; font-weight:600; text-transform:none; letter-spacing:0; }
th, td { padding:13px 12px; border-color:var(--border); }
tbody tr:hover { background:var(--surface-muted); }
td small { display:block; margin-top:4px; font-size:12px; line-height:1.4; }
td strong { font-weight:500; }
td a:not(.button) { font-weight:500; text-decoration:none; }
td a:not(.button):hover { text-decoration:underline; }
.table-customer { display:block; margin-top:4px; font-weight:500; }
.directory-table { min-width:640px; }
.directory-table td { vertical-align:top; }
.directory-table td:first-child { min-width:155px; }
.nowrap { white-space:nowrap; }
.status { display:inline-flex; align-items:center; white-space:nowrap; padding:3px 0; border:0; border-radius:0; font-size:12px; font-weight:400; background:transparent; }
.status--scheduled, .status--assigned, .status--accepted { color:var(--text-muted); background:transparent; }
.status--done { color:var(--positive); background:transparent; }
.status--late { color:var(--negative); background:transparent; }
.status--route, .status--progress { color:var(--info); background:transparent; }
.status[class*="status--"]::before { display:inline-block; width:6px; height:6px; margin-right:6px; border-radius:50%; vertical-align:middle; content:""; background:currentColor; }
.pagination { gap:9px; margin-top:18px; padding-top:15px; border-top:1px solid var(--border); font-size:12px; color:var(--text-muted); }
.pagination-summary { margin-right:auto; }
.pagination .button { min-height:33px; padding:5px 10px; font-size:12px; }
.tabs { gap:20px; margin-bottom:23px; border-bottom:1px solid var(--border); }
.tabs a { padding:10px 1px; min-height:40px; border-bottom-width:2px; font-size:13px; font-weight:400; }
.tabs a.is-active { color:var(--link); font-weight:600; }
.tabs a:hover { color:var(--text); background:transparent; }


.button, .primary-button, .secondary-button { min-height:38px; padding:8px 13px; border-radius:4px; font-size:13px; font-weight:500; line-height:1.5; box-shadow:none; transform:none; transition:background-color .12s,border-color .12s; }
.button { border:1px solid var(--control-border); color:var(--text); background:var(--surface); }
.button:hover { background:var(--surface-hover); border-color:var(--text-muted); }
.button.primary, .primary-button { color:#fff; border:1px solid var(--brand); background:var(--brand); box-shadow:none; }
.button.primary:hover, .primary-button:hover { background:var(--brand-hover); border-color:var(--brand-hover); box-shadow:none; transform:none; }
.button.subtle { border-color:transparent; color:var(--link); background:transparent; }
.button.subtle:hover { background:var(--surface-muted); }
td .button { min-height:36px; padding:7px 10px; font-size:12px; }
.form-field, .field { gap:6px; color:var(--text); font-size:13px; font-weight:500; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { min-height:39px; padding:9px 10px; color:var(--text); border:1px solid var(--control-border); border-radius:4px; background:var(--surface); font-size:13px; box-shadow:none; }
input::placeholder, textarea::placeholder { color:var(--text-muted); opacity:.8; }
input:focus, select:focus, textarea:focus { outline:2px solid var(--focus); outline-offset:1px; box-shadow:none; }
input:disabled, select:disabled, textarea:disabled { color:var(--text-muted); background:var(--surface-muted); }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color:var(--brand); }
.form-grid { gap:18px 20px; }
.check-row { font-size:13px; font-weight:400; }
.detail-grid { gap:18px; }
.detail-grid dt { font-size:12px; }
.detail-grid dd { font-size:14px; font-weight:500; }
dialog { padding:0; max-width:min(700px,calc(100vw - 32px)); border:1px solid var(--border); border-radius:6px; background:var(--surface); color:var(--text); box-shadow:var(--shadow-lg); }
dialog::backdrop { background:#151b1e70; backdrop-filter:none; }
.dialog-heading { padding:18px 22px; border-bottom:1px solid var(--border); }
.dialog-heading h2 { font-size:18px; }
.dialog-body { padding:22px; }
.dialog-actions { padding:16px 22px; border-top:1px solid var(--border); }
.flash-list { margin:0 0 20px; }
.flash { padding:12px 14px; border-radius:4px; font-size:13px; }
.flash--warning, .flash--info { color:var(--warning); background:color-mix(in srgb,var(--warning) 10%,var(--surface)); }
.error-summary { padding:16px; border-radius:4px; font-size:13px; }


.operational-map { height:360px; border-radius:3px; background:var(--map-bg); }
.operational-map--large { height:440px; }
.map-status { font-size:12px; }
.map-status:has([data-map-status]:empty):has([data-map-retry][hidden]) { display:none; }
.map-toolbar { display:flex; align-items:flex-end; gap:18px; margin:0 0 14px; }
.map-track-field { display:grid; gap:5px; flex:1; min-width:0; color:var(--text-muted); font-size:12px; }
.map-track-field select { width:100%; min-width:0; min-height:40px; padding:8px 30px 8px 11px; color:var(--text); font-size:13px; background:var(--surface); }
.map-toggles { display:flex; align-items:center; gap:14px; min-height:40px; }
.map-toggles label { display:flex; align-items:center; gap:5px; white-space:nowrap; color:var(--text-muted); font-size:12px; cursor:pointer; }
.map-toggles input { width:16px; min-height:16px; height:16px; margin:0 2px 0 0; padding:0; accent-color:var(--brand); }
.map-key { width:7px; height:7px; border-radius:50%; display:inline-block; background:#b72429; }
.map-key--place { background:#dfb442; }
.map-caption { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:8px 16px; min-height:20px; margin-top:9px; color:var(--text-muted); font-size:11px; }
.map-path-legend { display:flex; flex-wrap:wrap; gap:12px; }
.map-path-legend[hidden] { display:none; }
.map-path-key { display:flex; align-items:center; gap:5px; }
.map-path-key::before { content:""; width:18px; border-top:2px solid var(--text-muted); }
.map-path-key--planned::before { border-top-style:dashed; }
.map-path-key--approximate::before { border-top-style:dotted; }
body.map-expanded { overflow:hidden; }
.map-card--expanded { position:fixed; inset:0; z-index:2000; display:flex; flex-direction:column; width:100%; height:100dvh; margin:0; padding:20px; border:0; border-radius:0; overflow:hidden; background:var(--surface); }
.map-card--expanded .operational-map { flex:1; min-height:0; height:auto; }
.map-card--expanded .section-heading { margin-bottom:10px; }
.mapboxgl-popup-content { background:var(--surface)!important; color:var(--text)!important; border:1px solid var(--border); border-radius:5px!important; box-shadow:var(--shadow-lg); }
.mapboxgl-popup-close-button { color:var(--text); font-size:22px; }
.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip { border-top-color:var(--surface); }
.mapboxgl-popup-anchor-top .mapboxgl-popup-tip { border-bottom-color:var(--surface); }
@media (max-width:600px) { .map-toolbar { flex-wrap:wrap; gap:6px; }.map-track-field { flex-basis:100%; }.map-toggles { min-height:32px; }.map-card--expanded { padding:12px; } }
.route-cards { gap:18px; }
.route-card h2 { font-size:15px; }
.route-card > p { font-size:13px; color:var(--text-muted); }
.route-card .detail-grid { margin:16px 0; gap:14px; }
.order-list { gap:0; }
.order-card { padding:15px 0; border:0; border-bottom:1px solid var(--border); border-radius:0; background:transparent; }
.order-card:last-child { border-bottom:0; }
.order-card p { font-size:13px; }
.place-list { gap:0 24px; }
.place-list article { padding:12px 0; border-bottom:1px solid var(--border); }
.place-list p { font-size:13px; }
.driver-list { gap:0 24px; }
.driver-list article { padding:13px 0; border:0; border-bottom:1px solid var(--border); border-radius:0; background:transparent; }
.driver-list strong { font-size:13px; font-weight:500; }
.driver-list small { font-size:12px; }
.alert-list { gap:0; }
.alert-card { padding:13px 0; gap:10px; border:0; border-bottom:1px solid var(--border); border-radius:0; background:transparent; }
.alert-card:last-child { border-bottom:0; }
.alert-card strong { font-size:13px; font-weight:500; }
.alert-card p, .alert-card small { font-size:12px; line-height:1.5; }
.alert-symbol { width:21px; height:21px; flex-basis:21px; font-size:12px; border-radius:50%; color:var(--warning); background:color-mix(in srgb,var(--warning) 12%,var(--surface)); }
.route-search-input { flex:1; min-width:0; }
.route-search-input > label { font:inherit; }
.route-search-field { position:relative; }
.route-search-field #order-search { width:100%; padding-right:42px; }
.route-search-field input::-webkit-search-cancel-button { -webkit-appearance:none; appearance:none; }
.route-search-field input::-ms-clear { display:none; }
.route-search-clear { position:absolute; top:50%; right:3px; transform:translateY(-50%); width:32px; height:32px; min-width:32px; min-height:32px; }
.route-search-results { max-height:400px; }
.route-search-result { padding:13px 0; border:0; border-bottom:1px solid var(--border); border-radius:0; background:transparent; }
.route-search-result p, .route-stop-copy p { font-size:12px; }
.route-stop-list > li { padding:13px; border:1px solid var(--border); border-radius:4px; background:var(--surface-muted); }
.route-stop-actions .button { min-width:34px; min-height:34px; }
.route-optional-place summary { font-size:13px; }
.planned-trip-stops { font-size:13px; }
.point-bank { margin:7px 0 0; font-size:13px; }
.point-sync-line { display:flex; flex-wrap:wrap; align-items:center; gap:8px 20px; margin:-8px 0 22px; color:var(--text-muted); font-size:12px; }
.point-sync-line strong { font-weight:500; }
.point-time { font-variant-numeric:tabular-nums; font-weight:600; }
.point-bindings { max-height:430px; }
.point-bindings select { max-width:290px; }
.point-notice { position:fixed; right:22px; bottom:22px; z-index:100; width:min(370px,calc(100vw - 30px)); padding:15px 18px 17px; border:1px solid var(--border); border-top:3px solid var(--brand); border-radius:5px; background:var(--surface); color:var(--text); box-shadow:0 4px 20px #0002; font-size:13px; }
.point-notice-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.point-notice-heading .icon-button { margin:-7px -8px -7px 0; font-size:23px; }
.point-notice ul { margin:11px 0 15px; padding:0; list-style:none; }
.point-notice li { margin:0; padding:8px 0; border-bottom:1px solid var(--border); overflow-wrap:anywhere; }
.point-notice li:last-child { border-bottom:0; }
.point-notice > a { font-weight:600; }
.column-track span, .bar-track > span { background:var(--brand); }
.bar-track { height:8px; background:var(--surface-muted); }
.bar-row > div:first-child { font-size:12px; }
.chart-help { font-size:12px; }
.donut-layout { gap:22px; }
.donut { width:155px; height:155px; }
.donut strong { font-size:19px; }


.login-page { background:var(--app-bg); }
.login-page .login-panel { color:var(--text); color-scheme:inherit; }
.login-page .field { color:var(--text); }
.login-page .field-control input { color:var(--text); }
.login-page .field-control input::placeholder { color:var(--text-muted); }
.login-shell.login-shell--simple { position:relative; display:grid; grid-template-columns:1fr; min-height:100vh; padding:48px 20px; place-items:center; }
.login-shell--simple .login-panel { min-height:0; padding:0; width:min(100%,390px); background:transparent; }
.login-shell--simple .login-card { width:100%; padding:32px; border:1px solid var(--border); border-radius:6px; background:var(--surface); box-shadow:none; }
.login-shell--simple .brand { color:var(--text); font-size:23px; font-weight:650; margin-bottom:32px; }
.login-shell--simple .brand > span:last-child span { color:var(--link); }
.login-shell--simple .brand-logo { width:43px; height:43px; flex-basis:43px; }
.login-heading h1 { font-size:22px; }
.login-form { margin-top:24px; gap:20px; }
.field-control { min-height:42px; padding:0 9px; border:1px solid var(--control-border); border-radius:4px; background:var(--surface); }
.field-control:focus-within { border-color:var(--focus); outline:2px solid var(--focus); outline-offset:1px; box-shadow:none; }
.field-control input:not([type="checkbox"]) { min-height:40px; padding:9px 7px; border:0; background:transparent; outline:none; }
.field-control > svg { width:17px; flex-basis:17px; stroke:var(--text-muted); }
.password-toggle { min-height:32px; min-width:32px; width:32px; height:32px; border-radius:3px; }
.password-toggle svg { stroke:var(--text-muted); }
.password-toggle:focus-visible { outline:2px solid var(--focus); }
.login-form .primary-button { min-height:42px; }
.checkbox { color:var(--text-muted); font-size:13px; }
.login-help { font-size:12px; margin:20px 0 0; color:var(--text-muted); }
.login-theme-toggle { position:absolute; top:20px; right:22px; color:var(--text-muted); }
.placeholder-page { background:var(--app-bg); }
.placeholder-page section { padding:32px; border:1px solid var(--border); border-radius:5px; background:var(--surface); box-shadow:none; }
.error-shell { max-width:640px; margin:8vh auto; padding:24px; }
.error-code { margin:0 0 12px; color:var(--text-muted); font-size:14px; }
.error-shell h1 { font-size:22px; margin-bottom:24px; }

@media (max-width:1200px) {
  .app-header { width:194px; padding-left:12px; padding-right:12px; }
  .app-workspace .page-shell { width:calc(100% - 194px); margin-left:194px; padding:28px 25px 45px; }
  .dashboard-grid { grid-template-columns:1fr; gap:0; }
  .dashboard-alerts .empty { padding:8px 0; }
  .metric { padding:16px 17px; }
  .metric > strong { font-size:26px; }
  .two-columns { grid-template-columns:1fr; gap:0; }
}
@media (max-width:800px) {
  html { scroll-padding-top:78px; }
  .app-header { position:sticky; inset:0 0 auto; width:100%; min-height:62px; padding:0 16px; display:grid; grid-template-columns:1fr auto auto; align-items:center; gap:8px; border-right:0; border-bottom:1px solid var(--border); }
  .app-logo { padding:0; gap:8px; font-size:19px; }
  .brand-logo { width:34px; height:34px; flex-basis:34px; }
  .nav-toggle { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; width:36px; height:38px; padding:7px; border:0; border-radius:4px; color:var(--text); background:transparent; }
  .nav-toggle span { width:18px; height:2px; background:currentColor; }
  .nav-toggle:hover, .nav-toggle[aria-expanded="true"] { background:var(--surface-hover); }
  .main-nav { position:absolute; top:61px; left:0; right:0; display:none; width:100%; height:auto; max-height:calc(100vh - 70px); margin:0; padding:12px 16px; border-bottom:1px solid var(--border); background:var(--sidebar); overflow-y:auto; }
  .main-nav.is-open { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; }
  .main-nav__link { min-height:43px; }
  .nav-divider { display:none; }
  .header-actions { margin:0; padding:0; flex-wrap:nowrap; gap:2px; border:0; }
  .sidebar-account { display:none; }
  .profile-menu { margin:0; }
  .profile-dropdown { top:48px; bottom:auto; left:auto; right:0; }
  .app-workspace .page-shell { width:100%; margin:0; padding:26px 20px 40px; }
  .page-heading { gap:16px; }
  .page-heading .actions { justify-content:flex-end; }
  .operational-map--large { height:360px; }
}
@media (max-width:580px) {
  .app-header { padding:0 12px; gap:4px; }
  .app-logo { font-size:18px; }
  .profile-menu summary > svg { display:none; }
  .app-workspace .page-shell { padding:24px 15px 36px; }
  h1 { font-size:25px; }
  .page-heading { flex-direction:column; align-items:flex-start; margin-bottom:24px; }
  .page-heading .actions { justify-content:flex-start; }
  .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); row-gap:0; margin-bottom:22px; }
  .metric { padding:15px 16px; }
  .metric:nth-child(2n+1) { border-left:0; }
  .metric:nth-child(n+3) { border-top:1px solid var(--border); }
  .metric > strong { font-size:24px; }
  .card { padding:17px; margin-bottom:20px; }
  .section-heading { align-items:center; gap:10px; }
  .section-heading h2 { font-size:16px; }
  .form-grid, .route-cards, .driver-list, .place-list { grid-template-columns:1fr; }
  .form-wide { grid-column:auto; }
  .order-card { grid-template-columns:1fr; }
  .filters.card { padding:15px; }
  .filters label { min-width:130px; }
  .filters .button { min-height:40px; }
  .operational-map, .operational-map--large { height:315px; }
  .tabs { gap:18px; overflow-x:auto; }
  .tabs a { flex-shrink:0; }
  .pagination-summary { flex-basis:100%; }
  .login-shell--simple .login-card { padding:27px; }
  .section-disclosure > summary { padding:16px; }
  .section-disclosure .disclosure-body { padding:0 16px 16px; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation:none !important; transition:none !important; scroll-behavior:auto !important; }
}
@media print {
  :root, html[data-theme="dark"], html[data-theme="dark"] .app-page { --app-bg:#fff; --surface:#fff; --surface-muted:#fff; --text:#111; --text-muted:#444; --border:#ccc; --link:#111; }
  .app-header { display:none !important; }
  .point-notice { display:none !important; }
  .app-workspace .page-shell { width:100%; margin:0; padding:0; }
  .card, .metrics { border-radius:0; }
  .page-actions, .list-preview-footer, .login-theme-toggle { display:none !important; }
}

.live-update-line { display:flex; justify-content:flex-end; margin:0 0 8px; color:var(--text-muted); font-size:12px; }
.live-update-line .has-warning { color:var(--text); }
[data-live-region="routes-alerts"]:empty { display:none; }
@media print { .live-update-line { display:none; } }


.attendance-state { display:inline-flex; align-items:center; gap:6px; max-width:100%; color:var(--text-muted); font-size:12px; font-weight:500; line-height:1.45; }
.attendance-state::before { content:""; flex:0 0 6px; width:6px; height:6px; border-radius:50%; background:currentColor; }
.attendance-state--available, .attendance-state--returned { color:var(--positive); }
.attendance-state--lunch { color:var(--warning); }
.attendance-state--review { color:var(--warning); }
.attendance-stale { display:block; margin-top:3px; color:var(--text-muted); font-size:11px; }
.attendance-table { font-variant-numeric:tabular-nums; }
.attendance-table th:not(:first-child), .attendance-table td:not(:first-child) { white-space:nowrap; }
.attendance-table td:first-child { min-width:170px; }
.attendance-table .attendance-state { white-space:normal; }
.attendance-inline { display:block; margin-top:5px; }
.route-card .attendance-inline { margin:-6px 0 12px; }
.metrics:has(> .metric:nth-child(3):last-child) { grid-template-columns:repeat(3,minmax(0,1fr)); }
.metric.metric--text > strong { font-size:16px; line-height:1.6; letter-spacing:0; }
.table-scroll { scrollbar-width:thin; scrollbar-color:var(--control-border) transparent; }
.table-scroll table { width:100%; }
.table-scroll thead th { position:sticky; top:0; z-index:1; }
.table-scroll tbody tr:last-child > * { border-bottom:0; }
.table-scroll tbody tr { transition:background-color .12s; }
.fleet-vehicle-table { min-width:740px; }
.fleet-vehicle-table td:first-child { min-width:180px; }
.fleet-vehicle-table td:nth-child(2) { min-width:170px; }
.section-count { display:inline-block; padding:2px 7px; border-radius:4px; background:var(--surface-muted); }
fieldset.form-group { min-width:0; width:100%; margin:0 0 24px; padding:0 0 24px; border:0; border-bottom:1px solid var(--border); }
.form-group > legend { width:100%; margin:0 0 17px; padding:0; color:var(--text); font-size:14px; font-weight:600; }
.form-group:last-of-type { padding-bottom:0; border-bottom:0; }
.form-grid > .form-group { grid-column:1 / -1; margin-bottom:0; }
.form-grid > .form-group:last-of-type { margin-bottom:8px; }
.form-actions, .planner-footer { display:flex; flex-wrap:wrap; align-items:center; gap:9px; margin-top:24px; padding-top:18px; border-top:1px solid var(--border); }
.form-field > label > span[aria-hidden] { color:var(--text-muted); }
.form-grid .check-row { align-self:center; }
.form-field input[type="file"] { width:100%; font-size:12px; }
.form-field input[type="file"]::file-selector-button { margin:-3px 9px -3px -4px; padding:5px 9px; border:0; border-radius:3px; background:var(--surface-muted); color:var(--text); font:inherit; cursor:pointer; }
.record-form-card, .account-page { max-width:940px; }
.record-form-card .form-grid, .account-card .form-grid { align-items:start; }
.planning-layout { display:grid; grid-template-columns:minmax(300px,.9fr) minmax(0,1.1fr); align-items:start; gap:22px; }
.planning-form-card, .planning-list-card { margin-bottom:0; }
.planning-form-card .form-field, .planning-form-card .form-field input { min-width:0; }
.planning-list-card .place-list { grid-template-columns:1fr; }
.planning-list-card .place-list article { padding:15px 0; }
.planning-list-card .place-list article:first-child { padding-top:0; }
.planning-list-card .place-list article:last-child { border-bottom:0; padding-bottom:0; }
.planning-list-card .place-list p { margin:5px 0; color:var(--text-muted); }
.fleet-summary-grid { align-items:stretch; }
.fuel-summary { display:flex; flex-direction:column; }
.fuel-summary > .large-value { font-size:28px; font-weight:600; letter-spacing:-.03em; }
.fuel-summary-meta { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 20px; margin:19px 0 0; }
.fuel-summary-meta dt { margin-bottom:4px; font-size:12px; }
.fuel-summary-meta dd { margin:0; font-size:13px; }
.place-preview-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 22px; }
.place-preview-list article { display:flex; flex-direction:column; gap:4px; padding:13px 0; border-bottom:1px solid var(--border); }
.place-preview-list small { color:var(--text-muted); }
.route-card { display:flex; flex-direction:column; margin-bottom:0; }
.route-card > .section-heading { align-items:flex-start; }
.route-card > .section-heading .status { flex-shrink:0; padding-top:0; font-size:11px; }
.route-card-meta { display:flex; flex-direction:column; gap:5px; font-size:12px; color:var(--text-muted); }
.route-vehicle { color:var(--text); }
.route-card .route-stop-place { margin:9px 0 0; font-size:12px; line-height:1.5; }
.route-stop-place > span { color:var(--text-muted); }
.route-card .route-card-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 18px; margin:18px 0; padding-top:16px; border-top:1px solid var(--border); }
.route-card-metrics dt { font-size:11px; }
.route-card-metrics dd { margin-top:3px; font-size:13px; font-variant-numeric:tabular-nums; }
.route-card-footer { display:flex; align-items:center; margin-top:auto; padding-top:15px; border-top:1px solid var(--border); font-size:12px; }
.route-cards { margin-bottom:22px; align-items:stretch; }
.order-customer { min-width:0; max-width:700px; }
.order-customer > p { margin:7px 0 0; color:var(--text-muted); font-size:13px; }
.order-details { margin:0; padding-top:21px; border-top:1px solid var(--border); }
.order-record .record-heading { margin-bottom:21px; }
.route-planner-form .planner-panel-heading { padding-bottom:13px; margin-bottom:18px; border-bottom:1px solid var(--border); }
.route-planner-form .planner-panel-heading .section-count { margin-left:auto; }
.route-planner-form .route-itinerary > .empty { padding:24px 10px; margin:0; }
.route-planner-form .planner-footer { margin-top:17px; }
.route-search-result strong, .route-stop-copy strong { font-weight:500; }
.integration-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; align-items:stretch; margin-bottom:22px; }
.integration-card { display:flex; flex-direction:column; margin-bottom:0; }
.integration-page > .integration-card { margin-bottom:22px; }
.integration-page > .card:not(.integration-card) > .detail-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.integration-card .detail-grid { margin:0 0 22px; }
.card-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding-top:17px; margin-top:auto; border-top:1px solid var(--border); }
.card-actions form { margin:0; }
.binding-row { display:grid; grid-template-columns:minmax(180px,1fr) auto; align-items:center; gap:8px; }
.binding-row select { width:100%; max-width:none; min-width:0; }
.binding-row .button { white-space:nowrap; }
.attendance-table .point-slot { text-align:center; font-variant-numeric:tabular-nums; }
.attendance-table th:nth-child(n+2):nth-child(-n+5) { text-align:center; }
.point-page .point-sync-line { margin:0 0 22px; padding:11px 15px; border:1px solid var(--border); border-radius:6px; background:var(--surface); }
.users-directory .collection-toolbar { padding-bottom:18px; margin-bottom:18px; border-bottom:1px solid var(--border); }
.error-card { margin:0; }
.dashboard-page .dashboard-toolbar .dashboard-filter { flex-direction:column; align-items:stretch; gap:5px; }
.dashboard-field-label { color:var(--text-muted); font-size:11px; }
.dashboard-page .dashboard-toolbar { align-items:flex-end; }
.dashboard-page .dashboard-board:not(:fullscreen) .dashboard-overview { border-radius:8px; }
.dashboard-page .dashboard-board:not(:fullscreen) .technician-card { border-radius:7px; }
.dashboard-page .dashboard-board:fullscreen .dashboard-field-label { display:none; }
@media (min-width:801px) and (max-width:1100px) {
  .planning-layout { grid-template-columns:1fr; }
  .integration-grid { gap:18px; }
}
@media (max-width:800px) {
  .planning-layout, .integration-grid { grid-template-columns:1fr; gap:18px; }
  .planning-form-card, .planning-list-card { margin-bottom:0; }
  .route-card { margin-bottom:0; }
}
@media (max-width:580px) {
  .metrics:has(> .metric:nth-child(3):last-child) { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .metrics:has(> .metric:nth-child(3):last-child) > .metric:last-child { grid-column:1 / -1; }
  .place-preview-list { grid-template-columns:1fr; }
  .form-group > legend { margin-bottom:15px; }
  .binding-row { grid-template-columns:minmax(140px,1fr); }
  .binding-row .button { justify-self:start; }
  .operation-filter-toolbar label { flex-basis:calc(50% - 12px); min-width:0; }
  .operation-filter-toolbar .collection-search { flex-basis:100%; }
  .operation-filter-toolbar input, .operation-filter-toolbar select { width:100%; min-width:0; }
  .point-page .point-sync-line { padding:10px 12px; }
  .integration-page > .card:not(.integration-card) > .detail-grid { grid-template-columns:1fr; }
  .record-form-card, .account-card { padding:18px; }
  .dashboard-page .dashboard-toolbar .dashboard-filter { min-width:0; }
}
@media print {
  .planning-layout, .integration-grid { display:block; }
  .form-actions, .card-actions, .planner-footer { display:none; }
  .card { box-shadow:none; }
  .table-scroll thead th { position:static; }
}
