/* Däckius – workshop UI.
   Concrete floor greys, rubber-black top bar, Swedish plate as the signature element.
   Season colours carry meaning everywhere: amber = summer, steel blue = winter, green = all-season. */
:root {
    --bg: #E6E9EC;
    --surface: #FFFFFF;
    --surface-2: #F3F5F7;
    --ink: #1B2026;
    --muted: #5D6873;
    --line: #C8CFD6;
    --rubber: #22272D;
    --summer: #C27A1A;
    --summer-tint: #FBEBD3;
    --winter: #2C67A8;
    --winter-tint: #DDE9F6;
    --allseason: #3E7D4F;
    --allseason-tint: #DDEEE1;
    --ok: #2E7A4C;
    --ok-tint: #DCEFE2;
    --warn: #9A6200;
    --warn-tint: #FFF0C2;
    --bad: #B0261C;
    --bad-tint: #FADAD6;
    --plate-blue: #003399;
    --plate-yellow: #FFCC00;
    --focus: #FFCC00;
    --radius: 6px;
    --font: "Barlow", "DIN Alternate", "Bahnschrift", "Segoe UI", system-ui, sans-serif;
    --font-display: "Barlow Semi Condensed", "Barlow", "Bahnschrift", "Arial Narrow", sans-serif;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #15191D; --surface: #1E2328; --surface-2: #262C32; --ink: #E6EAEE; --muted: #9AA5AF; --line: #353D45;
        --rubber: #0F1215;
        --summer-tint: #3B2B12; --winter-tint: #17293D; --allseason-tint: #1A3022;
        --ok-tint: #173022; --warn-tint: #3A2E0E; --bad-tint: #3D1714;
        --summer: #E0A04A; --winter: #6FA3DD; --allseason: #6DB884; --ok: #6DB884; --warn: #E3B23C; --bad: #EF7A6F;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font); }
a { color: var(--winter); text-underline-offset: 2px; }
h1, h2 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.25rem; }
small, .small-text { font-size: .875rem; }
.muted { color: var(--muted); }
.grow { flex: 1; min-width: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
code { background: var(--surface-2); padding: .1em .3em; border-radius: 3px; }

/* ---------- Top bar ---------- */
.topbar { background: var(--rubber); color: #F0F2F4; }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: .6rem 1.25rem; display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .55rem; color: inherit; text-decoration: none; font: 700 1.2rem var(--font-display); }
.brand-mark { width: 28px; height: 28px; color: var(--plate-yellow); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-slogan { font: italic 500 .75rem var(--font); opacity: .75; letter-spacing: .02em; }
.login-slogan { margin: -.5rem 0 1.25rem; color: var(--muted); font-style: italic; }
.mainnav { display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; margin-left: auto; }
.mainnav a, .mainnav .linkish { color: #C9D0D6; text-decoration: none; padding: .4rem .65rem; border-radius: 4px; font-weight: 500; }
.mainnav a:hover, .mainnav .linkish:hover { color: #fff; background: rgba(255,255,255,.08); }
.mainnav a.active { color: var(--rubber); background: var(--plate-yellow); }

.page { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.count { font-size: 1rem; font-family: var(--font); color: var(--muted); font-weight: 500; margin-left: .3rem; }
.subtitle { font: 500 1rem var(--font); margin-left: .4rem; }

/* ---------- Swedish registration plate ---------- */
.plate { display: inline-flex; align-items: stretch; vertical-align: middle; background: #fff; color: #111;
    border: 2px solid #111; border-radius: 4px; overflow: hidden; white-space: nowrap;
    font: 700 .95rem/1 var(--font-display); letter-spacing: .07em; }
.plate-eu { background: var(--plate-blue); color: #fff; font-size: .62em; padding: .25em .32em; letter-spacing: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .18em; }
.plate-eu::before { content: ""; width: .95em; height: .95em; border: 1.5px dotted var(--plate-yellow); border-radius: 50%; }
.plate-no { padding: .28em .5em .22em; }
.plate.lg { font-size: 1.45rem; border-width: 3px; }
.plate.xl { font-size: 2.3rem; border-width: 3px; }
a:has(> .plate) { text-decoration: none; }
a:hover > .plate { box-shadow: 0 0 0 3px var(--plate-yellow); }

/* Plate-shaped search inputs */
.plate-input { display: flex; align-items: stretch; background: #fff; border: 3px solid #111; border-radius: 8px; overflow: hidden; }
.plate-input .plate-eu { font-size: 1rem; padding: .35rem .5rem; }
.plate-input input { flex: 1; min-width: 0; border: 0; background: transparent; color: #111; outline: none;
    font: 700 1.1rem var(--font-display); letter-spacing: .1em; text-transform: uppercase; padding: .3rem .6rem; }
.plate-input input::placeholder { color: #A8AFB6; letter-spacing: .06em; }
.plate-input:focus-within { box-shadow: 0 0 0 4px var(--focus); }
.plate-input button { border: 0; background: #111; color: #fff; font: 600 1rem var(--font); padding: 0 1.4rem; cursor: pointer; }
.plate-input.small { border-width: 2px; border-radius: 5px; width: 170px; }
.plate-input.small .plate-eu { font-size: .7rem; padding: .25rem .3rem; }
.plate-input.small input { font-size: 1rem; padding: .3rem .45rem; }
.plate-input.big { max-width: 620px; }
.plate-input.big .plate-eu { font-size: 1.35rem; padding: .5rem .7rem; }
.plate-input.big input { font-size: clamp(2rem, 6vw, 3.4rem); padding: .2rem 1rem; }
.plate-input.big.compact { max-width: 520px; margin-bottom: 1.5rem; }
.plate-input.big.compact input { font-size: clamp(1.6rem, 5vw, 2.4rem); }

.hero { padding: 2rem 0 2.5rem; }
.hero-title { font-size: clamp(1.6rem, 3.5vw, 2.5rem); margin-bottom: 1rem; }
.hero .muted { margin: .6rem 0 0; }

/* ---------- Panels & layout ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.panel.empty { text-align: left; color: var(--muted); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.dash { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1.15fr); gap: 1.25rem; align-items: start; }
.dash .panel { margin: 0; }
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 1000px) { .dash, .two-col { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1001px) and (max-width: 1180px) { .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Tags ---------- */
.season { display: inline-flex; align-items: center; gap: .35em; font-size: .8rem; font-weight: 600; padding: .12em .5em .12em .4em; border-radius: 3px; white-space: nowrap; }
.season::before { content: ""; width: .55em; height: .55em; border-radius: 50%; background: currentColor; }
.season-sommar { color: var(--summer); background: var(--summer-tint); }
.season-vinter { color: var(--winter); background: var(--winter-tint); }
.season-helar { color: var(--allseason); background: var(--allseason-tint); }
.status { display: inline-block; font-size: .8rem; font-weight: 600; padding: .12em .5em; border-radius: 3px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.status-lagrad { color: var(--ink); border-color: var(--ink); }
.status-monterad { color: var(--ok); border-color: var(--ok); }
.bstatus-klar { color: var(--ok); border-color: var(--ok); }
.bstatus-avbokad { text-decoration: line-through; }
.loc-chip { display: inline-block; font: 700 .85rem var(--font-display); letter-spacing: .04em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 3px; padding: .05em .4em; margin-right: .2rem; }
.loc-chip.big { font-size: 1.05rem; }
.loc-chip.huge { font-size: 1.6rem; padding: .1em .45em; background: var(--plate-yellow); color: #111; border-color: #111; }

/* Tread grid: 2×2, like the car seen from above */
.tread { display: inline-grid; grid-template-columns: repeat(2, 2.7em); gap: 2px; font: 600 .78rem/1.5 var(--font); vertical-align: middle; }
.tread span { text-align: center; border-radius: 2px; }
.t-ok { background: var(--ok-tint); color: var(--ok); }
.t-warn { background: var(--warn-tint); color: var(--warn); }
.t-bad { background: var(--bad-tint); color: var(--bad); }
.t-none { background: var(--surface-2); color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--line); padding: .45rem .6rem; white-space: nowrap; }
.table td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.dim { opacity: .55; }
.panel > .table, .panel > .table-wrap { margin: 0 -.6rem; width: calc(100% + 1.2rem); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions a { margin-left: .6rem; }
.kv { border-collapse: collapse; margin: .8rem 0; }
.kv th { text-align: left; padding: .2rem 1rem .2rem 0; font-weight: 400; }
.kv td { white-space: nowrap; }

/* ---------- Lists ---------- */
.daylist, .wornlist, .plain, .history { list-style: none; margin: 0; padding: 0; }
.daylist li, .wornlist li { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.daylist li:last-child, .wornlist li:last-child { border-bottom: 0; }
.daylist li.done { opacity: .55; }
.wornlist li { flex-wrap: wrap; row-gap: .35rem; }
.wornlist .grow { white-space: nowrap; }
.daylist .time { font: 700 1.05rem var(--font-display); min-width: 3.2em; }
.daylist.compact li { padding: .3rem 0; }
.daylist.compact .time { min-width: 6.5em; font-size: .95rem; }
.plain li { padding: .25rem 0; }
.history li { padding: .3rem 0; border-bottom: 1px dashed var(--line); }
.history time { color: var(--muted); margin-right: .6rem; font-variant-numeric: tabular-nums; }

.meter { height: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; margin-top: .3rem; }
.meter span { display: block; height: 100%; background: repeating-linear-gradient(135deg, var(--ink) 0 8px, #3A424B 8px 16px); }
.meter-caption { margin: .4rem 0 0; }

/* ---------- Customer page ---------- */
.contact { display: flex; gap: 1rem; flex-wrap: wrap; margin: .2rem 0 0; }
.note { background: var(--warn-tint); border-left: 3px solid var(--warn); padding: .4rem .7rem; margin: .5rem 0; max-width: 70ch; white-space: pre-line; }
.vehicle { scroll-margin-top: 1rem; }
.vehicle:target { box-shadow: 0 0 0 3px var(--plate-yellow); }
.vehicle-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.vehicle-line { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin: .3rem 0 1rem; }

/* ---------- Forms ---------- */
label { display: flex; flex-direction: column; gap: .3rem; font-size: .875rem; font-weight: 500; color: var(--muted); }
input, select, textarea { font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: .5rem .6rem; min-height: 2.5rem; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--ink); }
input.upper { text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
fieldset { border: 0; border-top: 1px solid var(--line); padding: .8rem 0 .2rem; margin: 1rem 0 0; }
fieldset.tight { margin-top: .6rem; }
legend { font: 700 1rem var(--font-display); color: var(--ink); padding-right: .6rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .9rem 1.1rem; margin-bottom: .9rem; }
.form-grid.tight { margin: .8rem 0 .9rem; }
label.full { margin-bottom: .9rem; }
.checks { display: flex; gap: 1.5rem; flex-wrap: wrap; }
label.check { flex-direction: row; align-items: center; gap: .45rem; color: var(--ink); font-size: 1rem; }
label.check input { min-height: 0; width: 1.15rem; height: 1.15rem; accent-color: var(--ink); }
.inline-form { display: flex; align-items: flex-end; gap: .9rem; flex-wrap: wrap; }
.inline-form .errors { flex-basis: 100%; }
.inline-form > label { min-width: 0; max-width: 100%; }
input[type=file] { max-width: 100%; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filters input:not([type=checkbox]) { flex: 1 1 260px; }
.actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: 1rem; }
.errors ul { margin: 0 0 1rem; padding: .6rem .9rem .6rem 2rem; background: var(--bad-tint); color: var(--bad); border-radius: 4px; }
.errors.validation-summary-valid { display: none; }
.error-text { color: var(--bad); }
.danger-zone { margin-top: 2rem; }
.inline { display: inline; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 1rem; }

/* Tread inputs placed around a car outline */
.car-treads { display: grid; grid-template-columns: minmax(0, 9rem) 4.5rem minmax(0, 9rem); grid-template-rows: auto auto; gap: .8rem 1rem; align-items: center; }
.car-treads > label:nth-of-type(1) { grid-area: 1 / 1; }
.car-treads > label:nth-of-type(2) { grid-area: 1 / 3; }
.car-treads > label:nth-of-type(3) { grid-area: 2 / 1; }
.car-treads > label:nth-of-type(4) { grid-area: 2 / 3; }
.car-body { grid-area: 1 / 2 / 3 / 3; align-self: stretch; border: 2px solid var(--line); border-radius: 22px 22px 12px 12px; position: relative; min-height: 7rem; }
.car-body::before { content: ""; position: absolute; left: 18%; right: 18%; top: 16%; height: 18%; border: 2px solid var(--line); border-radius: 6px 6px 2px 2px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: 600 .95rem var(--font); text-decoration: none;
    background: var(--ink); color: var(--surface); border: 2px solid var(--ink); border-radius: 4px; padding: .5rem 1rem; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.25); }
.btn.secondary { background: transparent; color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: transparent; }
.btn.ghost:hover { border-color: var(--line); filter: none; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.small { font-size: .82rem; padding: .25rem .6rem; }
.btn.big { font-size: 1.1rem; padding: .75rem 1.6rem; }
.btn-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.linkish { background: none; border: 0; font: inherit; cursor: pointer; padding: 0; color: var(--winter); }
.danger-text { color: var(--bad); }

.flash { background: var(--ok-tint); color: var(--ink); border-left: 4px solid var(--ok); padding: .7rem 1rem; border-radius: 4px; margin-bottom: 1.25rem; }

/* ---------- Swap ---------- */
.swap { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.swap .panel { margin: 0; }
@media (max-width: 900px) { .swap { grid-template-columns: 1fr; } }
.pick { flex-direction: row; align-items: center; gap: .8rem; padding: .7rem .8rem; border: 2px solid var(--line); border-radius: var(--radius); margin-bottom: .6rem; cursor: pointer; color: var(--ink); font-size: 1rem; }
.pick:has(input:checked) { border-color: var(--ink); background: var(--surface-2); }
.pick input { min-height: 0; width: 1.2rem; height: 1.2rem; accent-color: var(--ink); }
.pick-body { display: flex; align-items: center; gap: 1rem; flex: 1; flex-wrap: wrap; }
.pick.none { color: var(--muted); padding: .45rem .8rem; }

/* ---------- Storage racks ---------- */
.legend { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: .4rem 0 0; }
.legend-free { font-size: .8rem; border: 1px dashed var(--muted); padding: .05em .5em; border-radius: 3px; color: var(--muted); }
.rack { margin-bottom: 1.6rem; }
.rack-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: .5rem; }
.rack-head h2 { margin: 0; }
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.loc { position: relative; display: flex; flex-direction: column; gap: .15rem; padding: .45rem .55rem; min-height: 3.9rem; border-radius: 4px; text-decoration: none; color: var(--ink); }
.loc.used { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--muted); }
.loc.used:hover { border-color: var(--ink); }
.loc-sommar { border-left-color: var(--summer) !important; }
.loc-vinter { border-left-color: var(--winter) !important; }
.loc-helar { border-left-color: var(--allseason) !important; }
.loc.free { border: 1px dashed var(--line); color: var(--muted); }
.loc-code { font: 700 .95rem var(--font-display); }
.loc-reg { font: 600 .8rem var(--font-display); letter-spacing: .06em; }
.loc-del { position: absolute; top: .15rem; right: .25rem; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; opacity: 0; }
.loc.free:hover .loc-del, .loc-del:focus-visible { opacity: 1; }

/* ---------- Bookings week ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 6px; overflow-x: auto; padding-bottom: .5rem; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; min-height: 14rem; display: flex; flex-direction: column; gap: .45rem; }
.day.today { border: 2px solid var(--ink); }
.day.past { background: var(--surface-2); }
.day-head { display: flex; justify-content: space-between; padding: 0 .2rem .3rem; border-bottom: 1px solid var(--line); }
.booking { border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: 4px; padding: .4rem .5rem; display: flex; flex-direction: column; gap: .25rem; align-items: flex-start; background: var(--surface); }
.booking.bstatus-klar { border-left-color: var(--ok); opacity: .7; }
.booking.bstatus-avbokad { border-left-color: var(--line); opacity: .5; }
.booking-time { font: 700 .9rem var(--font-display); }
.booking-who { font-size: .85rem; line-height: 1.25; }
.booking-actions { display: flex; gap: .3rem; }
.day-add { margin-top: auto; font-size: .85rem; text-decoration: none; color: var(--muted); padding: .3rem; border-radius: 4px; text-align: center; border: 1px dashed transparent; }
.day-add:hover { border-color: var(--line); color: var(--ink); }

/* ---------- Login ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; background: var(--rubber); }
.login { background: var(--surface); padding: 2rem; border-radius: var(--radius); width: min(360px, 92vw); border-top: 6px solid var(--plate-yellow); }

/* ---------- Print labels ---------- */
.print-body { background: #fff; color: #111; }
.print-bar { display: flex; gap: 1rem; align-items: center; padding: 1rem; }
.labels { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; padding: 6mm; }
.label { border: 2px solid #111; border-radius: 3mm; padding: 5mm; break-inside: avoid; display: flex; flex-direction: column; gap: 2mm; color: #111; }
.label-top { display: flex; justify-content: space-between; align-items: baseline; }
.label-loc { font: 700 40pt/1 var(--font-display); }
.label-pos { font: 700 22pt/1 var(--font-display); border: 2px solid #111; padding: 1mm 2.5mm; border-radius: 2mm; }
.label-name { font-size: 13pt; font-weight: 600; }
.label-meta { font-size: 10pt; line-height: 1.4; }
.label-company { font-size: 8pt; color: #555; margin-top: auto; }
@media print {
    .print-bar { display: none; }
    @page { margin: 8mm; }
}

@media (max-width: 1240px) {
    .topbar-inner { gap: .8rem; }
    .mainnav a, .mainnav .linkish { padding: .4rem .45rem; font-size: .95rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 700px) {
    .topbar-inner { gap: .6rem; }
    .mainnav { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
    .plate-input.small { flex: 1; }
    h1 { font-size: 1.6rem; }
}

/* ---------- Released tyres (virtual rack "Utlämnat") ---------- */
.loc-chip.released { background: transparent; border: 1px dashed var(--muted); color: var(--muted); font-family: var(--font); font-weight: 600; font-size: .8rem; text-decoration: none; }
a.loc-chip.released:hover { color: var(--ink); border-color: var(--ink); }
.release-note { font-size: .85rem; line-height: 1.35; max-width: 42ch; margin-top: .2rem; white-space: pre-line; }
.released-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.loc.released { gap: .35rem; padding: .6rem .7rem; border-style: dashed; border-left-style: solid; align-items: flex-start; }
.released-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.vehicle-contact { font-size: .9rem; margin: .1rem 0; display: flex; gap: .3rem .8rem; flex-wrap: wrap; align-items: baseline; }
.span-2 { grid-column: span 2; }
@media (max-width: 600px) { .span-2 { grid-column: auto; } }

/* ---------- Label printer ---------- */
.errors-inline { background: var(--bad-tint); color: var(--bad); border-left: 4px solid var(--bad); padding: .7rem 1rem; border-radius: 4px; margin: 0 0 1rem; }
.print-result { margin: 0 1rem 1rem; }
@media print { .print-result { display: none; } }

/* Printer warning on every page, and status on the settings page */
.printer-alert { background: var(--bad); color: #fff; }
.printer-alert[hidden] { display: none; }
.printer-alert-inner { max-width: 1280px; margin: 0 auto; padding: .55rem 1.25rem; display: flex; gap: .3rem .8rem; flex-wrap: wrap; align-items: baseline; }
.printer-alert a { color: #fff; font-weight: 600; margin-left: auto; }
.printer-state { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin: 0 0 1rem; padding: .6rem .8rem; border-radius: 4px; background: var(--surface-2); }
.printer-dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--muted); align-self: center; flex: none; }
.printer-state-ok .printer-dot { background: var(--ok); }
.printer-state-problem .printer-dot, .printer-state-offline .printer-dot { background: var(--bad); }
.printer-state-problem, .printer-state-offline { background: var(--bad-tint); }

/* Vehicle register lookup */
.bv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .5rem 2rem; }
.bv-grid p { margin: .2rem 0; }
.pick-body select { min-width: 14rem; }

/* Audit log */
.table.audit td { vertical-align: top; }
.nowrap { white-space: nowrap; }
.changes { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.changes li { padding: .05rem 0; }
.changes del { color: var(--bad); text-decoration: line-through; }
.changes ins { color: var(--ok); text-decoration: none; font-weight: 600; }
.inline-label { flex-direction: row; align-items: center; gap: .4rem; }

/* New tyres in stock */
.table th.num, .table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stock-qty { display: inline-block; min-width: 2.2em; padding: .1em .45em; border-radius: 3px; font-weight: 700; text-align: center; background: var(--ok-tint); color: var(--ok); }
.stock-qty.stock-low { background: var(--bad-tint); color: var(--bad); }

/* Sign-in with Microsoft */
.sso-btn { width: 100%; gap: .6rem; background: var(--surface); color: var(--ink); border: 2px solid var(--line); padding: .7rem 1rem; font-size: 1rem; }
.sso-btn:hover { border-color: var(--ink); filter: none; }
.login-divider { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .85rem; margin: 1.2rem 0; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* API keys */
.new-key { border: 2px solid var(--ok); }
.key-box { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.key-box code { font-size: 1rem; padding: .5rem .7rem; background: var(--surface-2); border-radius: 4px; word-break: break-all; }
.code-sample { background: var(--surface-2); padding: .7rem .9rem; border-radius: 4px; overflow-x: auto; font-size: .9rem; }

/* Users see no administrator-only controls. This is only for convenience: the server checks every action. */
.role-user .admin-only,
.role-user .danger-zone,
.role-user .loc-del,
.role-user .rack-head form,
.role-user .mainnav a[href="/Settings"],
.role-user a[href^="/export/"],
.role-user a[href*="handler=Csv"],
.role-user a[href^="/Audit"] { display: none !important; }
/* Readers see no buttons, links or panels that change data; forms show their values locked. Only for convenience: the server refuses every change. */
.role-reader main form.read-only button,
.role-reader main form.read-only [type="submit"],
.role-reader .mainnav a[href="/Swap"],
.role-reader a[href^="/Swap"],
.role-reader a[href^="/Release"],
.role-reader a[href^="/Vehicles/New"],
.role-reader a[href^="/Vehicles/Edit"],
.role-reader a[href^="/Stock/Move"],
.role-reader a[href^="/TireSets/Label"],
.role-reader a[href="/Customers/Edit"],
.role-reader a[href^="/Customers/Edit/"],
.role-reader a[href="/Stock/Edit"],
.role-reader a[href^="/TireSets/Edit?"],
.role-reader a[href="/Bookings/Edit"],
.role-reader a[href^="/Bookings/Edit?"],
.role-reader a[href^="/Stock?RegNo="],
.role-reader .write-only { display: none !important; }
.role-reader form.read-only :is(input, select, textarea):disabled { background: var(--surface-2); color: var(--ink); opacity: 1; cursor: default; }
.compact-row { gap: .6rem; align-items: center; }
.compact-row select { min-height: 2.1rem; padding: .25rem .5rem; }
.loc.loc-stock { background: var(--surface-2); border-left-color: var(--ink) !important; }
.legend-stock { font-size: .8rem; font-weight: 600; padding: .05em .5em; border-radius: 3px; background: var(--surface-2); border-left: 4px solid var(--ink); }

/* Paging of long lists */
.pager { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }
.pager .muted { margin-right: auto; }
