:root {
  color-scheme: light;
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #f8f7f3;
  --surface-3: #eeede8;
  --ink: #191b1a;
  --muted: #6d716f;
  --line: #deded8;
  --line-strong: #c9cac3;
  --accent: #e86722;
  --accent-dark: #b94a12;
  --accent-soft: #fff0e6;
  --good: #16805d;
  --good-soft: #e8f6f0;
  --warn: #b56c0a;
  --warn-soft: #fff5dc;
  --danger: #b63838;
  --danger-soft: #fcecec;
  --blue: #316da5;
  --shadow: 0 18px 48px rgba(24, 27, 25, 0.08);
  --radius: 18px;
  --sidebar: 248px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111312;
  --surface: #191c1a;
  --surface-2: #202321;
  --surface-3: #292d2a;
  --ink: #f3f2ed;
  --muted: #a5aaa6;
  --line: #303531;
  --line-strong: #444a46;
  --accent: #f17a37;
  --accent-dark: #ff9a61;
  --accent-soft: #3a251a;
  --good: #63c59f;
  --good-soft: #19352a;
  --warn: #edb44d;
  --warn-soft: #382f19;
  --danger: #ee8585;
  --danger-soft: #3a2020;
  --blue: #7eb7e8;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 34%, transparent); outline-offset: 2px; }
.icon { width: 19px; height: 19px; display: inline-block; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.boot { min-height: 100vh; display: grid; place-content: center; grid-template-columns: auto auto; gap: 16px; align-items: center; }
.boot p { margin: 5px 0 0; color: var(--muted); }
.brand-symbol { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; color: #fff; background: var(--accent); font-size: 13px; font-weight: 800; letter-spacing: .06em; }

.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, .9fr) minmax(480px, 1.1fr); }
.auth-brand { padding: clamp(32px, 7vw, 96px); background: #171918; color: #fff; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; width: 480px; height: 480px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); right: -180px; bottom: -210px; box-shadow: 0 0 0 70px rgba(255,255,255,.03), 0 0 0 140px rgba(255,255,255,.02); }
.auth-logo { display: flex; align-items: center; gap: 14px; font-weight: 700; }
.auth-brand h1 { max-width: 560px; font-size: clamp(38px, 5vw, 70px); line-height: .98; letter-spacing: -.055em; margin: auto 0 24px; position: relative; z-index: 1; }
.auth-brand p { max-width: 520px; color: #b8bdb9; font-size: 17px; line-height: 1.6; position: relative; z-index: 1; }
.auth-panel { display: grid; place-items: center; padding: 32px; }
.auth-card { width: min(430px, 100%); }
.auth-card .eyebrow { color: var(--accent); }
.auth-card h2 { font-size: 32px; letter-spacing: -.035em; margin: 10px 0 8px; }
.auth-card > p { margin: 0 0 30px; color: var(--muted); line-height: 1.55; }

.app-layout { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; background: #171918; color: #ecede9; display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 25px; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand strong { display: block; font-size: 14px; }
.brand small { color: #8f9691; }
.nav { display: grid; gap: 4px; margin-top: 24px; }
.nav-label { color: #707772; text-transform: uppercase; font-size: 10px; letter-spacing: .13em; padding: 14px 12px 7px; }
.nav button { border: 0; background: transparent; color: #aeb4b0; min-height: 44px; border-radius: 11px; display: flex; align-items: center; gap: 12px; padding: 0 13px; cursor: pointer; text-align: left; }
.nav button:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav button.active { color: #fff; background: rgba(232,103,34,.15); box-shadow: inset 3px 0 var(--accent); }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.09); display: flex; gap: 10px; align-items: center; }
.sidebar-foot .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: white; border: 0; font-weight: 700; }
.sidebar-foot strong { display: block; font-size: 12px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot small { color: #868d88; text-transform: capitalize; }

.workspace { min-width: 0; }
.topbar { height: 68px; padding: 0 clamp(18px, 3vw, 40px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(18px); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; }
.top-context { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.top-context strong { color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.icon-button:hover { border-color: var(--line-strong); background: var(--surface-2); }
.mobile-menu { display: none; }
.content { width: min(1380px, 100%); margin: 0 auto; padding: clamp(24px, 4vw, 48px); }

.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 28px; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 750; margin: 0 0 8px; }
.page-heading h1, .vehicle-hero h1 { margin: 0; font-size: clamp(30px, 4vw, 48px); letter-spacing: -.045em; line-height: 1.05; }
.page-heading p:last-child { color: var(--muted); margin: 9px 0 0; }
.heading-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.btn, .btn-secondary, .btn-ghost, .btn-danger { min-height: 42px; border-radius: 11px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border: 1px solid transparent; font-weight: 680; font-size: 13px; }
.btn { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(232,103,34,.22); }
.btn:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--surface); border-color: var(--line); }
.btn-secondary:hover, .btn-ghost:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.btn[disabled], button[disabled] { opacity: .46; cursor: not-allowed; box-shadow: none; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }
.kpi { min-height: 132px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.kpi span { color: var(--muted); font-size: 12px; }
.kpi b { display: block; margin: 18px 0 5px; font-size: 32px; letter-spacing: -.04em; }
.kpi small { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(310px, .8fr); gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel + .panel { margin-top: 18px; }
.panel-head { min-height: 74px; padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-head h2 { margin: 3px 0 0; font-size: 18px; letter-spacing: -.02em; }
.panel-body { padding: 8px 22px 20px; }
.attention-list, .timeline, .data-list { display: grid; }
.attention-item, .timeline-item, .data-row { padding: 15px 0; border-bottom: 1px solid var(--line); display: grid; gap: 5px; }
.attention-item:last-child, .timeline-item:last-child, .data-row:last-child { border-bottom: 0; }
.attention-item { grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; }
.attention-item p, .timeline-item p, .data-row p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.timeline-item { grid-template-columns: 118px 12px 1fr; position: relative; }
.timeline-item time { color: var(--muted); font-size: 12px; }
.timeline-item > i { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; margin-top: 5px; position: relative; }
.timeline-item > i::after { content: ""; position: absolute; width: 1px; height: 54px; background: var(--line); left: 3px; top: 10px; }
.timeline-item:last-child > i::after { display: none; }
.badge { display: inline-flex; align-items: center; gap: 6px; width: max-content; min-height: 26px; padding: 0 9px; border-radius: 99px; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 750; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.good { color: var(--good); background: var(--good-soft); }
.badge.blue { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, var(--surface)); }
.badge.warn { color: var(--warn); background: var(--warn-soft); }
.badge.danger { color: var(--danger); background: var(--danger-soft); }
.badge.neutral::before { display: none; }

.fleet-tools { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 12px; margin-bottom: 12px; }
.search { position: relative; }
.search .icon { position: absolute; left: 14px; top: 13px; color: var(--muted); }
.search input { padding-left: 44px; }
.input, input, select, textarea { width: 100%; min-height: 44px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 11px; padding: 10px 13px; }
textarea { min-height: 100px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
.filters { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 22px; }
.filters button { min-height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 0 12px; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 650; }
.filters button.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.vehicle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.vehicle-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-height: 320px; display: flex; flex-direction: column; cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.vehicle-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.vehicle-card-photo { height: 150px; margin: -8px -8px 16px; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.vehicle-photo { width: 100%; height: 100%; display: block; object-fit: cover; }
.vehicle-photo-empty { display: grid; place-items: center; color: var(--muted); background: linear-gradient(145deg, var(--surface-2), var(--surface-3)); }
.vehicle-photo-empty .icon { width: 42px; height: 42px; opacity: .55; }
.vehicle-card-top { display: flex; justify-content: space-between; align-items: center; }
.vehicle-card-icon { width: 42px; height: 42px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; color: var(--accent); }
.vehicle-card h2 { font-size: 19px; letter-spacing: -.02em; margin: 18px 0 3px; }
.plate { color: var(--muted); font-weight: 650; letter-spacing: .06em; font-size: 12px; }
.vehicle-km { margin: 20px 0; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.vehicle-km small { color: var(--muted); display: block; }
.vehicle-km b { display: block; margin-top: 4px; font-size: 24px; letter-spacing: -.035em; }
.vehicle-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 0; }
.vehicle-card dt { color: var(--muted); font-size: 11px; }
.vehicle-card dd { margin: 4px 0 0; font-size: 12px; font-weight: 650; line-height: 1.35; }
.vehicle-card footer { margin-top: auto; padding-top: 18px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.vehicle-card footer strong { color: var(--accent); }

.back-link { border: 0; background: transparent; padding: 0; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; margin-bottom: 20px; }
.vehicle-hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; padding-bottom: 24px; }
.vehicle-hero-main { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: center; min-width: 0; }
.vehicle-hero-photo { width: 220px; height: 150px; object-fit: cover; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2); }
.vehicle-hero .vehicle-meta { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.vehicle-hero-km { font-size: clamp(30px, 5vw, 58px); font-weight: 750; letter-spacing: -.055em; margin-top: 20px; }
.vehicle-submeta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 18px; margin-top: 8px; }
.summary-strip { display: grid; grid-template-columns: repeat(6, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0 22px; }
.summary-strip div { padding: 17px; min-width: 0; border-right: 1px solid var(--line); }
.summary-strip div:last-child { border-right: 0; }
.summary-strip span { color: var(--muted); font-size: 10px; display: block; }
.summary-strip b { display: block; margin-top: 6px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.operational-summary { grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; }
.operations-panel { margin-bottom: 22px; }
.report-heading { align-items: center; }
.report-period-control { min-width: 260px; display: grid; justify-items: end; gap: 6px; }
.report-period-control > span { color: var(--muted); font-size: 11px; font-weight: 680; }
.report-period-control > div { display: flex; gap: 7px; align-items: center; }
.report-period { min-width: 190px; margin: 0; }
.report-period input { min-height: 40px; }
.report-today { padding: 0; border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: 10px; font-weight: 700; }
.report-today:disabled { color: var(--muted); cursor: default; }
.dynamic-kpi > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.trend { flex: 0 0 auto; padding: 4px 7px; border-radius: 99px; font-size: 9px; font-weight: 750; }
.trend.up { color: var(--good); background: var(--good-soft); }
.trend.down { color: var(--warn); background: var(--warn-soft); }
.trend.neutral { color: var(--muted); background: var(--surface-3); }
.report-visual-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .55fr); gap: 18px; margin-bottom: 18px; }
.chart-legend { display: flex; gap: 13px; color: var(--muted); font-size: 10px; }
.chart-legend span { display: flex; gap: 5px; align-items: center; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; }
.chart-legend .distance { background: var(--accent); }
.chart-legend .cost { background: var(--blue); }
.report-chart { height: 270px; display: grid; grid-template-columns: repeat(6, minmax(46px, 1fr)); gap: clamp(8px, 2vw, 24px); align-items: end; padding: 24px 24px 18px; overflow-x: auto; }
.report-chart-column { min-width: 46px; height: 100%; display: grid; grid-template-rows: 1fr auto auto; gap: 5px; align-items: end; text-align: center; }
.report-chart-column strong { text-transform: uppercase; font-size: 10px; }
.report-chart-column > span { color: var(--muted); font-size: 9px; white-space: nowrap; }
.report-chart-bars { width: 100%; height: 190px; display: block; border-bottom: 1px solid var(--line); overflow: visible; }
.report-chart-bars .distance { fill: var(--accent); }
.report-chart-bars .cost { fill: var(--blue); }
.cost-composition { min-height: 270px; padding: 24px; display: grid; place-items: center; align-content: center; gap: 24px; }
.cost-donut { width: 158px; height: 158px; display: grid; place-items: center; position: relative; }
.cost-donut svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.cost-donut .donut-base { stroke: var(--surface-3); }
.cost-donut.has-cost .donut-base { stroke: var(--blue); }
.cost-donut .donut-fuel { stroke: var(--accent); }
.cost-donut span { position: relative; z-index: 1; display: grid; text-align: center; }
.cost-donut b { font-size: 18px; }
.cost-donut small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.cost-legend { width: 100%; display: grid; gap: 7px; }
.cost-legend button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: inherit; text-align: left; cursor: pointer; }
.cost-legend i { width: 9px; height: 30px; border-radius: 5px; }
.cost-legend i.fuel { background: var(--accent); }
.cost-legend i.maintenance { background: var(--blue); }
.cost-legend span, .cost-legend small, .cost-legend strong { display: block; }
.cost-legend small { color: var(--muted); font-size: 9px; }
.cost-legend strong { margin-top: 2px; font-size: 11px; }
.report-lower-grid { margin-bottom: 18px; }
.vehicle-ranking { display: grid; padding: 8px 14px 14px; }
.ranking-row { display: grid; grid-template-columns: 28px minmax(130px, .8fr) minmax(90px, 1fr) 74px; gap: 10px; align-items: center; padding: 10px 8px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.ranking-row:last-child { border-bottom: 0; }
.ranking-row:hover, .ranking-row.active { background: var(--surface-2); border-radius: 10px; }
.ranking-row.active { box-shadow: inset 3px 0 var(--accent); }
.ranking-position { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: var(--surface-3); color: var(--muted); font-size: 10px; font-weight: 750; }
.ranking-name strong, .ranking-name small { display: block; }
.ranking-name strong { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-name small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.ranking-meter { width: 100%; height: 6px; border: 0; border-radius: 99px; background: var(--surface-3); overflow: hidden; appearance: none; }
.ranking-meter::-webkit-progress-bar { background: var(--surface-3); border-radius: 99px; }
.ranking-meter::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
.ranking-meter::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.ranking-row > b { text-align: right; font-size: 10px; white-space: nowrap; }
.insight-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; padding: 1px; background: var(--line); }
.insight-list article { min-height: 92px; padding: 17px; background: var(--surface); }
.insight-list span { display: block; color: var(--muted); font-size: 9px; }
.insight-list strong { display: block; margin-top: 12px; font-size: 13px; line-height: 1.4; }
.report-table-panel { overflow: hidden; }
.report-table-tools { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) auto; gap: 12px; align-items: end; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.activity-filter { min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; font-size: 11px; font-weight: 680; }
.activity-filter.active { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, var(--line)); background: var(--good-soft); }
.report-row { cursor: pointer; transition: background .15s ease; }
.report-row:hover { background: var(--surface-2); }
.report-note, .form-hint { color: var(--muted); font-size: 12px; line-height: 1.55; }
.report-note { margin: 14px 2px 0; }
.checklist-valid { padding: 20px; border: 1px solid var(--good); background: var(--good-soft); border-radius: 16px; }
.checklist-valid p:last-child { color: var(--muted); margin-bottom: 0; }
.tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); gap: 22px; scrollbar-width: none; }
.tabs button { flex: 0 0 auto; min-height: 46px; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; position: relative; font-size: 13px; }
.tabs button.active { color: var(--ink); font-weight: 700; }
.tabs button.active::after { content: ""; position: absolute; height: 2px; left: 0; right: 0; bottom: -1px; background: var(--accent); }
.dossier-content { padding-top: 22px; }
.section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.section-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.section-card h3 { margin: 0 0 14px; font-size: 15px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.facts span { color: var(--muted); font-size: 11px; display: block; }
.facts b { display: block; margin-top: 4px; font-size: 13px; }
.wide { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th { text-align: left; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; padding: 11px 13px; border-bottom: 1px solid var(--line); }
td { padding: 13px; border-bottom: 1px solid var(--line); font-size: 12px; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.empty { padding: 38px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 14px; }
.empty .icon { width: 30px; height: 30px; margin-bottom: 10px; }
.empty b { display: block; color: var(--ink); margin-bottom: 5px; }
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

.checklist-builder { margin-bottom: 22px; overflow: hidden; }
.checklist-builder-head { align-items: flex-end; }
.checklist-builder-head p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.checklist-builder-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; align-items: end; padding: 18px 22px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.checklist-kind-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.checklist-kind-tabs button { min-height: 66px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; cursor: pointer; }
.checklist-kind-tabs button:hover { border-color: var(--line-strong); }
.checklist-kind-tabs button.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.checklist-kind-tabs strong, .checklist-kind-tabs span { display: block; }
.checklist-kind-tabs strong { font-size: 13px; }
.checklist-kind-tabs span { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.checklist-category { gap: 5px; }
.checklist-builder-note { display: flex; gap: 9px; align-items: baseline; padding: 12px 22px; color: var(--muted); background: var(--surface); font-size: 11px; border-bottom: 1px solid var(--line); }
.checklist-builder-note strong { color: var(--ink); }
.checklist-template-table table { min-width: 900px; }
.checklist-template-table td p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.table-actions { text-align: right; }
.template-actions { display: flex; justify-content: flex-end; gap: 4px; white-space: nowrap; }
.icon-button.compact { width: 32px; height: 32px; border-radius: 8px; }
.compact-text { min-height: 32px; padding: 0 8px; font-size: 11px; cursor: pointer; }
.danger-action { color: var(--danger); }
.compact-empty { margin: 8px; padding: 24px 16px; }
.compact-empty p { margin: 6px 0 0 !important; }
.checklist-builder-foot { display: flex; justify-content: space-between; gap: 16px; padding: 13px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.45; }
.settings-support-grid { margin-top: 18px; }
.toggle-field { display: flex; gap: 11px; align-items: flex-start; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.toggle-field.full { grid-column: 1 / -1; }
.toggle-field input { margin-top: 3px; accent-color: var(--accent); }
.toggle-field strong, .toggle-field small { display: block; }
.toggle-field small { margin-top: 4px; color: var(--muted); line-height: 1.4; }
.check-item-meta { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.checklist-text-answer { min-width: min(320px, 46vw); }
.checklist-text-answer textarea { min-height: 70px; }

.driver-shell { min-height: 100vh; max-width: 760px; margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) 18px calc(96px + env(safe-area-inset-bottom)); }
.driver-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.driver-head .auth-logo { color: var(--ink); }
.driver-head-actions { display: flex; gap: 8px; }
.driver-welcome { margin: 18px 0 20px; }
.driver-welcome h1 { font-size: 31px; letter-spacing: -.04em; margin: 5px 0; }
.driver-welcome p { color: var(--muted); margin: 0; }
.driver-status { padding: 22px; border-radius: 22px; background: #171918; color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.driver-status::after { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); right: -65px; top: -72px; }
.driver-status > span { color: #aeb4b0; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.driver-status h2 { font-size: 25px; margin: 14px 0 3px; }
.driver-status .plate { color: #bbb; }
.driver-status dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0; }
.driver-status dt { color: #969d98; font-size: 10px; }
.driver-status dd { margin: 4px 0 0; font-weight: 680; }
.driver-status .btn { width: 100%; min-height: 50px; }
.driver-section { margin-top: 26px; }
.driver-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.driver-section h3 { margin: 0; font-size: 15px; }
.driver-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.driver-actions button { min-height: 104px; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 15px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; cursor: pointer; font-weight: 680; text-align: left; }
.driver-actions button:hover { border-color: var(--accent); }
.driver-actions .icon { color: var(--accent); width: 24px; height: 24px; }
.driver-recent { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 3px 17px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(7, 9, 8, .58); backdrop-filter: blur(4px); z-index: 80; display: grid; place-items: center; padding: 18px; }
.modal { width: min(620px, 100%); max-height: min(880px, calc(100vh - 36px)); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.modal.large { width: min(820px, 100%); }
.modal-head { position: sticky; top: 0; z-index: 2; min-height: 72px; display: flex; justify-content: space-between; align-items: center; background: var(--surface); border-bottom: 1px solid var(--line); padding: 16px 22px; }
.modal-head h2 { margin: 4px 0 0; font-size: 21px; }
.modal-close { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); cursor: pointer; }
.modal-body { padding: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label, .field > span { color: var(--muted); font-size: 11px; font-weight: 680; }
.field small { color: var(--muted); line-height: 1.4; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line); }
.checklist { display: grid; gap: 10px; margin-top: 18px; }
.check-item { padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.check-item-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.segmented { display: flex; gap: 5px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { min-height: 34px; min-width: 54px; border: 1px solid var(--line); border-radius: 9px; display: grid; place-items: center; padding: 0 10px; font-size: 11px; color: var(--muted); }
.segmented input:checked + span { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.problem-fields { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-top: 10px; }
.file-button { min-height: 44px; border: 1px dashed var(--line-strong); border-radius: 11px; padding: 0 13px; display: inline-flex; align-items: center; cursor: pointer; color: var(--muted); font-size: 12px; }
.file-button input { display: none; }
.vehicle-photo-editor { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.vehicle-photo-preview { width: 180px; height: 120px; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.vehicle-photo-preview-image { width: 100%; height: 100%; display: block; object-fit: cover; }
.vehicle-photo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.vehicle-photo-controls small { flex-basis: 100%; }
.form-error { color: var(--danger); background: var(--danger-soft); border-radius: 10px; padding: 10px 12px; font-size: 12px; margin-bottom: 14px; }

#toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: grid; gap: 9px; }
.toast { min-width: 280px; max-width: 420px; background: #171918; color: #fff; border-radius: 13px; box-shadow: var(--shadow); padding: 14px 16px; font-size: 13px; animation: toast-in .2s ease; }
.toast.error { background: #7e2727; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.offline-banner { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 100; padding: 8px 13px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); font-size: 11px; font-weight: 700; }

@media (max-width: 1120px) {
  :root { --sidebar: 218px; }
  .vehicle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-strip { grid-template-columns: repeat(3, 1fr); }
  .summary-strip div:nth-child(3) { border-right: 0; }
  .summary-strip div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .report-visual-grid { grid-template-columns: 1fr; }
  .cost-composition { grid-template-columns: auto minmax(220px, 1fr); }
}

@media (max-width: 820px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { min-height: 280px; padding: 28px; }
  .auth-brand h1 { margin: 50px 0 10px; font-size: 42px; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-102%); transition: transform .2s ease; width: min(290px, 88vw); }
  body.menu-open .sidebar { transform: translateX(0); box-shadow: 20px 0 60px rgba(0,0,0,.3); }
  .mobile-menu { display: grid; }
  .top-context span { display: none; }
  .content { padding: 24px 18px 44px; }
  .grid-2, .section-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .vehicle-hero { grid-template-columns: 1fr; align-items: start; }
  .vehicle-hero-main { grid-template-columns: 180px minmax(0, 1fr); }
  .vehicle-hero-photo { width: 180px; height: 130px; }
  .heading-actions { justify-content: flex-start; }
  .checklist-builder-toolbar { grid-template-columns: 1fr; }
  .report-heading { align-items: flex-start; }
  .report-period-control { justify-items: start; }
  .report-table-tools { grid-template-columns: 1fr 1fr; }
  .activity-filter { grid-column: 1 / -1; }
}

@media (max-width: 580px) {
  .page-heading { align-items: flex-start; flex-direction: column; }
  .fleet-tools { grid-template-columns: 1fr; }
  .vehicle-grid { grid-template-columns: 1fr; }
  .kpi-grid { gap: 10px; }
  .kpi { min-height: 114px; padding: 16px; }
  .kpi b { font-size: 27px; margin-top: 14px; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .summary-strip div, .summary-strip div:nth-child(3) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .summary-strip div:nth-child(2n) { border-right: 0; }
  .summary-strip div:nth-last-child(-n+2) { border-bottom: 0; }
  .timeline-item { grid-template-columns: 86px 10px 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .toggle-field.full { grid-column: auto; }
  .vehicle-hero-main, .vehicle-photo-editor { grid-template-columns: 1fr; }
  .vehicle-hero-photo, .vehicle-photo-preview { width: 100%; }
  .vehicle-hero-photo { height: 180px; }
  .vehicle-photo-preview { height: 190px; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; border-bottom: 0; }
  .problem-fields { grid-template-columns: 1fr; }
  .check-item-head { align-items: flex-start; flex-direction: column; }
  .segmented { width: 100%; }
  .segmented label { flex: 1; }
  .segmented span { width: 100%; }
  .checklist-builder-head { align-items: flex-start; flex-direction: column; }
  .checklist-builder-head .btn { width: 100%; }
  .checklist-builder-toolbar { padding: 14px; }
  .checklist-kind-tabs { grid-template-columns: 1fr; }
  .checklist-builder-note, .checklist-builder-foot { align-items: flex-start; flex-direction: column; padding-left: 14px; padding-right: 14px; }
  .checklist-text-answer { min-width: 100%; width: 100%; }
  .report-period-control { width: 100%; }
  .report-period-control > div { width: 100%; }
  .report-period { flex: 1; min-width: 0; }
  .report-period input { width: 100%; }
  .report-visual-grid { gap: 12px; }
  .report-chart { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .report-chart-bars { height: 160px; }
  .cost-composition { grid-template-columns: 1fr; }
  .report-lower-grid { gap: 12px; }
  .ranking-row { grid-template-columns: 25px minmax(110px, 1fr) 64px; }
  .ranking-meter { display: none; }
  .insight-list { grid-template-columns: 1fr; }
  .insight-list article { min-height: 78px; }
  .report-table-tools { grid-template-columns: 1fr; }
  .activity-filter { grid-column: auto; }
  #toast-root { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

:root .environment-banner { padding: 10px 18px; text-align: center; background: #fff1d6; color: #6d4608; font-size: 12px; font-weight: 650; }
:root .environment-banner[hidden] { display: none; }
