:root {
    --page: #f4f6fa;
    --surface: #fff;
    --ink: #182740;
    --muted: #64748b;
    --line: #e1e7ef;
    --blue: #245be8;
    --blue-soft: #edf2ff;
    --radius: 16px;
    color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: "Avenir Next", "Segoe UI", sans-serif; font-size: 14px; line-height: 1.6; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid #8baeff; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(26px, 3vw, 36px); line-height: 1.2; letter-spacing: -1.2px; font-weight: 750; }
h2 { font-size: 19px; line-height: 1.35; letter-spacing: -.4px; }
h3 { font-size: 17px; }
.icon { flex-shrink: 0; vertical-align: middle; }
.nav { background: var(--surface); border-bottom: 1px solid var(--line); }
.nav-inner { max-width: 1240px; margin: auto; padding: 20px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-size: 21px; line-height: 1.2; font-weight: 800; letter-spacing: -.7px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; background: var(--blue); color: #fff; border-radius: 13px; }
.brand-mark .icon { width: 25px; height: 25px; }
.brand-light { font-weight: 450; }
.brand small { display: block; margin-top: 6px; font-size: 8px; letter-spacing: 1.6px; font-weight: 700; color: var(--muted); }
.nav nav { display: flex; align-items: center; gap: 24px; }
.nav-link { color: var(--muted); font-weight: 600; font-size: 13px; }
.nav-caption { color: var(--muted); font-size: 12px; }
.container { max-width: 1240px; margin: auto; padding: 38px 28px 60px; min-height: calc(100vh - 180px); }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 28px; }
.eyebrow { color: var(--muted); font-size: 10px; letter-spacing: 2px; font-weight: 750; margin-bottom: 9px; text-transform: uppercase; }
.subtitle { color: var(--muted); margin-top: 10px; max-width: 620px; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #fff; color: var(--ink); border: 1px solid #dce3ed; border-radius: 9px; min-height: 42px; padding: 10px 15px; font-weight: 650; font-size: 12px; cursor: pointer; line-height: 1.4; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: #f8faff; border-color: #b3c2dc; text-decoration: none; }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 3px 7px #245be820; }
.btn.primary:hover { background: #174bd0; }
.btn.soft { background: var(--blue-soft); color: #254fb0; border-color: #dae4ff; }
.btn.small { padding: 7px 10px; min-height: 36px; font-size: 11px; gap: 6px; }
.btn.small .icon { width: 15px; height: 15px; }
.btn.danger { color: #b13a43; }
.btn.danger:hover { background: #fff2f3; border-color: #f2c9cc; }
.btn.icon-only { padding: 8px; width: 38px; min-height: 38px; }
.btn:disabled { opacity: .45; cursor: default; }
.inline-form { display: inline-flex; margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 4px 18px #23395403; }
.garage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.vehicle-card { padding: 0; overflow: hidden; }
.vehicle-card-main { padding: 26px; }
.vehicle-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.vehicle-symbol { display: grid; place-items: center; width: 52px; height: 52px; background: #f0f4fa; color: #5c7499; border-radius: 14px; }
.vehicle-symbol .icon { width: 30px; height: 30px; }
.vehicle-card h2 { font-size: 25px; letter-spacing: -.8px; margin-bottom: 4px; }
.vehicle-card-foot { padding: 18px 26px; border-top: 1px solid var(--line); background: #fcfdff; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.vehicle-facts { display: flex; gap: 24px; margin-top: 20px; flex-wrap: wrap; }
.vehicle-facts span { font-size: 12px; color: var(--muted); }
.vehicle-facts strong { display: block; font-size: 15px; font-weight: 650; color: var(--ink); }
.sr-plate { display: inline-flex; overflow: hidden; border: 1px solid #bcc8d7; border-radius: 5px; background: #fff; vertical-align: middle; box-shadow: 0 1px 2px #203c5510; }
.sr-plate-band { display: flex; align-items: center; padding: 4px; font-size: 7px; letter-spacing: .4px; font-weight: 700; color: white; background: #2650a4; }
.sr-plate-text { padding: 3px 10px; font-size: 14px; font-weight: 800; letter-spacing: 1px; font-variant-numeric: tabular-nums; color: #24334b; }
.breadcrumb { margin-bottom: 22px; display: inline-flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.vehicle-heading { align-items: flex-start; }
.vehicle-heading h1 { margin-top: 14px; }
.vehicle-details { display: flex; gap: 20px; color: var(--muted); font-size: 11px; margin-top: 12px; flex-wrap: wrap; overflow-wrap: anywhere; }
.vehicle-details b { color: #42536d; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat { padding: 20px 23px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.stat-label { font-size: 11px; color: var(--muted); display: block; margin-bottom: 4px; }
.stat-value { font-size: clamp(18px, 2vw, 24px); font-weight: 750; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.stat-icon { color: #6e8acc; background: #f0f4fd; padding: 11px; border-radius: 12px; }
.history { padding: 0; overflow: hidden; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 22px 24px; }
.section-heading .muted { font-size: 12px; margin-top: 4px; }
.search-wrap { display: flex; align-items: center; gap: 9px; background: #f8fafd; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; color: #8391a7; max-width: 330px; width: 100%; }
.search-wrap input { border: 0; background: transparent; margin: 0; box-shadow: none; padding: 10px 0; min-width: 0; font-size: 12px; }
.search-wrap:focus-within { outline: 2px solid #8baeff; }
.search-wrap input:focus { outline: 0; box-shadow: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: #f8fafd; color: #7b879b; font-size: 9px; font-weight: 750; letter-spacing: 1px; text-transform: uppercase; text-align: left; padding: 13px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
td { padding: 20px 18px; vertical-align: top; border-bottom: 1px solid #edf0f5; font-size: 12px; }
td:first-child, th:first-child { padding-left: 24px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfdff; }
.date-cell { font-weight: 700; white-space: nowrap; }
.number { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.service-description { min-width: 160px; max-width: 340px; overflow-wrap: anywhere; }
.service-description strong { display: block; margin-bottom: 5px; font-size: 13px; }
.service-description p { color: var(--muted); white-space: pre-line; }
.row-actions { display: flex; flex-wrap: wrap; gap: 5px; min-width: 135px; }
.row-actions .btn { font-size: 10px; }
.attachment-link { display: inline-flex; gap: 5px; align-items: center; margin-top: 9px; font-size: 11px; font-weight: 600; }
.table-footer { display: flex; justify-content: space-between; gap: 16px; padding: 15px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.reminder { margin-top: 22px; background: #fffcf3; border-color: #eee5ca; }
.reminder p { margin-top: 10px; white-space: pre-line; overflow-wrap: anywhere; color: #75653d; }
.reminder .section-heading { padding: 0; }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty h1, .empty h2 { color: var(--ink); margin-bottom: 10px; }
.empty .btn { margin-top: 20px; }
.empty-symbol { color: #92a3bb; margin-bottom: 14px; }
.empty-symbol .icon { width: 42px; height: 42px; }
.muted { color: var(--muted); }
.notice { border: 1px solid; border-radius: 10px; padding: 13px 17px; margin-bottom: 20px; overflow-wrap: anywhere; }
.notice.success { background: #eef9f4; color: #26724e; border-color: #c8e9d8; }
.notice.error { background: #fff2f2; color: #ad3741; border-color: #f0ced1; }
label { display: block; font-size: 12px; font-weight: 600; margin-top: 17px; color: #475872; }
input, textarea, select { display: block; width: 100%; border: 1px solid #d5dfeb; border-radius: 8px; padding: 11px 12px; background: #fff; color: var(--ink); margin-top: 7px; }
input:focus, textarea:focus, select:focus { outline: 0; border-color: #7397ec; box-shadow: 0 0 0 3px #245be814; }
input[type=file] { background: #f8fafd; font-size: 12px; padding: 14px; }
input::file-selector-button { border: 1px solid var(--line); background: white; border-radius: 6px; padding: 7px; margin-right: 10px; cursor: pointer; }
textarea { resize: vertical; min-height: 130px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.form-note { margin-top: 7px; font-size: 11px; color: var(--muted); }
.form-card { max-width: 720px; margin: auto; }
.form-card h1 { font-size: 27px; }
.login { max-width: 420px; margin: 55px auto; padding: 34px; }
.login .brand-mark { margin-bottom: 24px; }
.login h1 { font-size: 28px; }
.login .btn { width: 100%; margin-top: 25px; }
dialog { border: 1px solid var(--line); border-radius: 20px; padding: 26px; width: min(640px, calc(100% - 28px)); max-height: calc(100dvh - 40px); overflow-y: auto; color: var(--ink); box-shadow: 0 30px 100px #192b4a30; }
dialog::backdrop { background: #14243c80; backdrop-filter: blur(3px); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
body:has(dialog[open]) { overflow: hidden; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-top: 20px; }
.file-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: white; min-width: 0; }
.file-card img { width: 100%; height: 170px; object-fit: cover; display: block; background: #eef2f8; }
.file-caption { padding: 12px; overflow-wrap: anywhere; font-size: 11px; }
.file-caption .inline-form { margin-top: 10px; }
.pdf-file { display: flex; align-items: center; justify-content: center; min-height: 170px; gap: 8px; background: #f0f4fc; font-weight: 700; color: #627da8; }
.lightbox { width: min(1050px, calc(100% - 24px)); background: #132037; color: white; border: 0; padding: 16px; }
.lightbox img { display: block; width: 100%; max-height: 70dvh; object-fit: contain; margin: 16px auto; }
.lightbox-controls { display: flex; justify-content: center; gap: 16px; }
.site-footer { max-width: 1240px; padding: 20px 28px 28px; margin: auto; display: flex; justify-content: space-between; gap: 15px; color: #8b97a9; font-size: 10px; border-top: 1px solid var(--line); }
.site-footer span:first-child { font-weight: 750; color: #718096; }
.skip-link { position: fixed; top: -60px; left: 15px; z-index: 20; padding: 10px; background: white; }
.skip-link:focus { top: 10px; }
.stats-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-stats .stat { position: relative; overflow: hidden; }
.dashboard-stats .stat::after { content: ""; position: absolute; inset: auto -18px -34px auto; width: 90px; height: 90px; border-radius: 50%; background: #eef4ff; }
.dashboard-stats .stat > * { position: relative; z-index: 1; }
.dashboard-stats .status-overdue::after { background: #fff0f1; }
.dashboard-stats .status-due_soon::after { background: #fff7dd; }
.next-up { padding: 0; margin-bottom: 26px; overflow: hidden; }
.compact-empty { padding: 20px 24px 24px; color: var(--muted); }
.reminder-list { border-top: 1px solid var(--line); }
.reminder-row { display: grid; grid-template-columns: 12px minmax(180px, 1fr) auto auto; gap: 14px; align-items: center; min-width: 0; padding: 15px 24px; border-bottom: 1px solid #edf1f6; color: var(--ink); }
.dashboard-list .reminder-row { grid-template-columns: 12px minmax(180px, 1fr) auto auto minmax(120px, 210px); }
.dashboard-list .status-dot { grid-column: 1; }
.dashboard-list .reminder-main { grid-column: 2; }
.dashboard-list .category-pill { grid-column: 3; white-space: nowrap; }
.dashboard-list .status-badge { grid-column: 4; white-space: nowrap; }
.dashboard-list .due-detail { grid-column: 5; min-width: 120px; white-space: nowrap; }
a.reminder-row:hover { background: #fbfdff; text-decoration: none; }
.reminder-row:last-child { border-bottom: 0; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #8da0ba; box-shadow: 0 0 0 4px #edf1f6; }
.status-dot.overdue { background: #d94855; box-shadow: 0 0 0 4px #fdebed; }
.status-dot.due_soon { background: #d69111; box-shadow: 0 0 0 4px #fff4d7; }
.status-dot.planned { background: #3476df; box-shadow: 0 0 0 4px #e8f0ff; }
.status-dot.completed { background: #36a376; box-shadow: 0 0 0 4px #e5f6ef; }
.reminder-main { min-width: 0; }
.reminder-main strong, .reminder-main small { display: block; overflow-wrap: anywhere; }
.reminder-main small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.status-badge { display: inline-flex; align-items: center; width: max-content; border-radius: 999px; padding: 4px 8px; font-size: 9px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: #60718a; background: #eef2f7; }
.status-badge.overdue { color: #ae2937; background: #fde9eb; }
.status-badge.due_soon { color: #8b5a00; background: #fff0c4; }
.status-badge.planned { color: #255cb7; background: #e7efff; }
.status-badge.completed { color: #277658; background: #e2f5ec; }
.due-detail { color: var(--muted); font-size: 11px; text-align: right; max-width: 210px; overflow-wrap: anywhere; }
.category-pill, .category-line { color: #55719b; background: #eef3fb; border-radius: 999px; padding: 4px 8px; font-size: 10px; }
.category-line { display: inline-block; margin-bottom: 7px; }
.vehicle-next { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding: 12px 14px; border: 1px solid #e7ecf3; border-radius: 11px; background: #fafcff; }
.vehicle-next > span:last-child { min-width: 0; }
.vehicle-next strong, .vehicle-next small { display: block; overflow-wrap: anywhere; }
.vehicle-next small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.vehicle-next.quiet { color: var(--muted); }
.vehicle-maintenance { padding: 0; margin-bottom: 22px; overflow: hidden; }
.choice-group { border: 0; padding: 0; margin: 22px 0 0; }
.choice-group legend { font-size: 12px; font-weight: 700; color: #475872; }
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.check-choice, .check-line { display: flex; align-items: center; gap: 9px; margin: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fafcff; font-weight: 600; cursor: pointer; }
.check-choice input, .check-line input { width: auto; margin: 0; accent-color: var(--blue); }
.reminder-builder { margin-top: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcff; }
.reminder-builder summary { cursor: pointer; color: #355a91; font-weight: 700; }
.reminder-builder .check-line { margin-top: 14px; }
.filter-bar { margin-bottom: 20px; padding: 12px 18px; }
.filter-bar label { display: flex; align-items: center; gap: 12px; margin: 0; }
.filter-bar select { width: min(420px, 100%); margin: 0; }
.reminder-manager { padding: 0; overflow: hidden; }
.reminder-list.detailed .reminder-row { grid-template-columns: 12px minmax(160px, 1fr) auto minmax(120px, auto); }
.reminder-row.inactive { opacity: .68; background: #f8fafc; }
.reminder-actions { grid-column: 2 / -1; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.complete-form { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.complete-form input { width: 150px; margin: 0; padding: 8px 9px; font-size: 11px; }
.reminder-edit { margin: 0 auto 22px; }
.backup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.backup-card { padding: 30px; }
.backup-card h2 { font-size: 23px; margin-bottom: 10px; }
.backup-card > p:not(.eyebrow) { color: var(--muted); margin-bottom: 22px; }
.feature-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 22px; border-radius: 14px; color: #2d66c5; background: #eaf1ff; }
.feature-icon.warning { color: #a96813; background: #fff2d6; }
.restore-card { border-color: #eadfca; }
@media (max-width: 900px) {
    .page-heading { align-items: flex-start; }
    .vehicle-heading { flex-direction: column; gap: 18px; }
    .stats { gap: 10px; }
    .stat { padding: 18px; }
    .stat-icon { display: none; }
    td, th { padding: 16px 12px; }
    .stats-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .backup-grid { grid-template-columns: 1fr; }
    .dashboard-list .reminder-row { grid-template-columns: 12px minmax(0, 1fr) auto; }
    .dashboard-list .status-dot { grid-column: 1; }
    .dashboard-list .reminder-main { grid-column: 2; }
    .dashboard-list .category-pill { display: none; }
    .dashboard-list .status-badge { grid-column: 3; }
    .dashboard-list .due-detail { grid-column: 2 / -1; min-width: 0; max-width: none; text-align: left; white-space: normal; }
}
@media (max-width: 640px) {
    .nav-inner { padding: 16px; gap: 15px; flex-wrap: wrap; }
    .brand { font-size: 19px; }
    .brand-mark { width: 38px; height: 38px; }
    .nav nav { gap: 10px 14px; flex-wrap: wrap; }
    .nav-link { font-size: 11px; }
    .nav-caption { display: none; }
    .container { padding: 26px 16px 40px; }
    .page-heading { flex-direction: column; gap: 20px; margin-bottom: 22px; }
    h1 { font-size: 29px; }
    .garage-grid { grid-template-columns: 1fr; }
    .vehicle-card-main { padding: 22px; }
    .vehicle-card-foot { padding: 16px 22px; }
    .stats { grid-template-columns: 1fr 1fr; margin-bottom: 22px; }
    .stat:last-child { grid-column: 1 / -1; }
    .stat-value { font-size: 21px; }
    .stat { padding: 16px; }
    .stat:last-child .stat-icon { display: block; }
    .section-heading { flex-direction: column; align-items: stretch; padding: 20px; gap: 16px; }
    .search-wrap { max-width: none; }
    .table-wrap { overflow: visible; }
    .services-table, .services-table tbody { display: block; }
    .services-table thead { display: none; }
    .services-table tr { display: grid; grid-template-columns: 1fr 1fr; margin: 0 14px 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; padding: 16px; gap: 14px; }
    .services-table td, .services-table td:first-child { display: block; border: 0; padding: 0; min-width: 0; }
    .services-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 10px; font-weight: 500; margin-bottom: 4px; }
    .services-table .service-description { grid-column: 1 / -1; grid-row: 2; max-width: none; }
    .services-table .service-description::before, .services-table .action-cell::before { display: none; }
    .services-table .action-cell { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 13px; }
    .row-actions { justify-content: flex-start; }
    .row-actions .btn { min-height: 38px; font-size: 11px; }
    .table-footer { padding: 15px 20px; flex-wrap: wrap; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .card.form-card { padding: 20px; }
    .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .file-card img, .pdf-file { height: 135px; min-height: 135px; }
    dialog { padding: 20px; }
    .login { margin: 20px auto; padding: 26px; }
    .site-footer { padding: 18px 16px; font-size: 9px; }
    .reminder .section-heading { flex-direction: row; align-items: center; }
    .dashboard-stats .stat:last-child { grid-column: auto; }
    .reminder-row, .reminder-list.detailed .reminder-row { grid-template-columns: 12px minmax(0, 1fr) auto; padding: 15px 17px; gap: 10px; }
    .reminder-row .due-detail { grid-column: 2 / -1; text-align: left; max-width: none; }
    .dashboard-list .category-pill { display: none; }
    .reminder-actions { grid-column: 1 / -1; justify-content: flex-start; padding-top: 10px; border-top: 1px solid var(--line); }
    .complete-form { width: 100%; }
    .complete-form input { flex: 1 1 130px; min-width: 0; }
    .category-grid { grid-template-columns: 1fr; }
    .filter-bar label { align-items: stretch; flex-direction: column; gap: 4px; }
    .filter-bar select { width: 100%; }
    .backup-card { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}
