/* Koelwacht portal – design tokens, app shell, components. Light and dark theme follow the OS setting. */

:root {
    --navy: #07182b;
    --navy-2: #0d2742;
    --accent: #7cc4ff;
    --accent-strong: #1f7ae0;
    --ink: #0b1f33;
    --ink-2: #33475c;
    --muted: #64768a;
    --bg: #f3f6fa;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --ok: #0f9d6b;
    --ok-soft: #e3f7ef;
    --alarm: #e5484d;
    --alarm-soft: #fdecec;
    --warn: #d97706;
    --warn-soft: #fff4e0;
    --offline: #8a99ab;
    --offline-soft: #eef1f5;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 4px 16px rgb(15 23 42 / 0.06);
    --shadow-lg: 0 2px 4px rgb(15 23 42 / 0.05), 0 12px 32px rgb(15 23 42 / 0.10);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --sidebar: 248px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #e6edf5;
        --ink-2: #b7c4d3;
        --muted: #8a9bb0;
        --bg: #0a1420;
        --surface: #111d2b;
        --surface-2: #162434;
        --line: #1f3044;
        --line-strong: #2c4259;
        --accent-strong: #7cc4ff;
        --ok: #34d399;
        --ok-soft: rgb(52 211 153 / 0.12);
        --alarm: #ff6b6f;
        --alarm-soft: rgb(255 107 111 / 0.13);
        --warn: #fbbf24;
        --warn-soft: rgb(251 191 36 / 0.12);
        --offline: #7d8ea3;
        --offline-soft: rgb(125 142 163 / 0.14);
        --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 16px rgb(0 0 0 / 0.25);
        --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.3), 0 12px 32px rgb(0 0 0 / 0.35);
        color-scheme: dark;
    }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 12px; text-wrap: balance; }
h1 { font-size: clamp(26px, 3vw, 32px); font-weight: 700; }
h2 { font-size: 20px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0 0 12px; text-wrap: pretty; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.92em; }
pre { white-space: pre-wrap; font-size: 12px; }
svg.ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); font-size: 14px; }
.error, .text-danger, .field-validation-error, .validation-summary-errors { color: var(--alarm); font-size: 14px; }
.validation-summary-valid { display: none; }
.sr-only, .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pre { white-space: pre-line; }
.right { text-align: right; }

/* ---------- App shell ---------- */
.shell { min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
    display: flex; flex-direction: column; gap: 8px;
    padding: 20px 14px;
    background: var(--navy);
    color: #c9d6e5;
    overflow-y: auto;
    z-index: 10;
}
.admin .sidebar { background: #040f1c; }
.content { margin-left: var(--sidebar); padding: 32px clamp(20px, 4vw, 48px) 64px; max-width: calc(1240px + var(--sidebar)); }
.content-wide { max-width: none; }
.no-nav .sidebar { position: static; width: auto; flex-direction: row; align-items: center; justify-content: space-between; padding: 14px 24px; }
.no-nav .content { margin: 0 auto; max-width: 1100px; }

.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; color: #fff; text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.no-nav .brand { padding: 0; }
.app-mode .sidebar { display: none; }
.app-mode .content { padding-top: 16px; }
.logo { width: 30px; height: 30px; fill: none; }
.logo-shield { stroke: var(--accent); stroke-width: 2; }
.logo-stem { stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.logo-bulb { fill: var(--accent); }
.badge { font-family: var(--font); font-size: 11px; font-weight: 600; letter-spacing: 0.02em; background: var(--accent); color: var(--navy); padding: 2px 8px; border-radius: 999px; }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { margin: 16px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #6f86a0; }
.sidebar nav a, .sidebar-foot a, .nav-button {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; min-height: 40px;
    border-radius: 10px;
    color: #c9d6e5; text-decoration: none; font: inherit; font-weight: 500;
    background: none; border: 0; width: 100%; text-align: left; justify-content: flex-start; cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.sidebar nav svg, .sidebar-foot svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; opacity: 0.85; }
.sidebar nav a:hover, .sidebar-foot a:hover, .nav-button:hover { background: rgb(255 255 255 / 0.06); color: #fff; }
.sidebar nav a.active { background: rgb(124 196 255 / 0.14); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.sidebar nav a.active svg { opacity: 1; color: var(--accent); }
.sidebar nav a.nav-disabled { opacity: 0.38; pointer-events: none; cursor: default; filter: grayscale(1); }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgb(255 255 255 / 0.08); display: flex; flex-direction: column; gap: 2px; }
.sidebar-foot form { margin: 0; }
.nav-public { flex-direction: row !important; }
.no-nav .nav-public a { color: #fff; font-weight: 600; }

@media (max-width: 900px) {
    .sidebar { position: sticky; top: 0; inset: auto; width: auto; flex-direction: row; align-items: center; gap: 4px; padding: 10px 12px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
    .sidebar::-webkit-scrollbar { display: none; }
    .brand { padding: 0 8px 0 4px; font-size: 18px; }
    .brand span:not(.badge) { display: none; }
    .sidebar nav, .sidebar-foot { flex-direction: row; gap: 2px; }
    .nav-group { display: none; }
    .sidebar nav a, .sidebar-foot a, .nav-button { white-space: nowrap; padding: 8px 10px; width: auto; }
    .sidebar nav a.active { box-shadow: inset 0 -2px 0 var(--accent); }
    .sidebar-foot { margin: 0; padding: 0 0 0 8px; border-top: 0; border-left: 1px solid rgb(255 255 255 / 0.1); }
    .content { margin-left: 0; padding: 20px 16px 48px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat { padding: 14px; }
    .stat strong { font-size: 26px; }
}

/* ---------- Language switch ---------- */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 6px 6px; border-radius: 9px; background: rgb(255 255 255 / 0.06); width: fit-content; }
.lang-switch button { min-height: 0; padding: 4px 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; background: none; color: #9fb3c8; border: 0; border-radius: 7px; box-shadow: none; }
.lang-switch button:hover { color: #fff; box-shadow: none; }
.lang-switch button.active { background: rgb(124 196 255 / 0.18); color: #fff; }
.nav-public { display: flex; align-items: center; gap: 16px; }
.nav-public .lang-switch { margin: 0; }
@media (max-width: 900px) { .sidebar-foot .lang-switch { margin: 0 6px 0 0; align-self: center; } }

/* ---------- Sign-in ---------- */
.auth { max-width: 440px; margin: 48px auto; display: flex; flex-direction: column; gap: 12px; }
.auth h1 { margin: 0; }
.auth .card { max-width: none; }
.code-input { font-family: var(--font-display); font-size: 28px; letter-spacing: 0.3em; text-align: center; }

/* ---------- Page head ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.page-head h1 { margin: 0; }
.eyebrow { margin: 0 0 4px; font-size: 13px; font-weight: 500; color: var(--muted); }
.eyebrow::first-letter { text-transform: uppercase; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 32px 0 14px; }
.section-head h2 { margin: 0; }

/* ---------- Buttons & forms ---------- */
button, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: inherit; font-weight: 600; font-size: 15px;
    padding: 10px 18px; min-height: 44px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    background: var(--navy); color: #fff; text-decoration: none; cursor: pointer;
    transition: transform 0.05s, background 0.15s, box-shadow 0.15s;
}
@media (prefers-color-scheme: dark) { button, .btn { background: var(--accent); color: var(--navy); } }
button:hover, .btn:hover { box-shadow: var(--shadow); }
button:active, .btn:active { transform: translateY(1px); }
button.secondary, .btn-ghost, .btn-secondary, .btn-outline-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
td.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
td.actions form { margin: 0; }
.card.narrow { max-width: 640px; }
.btn-danger, button.danger { background: var(--alarm); color: #fff; }
button.link, .btn-link { background: none; border: 0; padding: 0; min-height: 0; font-weight: 500; color: var(--accent-strong); box-shadow: none; }
.btn-lg { min-height: 50px; font-size: 16px; }
.w-100 { width: 100%; }

label, .form-label, .control-label { font-weight: 600; font-size: 14px; color: var(--ink-2); }
input, select, textarea, .form-control, .form-select {
    font: inherit; color: var(--ink);
    padding: 10px 12px; min-height: 44px;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 96px; }
input:focus, select:focus, textarea:focus, .form-control:focus { outline: none; border-color: var(--accent-strong); box-shadow: 0 0 0 4px rgb(124 196 255 / 0.35); }
input[type="checkbox"], input[type="radio"], .form-check-input { min-height: 0; width: 18px; height: 18px; padding: 0; accent-color: var(--accent-strong); }
form.inline { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
fieldset { border: 0; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.choice, .form-check, .checkbox { display: flex; gap: 10px; align-items: center; }

/* ---------- Surfaces ---------- */
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px; box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 10px; max-width: 560px;
}
.card.wide { max-width: none; margin-bottom: 20px; }
.card.login { margin: 48px auto; }
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 20px; align-items: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.notice, .alert {
    background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent-strong);
    padding: 12px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow); margin: 0 0 16px;
}
.alert-danger { border-left-color: var(--alarm); }
.alert-success { border-left-color: var(--ok); }
.alert-warning { border-left-color: var(--warn); }
.paused-banner strong { display: block; margin-bottom: 4px; }

/* ---------- Tables ---------- */
table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow); font-size: 14px;
}
th { background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
table.log td { vertical-align: top; font-size: 13px; }
tr.level-error td, tr.level-critical td { background: var(--alarm-soft); }
tr.level-warning td { background: var(--warn-soft); }
code.token { display: block; word-break: break-all; background: var(--surface-2); border: 1px solid var(--line); padding: 10px 12px; border-radius: var(--radius-sm); user-select: all; }

/* ---------- Status primitives ---------- */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--offline); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.alarm { background: var(--alarm); box-shadow: 0 0 0 3px var(--alarm-soft); }
.dot.offline { background: var(--offline); box-shadow: 0 0 0 3px var(--offline-soft); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.alarm { color: var(--alarm); background: var(--alarm-soft); }
.pill.offline { color: var(--offline); background: var(--offline-soft); }
.pill.pending { color: var(--warn); background: var(--warn-soft); }

/* ---------- Dashboard ---------- */
.hero {
    display: flex; gap: 18px; align-items: center;
    padding: 20px 22px; margin-bottom: 18px;
    border-radius: var(--radius); border: 1px solid var(--line);
    background: var(--surface); box-shadow: var(--shadow);
}
.hero h2 { margin: 0 0 2px; font-size: 19px; }
.hero p { margin: 0; color: var(--ink-2); }
.hero-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.hero-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hero.is-ok .hero-icon { color: var(--ok); background: var(--ok-soft); }
.hero.is-warn .hero-icon { color: var(--warn); background: var(--warn-soft); }
.hero.is-alarm { border-color: color-mix(in srgb, var(--alarm) 40%, var(--line)); background: linear-gradient(90deg, var(--alarm-soft), var(--surface) 60%); }
.hero.is-alarm .hero-icon { color: #fff; background: var(--alarm); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgb(229 72 77 / 0.45); } 50% { box-shadow: 0 0 0 10px rgb(229 72 77 / 0); } }
@media (prefers-reduced-motion: reduce) { .hero.is-alarm .hero-icon { animation: none; } }

.stats, .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 8px; }
.kpis { margin-bottom: 28px; }
.stat, .kpi {
    display: flex; flex-direction: column; gap: 2px;
    padding: 16px 18px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
    color: var(--ink); text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
a.stat:hover, a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.stat-label, .kpi span { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.stat strong, .kpi strong { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .of { font-size: 18px; color: var(--muted); font-weight: 500; }
.stat small, .kpi small { color: var(--muted); font-size: 13px; }
.stat.attention, .kpi.attention { border-color: color-mix(in srgb, var(--alarm) 50%, var(--line)); }
.stat.attention strong, .kpi.attention strong { color: var(--alarm); }

.sensor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.sensor {
    position: relative; display: flex; flex-direction: column; gap: 14px;
    padding: 18px 18px 14px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
    overflow: hidden;
}
.sensor::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--ok); }
.sensor.alarm::before { background: var(--alarm); }
.sensor.offline::before { background: var(--offline); }
.sensor.alarm { border-color: color-mix(in srgb, var(--alarm) 45%, var(--line)); }
.sensor header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sensor h3 { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.reading { display: flex; align-items: baseline; gap: 4px; }
.reading .temp { font-family: var(--font-display); font-size: 44px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.reading .unit { font-size: 18px; font-weight: 600; color: var(--muted); }
.sensor.alarm .reading .temp { color: var(--alarm); }
.sensor.offline .reading .temp { color: var(--offline); }

.gauge svg { display: block; width: 100%; height: 12px; overflow: visible; }
.gauge-track { fill: var(--line); }
.gauge-band { fill: var(--ok); opacity: 0.35; }
.sensor.alarm .gauge-band { fill: var(--alarm); opacity: 0.25; }
.gauge-marker { fill: var(--ink); }
.gauge-labels { position: relative; height: 16px; margin-top: 4px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gauge-labels span { position: absolute; transform: translateX(-50%); }
.gauge-labels span:first-child { left: 20%; }
.gauge-labels span:last-child { left: 80%; }

.spark { display: block; width: 100%; height: 48px; }
.spark polyline { fill: none; stroke: var(--accent-strong); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sensor.alarm .spark polyline { stroke: var(--alarm); }
.spark-band { fill: var(--ok); opacity: 0.08; }
.spark-empty { display: grid; place-items: center; font-size: 12px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.spark-range { display: flex; justify-content: space-between; margin: -8px 0 0; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.sensor footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.sensor footer span { display: inline-flex; align-items: center; gap: 6px; }
.battery-low { color: var(--warn); font-weight: 600; }

.empty {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
    padding: 56px 24px; border-radius: var(--radius);
    background: var(--surface); border: 1px dashed var(--line-strong);
}
.empty > svg { width: 48px; height: 48px; fill: none; stroke: var(--accent-strong); stroke-width: 1.6; stroke-linecap: round; margin-bottom: 8px; }
.empty p { max-width: 440px; color: var(--muted); }

/* Old dashboard tiles (still used elsewhere) */
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.tile.alarm, .card.alarm { border-left: 4px solid var(--alarm); }
.card.alarm { margin-bottom: 14px; max-width: none; }
.card.alarm h3 { margin-top: 0; }

/* ---------- QR scanner ---------- */
.qr-start { max-width: 560px; margin-bottom: 16px; }
.qr-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.qr-buttons label.btn { cursor: pointer; font-weight: 600; font-size: 15px; color: var(--ink); }
.qr-scanner { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.qr-scanner[hidden] { display: none; }
.qr-video { position: relative; border-radius: var(--radius-sm); overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.qr-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.qr-frame { position: absolute; inset: 18%; border: 3px solid var(--accent); border-radius: 14px; box-shadow: 0 0 0 9999px rgb(0 0 0 / 0.35); }
.qr-status { margin: 0; font-size: 14px; color: var(--ink-2); }
.qr-status.error { color: var(--alarm); }

/* ---------- Admin forms ---------- */
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions button { min-height: 36px; padding: 6px 12px; font-size: 13px; }
td input, td select { min-height: 38px; padding: 6px 10px; width: 100%; min-width: 120px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.form-row label { display: flex; flex-direction: column; gap: 6px; }
.add-user { margin-top: 16px; }
.danger-zone { border-color: color-mix(in srgb, var(--alarm) 45%, var(--line)); }
.danger-zone h2 { color: var(--alarm); }

/* ---------- Tabs ---------- */
.tabs, .nav-pills { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 0 0 18px; list-style: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; width: fit-content; }
.tabs a, .nav-pills .nav-link { padding: 7px 14px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 14px; display: block; }
.tabs a.active, .nav-pills .nav-link.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Invoices ---------- */
.mandate-text { font-size: 13px; line-height: 1.55; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 12px; border-radius: var(--radius-sm); }
.invoice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; max-width: 840px; box-shadow: var(--shadow); }
.invoice table { box-shadow: none; }
.invoice-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.invoice tfoot td { font-weight: 600; }
.invoice tr.total td { font-size: 18px; }
.brand-dark { font-family: var(--font-display); font-weight: 700; font-size: 22px; margin: 0 0 8px; }

/* ---------- Identity pages (login, register, 2FA; Bootstrap class names) ---------- */
.row { display: flex; flex-wrap: wrap; gap: 24px; }
.row > [class*="col-"] { flex: 1 1 320px; min-width: 0; }
.col-md-4, .col-lg-6, .col-md-6 { max-width: 480px; }
.col-md-6.col-md-offset-2, .col-lg-4.col-lg-offset-2 { display: none; }
form#account, form#registerForm, form#external-account, .row form {
    display: flex; flex-direction: column; gap: 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 26px; box-shadow: var(--shadow);
}
.form-floating, .form-group, .mb-3 { display: flex; flex-direction: column; gap: 6px; }
.form-floating > label, .form-group > label, .mb-3 > label { order: -1; }
.form-floating > .form-control::placeholder { color: transparent; }
.form-check { flex-direction: row; }
.form-check .form-check-label { font-weight: 500; }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
h3 + hr, h2 + hr { display: none; }
.content > h1 + .row, .content > h1 + div { margin-top: 8px; }

/* ---------- Print ---------- */
@media print {
    .sidebar, .no-print { display: none; }
    .content { margin: 0; padding: 0; }
    body { background: #fff; color: #000; }
    .invoice { padding: 0; border: 0; box-shadow: none; }
}
