/* Garaż — wygląd aplikacji. Motyw jasny i ciemny (ustawienie systemu albo wybór w menu: html[data-theme]). */

:root {
    --bg: #f4f6fa;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef2f7;
    --border: #e3e8f0;
    --border-2: #d3dbe7;
    --text: #0f172a;
    --text-2: #475569;
    --text-3: #8592a6;
    --accent: #2457d6;
    --accent-2: #1c46b0;
    --accent-soft: #e9f0ff;
    --accent-text: #ffffff;
    --ok: #15803d;
    --ok-soft: #e6f6ec;
    --soon: #b45309;
    --soon-soft: #fdf2df;
    --bad: #dc2626;
    --bad-soft: #fdeaea;
    --info: #2457d6;
    --info-soft: #e9f0ff;
    --ev: #0d9488;
    --petrol: #d97706;
    --summer: #ea8a0c;
    --winter: #2b7de0;
    --sb-bg: #0b1120;
    --sb-bg-2: #111a2e;
    --sb-text: #c9d3e3;
    --sb-muted: #6b7a93;
    --sb-line: rgba(255, 255, 255, .07);
    --sb-hover: rgba(255, 255, 255, .06);
    --sb-active: rgba(96, 140, 255, .18);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 20px -6px rgba(15, 23, 42, .08);
    --shadow-lg: 0 24px 60px -12px rgba(15, 23, 42, .35);
    --radius: 14px;
    --radius-sm: 10px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0c1222;
        --surface: #121a2c;
        --surface-2: #161f34;
        --surface-3: #1b2640;
        --border: #232f48;
        --border-2: #2f3c5a;
        --text: #e7ecf5;
        --text-2: #a6b2c7;
        --text-3: #6d7b95;
        --accent: #5d8dff;
        --accent-2: #7ba3ff;
        --accent-soft: rgba(93, 141, 255, .15);
        --accent-text: #0b1120;
        --ok: #4ade80;
        --ok-soft: rgba(74, 222, 128, .12);
        --soon: #fbbf24;
        --soon-soft: rgba(251, 191, 36, .13);
        --bad: #f87171;
        --bad-soft: rgba(248, 113, 113, .13);
        --info: #7ba3ff;
        --info-soft: rgba(93, 141, 255, .15);
        --ev: #2dd4bf;
        --sb-bg: #080d19;
        --sb-bg-2: #0e1526;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .45);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #0c1222;
    --surface: #121a2c;
    --surface-2: #161f34;
    --surface-3: #1b2640;
    --border: #232f48;
    --border-2: #2f3c5a;
    --text: #e7ecf5;
    --text-2: #a6b2c7;
    --text-3: #6d7b95;
    --accent: #5d8dff;
    --accent-2: #7ba3ff;
    --accent-soft: rgba(93, 141, 255, .15);
    --accent-text: #0b1120;
    --ok: #4ade80;
    --ok-soft: rgba(74, 222, 128, .12);
    --soon: #fbbf24;
    --soon-soft: rgba(251, 191, 36, .13);
    --bad: #f87171;
    --bad-soft: rgba(248, 113, 113, .13);
    --info: #7ba3ff;
    --info-soft: rgba(93, 141, 255, .15);
    --ev: #2dd4bf;
    --sb-bg: #080d19;
    --sb-bg-2: #0e1526;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .45);
    color-scheme: dark;
}

/* ------------------------------------------------------------ podstawy */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums;
}
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .86em; background: var(--surface-3); padding: 1px 6px; border-radius: 6px; color: var(--text-2); white-space: nowrap; }
code:empty { display: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.i { width: 18px; height: 18px; flex: none; }
.grow { flex: 1 1 auto; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; color: var(--text-3); display: block; }
.block { display: block; }
.pad { padding: 16px 20px; }
.pad-x { padding: 0 20px 20px; }
.warn-text { color: var(--soon); }
.danger-text { color: var(--bad) !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sub { color: var(--text-2); font-size: 14px; }
.notes { color: var(--text-2); font-size: 14px; white-space: pre-line; padding: 10px 14px; background: var(--surface-2); border-radius: var(--radius-sm); margin-top: 12px; }
.money { font-weight: 650; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------ przyciski */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 38px; padding: 0 15px; border-radius: 10px;
    border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
    font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
    box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, transform .05s;
    text-decoration: none !important;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn .i { width: 17px; height: 17px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.primary.ev { background: var(--ev); border-color: var(--ev); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { filter: brightness(.94); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.wide { width: 100%; height: 44px; }
.btn-icon {
    display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
    border: 0; background: transparent; color: var(--text-2); cursor: pointer; flex: none;
}
.btn-icon:hover { background: var(--surface-3); color: var(--text); }
.btn-icon.sm { width: 30px; height: 30px; border-radius: 8px; }
.btn-icon.sm .i { width: 16px; height: 16px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--border); background: var(--surface); border-radius: 11px; padding: 2px; }
.seg .btn-icon { width: 32px; height: 32px; }

/* ------------------------------------------------------------ powłoka */

.shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
    background: linear-gradient(180deg, var(--sb-bg-2), var(--sb-bg) 40%);
    color: var(--sb-text); display: flex; flex-direction: column; padding: 18px 14px 14px;
    border-right: 1px solid var(--sb-line);
    padding-top: max(18px, env(safe-area-inset-top));
}
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 18px; }
.sb-brand img { border-radius: 9px; }
.sb-brand strong { display: block; color: #fff; font-size: 17px; letter-spacing: -.01em; }
.sb-brand span { display: block; font-size: 11.5px; color: var(--sb-muted); }
.sb-brand .sb-close { margin-left: auto; color: var(--sb-text); display: none; }
.sb-nav, .sb-cars { display: flex; flex-direction: column; gap: 2px; }
.sb-link, .sb-car {
    display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px;
    color: var(--sb-text); text-decoration: none !important; font-weight: 550; font-size: 14px; position: relative;
}
.sb-link .i { color: var(--sb-muted); }
.sb-link:hover, .sb-car:hover { background: var(--sb-hover); }
.sb-link.active, .sb-car.active { background: var(--sb-active); color: #fff; }
.sb-link.active .i { color: #8fb0ff; }
.sb-badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.sb-badge.overdue { background: #ef4444; color: #fff; }
.sb-badge.soon { background: #f59e0b; color: #1f1300; }
.sb-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 8px 6px 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sb-muted); }
.sb-title .btn-icon { color: var(--sb-text); }
.sb-title .btn-icon:hover { background: var(--sb-hover); color: #fff; }
.sb-car-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--car) 30%, transparent); color: #fff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--car) 55%, transparent); }
.sb-car-ic .i { width: 16px; height: 16px; }
.sb-car-t { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sb-car-t b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-car-t small { color: var(--sb-muted); font-size: 12px; letter-spacing: .02em; }
.sb-car .dot { margin-left: auto; }
.sb-empty { color: var(--sb-muted); font-size: 13px; padding: 6px 10px; }
.sb-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 2px; }
.sb-link .dot { margin-left: auto; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 12px 6px 2px 8px; margin-top: 8px; border-top: 1px solid var(--sb-line); }
.sb-user .btn-icon { color: var(--sb-muted); width: 32px; height: 32px; }
.sb-user .btn-icon:hover { background: var(--sb-hover); color: #fff; }
.sb-user-t { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.sb-user-t b { color: #fff; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.sb-user-t small { color: var(--sb-muted); font-size: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12.5px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #3b6ef5, #7c3aed); letter-spacing: .02em; }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: var(--text-3); }
.dot.ok { background: #22c55e; }
.dot.soon { background: #f59e0b; }
.dot.overdue { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .2); }
.scrim { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.page { width: 100%; max-width: 1320px; margin: 0 auto; padding: 30px 34px 60px; outline: none; transition: opacity .15s; }
.page.loading > * { opacity: .55; }

.skeleton-page { display: grid; gap: 18px; }
.sk { height: 110px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: sk 1.4s infinite linear; }
.sk.h { height: 54px; width: 46%; }
.sk.big { height: 320px; }
.sk-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ------------------------------------------------------------ nagłówki stron, karty, kafelki */

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin-top: 4px; }
.page-head .sub { margin-top: 6px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px 24px; flex-wrap: wrap; margin: 4px 0 18px; }
.section-head h2 { font-size: 20px; font-weight: 700; }
.section-head .sub { margin-top: 4px; max-width: 760px; }
.list-title { font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin: 26px 0 10px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 9px; }
.card-head h2 .i { color: var(--text-3); }
.card-head .sub { font-size: 13px; margin-top: 2px; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile {
    position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 16px 18px 16px; display: flex; flex-direction: column; gap: 2px; color: var(--text); text-decoration: none !important; overflow: hidden; min-width: 0;
}
a.tile:hover { border-color: var(--border-2); transform: translateY(-1px); transition: transform .15s, border-color .15s; }
.tile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: transparent; }
.tile.overdue::before { background: var(--bad); }
.tile.soon::before { background: var(--soon); }
.tile.ok::before { background: var(--ok); }
.tile-ic { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.tile.overdue .tile-ic { background: var(--bad-soft); color: var(--bad); }
.tile.soon .tile-ic { background: var(--soon-soft); color: var(--soon); }
.tile.ok .tile-ic { background: var(--ok-soft); color: var(--ok); }
.tile small { font-size: 12.5px; font-weight: 600; color: var(--text-3); padding-right: 40px; }
.tile b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile > span:last-child, .tile > span:not(.tile-ic) { font-size: 13px; color: var(--text-2); }
.tile.overdue b { color: var(--bad); }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.chip .i { width: 13px; height: 13px; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.soon { background: var(--soon-soft); color: var(--soon); }
.chip.overdue { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.muted { background: var(--surface-3); color: var(--text-2); }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }

.empty { text-align: center; padding: 34px 20px; color: var(--text-2); }
.empty-icon { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty-icon .i { width: 24px; height: 24px; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 4px; }
.empty p { max-width: 460px; margin: 0 auto; font-size: 14px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.onboarding .empty { padding: 56px 20px; }

.banner { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: var(--radius); margin-bottom: 18px; background: var(--info-soft); color: var(--info); border: 1px solid transparent; }
.banner .i { width: 26px; height: 26px; }
.banner b { display: block; color: var(--text); }
.banner span { font-size: 13.5px; color: var(--text-2); }
.banner.soon { background: var(--soon-soft); color: var(--soon); }
.banner.overdue { background: var(--bad-soft); color: var(--bad); }

/* ------------------------------------------------------------ pulpit */

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cars-col { display: grid; gap: 16px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; align-items: start; }
.two-col:first-child { margin-top: 0; }
.tiles + .two-col { margin-top: 0; }
.stack { display: grid; gap: 20px; align-content: start; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }

.dues { display: flex; flex-direction: column; padding: 6px; }
.due { display: flex; align-items: center; gap: 13px; padding: 11px 12px; border-radius: 11px; color: var(--text); text-decoration: none !important; }
.due:hover { background: var(--surface-2); }
.due-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); }
.due.overdue .due-ic { background: var(--bad-soft); color: var(--bad); }
.due.soon .due-ic { background: var(--soon-soft); color: var(--soon); }
.due.ok .due-ic { background: var(--accent-soft); color: var(--accent); }
.due-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.due-main b { font-weight: 600; font-size: 14.5px; }
.due-main small { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--text-3); font-size: 12.5px; }
.due-side { text-align: right; display: flex; flex-direction: column; flex: none; }
.due-side b { font-size: 13.5px; font-weight: 600; }
.due-side small { font-size: 12.5px; color: var(--text-2); }
.due.overdue .due-side small { color: var(--bad); font-weight: 600; }
.due.soon .due-side small { color: var(--soon); font-weight: 600; }
.car-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-2); font-size: 12px; }
.car-tag::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--car); }

.car-card { display: block; color: var(--text); text-decoration: none !important; padding: 18px 20px 14px; position: relative; overflow: hidden; transition: transform .15s, border-color .15s; }
.car-card::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 120px; background: linear-gradient(180deg, color-mix(in srgb, var(--car) 13%, transparent), transparent); pointer-events: none; }
.car-card:hover { transform: translateY(-2px); border-color: var(--border-2); }
.cc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; position: relative; z-index: 1; }
.cc-top h3 { font-size: 18px; font-weight: 700; }
.cc-top p { color: var(--text-2); font-size: 13px; }
.cc-art { margin: 2px -6px 0; position: relative; z-index: 1; color: var(--text); }
.car-art { width: 100%; height: auto; display: block; max-height: 130px; }
.cc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 0 12px; border-bottom: 1px solid var(--border); }
.cc-stats small { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.cc-stats b { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.fuel { display: inline-flex; align-items: center; gap: 5px; }
.fuel .i { width: 15px; height: 15px; color: var(--petrol); }
.fuel.bev .i { color: var(--ev); }
.cc-dues { list-style: none; margin: 0; padding: 10px 0 0; display: grid; gap: 7px; }
.cc-dues li { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.cc-dues li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-dues li small { color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
.cc-dues li.overdue small { color: var(--bad); font-weight: 600; }
.cc-dues li.soon small { color: var(--soon); font-weight: 600; }
.cc-share { display: inline-flex; gap: 6px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--text-3); }
.cc-share .i { width: 14px; height: 14px; }

/* tablica rejestracyjna */
.plate { display: inline-flex; align-items: stretch; height: 30px; border-radius: 5px; overflow: hidden; background: #fff; border: 1.5px solid #1f2937; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); flex: none; }
.plate-eu { width: 19px; background: #1d4ed8; color: #fff; font-size: 9px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 2px; letter-spacing: .02em; }
.plate-eu i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px dotted #facc15; margin-bottom: 2px; }
.plate-num { padding: 0 10px; display: flex; align-items: center; font-weight: 800; font-size: 16px; letter-spacing: .08em; color: #111827; font-family: "DIN Alternate", "Arial Narrow", var(--font); }
.plate.sm { height: 26px; }
.plate.sm .plate-num { font-size: 13.5px; padding: 0 8px; }
.plate.sm .plate-eu { width: 16px; font-size: 8px; }
.plate.sm .plate-eu i { width: 7px; height: 7px; }

/* ------------------------------------------------------------ karta auta */

.car-hero {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 420px); gap: 10px 24px; align-items: center;
    padding: 26px 30px; border-radius: 18px; border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; position: relative;
    background:
        radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--car) 26%, transparent) 0%, transparent 55%),
        linear-gradient(135deg, var(--surface) 30%, color-mix(in srgb, var(--car) 8%, var(--surface)));
}
.hero-info h1 { font-size: 32px; margin: 6px 0 2px; }
.hero-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.vin { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.hero-stats { display: flex; gap: 10px 32px; flex-wrap: wrap; margin-top: 20px; }
.hero-stats > div { display: flex; flex-direction: column; min-width: 110px; }
.hero-stats small { font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.hero-stats b { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.hero-art { color: var(--text); align-self: end; }
.hero-art .car-art { max-height: 170px; filter: drop-shadow(0 18px 18px rgba(15, 23, 42, .18)); }

.tabs { display: flex; gap: 4px; margin: 20px 0 22px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 11px 14px; color: var(--text-2); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none !important; }
.tab .i { width: 17px; height: 17px; color: var(--text-3); }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab.active .i { color: var(--accent); }

.timeline { list-style: none; margin: 0; padding: 8px; }
.timeline a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; color: var(--text); text-decoration: none !important; }
.timeline a:hover { background: var(--surface-2); }
.tl-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; flex: none; }
.tl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tl-main b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-main small { color: var(--text-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-cost { font-weight: 600; font-size: 13.5px; white-space: nowrap; }

.cost-bars { padding: 16px 20px 6px; display: grid; gap: 10px; }
.cb-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.cb-y { font-weight: 600; font-size: 13px; color: var(--text-2); }
.cb-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.cb-bar i { display: block; height: 100%; min-width: 3px; }
.cb-t { font-size: 13.5px; min-width: 92px; text-align: right; }
.cb-inspections { background: #6366f1; }
.cb-repairs { background: #ef4444; }
.cb-tires { background: #0ea5e9; }
.cb-service { background: #f59e0b; }
.legend { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.cost-legend { padding: 4px 20px 12px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; white-space: nowrap; }
.table td.act { width: 1%; white-space: nowrap; text-align: right; }
.table tfoot td { font-weight: 700; border-top: 1px solid var(--border-2); border-bottom: 0; }
.table .sub-row td { color: var(--text-2); }
.card > .table-wrap:last-child .table tr:last-child td:first-child { border-bottom-left-radius: var(--radius); }
.record .table-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 14px; }
.record .table th { background: var(--surface-2); }

.dl { margin: 0; padding: 8px 20px 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.dl > div { padding: 9px 0; border-bottom: 1px dashed var(--border); min-width: 0; }
.dl dt { font-size: 12px; color: var(--text-3); font-weight: 600; }
.dl dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.dl.compact { padding: 0; grid-template-columns: 1fr; }
.dl.compact > div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; }
.dl.compact dd { text-align: right; font-size: 13.5px; }
.card .notes { margin: 0 20px 18px; }

.records { display: grid; gap: 14px; }
.record { padding: 18px 20px; }
.rec-head { display: flex; gap: 14px; align-items: flex-start; }
.rec-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.rec-ic.service { background: var(--soon-soft); color: var(--soon); }
.rec-ic.repair { background: var(--bad-soft); color: var(--bad); }
.rec-title { flex: 1; min-width: 0; }
.rec-title h3 { font-size: 16px; }
.rec-title p { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.rec-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.rec-btns { display: inline-flex; gap: 2px; }
.rec-next { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--text-2); margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.rec-next .i { width: 16px; height: 16px; color: var(--accent); }
.scope { margin-top: 14px; }
.scope-h { font-size: 12.5px; font-weight: 650; color: var(--text-2); margin-bottom: 8px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; }
.checklist li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--text-3); }
.checklist li .i { width: 16px; height: 16px; margin-top: 2px; }
.checklist li.done { color: var(--text); }
.checklist li.done .i { color: var(--ok); }

.list { display: flex; flex-direction: column; padding: 6px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; }
.row + .row { border-top: 1px solid var(--border); border-radius: 0; }
.row-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; flex: none; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-main b { font-weight: 600; }
.row-main small { font-size: 12.5px; color: var(--text-2); }
.row-main small.muted { color: var(--text-3); }
.row-side { display: flex; align-items: center; gap: 8px; flex: none; }

/* ------------------------------------------------------------ opony */

.sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; margin-bottom: 20px; }
.set { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; border-top: 3px solid var(--border-2); }
.set.summer { border-top-color: var(--summer); }
.set.winter { border-top-color: var(--winter); }
.set.all { border-top-color: var(--ok); }
.set.retired { opacity: .7; }
.set-head { display: flex; align-items: center; gap: 12px; }
.set-head > div { flex: 1; min-width: 0; }
.set-head h3 { font-size: 16px; }
.set-head p { color: var(--text-2); font-size: 13px; }
.set-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.set-ic.summer { background: color-mix(in srgb, var(--summer) 15%, transparent); color: var(--summer); }
.set-ic.winter { background: color-mix(in srgb, var(--winter) 15%, transparent); color: var(--winter); }
.set-ic.all { background: var(--ok-soft); color: var(--ok); }
.set-body { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: start; }
.set-facts { display: grid; gap: 12px; min-width: 0; }
.set-foot { display: flex; gap: 8px; align-items: center; padding-top: 10px; border-top: 1px solid var(--border); }
.set-empty {
    border: 1.5px dashed var(--border-2); background: transparent; box-shadow: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; padding: 30px; color: var(--text-2); cursor: pointer; min-height: 200px; text-align: center;
}
.set-empty .i { width: 30px; height: 30px; color: var(--text-3); }
.set-empty b { color: var(--text); }
.set-empty span { font-size: 13px; }
.set-empty:hover { border-color: var(--accent); color: var(--accent); }

.tread-car, .tread-input { display: grid; grid-template-columns: 1fr 1.05fr 1fr; grid-template-rows: auto auto; gap: 8px 6px; align-items: center; }
.tc-body {
    grid-column: 2; grid-row: 1 / span 2; align-self: stretch; border-radius: 22px 22px 16px 16px; min-height: 120px;
    background: linear-gradient(180deg, var(--surface-3), var(--surface-2)); border: 1px solid var(--border-2); position: relative;
    display: flex; justify-content: center; padding-top: 8px;
}
.tc-body span { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700; }
.tc-body::after { content: ""; position: absolute; left: 18%; right: 18%; top: 26%; height: 18%; border-radius: 6px 6px 3px 3px; background: color-mix(in srgb, var(--text-3) 22%, transparent); }
.tw { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 2px; border-radius: 9px; background: var(--surface-3); border: 1px solid var(--border); }
.tw b { font-size: 15px; font-weight: 700; line-height: 1.1; }
.tw small { font-size: 10px; color: var(--text-3); font-weight: 700; letter-spacing: .05em; }
.tw.fl, .tw.rl { grid-column: 1; }
.tw.fr, .tw.rr { grid-column: 3; }
.tw.fl, .tw.fr { grid-row: 1; }
.tw.rl, .tw.rr { grid-row: 2; }
.tw.good { background: var(--ok-soft); border-color: transparent; }
.tw.good b { color: var(--ok); }
.tw.warn { background: var(--soon-soft); border-color: transparent; }
.tw.warn b { color: var(--soon); }
.tw.bad { background: var(--bad-soft); border-color: transparent; }
.tw.bad b { color: var(--bad); }
.depth { font-weight: 650; }
.depth.good { color: var(--ok); }
.depth.warn { color: var(--soon); }
.depth.bad { color: var(--bad); }
.depth.na { color: var(--text-3); font-weight: 500; }
.depth-meter { display: grid; gap: 6px; }
.dm-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dm-top small { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.dm-top b { font-size: 17px; }
.dm-bar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); }
.dm-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--text-3); }
.dm-bar i.good { background: var(--ok); }
.dm-bar i.warn { background: var(--soon); }
.dm-bar i.bad { background: var(--bad); }
.dm-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-2); border-radius: 1px; }
.dm-mark.legal { left: 0; background: var(--bad); }
.depth-meter > small { font-size: 12px; }
.tread-input .tw-in { display: flex; flex-direction: column; gap: 4px; }
.tread-input .tw-in small { font-size: 12px; color: var(--text-2); font-weight: 600; }
.tread-input .tw-in.fl, .tread-input .tw-in.rl { grid-column: 1; }
.tread-input .tw-in.fr, .tread-input .tw-in.rr { grid-column: 3; }
.tread-input .tw-in.fl, .tread-input .tw-in.fr { grid-row: 1; }
.tread-input .tw-in.rl, .tread-input .tw-in.rr { grid-row: 2; }
.tread-input .tc-body { min-height: 150px; }
details.retired { margin-top: 20px; }
details.retired summary { padding: 14px 20px; cursor: pointer; font-weight: 600; color: var(--text-2); }
details.retired .sets { padding: 0 20px 20px; margin: 0; }

/* ------------------------------------------------------------ eksploatacja */

.feature { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); margin-bottom: 20px; overflow: hidden; }
.feat-main { display: flex; gap: 16px; align-items: flex-start; padding: 22px 24px; }
.feat-main > div { flex: 1; min-width: 0; }
.feat-main h3 { font-size: 22px; font-weight: 700; margin: 4px 0; letter-spacing: -.01em; }
.feat-ic { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--petrol) 15%, transparent); color: var(--petrol); }
.feat-ic .i { width: 26px; height: 26px; }
.feature.ev .feat-ic { background: color-mix(in srgb, var(--ev) 15%, transparent); color: var(--ev); }
.feature.overdue .feat-ic { background: var(--bad-soft); color: var(--bad); }
.feature.soon .feat-ic { background: var(--soon-soft); color: var(--soon); }
.feat-need { padding: 22px 24px; background: var(--surface-2); border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.need { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; width: 100%; }
.need li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; font-size: 13.5px; padding-bottom: 8px; border-bottom: 1px dashed var(--border-2); }
.need li b { font-weight: 600; }
.need li span { grid-column: 1; color: var(--text-2); font-size: 12.5px; }
.need li code { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.soh { display: flex; gap: 8px; align-items: flex-end; height: 86px; margin-top: 12px; }
.soh span { width: 34px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.soh b { font-size: 10.5px; font-weight: 700; color: var(--text-2); }
.soh i { display: block; width: 100%; height: var(--h); border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--ev), color-mix(in srgb, var(--ev) 50%, transparent)); }
.soh small { font-size: 10.5px; color: var(--text-3); }
.parts { padding: 8px 20px 16px; display: grid; gap: 14px; }
.pg-h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; margin-bottom: 4px; }
.part { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.part > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.part b { font-weight: 600; font-size: 14px; }
.part small { color: var(--text-2); font-size: 12.5px; }
.schedule td:first-child b { font-weight: 600; }

/* ------------------------------------------------------------ formularze */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid > .wide, .form-grid > .hint { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > label, .field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.req { color: var(--bad); margin-left: 3px; font-weight: 700; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input:not([type]), select, textarea {
    width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface);
    color: var(--text); font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.45; }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238592a6' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[readonly] { background: var(--surface-2); color: var(--text-2); }
input[type=date], input[type=time] { min-height: 40px; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
.with-suffix { position: relative; display: flex; align-items: center; }
.with-suffix input { padding-right: 46px; }
.suffix { position: absolute; right: 12px; font-size: 13px; color: var(--text-3); pointer-events: none; }
.hint { font-size: 12.5px; color: var(--text-3); line-height: 1.4; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }
.check.wide { grid-column: 1 / -1; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; }
.checks.inline { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-check { padding: 0; }
.pill-check input { position: absolute; opacity: 0; pointer-events: none; }
.pill-check span { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-2); font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.pill-check input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.pill-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.swatch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 4px; }
.rows { display: grid; gap: 8px; }
.erow { display: flex; gap: 8px; align-items: center; }
.erow input[type=text] { height: 38px; }
.item-row select { width: 150px; flex: none; height: 38px; }
.item-row > input[data-k=part] { width: 130px; flex: none; }
.item-row .with-suffix { width: 120px; flex: none; }
.scope-row .check { flex: none; }
.scope-row input[type=text] { flex: 1; }
.row-tools { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.sum { font-size: 14px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.form-actions .form-msg { flex: 1; text-align: left; }
.form-msg { color: var(--bad); font-size: 13.5px; font-weight: 600; min-height: 0; }
.form-msg:empty { display: none; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input, .inline select { flex: 1; }
.copy-field { display: flex; gap: 8px; margin: 8px 0; }
.copy-field input { font-family: var(--mono); font-size: 12.5px; }
.field.transfer { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.share-sel, .share-cell { height: 34px; width: auto; min-width: 116px; font-size: 13.5px; }
.share-cell.view { border-color: var(--info); color: var(--info); }
.share-cell.edit { border-color: var(--ok); color: var(--ok); }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.user-cell { display: inline-flex; align-items: center; gap: 10px; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); }
.danger-zone .card-head h2 { color: var(--bad); }
.preview { border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.preview .eyebrow { margin-bottom: 6px; }
ul.plain { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 5px; font-size: 14px; }
details.help { margin-top: 14px; font-size: 14px; }
details.help summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13.5px; }
.test-mail { border-top: 1px solid var(--border); }
.test-mail .eyebrow { margin-bottom: 8px; }

/* wybór rodzaju wpisu */
.pick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; text-align: left; font-weight: 600; font-size: 14px; }
.pick .i { width: 22px; height: 22px; color: var(--accent); }
.pick:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ------------------------------------------------------------ okna i powiadomienia */

dialog.modal {
    width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--border); border-radius: 18px;
    background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden;
}
dialog.modal.wide { width: min(780px, calc(100vw - 24px)); }
dialog.modal[open] { animation: pop .18s ease-out; }
dialog.modal::backdrop { background: rgba(8, 13, 25, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
dialog.modal form { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 14px 22px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
dialog.modal > form > .form-msg { padding: 0 22px 10px; }
.modal-foot { display: flex; gap: 10px; align-items: center; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.modal-body .hint { margin-top: 12px; display: block; }
.confirm-text { font-size: 15px; color: var(--text-2); }

.toasts { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 8px; pointer-events: none; }
.toast {
    display: flex; gap: 10px; align-items: center; min-width: 240px; max-width: 420px; padding: 12px 16px; border-radius: 12px;
    background: #0f172a; color: #f1f5f9; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 550; animation: pop .2s ease-out; transition: opacity .4s, transform .4s;
}
.toast .i { color: #4ade80; }
.toast.error .i { color: #f87171; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ------------------------------------------------------------ kalendarz */

.cal-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.filter { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text-3); font-weight: 600; font-size: 13px; cursor: pointer; }
.filter i { width: 9px; height: 9px; border-radius: 3px; background: var(--car); opacity: .35; }
.filter.on { color: var(--text); border-color: var(--text-3); }
.filter.on i { opacity: 1; }
.filter .i { width: 15px; height: 15px; }
.filter.plain.on { background: var(--surface-3); }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.cal { overflow: hidden; }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-dow span { padding: 9px 10px; font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-day {
    min-height: 112px; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface);
    padding: 7px 7px 6px; text-align: left; display: flex; flex-direction: column; gap: 4px; cursor: pointer; min-width: 0; color: var(--text);
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:nth-last-child(-n + 7) { border-bottom: 0; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.out { background: var(--surface-2); color: var(--text-3); }
.cal-day.out .pill { opacity: .55; }
.cal-num { font-size: 13px; font-weight: 650; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--accent); color: var(--accent-text); }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-pills { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pill { display: block; font-size: 11.5px; font-weight: 600; line-height: 1.3; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--surface-3); color: var(--text-2); border-left: 3px solid var(--car); }
.pill.due-overdue, .lg.due-overdue { background: var(--bad-soft); color: var(--bad); }
.pill.due-soon, .lg.due-soon { background: var(--soon-soft); color: var(--soon); }
.pill.due-ok, .lg.due-ok { background: var(--accent-soft); color: var(--accent); }
.pill.ev, .lg.ev { background: color-mix(in srgb, #8b5cf6 16%, transparent); color: #7c3aed; }
:root[data-theme="dark"] .pill.ev { color: #c4b5fd; }
.pill.ev-done { text-decoration: line-through; opacity: .6; }
.pill.planned { background: var(--info-soft); color: var(--info); border-left-style: dashed; }
.pill.hist, .lg.hist { background: var(--surface-3); color: var(--text-3); }
.pill.more { background: none; border: 0; color: var(--text-3); padding-left: 2px; }
.lg.due-overdue { background: var(--bad); }
.lg.due-soon { background: var(--soon); }
.lg.due-ok { background: var(--accent); }
.lg.ev { background: #8b5cf6; }
.lg.hist { background: var(--text-3); }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.cal-dots i.due-overdue { background: var(--bad); }
.cal-dots i.due-soon { background: var(--soon); }
.cal-dots i.due-ok { background: var(--accent); }
.cal-dots i.ev { background: #8b5cf6; }
.agenda { position: sticky; top: 20px; }
.agenda .card-head h2 { font-size: 15px; }
.agenda-list { padding: 8px; display: grid; gap: 4px; }
.ag-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; border-left: 3px solid var(--car); background: var(--surface-2); }
.ag-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--surface); display: grid; place-items: center; color: var(--text-2); flex: none; }
.ag-row.due-overdue .ag-ic { color: var(--bad); }
.ag-row.due-soon .ag-ic { color: var(--soon); }
.ag-row.due-ok .ag-ic { color: var(--accent); }
.ag-row.ev .ag-ic { color: #8b5cf6; }
.ag-main { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--text); text-decoration: none !important; }
.ag-main b { font-size: 14px; font-weight: 600; }
.ag-main small { font-size: 12.5px; color: var(--text-2); }
.note-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px 20px; margin-top: 20px; }
.note-card > .i { width: 22px; height: 22px; color: var(--accent); margin-top: 2px; }
.note-card p { color: var(--text-2); font-size: 14px; }

/* ------------------------------------------------------------ logowanie */

.login-page { min-height: 100vh; min-height: 100dvh; background: var(--bg); }
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 520px); }
.login-art {
    background:
        radial-gradient(80% 60% at 20% 100%, rgba(45, 212, 191, .22), transparent 60%),
        radial-gradient(70% 60% at 90% 10%, rgba(93, 141, 255, .35), transparent 60%),
        linear-gradient(160deg, #0f1a33, #080d19);
    color: #dbe4f3; display: flex; align-items: center; justify-content: center; padding: 60px;
}
.login-art-in { max-width: 460px; }
.login-art img { border-radius: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
.login-art h2 { color: #fff; font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 26px 0 20px; line-height: 1.2; }
.login-art ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.login-art li { display: flex; gap: 12px; align-items: center; font-size: 15.5px; }
.login-art li::before { content: ""; width: 20px; height: 20px; flex: none; border-radius: 50%; background: rgba(93, 141, 255, .25) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8c2ff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat; }
.login-card { align-self: center; justify-self: center; width: 100%; max-width: 400px; padding: 40px 32px; display: flex; flex-direction: column; gap: 14px; }
.login-mark { border-radius: 16px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 30px; margin-top: 6px; }
.login-lead { color: var(--text-2); margin-top: -8px; margin-bottom: 8px; }
.login-card .field span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.login-card input { height: 46px; }
.login-note { font-size: 13px; color: var(--text-3); text-align: center; }
.login-ver { font-size: 12px; color: var(--text-3); text-align: center; }
.login-noscript { text-align: center; color: var(--bad); }

/* ------------------------------------------------------------ układ responsywny */

@media (max-width: 1200px) {
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-grid, .settings-grid { grid-template-columns: minmax(0, 1fr); }
    .cars-col { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
    .cal-layout { grid-template-columns: minmax(0, 1fr); }
    .agenda { position: static; }
}

@media (max-width: 1024px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar {
        position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 50; transform: translateX(-102%);
        transition: transform .25s ease; box-shadow: var(--shadow-lg);
    }
    .sb-brand .sb-close { display: inline-grid; }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(8, 13, 25, .5); }
    body.nav-open { overflow: hidden; }
    .topbar {
        display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30; height: 56px; padding: 0 10px;
        padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top));
        background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
        border-bottom: 1px solid var(--border);
    }
    .topbar-brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 16px; text-decoration: none !important; }
    .topbar-brand img { border-radius: 7px; }
    .page { padding: 22px 20px 50px; }
    .two-col { grid-template-columns: minmax(0, 1fr); }
    .feature { grid-template-columns: minmax(0, 1fr); }
    .feat-need { border-left: 0; border-top: 1px solid var(--border); }
    .car-hero { grid-template-columns: minmax(0, 1fr); }
    .hero-art { position: absolute; right: -40px; top: 10px; width: 330px; opacity: .25; pointer-events: none; }
}

@media (max-width: 760px) {
    body { font-size: 15px; }
    h1 { font-size: 24px; }
    .page { padding: 18px 16px 44px; }
    .page-head { margin-bottom: 18px; }
    .page-head .actions { width: 100%; }
    .page-head .actions .btn { flex: 1; }
    .tiles, .tiles.three, .tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .tile { padding: 13px 14px; }
    .tile b { font-size: 19px; }
    .tile-ic { width: 28px; height: 28px; top: 11px; right: 11px; }
    .tile-ic .i { width: 15px; height: 15px; }
    .tile small { padding-right: 30px; }
    .tiles.three .tile:last-child { grid-column: 1 / -1; }
    .cars-col { grid-template-columns: minmax(0, 1fr); }
    .car-hero { padding: 20px 18px; border-radius: 16px; }
    .hero-info h1 { font-size: 26px; }
    .hero-stats { gap: 12px 22px; }
    .hero-stats b { font-size: 17px; }
    .hero-art { width: 240px; right: -50px; }
    .section-head .actions { width: 100%; }
    .section-head .actions .btn { flex: 1; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .dl { grid-template-columns: minmax(0, 1fr); }
    .sets { grid-template-columns: minmax(0, 1fr); }
    .set-body { grid-template-columns: 124px minmax(0, 1fr); gap: 14px; }
    .item-row { flex-wrap: wrap; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
    .item-row > input[data-k=t] { flex: 1 1 100%; }
    .item-row select { flex: 1 1 40%; width: auto; }
    .item-row > input[data-k=part] { flex: 1 1 30%; width: auto; }
    .item-row .with-suffix { flex: 1 1 40%; width: auto; }
    .rec-head { flex-wrap: wrap; }
    .rec-side { width: 100%; justify-content: flex-start; }
    .due { padding: 10px 8px; gap: 10px; }
    .due-ic { width: 34px; height: 34px; }
    .cal-day { min-height: 58px; padding: 4px; align-items: center; }
    .cal-pills { display: none; }
    .cal-dots { display: flex; justify-content: center; }
    .cal-num { font-size: 12.5px; }
    .cal-dow span { text-align: center; padding: 8px 2px; }
    .legend { display: none; }
    .pick-grid { grid-template-columns: minmax(0, 1fr); }
    dialog.modal, dialog.modal.wide { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
    dialog.modal form { max-height: 94dvh; }
    .modal-body { padding: 18px 16px; }
    .modal-head { padding: 14px 10px 12px 16px; }
    .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
    .toasts { left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); }
    .toast { max-width: none; }
    .login { grid-template-columns: minmax(0, 1fr); }
    .login-art { display: none; }
    .login-card { padding: 32px 20px; }
    .feat-main, .feat-need { padding: 18px; }
    .table th, .table td { padding: 9px 10px; }
    .cost-bars { padding: 14px 14px 4px; }
    .cb-t { min-width: 76px; }
}

@media (max-width: 440px) {
    .set-body { grid-template-columns: minmax(0, 1fr); }
    .set-body .tread-car { max-width: 230px; width: 100%; justify-self: center; }
    .tc-body { min-height: 96px; }
}

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