:root {
  color-scheme: dark;
  --bg: #07111d;
  --surface: #0d1928;
  --surface-2: #111f31;
  --surface-3: #16263a;
  --line: #23344a;
  --line-soft: rgba(145, 164, 188, .14);
  --text: #f1f5fb;
  --muted: #98a8bb;
  --accent: #4f8cff;
  --accent-hover: #6a9dff;
  --ok: #51d49a;
  --warning: #f3c95d;
  --urgent: #ff9a55;
  --critical: #ff6676;
  --overdue: #ff4057;
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 18px 52px rgba(0, 0, 0, .3);
  --sidebar: 258px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 0; min-height: 100%; overflow-x: hidden; background: var(--bg); }
body { min-width: 0; min-height: 100%; margin: 0; overflow-x: hidden; color: var(--text); background: radial-gradient(circle at 80% 0, rgba(79, 140, 255, .1), transparent 30rem), var(--bg); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(79, 140, 255, .55); outline-offset: 2px; }
.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; border-radius: 8px; transform: translateY(-160%); color: white; background: var(--accent); }
.skip-link:focus { transform: none; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; z-index: 20; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 22px 16px; border-right: 1px solid var(--line-soft); background: rgba(7, 15, 26, .96); }
.brand { display: flex; align-items: center; gap: 12px; width: 100%; padding: 5px 7px 23px; border: 0; color: var(--text); text-align: left; background: transparent; }
.brand-mark { display: grid; flex: 0 0 45px; height: 45px; place-items: center; border-radius: 13px; font-weight: 900; letter-spacing: -.03em; background: linear-gradient(145deg, #4382fa, #7059e8); box-shadow: 0 10px 28px rgba(70, 126, 243, .22); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.desktop-nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 45px; padding: 0 12px; border: 1px solid transparent; border-radius: 11px; color: #adbbcc; text-align: left; background: transparent; }
.nav-item > span { width: 20px; color: #7f94ad; text-align: center; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, .035); }
.nav-item.active { border-color: rgba(79, 140, 255, .2); color: #dce8ff; background: rgba(79, 140, 255, .11); }
.nav-item.active > span { color: #82aaff; }
.sidebar-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 12px; color: var(--muted); font-size: 11px; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(81, 212, 154, .1); }

.main { min-width: 0; width: 100%; max-width: 1700px; padding: 30px clamp(20px, 3vw, 48px) 64px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.topbar h1 { margin: 4px 0 0; font-size: clamp(26px, 3vw, 38px); line-height: 1.1; letter-spacing: -.035em; }
.eyebrow { color: #7ea5e9; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.topbar time { color: var(--muted); font-size: 12px; }
.view { display: none; }
.view.active { display: block; }

.primary-btn, .secondary-btn, .ghost-btn, .danger-btn, .danger-outline, .small-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; padding: 0 15px; border: 1px solid transparent; border-radius: 10px; font-weight: 750; }
.primary-btn { color: white; background: var(--accent); box-shadow: 0 8px 22px rgba(79, 140, 255, .18); }
.primary-btn:hover { background: var(--accent-hover); }
.secondary-btn { border-color: var(--line); color: var(--text); background: var(--surface-3); }
.ghost-btn { border-color: var(--line); color: #c0ccda; background: transparent; }
.danger-btn { color: white; background: #cf3044; }
.danger-outline { min-height: 39px; border-color: rgba(255, 76, 97, .32); color: #ff8795; background: rgba(255, 64, 87, .06); }
.small-btn { min-height: 34px; padding-inline: 11px; color: white; background: var(--accent); font-size: 12px; }
.full { width: 100%; }
.link-btn { padding: 0; border: 0; color: #8bb1ff; font-size: 11px; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; }
.danger-text { color: #ff7686; }
.muted { color: var(--muted); }

.system-banner { position: sticky; z-index: 100; top: 0; display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 48px; padding: 7px 16px; border-bottom: 1px solid rgba(79, 140, 255, .35); background: #142b4a; }
.callout { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; margin-bottom: 16px; padding: 17px 18px; border: 1px solid rgba(79, 140, 255, .24); border-radius: var(--radius); background: linear-gradient(100deg, rgba(79, 140, 255, .12), rgba(112, 89, 232, .06)); }
.callout-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: #a9c4ff; background: rgba(79, 140, 255, .15); }
.callout h2 { margin: 0 0 4px; font-size: 15px; }
.callout p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.callout-actions { display: flex; gap: 8px; }

.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { min-width: 0; min-height: 137px; padding: 18px; border: 1px solid var(--line-soft); border-radius: var(--radius); color: var(--text); text-align: left; background: linear-gradient(145deg, rgba(17, 31, 49, .96), rgba(12, 24, 39, .96)); box-shadow: 0 12px 32px rgba(0, 0, 0, .13); transition: border-color .15s, transform .15s; }
.stat-card:hover { border-color: #385271; transform: translateY(-1px); }
.stat-card span, .stat-card small { display: block; color: var(--muted); }
.stat-card span { font-size: 11px; font-weight: 750; }
.stat-card strong { display: block; margin: 6px 0 1px; font-size: 34px; line-height: 1; }
.stat-card small { font-size: 11px; }
.stat-card.danger strong { color: #ff7181; }
.stat-card.critical strong { color: var(--urgent); }
.stat-card.warning strong { color: var(--warning); }
.stat-card.success strong { color: var(--ok); }
.dashboard-filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(160px, auto) minmax(160px, auto) auto; gap: 9px; margin-bottom: 16px; padding: 12px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: rgba(13, 25, 40, .78); }
.dashboard-filter-bar select { min-width: 0; min-height: 43px; padding: 0 34px 0 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--text); background: #091522; }
.dashboard-filter-bar select:focus { border-color: rgba(79, 140, 255, .75); box-shadow: 0 0 0 3px rgba(79, 140, 255, .1); }
.dashboard-filter-bar .search-field input { width: 100%; }

.panel { min-width: 0; margin-bottom: 16px; overflow: hidden; border: 1px solid var(--line-soft); border-radius: var(--radius); background: rgba(13, 25, 40, .94); box-shadow: 0 14px 46px rgba(0, 0, 0, .16); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 78px; padding: 18px 21px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2, .settings-card h2 { margin: 4px 0 0; font-size: 18px; }
.upcoming-list { display: grid; }
.upcoming-item { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(250px, 1fr) minmax(250px, 1.1fr) 18px; align-items: center; gap: 20px; min-height: 92px; padding: 14px 21px; border: 0; border-bottom: 1px solid var(--line-soft); color: var(--text); text-align: left; background: transparent; }
.upcoming-item:last-child { border-bottom: 0; }
.upcoming-item:hover { background: rgba(255, 255, 255, .025); }
.upcoming-vehicle, .upcoming-next { display: grid; justify-items: start; gap: 5px; }
.upcoming-next { padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; background: rgba(79, 140, 255, .045); }
.upcoming-next > small { color: #7ea5e9 !important; font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.upcoming-further { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.upcoming-further > span { display: grid; gap: 3px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: rgba(255, 255, 255, .018); }
.upcoming-further small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-further strong { font-size: 11px; }
.upcoming-item small { color: var(--muted); }
.row-arrow { color: #697e97; font-size: 22px; }
.plate { font-weight: 850; letter-spacing: .055em; }

.vehicle-head { align-items: end; }
.vehicle-tools { display: flex; align-items: center; gap: 9px; }
.search-field input, .desktop-filters select, .field input, .field select { min-height: 43px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--text); background: #091522; }
.search-field input { width: min(270px, 30vw); padding: 0 13px; }
.desktop-filters { display: flex; gap: 9px; }
.desktop-filters select { max-width: 175px; padding: 0 30px 0 11px; }
.search-field input:focus, .desktop-filters select:focus, .field input:focus, .field select:focus { border-color: rgba(79, 140, 255, .75); box-shadow: 0 0 0 3px rgba(79, 140, 255, .1); }
.filter-button { display: none; }
.filter-count { display: inline-grid; min-width: 20px; height: 20px; margin-left: 7px; place-items: center; border-radius: 50%; color: white; background: var(--accent); font-size: 10px; }

.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
table { width: 100%; min-width: 1000px; border-collapse: collapse; }
th, td { padding: 15px 16px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
th { color: #8496aa; background: rgba(255, 255, 255, .012); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
td { font-size: 12px; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: rgba(255, 255, 255, .024); }
tbody tr:last-child td { border-bottom: 0; }
.right { text-align: right; }
.table-sub { display: block; margin-top: 5px; color: var(--muted); }
.date-cell { display: grid; justify-items: start; gap: 4px; }
.date-cell > small { color: var(--muted); font-size: 10px; }
.action-button { width: 44px; height: 40px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface-3); font-weight: 900; letter-spacing: .08em; }
.action-button:hover, .action-button[aria-expanded="true"] { border-color: #41628b; background: #1a304b; }
.action-popover { position: fixed; z-index: 1000; display: grid; padding: 7px; border: 1px solid #314762; border-radius: 12px; background: #0d1928; box-shadow: 0 24px 70px rgba(0, 0, 0, .55); }
.action-popover button, .sheet-actions button { min-height: 40px; padding: 8px 11px; border: 0; border-radius: 8px; color: #e5edf8; text-align: left; background: transparent; }
.action-popover button:hover, .sheet-actions button:hover { background: rgba(79, 140, 255, .12); }
.action-popover hr, .sheet-actions hr { width: 100%; margin: 5px 0; border: 0; border-top: 1px solid var(--line); }
.action-popover .danger-action, .sheet-actions .danger-action { color: #ff8593; }
.vehicle-card-list { display: none; }

.status-badge { display: inline-flex; align-items: center; gap: 5px; width: max-content; max-width: 100%; padding: 4px 8px; border: 1px solid transparent; border-radius: 999px; font-size: 10px; font-weight: 800; line-height: 1.25; white-space: nowrap; }
.status-badge > span { display: inline-grid; width: 13px; height: 13px; place-items: center; border-radius: 50%; font-size: 8px; }
.status-badge.ok { border-color: rgba(81, 212, 154, .22); color: #75e0b2; background: rgba(81, 212, 154, .09); }
.status-badge.warning { border-color: rgba(243, 201, 93, .24); color: #f8d779; background: rgba(243, 201, 93, .09); }
.status-badge.urgent { border-color: rgba(255, 154, 85, .25); color: #ffb078; background: rgba(255, 154, 85, .1); }
.status-badge.critical { border-color: rgba(255, 102, 118, .28); color: #ff8995; background: rgba(255, 102, 118, .11); }
.status-badge.due, .status-badge.overdue { border-color: rgba(255, 64, 87, .34); color: #ff7586; background: rgba(133, 12, 29, .24); }
.status-badge.none { border-color: var(--line-soft); color: var(--muted); background: rgba(255, 255, 255, .03); }
.next-appointment { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--ok); border-radius: 9px; background: rgba(255, 255, 255, .025); }
.next-appointment > span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.next-appointment small { color: #b3c0cf; }
.next-appointment.warning { border-left-color: var(--warning); }
.next-appointment.urgent { border-left-color: var(--urgent); }
.next-appointment.critical, .next-appointment.due { border-left-color: var(--critical); }
.next-appointment.overdue { border-left-color: var(--overdue); background: rgba(120, 15, 29, .1); }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-card { padding: 22px; }
.settings-card p { line-height: 1.65; }
.status-row { display: flex; align-items: center; gap: 10px; margin: 20px 0 8px; }
.status-dot { width: 11px; height: 11px; border-radius: 50%; background: #8493a6; box-shadow: 0 0 0 5px rgba(132, 147, 166, .09); }
.status-dot.active { background: var(--ok); box-shadow: 0 0 0 5px rgba(81, 212, 154, .1); }
.status-dot.blocked { background: var(--critical); box-shadow: 0 0 0 5px rgba(255, 102, 118, .1); }
.device-list { display: grid; }
.device-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 15px 20px; border-bottom: 1px solid var(--line-soft); }
.device-item:last-child { border-bottom: 0; }
.device-item span:nth-child(2) { display: grid; gap: 4px; }
.device-item small { color: var(--muted); line-height: 1.45; }
.device-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 10px; color: #9ebcff; background: rgba(79, 140, 255, .11); }
.reminder-options { margin: 18px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.reminder-options legend { padding: 0 7px; color: #c9d4e2; font-size: 11px; font-weight: 750; }
.reminder-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.reminder-grid label { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 9px; color: #c9d4e2; background: rgba(255, 255, 255, .018); font-size: 12px; }
.reminder-grid input, .toggle-option input { width: 18px; height: 18px; accent-color: var(--accent); }
.toggle-option { display: flex; align-items: flex-start; gap: 11px; margin-top: 13px; padding: 13px; border: 1px solid var(--line-soft); border-radius: 10px; }
.toggle-option > span { display: grid; gap: 4px; }
.toggle-option small { color: var(--muted); line-height: 1.4; }

.timeline { display: grid; padding: 20px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding-bottom: 24px; }
.timeline-item:not(:last-child)::before { position: absolute; top: 15px; bottom: 0; left: 6px; width: 1px; content: ''; background: var(--line); }
.timeline-marker { z-index: 1; width: 13px; height: 13px; margin-top: 3px; border: 3px solid #203959; border-radius: 50%; background: var(--accent); }
.timeline-title { display: flex; flex-wrap: wrap; gap: 10px; }
.timeline-item dl { display: grid; grid-template-columns: repeat(3, minmax(0, 150px)); gap: 10px; margin: 11px 0 8px; }
.timeline-item dl div { display: grid; gap: 2px; }
.timeline-item dt { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.timeline-item dd { margin: 0; font-size: 12px; }
.timeline-item small { color: var(--muted); }
.timeline.compact { padding: 8px 0 0; }
.loading-state { padding: 34px 20px; color: var(--muted); text-align: center; }
.empty-state { display: grid; gap: 6px; padding: 48px 20px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--text); }

.dialog { width: min(720px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); padding: 0; overflow: visible; border: 0; color: var(--text); background: transparent; }
.wide-dialog { width: min(820px, calc(100vw - 28px)); }
.medium-dialog { width: min(650px, calc(100vw - 28px)); }
.small-dialog { width: min(490px, calc(100vw - 28px)); }
.dialog::backdrop { background: rgba(1, 7, 14, .78); backdrop-filter: blur(5px); }
.dialog-card { max-height: calc(100dvh - 28px); padding: 22px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #0d1928; box-shadow: 0 30px 100px rgba(0, 0, 0, .55); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.dialog-head h2 { margin: 4px 0 0; font-size: 21px; }
.icon-btn { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: #b9c7d7; background: var(--surface-3); font-size: 21px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span { color: #c9d4e2; font-size: 11px; font-weight: 750; }
.field input, .field select { width: 100%; min-width: 0; padding: 0 11px; }
.field input[readonly] { border-style: dashed; color: #b7c5d7; background: rgba(255, 255, 255, .025); }
.field.manual-field input { border-style: solid; border-color: rgba(243, 201, 93, .42); }
.field small, .manual-control small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.inspection-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--line-soft); border-radius: 12px; }
.inspection-form legend { padding: 0 7px; color: #9eb5d1; font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.manual-control { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px 14px; padding-top: 1px; }
.manual-control label { font-size: 11px; }
.manual-control small { grid-column: 1 / -1; }
.manual-control:not(.is-manual) .link-btn { visibility: hidden; }
.manual-control.is-manual label { color: var(--warning); font-weight: 700; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.form-message { margin-top: 14px; padding: 11px 12px; border-radius: 9px; font-size: 12px; }
.form-message.error { border: 1px solid rgba(255, 102, 118, .25); color: #ff9aa4; background: rgba(255, 64, 87, .08); }
.detail-next { margin-bottom: 18px; }
.detail-next .next-appointment { padding: 16px; }
.detail-section { padding: 18px 0; border-top: 1px solid var(--line-soft); }
.detail-section h3 { margin: 0 0 13px; color: #b8c7da; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.detail-inspections { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.detail-inspections > div { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(255, 255, 255, .02); }
.detail-inspections > div > span:first-child, .detail-inspections small { color: var(--muted); font-size: 10px; }
.dialog-timeline { max-height: 55vh; overflow-y: auto; padding: 0; }
.ios-steps { display: grid; gap: 13px; padding-left: 24px; color: #c4d0df; line-height: 1.5; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet-head strong { font-size: 18px; letter-spacing: .04em; }
.sheet-actions { display: grid; margin-bottom: 10px; }
.sheet-actions button { min-height: 47px; font-size: 14px; }

.bottom-nav { display: none; }
.toast-container { position: fixed; z-index: 1300; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { width: min(360px, calc(100vw - 28px)); padding: 13px 15px; border: 1px solid var(--line); border-left: 3px solid var(--ok); border-radius: 10px; color: var(--text); background: #142338; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .18s ease-out; }
.toast.error { border-left-color: var(--critical); }
.toast.info { border-left-color: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .desktop-filters { display: grid; }
  .search-field input { width: 230px; }
}

@media (max-width: 900px) {
  :root { --sidebar: 78px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand > span:last-child, .nav-item:not(.active) { font-size: 0; }
  .nav-item { justify-content: center; padding: 0; font-size: 0; }
  .nav-item > span { width: auto; font-size: 19px; }
  .sidebar-foot span:not(.connection-dot) { display: none; }
  .sidebar-foot { justify-content: center; }
  .vehicle-head { align-items: stretch; flex-direction: column; }
  .vehicle-tools { justify-content: space-between; }
  .search-field { flex: 1; }
  .search-field input { width: 100%; }
  .desktop-filters { display: flex; }
  .dashboard-filter-bar { grid-template-columns: minmax(0, 1fr) minmax(150px, auto); }
}

@media (max-width: 767px) {
  .app-shell { display: block; min-height: 100dvh; }
  .sidebar { display: none; }
  .main { width: 100%; padding: max(20px, env(safe-area-inset-top)) 12px calc(92px + env(safe-area-inset-bottom)); }
  .topbar { margin-bottom: 18px; }
  .topbar h1 { font-size: 27px; }
  .topbar time, .desktop-create { display: none; }
  .callout { grid-template-columns: auto minmax(0, 1fr); padding: 15px; }
  .callout-actions { grid-column: 1 / -1; }
  .callout-actions > * { flex: 1; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat-card { min-height: 115px; padding: 15px; }
  .stat-card strong { font-size: 30px; }
  .dashboard-filter-bar { grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
  .dashboard-filter-bar .dashboard-search { grid-column: 1 / -1; }
  .dashboard-filter-bar .ghost-btn { grid-column: 1 / -1; }
  .panel { border-radius: 13px; }
  .panel-head { min-height: 70px; padding: 16px; }
  .upcoming-item { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 15px 16px; }
  .upcoming-vehicle { grid-column: 1; }
  .upcoming-next { grid-column: 1 / -1; }
  .upcoming-further { grid-column: 1 / -1; width: 100%; }
  .upcoming-item .row-arrow { grid-column: 2; grid-row: 1; }
  .vehicle-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .desktop-filters { display: none; }
  .filter-button { display: inline-flex; }
  .table-wrap { display: none; }
  .vehicle-card-list { display: grid; gap: 12px; padding: 12px; }
  .vehicle-card { min-width: 0; padding: 15px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: rgba(9, 20, 33, .82); }
  .vehicle-card-head { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 0 0 12px; border: 0; color: var(--text); text-align: left; background: transparent; }
  .vehicle-card-head > span:first-child { display: grid; gap: 4px; min-width: 0; }
  .vehicle-card-head small { color: var(--muted); }
  .vehicle-card-head > span:last-child { color: #70849c; font-size: 25px; }
  .vehicle-card > .next-appointment { margin-bottom: 14px; padding: 13px; }
  .mobile-inspections { display: grid; gap: 0; margin-bottom: 14px; }
  .mobile-inspections > div { display: grid; grid-template-columns: minmax(90px, .8fr) minmax(100px, 1fr); align-items: center; gap: 6px 10px; min-width: 0; padding: 11px 2px; border-bottom: 1px solid var(--line-soft); }
  .mobile-inspections > div > span:first-child { color: var(--muted); font-size: 11px; }
  .mobile-inspections .status-badge { grid-column: 2; }
  .touch-button { min-height: 48px; }
  .settings-grid { grid-template-columns: 1fr; gap: 0; }
  .device-item { grid-template-columns: 40px minmax(0, 1fr); padding: 15px; }
  .device-item .danger-outline { grid-column: 1 / -1; width: 100%; }
  .reminder-grid { grid-template-columns: 1fr; }
  .timeline { padding: 16px; }
  .timeline-item dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bottom-nav { position: fixed; z-index: 50; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); min-height: calc(68px + env(safe-area-inset-bottom)); padding: 7px 5px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(8, 19, 32, .97); backdrop-filter: blur(18px); }
  .bottom-nav button { display: grid; align-content: center; justify-items: center; gap: 3px; min-width: 0; min-height: 53px; padding: 0 2px; border: 0; color: #8597aa; background: transparent; font-size: 9px; }
  .bottom-nav button > span { font-size: 18px; }
  .bottom-nav button.active { color: #92b4ff; }
  .bottom-nav .add-button { align-self: center; width: 51px; height: 51px; min-height: 51px; margin: -23px auto 0; border-radius: 16px; color: white; background: var(--accent); box-shadow: 0 10px 26px rgba(79, 140, 255, .32); }
  .bottom-nav .add-button span { font-size: 27px; }
  .dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .dialog-card { max-height: calc(100dvh - 20px); padding: 18px; border-radius: 16px; }
  .bottom-dialog { width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; }
  .bottom-dialog .dialog-card { max-height: 92dvh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-right: 0; border-bottom: 0; border-left: 0; border-radius: 20px 20px 0 0; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: 1; }
  .inspection-form { grid-template-columns: 1fr; padding: 14px; }
  .inspection-form .span-2 { grid-column: 1; }
  .manual-control { grid-template-columns: 1fr; }
  .manual-control small { grid-column: 1; }
  .dialog-actions { position: sticky; bottom: -18px; margin-right: -18px; margin-left: -18px; padding: 14px 18px calc(2px + env(safe-area-inset-bottom)); background: #0d1928; }
  .dialog-actions > * { flex: 1; min-height: 47px; }
  .detail-inspections { grid-template-columns: 1fr; }
  .toast-container { right: 14px; bottom: calc(82px + env(safe-area-inset-bottom)); left: 14px; }
  .toast { width: 100%; }
}

@media (max-width: 359px) {
  .main { padding-inline: 9px; }
  .stats-grid { gap: 7px; }
  .stat-card { min-height: 108px; padding: 12px; }
  .stat-card span, .stat-card small { font-size: 10px; }
  .vehicle-card-list { padding: 9px; }
  .vehicle-card { padding: 13px; }
  .mobile-inspections > div { grid-template-columns: minmax(82px, .75fr) minmax(0, 1fr); }
  .status-badge { white-space: normal; }
  .timeline-item dl { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
