:root {
  --navy: #163a5f;
  --navy-dark: #102d4a;
  --blue: #1769aa;
  --blue-light: #e8f2fb;
  --green: #24734a;
  --green-light: #e9f5ee;
  --amber: #9a6200;
  --amber-light: #fff3d6;
  --red: #a52a2a;
  --red-light: #fbeaea;
  --ink: #222a31;
  --muted: #5f6b75;
  --border: #d7dde2;
  --background: #f3f5f7;
  --surface: #fff;
  --sidebar: 238px;
  --topbar: 68px;
  --radius: 6px;
  --shadow: 0 2px 8px rgba(21, 39, 54, .1);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--background); font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--blue); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 10px 14px; transform: translateY(-150%); background: #fff; border: 2px solid var(--blue); font-weight: 700; }
.skip-link:focus { transform: none; }
:focus-visible { outline: 3px solid #f0a928; outline-offset: 2px; }

.topbar { position: fixed; z-index: 100; inset: 0 0 auto; height: var(--topbar); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; color: #fff; background: var(--navy); border-bottom: 1px solid var(--navy-dark); }
.portal-brand { display: inline-flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; }
.portal-logo { width: 38px; height: 38px; display: grid; place-items: center; background: #fff; color: var(--navy); border-radius: 3px; font-weight: 800; }
.portal-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.portal-brand strong { font-size: 17px; }
.portal-brand small { margin-top: 2px; color: #cbd8e4; font-size: 11px; }
.user-menu { position: relative; display: flex; align-items: center; gap: 18px; }
.company-name { padding-right: 18px; color: #dce6ef; border-right: 1px solid rgba(255,255,255,.25); font-size: 13px; }
.user-button { min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 4px 6px; color: #fff; background: transparent; border: 0; border-radius: 4px; text-align: left; }
.user-button:hover { background: rgba(255,255,255,.1); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; color: var(--navy); background: #fff; border-radius: 50%; font-size: 12px; font-weight: 700; }
.user-copy { display: flex; flex-direction: column; line-height: 1.2; }
.user-copy strong { font-size: 13px; }
.user-copy small { margin-top: 2px; color: #ccd9e5; font-size: 11px; }
.user-dropdown { position: absolute; z-index: 10; top: 52px; right: 0; width: 280px; padding: 8px; color: var(--ink); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.user-dropdown button, .user-dropdown a { width: 100%; min-height: 40px; display: flex; align-items: center; padding: 8px 10px; color: var(--ink); background: transparent; border: 0; border-radius: 3px; text-align: left; text-decoration: none; }
.user-dropdown button:hover, .user-dropdown a:hover { background: var(--background); }
.user-dropdown hr { margin: 8px 0; border: 0; border-top: 1px solid var(--border); }
.account-switcher { display: grid; gap: 5px; padding: 7px 8px 9px; }
.account-switcher span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.account-switcher select { width: 100%; min-height: 40px; padding: 7px 9px; }

.app-shell { min-height: 100vh; padding-top: var(--topbar); }
.sidebar { position: fixed; z-index: 50; inset: var(--topbar) auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; justify-content: space-between; padding: 20px 12px; background: #fff; border-right: 1px solid var(--border); overflow-y: auto; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a { min-height: 45px; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; padding: 9px 12px; color: #36434d; border-radius: 4px; text-decoration: none; font-weight: 600; }
.sidebar nav a:hover { background: #eef3f7; }
.sidebar nav a[aria-current="page"] { color: #fff; background: var(--navy); }
.sidebar nav a > span:first-child { text-align: center; font-size: 18px; }
.nav-count { min-width: 24px; padding: 1px 7px; color: #fff; background: var(--amber); border-radius: 10px; font-size: 11px; text-align: center; }
.sidebar nav a[aria-current="page"] .nav-count { color: var(--navy); background: #fff; }
.sidebar-help { margin: 24px 4px 4px; padding: 14px; background: var(--background); border: 1px solid var(--border); border-radius: var(--radius); }
.sidebar-help strong { display: block; margin-bottom: 8px; font-size: 13px; }
.sidebar-help a { display: block; margin-top: 6px; font-size: 12px; }

.main-content { margin-left: var(--sidebar); padding: 34px clamp(22px, 3vw, 48px) 60px; }
.page { max-width: 1320px; margin: 0 auto; }
.page-heading { min-height: 82px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 26px; }
.page-heading h1 { margin: 2px 0 5px; color: #1f2b34; font-size: clamp(27px, 3vw, 36px); line-height: 1.15; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow { margin: 0 !important; color: var(--blue) !important; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border: 1px solid transparent; border-radius: 4px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.button-primary { color: #fff; background: var(--blue); border-color: #105b99; }
.button-primary:hover { background: #105b99; }
.button-secondary { color: #26343e; background: #fff; border-color: #aeb7be; }
.button-secondary:hover { background: #f0f3f5; }
.button-danger { color: #8a2020; background: #fff; border-color: #c98989; }
.button-danger:hover { color: #fff; background: #9b2828; }
.text-button { min-height: 40px; display: inline-flex; align-items: center; padding: 7px 4px; color: var(--blue); background: transparent; border: 0; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.icon-button { width: 42px; height: 42px; padding: 0; color: #46545f; background: transparent; border: 1px solid transparent; border-radius: 4px; font-size: 28px; line-height: 1; }
.icon-button:hover { background: var(--background); border-color: var(--border); }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.summary-card { min-height: 94px; display: flex; align-items: center; gap: 15px; padding: 18px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(21,39,54,.05); }
.summary-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; font-size: 21px; font-weight: 700; }
.summary-icon.blue { color: var(--blue); background: var(--blue-light); }
.summary-icon.green { color: var(--green); background: var(--green-light); }
.summary-icon.amber { color: var(--amber); background: var(--amber-light); }
.summary-icon.red { color: var(--red); background: var(--red-light); }
.summary-card div { display: flex; flex-direction: column; }
.summary-card strong { font-size: 25px; line-height: 1; }
.summary-card span:last-child { margin-top: 6px; color: var(--muted); font-size: 13px; }

.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(21,39,54,.05); }
.panel-heading { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.panel-heading.compact { min-height: 68px; }
.panel-heading h2, .help-card h2 { margin: 0; color: #27343d; font-size: 18px; }
.panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.vehicle-list { display: grid; }
.vehicle-row { min-height: 88px; display: grid; grid-template-columns: minmax(210px, 1.25fr) minmax(160px, 1fr) minmax(190px, 1fr) auto; align-items: center; gap: 22px; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.vehicle-row:last-child { border-bottom: 0; }
.vehicle-identity { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 12px; }
.train-symbol { width: 48px; height: 48px; display: grid; place-items: center; color: var(--navy); background: #edf2f6; border: 1px solid #d9e1e7; border-radius: 5px; font-size: 22px; }
.vehicle-identity strong, .vehicle-cell strong { display: block; }
.vehicle-identity span, .vehicle-cell span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.vehicle-actions { display: flex; gap: 8px; }
.small-button { min-height: 38px; padding: 7px 11px; color: var(--blue); background: #fff; border: 1px solid #b9c5ce; border-radius: 4px; font-weight: 700; }
.small-button:hover { background: var(--blue-light); border-color: #9ab6cd; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; }
.window-card { min-height: 138px; display: grid; grid-template-columns: 66px 1fr auto; align-items: center; gap: 16px; padding: 20px; }
.calendar-block { width: 60px; overflow: hidden; text-align: center; border: 1px solid #aeb9c2; border-radius: 4px; }
.calendar-block strong { display: block; padding: 6px 0 3px; font-size: 24px; }
.calendar-block span { display: block; padding: 3px; color: #fff; background: var(--navy); font-size: 10px; font-weight: 800; }
.window-card > div:nth-child(2) { display: flex; flex-direction: column; }
.window-card > div:nth-child(2) span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.activity-list { list-style: none; margin: 0; padding: 8px 20px 15px; }
.activity-list li { position: relative; min-height: 52px; padding: 10px 0 10px 24px; border-bottom: 1px solid #edf0f2; }
.activity-list li:last-child { border-bottom: 0; }
.activity-list li::before { content: ""; position: absolute; left: 1px; top: 18px; width: 8px; height: 8px; background: var(--blue); border-radius: 50%; }
.activity-list strong { display: block; font-size: 13px; }
.activity-list span { color: var(--muted); font-size: 11px; }

.status { display: inline-flex; align-items: center; width: max-content; min-height: 24px; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: currentColor; }
.status-green { color: var(--green); background: var(--green-light); }
.status-blue { color: #17639c; background: var(--blue-light); }
.status-amber { color: var(--amber); background: var(--amber-light); }
.status-red { color: var(--red); background: var(--red-light); }
.status-gray { color: #55636d; background: #edf0f2; }

.table-toolbar { min-height: 68px; display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.search-field { width: min(420px, 60%); display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid #aeb8c0; border-radius: 4px; background: #fff; }
.search-field input { width: 100%; height: 40px; padding: 0; border: 0; outline: 0; }
select, input, textarea { color: var(--ink); background: #fff; border: 1px solid #aeb8c0; border-radius: 4px; }
.table-toolbar select { height: 42px; padding: 0 32px 0 10px; }
.filter-group { display: flex; gap: 10px; }
.user-summary { grid-template-columns: repeat(4, 1fr); }
.user-audit-panel { margin-top: 22px; }
.user-name-cell, .user-cell { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 10px; }
.user-name-cell .avatar, .user-cell .avatar { color: #fff; background: var(--navy); }
.user-name-cell strong, .user-name-cell span, .user-cell strong, .user-cell small { display: block; }
.user-cell small { color: var(--muted); }
.scope-summary { max-width: 210px; color: var(--muted); font-size: 12px; }
.status-invited { color: var(--amber); background: var(--amber-light); }
.status-suspended { color: var(--red); background: var(--red-light); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 11px 16px; color: #53616b; background: #f6f8f9; border-bottom: 1px solid var(--border); font-size: 11px; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
td { padding: 15px 16px; border-bottom: 1px solid #e6eaed; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
.table-vehicle strong { display: block; }
.table-vehicle span, .muted { color: var(--muted); font-size: 12px; }
.empty-state { margin: 0; padding: 44px 20px; color: var(--muted); text-align: center; }
.notice { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; padding: 14px 16px; border: 1px solid; border-radius: var(--radius); }
.notice > span { width: 25px; height: 25px; display: grid; place-items: center; flex: none; border-radius: 50%; font-weight: 800; }
.notice p { margin: 3px 0 0; font-size: 13px; }
.notice-info { color: #194f78; background: #eaf4fb; border-color: #b9d7eb; }
.notice-info > span { color: #fff; background: #286d9f; }
.priority-high { color: var(--red); font-weight: 700; }
.priority-normal { color: #42515c; }
.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.help-card { min-height: 260px; padding: 24px; }
.help-card > span { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 30px; color: #fff; background: var(--navy); border-radius: 50%; font-weight: 800; }
.help-card h2 { font-size: 19px; }
.help-card p { min-height: 88px; color: var(--muted); }

.dialog { width: min(610px, calc(100% - 28px)); max-height: calc(100vh - 28px); padding: 0; color: var(--ink); background: #fff; border: 0; border-radius: 7px; box-shadow: 0 18px 55px rgba(10,29,44,.3); overflow: auto; }
.dialog::backdrop { background: rgba(12, 28, 41, .58); }
.dialog-heading { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 22px; border-bottom: 1px solid var(--border); }
.dialog-heading h2 { margin: 0; font-size: 22px; }
.dialog-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.form-body { display: grid; gap: 17px; padding: 22px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 700; }
.field b { color: var(--red); }
.field input, .field select, .field textarea { width: 100%; min-height: 43px; padding: 9px 10px; }
.field textarea { resize: vertical; }
.field small { color: var(--muted); font-size: 11px; }
.field [aria-invalid="true"] { border: 2px solid var(--red); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.quick-entry { min-width: 0; margin: 0; padding: 14px; background: #f6f8f9; border: 1px solid var(--border); border-radius: 4px; }
.quick-entry legend { padding: 0 5px; font-weight: 700; }
.quick-entry p { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.quick-entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-entry-grid button { min-height: 40px; padding: 8px 10px; color: #24445f; background: #fff; border: 1px solid #aebbc5; border-radius: 4px; font-weight: 700; text-align: left; }
.quick-entry-grid button:hover { background: var(--blue-light); border-color: #85a9c5; }
.quick-entry-grid button[aria-pressed="true"] { color: #fff; background: var(--navy); border-color: var(--navy); }
.permission-box { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: 4px; }
.permission-box legend { padding: 0 5px; font-weight: 700; }
.permission-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.permission-line, .permission-list label, .radio-line, .vehicle-scope-list label { min-height: 42px; display: flex; align-items: flex-start; gap: 9px; padding: 7px 8px; border-radius: 3px; }
.permission-line:hover, .permission-list label:hover, .radio-line:hover, .vehicle-scope-list label:hover { background: #f5f7f8; }
.permission-line input, .permission-list input, .radio-line input, .vehicle-scope-list input { width: 18px; height: 18px; flex: none; margin: 2px 0 0; accent-color: var(--blue); }
.permission-line span, .permission-list span, .radio-line span { display: flex; flex-direction: column; }
.permission-line small, .permission-list small, .radio-line small { margin-top: 2px; color: var(--muted); }
.vehicle-scope-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 8px 0 0 27px; padding: 8px; background: #f6f8f9; border-radius: 3px; }
.account-state { padding-top: 2px; }
.user-dialog { width: min(720px, calc(100% - 28px)); }
.user-dialog-actions { justify-content: space-between; }
.user-dialog-actions > div { display: flex; gap: 10px; }
.coordinate-help { display: block; margin-top: -10px; color: var(--muted); }
.fleet-summary { grid-template-columns: repeat(4, 1fr); }
.fleet-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .65fr); gap: 22px; margin-bottom: 22px; }
.fleet-table-panel { margin-top: 0; }
.coordinate-map { position: relative; min-height: 330px; overflow: hidden; background: #eaf1f5; border-bottom: 1px solid var(--border); }
.coordinate-map.large { min-height: 520px; }
.coordinate-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-country { fill: #f9fbfc; stroke: #8ba3b5; stroke-width: 1.5; }
.map-grid-line { stroke: #cbd8e1; stroke-width: .55; stroke-dasharray: 3 4; }
.svg-map-marker { cursor: pointer; outline: none; }
.svg-map-marker circle { fill: var(--blue); stroke: #fff; stroke-width: 3; filter: drop-shadow(0 1px 3px rgba(0,0,0,.35)); }
.svg-map-marker:hover circle, .svg-map-marker:focus circle, .svg-map-marker.is-selected circle { fill: var(--amber); stroke-width: 5; }
.svg-map-marker.vehicle circle { fill: var(--navy); }
.svg-map-marker.vehicle.attention circle { fill: var(--red); }
.svg-map-marker:focus circle { stroke: #f0a928; stroke-width: 7; }
.map-marker { position: absolute; z-index: 2; width: 15px; height: 15px; padding: 0; transform: translate(-50%, -50%); background: var(--blue); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 5px rgba(0,0,0,.35); }
.map-marker:hover, .map-marker:focus-visible, .map-marker.is-selected { z-index: 3; width: 21px; height: 21px; background: var(--amber); }
.map-marker.vehicle { width: 20px; height: 20px; background: var(--navy); }
.map-marker.vehicle.attention { background: var(--red); }
.map-attribution { margin: 0; padding: 8px 12px; color: var(--muted); background: #f7f9fa; font-size: 10px; }
.attention-list { list-style: none; margin: 0; padding: 8px 18px 18px; }
.attention-list li { padding: 13px 0; border-bottom: 1px solid #e7ebee; }
.attention-list li:last-child { border-bottom: 0; }
.attention-list button { width: 100%; padding: 0; color: inherit; background: transparent; border: 0; text-align: left; }
.attention-list strong, .attention-list span { display: block; }
.attention-list span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.location-layout { display: grid; grid-template-columns: minmax(370px, .82fr) minmax(0, 1.18fr); gap: 22px; }
.location-directory { align-self: start; }
.geocode-search { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 16px; background: #eef5fa; border-bottom: 1px solid var(--border); }
.geocode-search .search-field { width: 100%; }
.geocode-results { padding: 8px 16px; border-bottom: 1px solid var(--border); }
.geocode-result { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 10px 4px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid #dfe6eb; text-align: left; }
.geocode-result:last-child { border-bottom: 0; }
.geocode-result:hover { color: var(--blue); }
.geocode-result span { color: var(--muted); font-size: 11px; }
.interactive-map { width: 100%; min-height: 520px; display: block; border: 0; border-bottom: 1px solid var(--border); background: #eaf1f5; }
.coordinate-actions { display: flex; justify-content: flex-end; margin-top: -8px; }
.location-search-box { display: grid; grid-template-columns: 1fr 150px; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.location-search-box .search-field { width: 100%; }
.location-search-box select { width: 100%; min-height: 42px; padding: 7px 8px; }
.location-api-state { padding: 14px 18px; color: var(--muted); }
.location-results { max-height: 600px; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.location-results li { border-bottom: 1px solid #e6eaed; }
.location-result-button { width: 100%; min-height: 68px; display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 18px; color: var(--ink); background: #fff; border: 0; text-align: left; }
.location-result-button:hover, .location-result-button[aria-current="true"] { background: var(--blue-light); }
.location-result-button strong, .location-result-button span { display: block; }
.location-result-button span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.location-result-button code { align-self: center; color: #50606b; font-size: 11px; }
.load-more { margin: 14px 18px 18px; }
.selected-location { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 16px 18px; border-top: 1px solid var(--border); }
.selected-location strong, .selected-location span { display: block; }
.selected-location span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.selected-location code { align-self: center; padding: 7px 9px; background: #edf1f3; border-radius: 3px; }
.safety-check { display: flex; gap: 11px; padding: 14px; background: var(--amber-light); border: 1px solid #e2bd68; border-radius: 4px; }
.safety-check input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--red); }
.safety-check span { display: flex; flex-direction: column; }
.safety-check small { margin-top: 3px; color: #6b531e; }
.form-error { padding: 10px 12px; color: #7c1f1f; background: var(--red-light); border: 1px solid #e2b1b1; border-radius: 4px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; background: #f6f8f9; border-top: 1px solid var(--border); }
.detail-dialog { width: min(680px, calc(100% - 28px)); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.detail-item { padding: 13px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.detail-item:nth-child(even) { border-right: 0; }
.detail-item span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.detail-item strong { display: block; margin-top: 4px; }
.toast { position: fixed; z-index: 300; right: 24px; bottom: 24px; max-width: 410px; padding: 14px 18px; color: #fff; background: #193d2b; border-radius: 5px; box-shadow: 0 6px 22px rgba(0,0,0,.2); font-weight: 700; }

@media (max-width: 1050px) {
  :root { --sidebar: 196px; }
  .vehicle-row { grid-template-columns: 1.2fr 1fr 1fr; }
  .vehicle-actions { grid-column: 1 / -1; padding-left: 60px; }
  .two-column, .help-grid { grid-template-columns: 1fr; }
  .user-summary, .fleet-summary { grid-template-columns: repeat(2, 1fr); }
  .fleet-layout, .location-layout { grid-template-columns: 1fr; }
  .help-card { min-height: auto; }
  .help-card p { min-height: 0; }
}

@media (max-width: 760px) {
  :root { --topbar: 62px; }
  .topbar { padding: 0 12px; }
  .company-name, .user-copy { display: none; }
  .sidebar { position: fixed; inset: var(--topbar) 0 auto; width: auto; height: 67px; display: block; padding: 5px 6px; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
  .sidebar nav { min-width: max-content; display: flex; gap: 3px; }
  .sidebar nav a { position: relative; width: 92px; min-height: 56px; display: flex; flex: 0 0 92px; justify-content: center; padding: 7px 3px; font-size: 9px; line-height: 1.15; text-align: center; white-space: normal; }
  .sidebar nav a > span:first-child { display: none; }
  .sidebar nav a .nav-count { position: absolute; top: 2px; right: 3px; min-width: 19px; padding: 0 5px; font-size: 9px; }
  .sidebar-help { display: none; }
  .main-content { margin-left: 0; padding: 98px 14px 40px; }
  .page-heading { display: grid; align-items: start; gap: 16px; }
  .page-heading .button { justify-self: start; }
  .summary-grid { grid-template-columns: 1fr; gap: 9px; }
  .summary-card { min-height: 75px; padding: 13px; }
  .vehicle-row { grid-template-columns: 1fr; gap: 13px; }
  .vehicle-actions { grid-column: auto; padding-left: 0; }
  .window-card { grid-template-columns: 60px 1fr; }
  .window-card .status { grid-column: 2; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .table-toolbar select { width: 100%; }
  .filter-group { display: grid; grid-template-columns: 1fr 1fr; }
  .location-search-box { grid-template-columns: 1fr; }
  .geocode-search { grid-template-columns: 1fr; }
  .interactive-map { min-height: 390px; }
  .coordinate-map.large { min-height: 390px; }
  .table-scroll { overflow: visible; }
  .table-scroll table, .table-scroll tbody, .table-scroll tr, .table-scroll td { display: block; width: 100%; }
  .table-scroll thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .table-scroll tbody tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .table-scroll tbody tr:last-child { border-bottom: 0; }
  .table-scroll td { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 6px 0; border: 0; }
  .table-scroll td::before { content: attr(data-label); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
  .table-scroll tbody tr:hover { background: transparent; }
  .form-row, .detail-grid, .quick-entry-grid, .permission-list, .vehicle-scope-list { grid-template-columns: 1fr; }
  .vehicle-scope-list { margin-left: 0; }
  .user-dialog-actions { align-items: stretch; flex-direction: column-reverse; }
  .user-dialog-actions > div { display: grid; grid-template-columns: 1fr; width: 100%; }
  .detail-item { border-right: 0; }
  .dialog-actions { align-items: stretch; flex-direction: column-reverse; }
  .dialog-actions .button { width: 100%; }
  .toast { right: 12px; bottom: 12px; left: 12px; max-width: none; }
}

@media (max-width: 430px) {
  .portal-brand small { display: none; }
  .panel-heading { align-items: flex-start; }
  .vehicle-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .vehicle-actions .small-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
