/* ==========================================================================
   Fulfillment – Basisstil
   Eigene Komponenten, kein CSS-Framework. Systemschriften (offline-fähig im Lager).
   ========================================================================== */

:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-sunken: #f8f9fb;
    --border: #e1e4e9;
    --border-strong: #c9ced6;
    --text: #18202b;
    --text-muted: #5d6877;
    --accent: #0b6271;
    --accent-hover: #084f5b;
    --accent-soft: #e5f1f3;
    --success: #1c7a43;
    --success-soft: #e6f4ec;
    --warning: #8a5a00;
    --warning-soft: #fdf2dc;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --neutral-soft: #eef0f3;
    --focus: #1b74e4;

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;

    --radius: 8px;
    --radius-small: 6px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-raised: 0 8px 24px rgba(16, 24, 40, .12);
    --topbar-h: 56px;
    --sidebar-w: 256px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 600; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
code { font-family: var(--mono); font-size: .875em; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.muted { color: var(--text-muted); }
.small { font-size: .8125rem; }
.tabular { font-variant-numeric: tabular-nums; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.my-12 { margin-top: 12px; margin-bottom: 12px; }
.nowrap { white-space: nowrap; }
.prewrap { white-space: pre-wrap; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-small); }
.skip-link:focus { left: 8px; }

.icon { flex-shrink: 0; display: block; }
[hidden] { display: none !important; }

/* ---------- Grundgerüst ---------- */

.topbar {
    position: sticky; top: 0; z-index: 30;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 16px;
    padding: 0 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 600; }
.brand-mark {
    width: 30px; height: 30px; border-radius: 7px;
    display: grid; place-items: center;
    background: var(--accent); color: #fff; font-weight: 700; font-size: 15px;
}
.topbar-context { margin-left: 8px; }
.context-chip {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    background: var(--neutral-soft); color: var(--text-muted); font-size: .75rem; font-weight: 500;
}
.context-chip-tenant { background: var(--accent-soft); color: var(--accent); }

.user-menu { margin-left: auto; position: relative; }
.user-menu summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
    padding: 4px 8px 4px 4px; border-radius: 999px; min-height: 40px;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--surface-sunken); }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center; font-size: .75rem; font-weight: 600;
    background: var(--accent-soft); color: var(--accent);
}
.user-menu-panel {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-raised); padding: 6px; display: flex; flex-direction: column;
}
.user-menu-head { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-menu-head .muted { font-size: .8125rem; }
.user-menu-panel a, .menu-button {
    display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--radius-small);
    color: var(--text); text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer;
}
.user-menu-panel a:hover, .menu-button:hover { background: var(--surface-sunken); }

.shell { display: flex; min-height: calc(100vh - var(--topbar-h)); }

.sidebar {
    width: var(--sidebar-w); flex-shrink: 0;
    background: var(--surface); border-right: 1px solid var(--border);
    padding: 16px 12px; position: sticky; top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h)); overflow-y: auto;
}
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-link {
    display: flex; align-items: center; gap: 10px; min-height: 38px;
    padding: 0 10px; border-radius: var(--radius-small);
    color: var(--text-muted); text-decoration: none; font-weight: 500;
}
.nav-link:hover { background: var(--surface-sunken); color: var(--text); }
.nav-link.is-active { background: var(--accent-soft); color: var(--accent); }
.nav-link.is-disabled { color: #9aa3ae; cursor: default; font-weight: 400; }
.nav-link > span:not(.phase-tag) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link.is-disabled:hover { background: none; color: #9aa3ae; }
.nav-heading {
    margin: 18px 10px 6px; font-size: .6875rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em; color: #8a94a1;
}
.phase-tag {
    margin-left: auto; font-size: .6875rem; font-weight: 600; color: #8a94a1;
    border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; line-height: 18px;
}

.main { flex: 1; min-width: 0; padding: 24px 32px 48px; max-width: 1280px; }
.main:focus { outline: none; }

.icon-button.nav-toggle { display: none; }
.sidebar-backdrop { display: none; }

/* ---------- Seitenkopf ---------- */

.page-header {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    margin-bottom: 24px; flex-wrap: wrap;
}
.page-header h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-header .muted { margin-top: 4px; }
.breadcrumb { font-size: .8125rem; margin-bottom: 4px; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.eyebrow { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 4px; }

/* ---------- Karten ---------- */

.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px 24px; margin-bottom: 24px;
}
.card-flush { padding: 0; overflow: hidden; }
.card-narrow { max-width: 680px; }
.card-highlight { border-color: var(--accent); background: var(--accent-soft); max-width: 680px; }
.card-highlight p { margin: 8px 0 12px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-header-padded { padding: 16px 24px; margin: 0; border-bottom: 1px solid var(--border); }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.columns > .card { margin-bottom: 0; }
.columns + .card, .columns + section { margin-top: 24px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat {
    display: flex; flex-direction: column; gap: 2px; padding: 16px 20px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    text-decoration: none; color: var(--text); box-shadow: var(--shadow);
}
a.stat:hover { border-color: var(--border-strong); color: var(--text); }
.stat-label { font-size: .8125rem; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 1.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-meta { font-size: .8125rem; color: var(--text-muted); }
.stat-muted .stat-value { color: #a3abb5; }

.details { display: grid; grid-template-columns: 180px 1fr; gap: 10px 16px; margin: 0; }
.details dt { color: var(--text-muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }

.activity { list-style: none; margin: 0; padding: 0; }
.activity li {
    display: grid; grid-template-columns: 1fr auto; gap: 0 12px;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.activity li:last-child { border-bottom: 0; }
.activity-action { font-weight: 500; }
.activity .muted { font-size: .8125rem; }
.activity time { grid-row: 1; grid-column: 2; }

.roadmap { list-style: none; margin: 0; padding: 0; }
.roadmap-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.roadmap-item:last-child { border-bottom: 0; }
.roadmap-phase { font-size: .8125rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.roadmap-item.is-planned .roadmap-title { color: var(--text-muted); }

.tag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list code { background: var(--surface-sunken); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; }

.empty { padding: 40px 24px; text-align: center; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.card:not(.card-flush) .empty { padding: 16px 0; }

.note { padding: 10px 12px; border-radius: var(--radius-small); background: var(--surface-sunken); color: var(--text-muted); font-size: .875rem; }

/* ---------- Tabellen ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th, .table td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table thead th {
    background: var(--surface-sunken); font-weight: 600; color: var(--text-muted);
    font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfc; }
.table .num { text-align: right; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.row-link { font-weight: 500; text-decoration: none; }
.row-link:hover { text-decoration: underline; }

.table-matrix th, .table-matrix td { padding: 8px 10px; }
.table-matrix .matrix-head { text-align: center; text-transform: none; letter-spacing: 0; font-size: .75rem; min-width: 96px; vertical-align: bottom; }
.table-matrix .matrix-head span { display: block; }
.table-matrix tbody th { font-weight: 400; }
.table-matrix tbody th code { display: block; }
.table-matrix .group-row th { background: var(--surface-sunken); font-weight: 600; font-size: .8125rem; }
.matrix-cell { text-align: center; }
.matrix-yes { color: var(--success); display: inline-flex; }
.matrix-no { color: #c3c9d1; }
.table-matrix tr.is-planned th { color: var(--text-muted); }
.table-matrix .phase-tag { margin-left: 6px; }
.sticky-col { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 260px; }
.table-matrix thead .sticky-col { background: var(--surface-sunken); }

/* ---------- Badges & Hinweise ---------- */

.badge {
    display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px;
    font-size: .75rem; font-weight: 600; line-height: 20px; white-space: nowrap; vertical-align: middle;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-neutral { background: var(--neutral-soft); color: var(--text-muted); }
h1 .badge { font-size: .75rem; }
td .badge + .badge, .row-link + .badge { margin-left: 6px; }

.alert { padding: 12px 16px; border-radius: var(--radius-small); margin-bottom: 20px; border: 1px solid transparent; font-size: .9375rem; }
.alert-success { background: var(--success-soft); color: #145c32; border-color: #bfe3cd; }
.alert-info { background: var(--accent-soft); color: var(--accent-hover); border-color: #bfdde2; }
.alert-danger { background: var(--danger-soft); color: #8f1c13; border-color: #f6c6c1; }

/* ---------- Formulare ---------- */

.stack { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { font-weight: 500; font-size: .875rem; padding: 0; }
.field legend { margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--text-muted); font-size: .8125rem; margin-left: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="tel"], input[type="number"], input[type="date"], select, textarea {
    width: 100%; font: inherit; color: var(--text);
    min-height: 40px; padding: 8px 12px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-small);
    transition: border-color .12s ease, box-shadow .12s ease;
}
textarea { resize: vertical; min-height: 96px; }
select { padding-right: 32px; }
input:hover, select:hover, textarea:hover { border-color: #aeb5bf; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11, 98, 113, .18); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.field-hint { font-size: .8125rem; color: var(--text-muted); }
.field-error { font-size: .8125rem; color: var(--danger); font-weight: 500; }

.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice-list-inline { flex-direction: row; flex-wrap: wrap; }
.choice {
    display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
    padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-small); background: var(--surface);
}
.choice:hover { border-color: var(--border-strong); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice:has(input:disabled) { cursor: default; opacity: .75; }
.choice input { margin: 3px 0 0; accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.choice > span { display: flex; flex-direction: column; gap: 1px; }
.choice .muted { font-size: .8125rem; }
.choice-list-inline .choice { flex: 1 1 220px; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.field-inline { flex: 0 1 220px; }
.field-inline label { font-size: .8125rem; color: var(--text-muted); }

.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }

/* ---------- Buttons ---------- */

.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 0 16px; border-radius: var(--radius-small);
    font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
    border: 1px solid transparent; white-space: nowrap;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.button .icon { width: 18px; height: 18px; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-hover); color: #fff; }
.button-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.button-secondary:hover { background: var(--surface-sunken); color: var(--text); }
.button-ghost { background: transparent; color: var(--text-muted); }
.button-ghost:hover { background: var(--surface-sunken); color: var(--text); }
.button-danger-outline { background: var(--surface); color: var(--danger); border-color: #eab3ad; }
.button-danger-outline:hover { background: var(--danger-soft); color: var(--danger); }
.button-small { min-height: 32px; padding: 0 12px; font-size: .875rem; }
.button-block { width: 100%; }
.button:disabled { opacity: .6; cursor: not-allowed; }
.icon-button {
    width: 40px; height: 40px; display: grid; place-items: center;
    background: none; border: 0; border-radius: var(--radius-small); color: var(--text); cursor: pointer;
}
.icon-button:hover { background: var(--surface-sunken); }
.link { font-size: .875rem; text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }

.secret { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.secret code {
    font-size: 1.0625rem; letter-spacing: .04em; padding: 8px 12px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-small);
}

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -8px; margin-bottom: 24px; font-size: .875rem; flex-wrap: wrap; }
.pagination-links { display: flex; align-items: center; gap: 10px; }

.debug { margin-top: 20px; text-align: left; }
.debug pre { white-space: pre-wrap; font-size: .75rem; background: var(--surface-sunken); padding: 12px; border-radius: var(--radius-small); overflow-x: auto; }

/* ---------- Anmeldung / Fehlerseiten ---------- */

body.auth { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.auth-main { width: 100%; max-width: 400px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; font-size: 1.0625rem; margin-bottom: 24px; }
.auth-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: var(--shadow); padding: 28px;
}
.auth-card h1 { margin-bottom: 4px; }
.auth-card > .muted { margin-bottom: 20px; }
.auth-card .alert { margin-bottom: 16px; }
.auth-card p + .alert, .auth-card p + form { margin-top: 16px; }
.auth-card .actions { margin-top: 20px; }
.auth-card > p + p { margin-top: 12px; }
.auth-footnote { text-align: center; font-size: .8125rem; margin-top: 16px; }

/* ---------- Lager & Bestand ---------- */

.stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.field-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.actions-cell { text-align: right; white-space: nowrap; }
.h1-code { font-size: 1.375rem; font-weight: 600; }
.qty-plus { color: var(--success); font-weight: 600; }
.qty-minus { color: var(--danger); font-weight: 600; }
.figure-available { color: var(--success); font-weight: 600; }
.figure-zero { color: var(--text-muted); }
.figure-warn { color: var(--warning); font-weight: 600; }
.stat-accent .stat-value { color: var(--success); }
.stat-warning { border-color: #f1d39a; background: var(--warning-soft); }
.formula { font-size: .8125rem; color: var(--text-muted); margin: -12px 0 24px; }
.subtle-row td { background: var(--surface-sunken); }
.table input[type="number"], .table input[type="text"], .table select { min-height: 34px; padding: 4px 8px; font-size: .875rem; }
.table .input-qty { width: 84px; text-align: right; }
.table .input-note { min-width: 140px; }
.table .input-location { min-width: 150px; }
tr.is-highlight td { background: var(--accent-soft); transition: background-color .6s ease; }
tr.is-diff td.diff-cell { color: var(--warning); font-weight: 600; }
.scan-bar {
    display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
    padding: 16px 20px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.scan-bar .field { flex: 1 1 260px; }
.scan-bar .field-qty { flex: 0 0 110px; }
.scan-bar input[name="code"] { font-family: var(--mono); font-size: 1.0625rem; min-height: 46px; }
.scan-feedback { font-size: .875rem; min-height: 1.4em; margin: -8px 0 16px; }
.scan-feedback.is-ok { color: var(--success); }
.scan-feedback.is-error { color: var(--danger); }
.sticky-actions {
    position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
    padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--border);
}
.sticky-hint { margin-right: auto; align-self: center; }
.tag-inline { display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--neutral-soft); font-size: .75rem; color: var(--text-muted); }
.mini-form { display: inline; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--danger); cursor: pointer; font-size: .875rem; }
.link-button:hover { text-decoration: underline; }

/* ---------- Installer ---------- */

.install-main { max-width: 600px; }
.install-steps { list-style: none; margin: 0 0 16px; padding: 0; display: flex; gap: 6px; counter-reset: step; }
.install-steps li {
    flex: 1; counter-increment: step; font-size: .8125rem; color: var(--text-muted);
    padding-top: 8px; border-top: 3px solid var(--border);
}
.install-steps li::before { content: counter(step) ". "; }
.install-steps li.is-done { border-top-color: var(--accent); }
.install-steps li.is-current { border-top-color: var(--accent); color: var(--text); font-weight: 600; }
.checklist { list-style: none; margin: 16px 0 20px; padding: 0; }
.checklist li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist li > span:last-child { display: flex; flex-direction: column; gap: 1px; }
.check-icon {
    width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
    display: grid; place-items: center; font-size: .75rem; font-weight: 700;
}
.is-ok .check-icon { background: var(--success-soft); color: var(--success); }
.is-warning .check-icon { background: var(--warning-soft); color: var(--warning); }
.is-error .check-icon { background: var(--danger-soft); color: var(--danger); }
.field-row-host { grid-template-columns: 1fr 110px; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
input[type="number"], input[type="url"] {
    width: 100%; font: inherit; color: var(--text); min-height: 40px; padding: 8px 12px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-small);
}
input[type="number"]:focus, input[type="url"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11, 98, 113, .18); }
.auth-card form + .actions, .auth-card .alert + .actions { margin-top: 16px; }

.steps-list { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
code.path { display: block; margin-top: 6px; padding: 8px 10px; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-small); overflow-wrap: anywhere; }
pre.code { font-family: var(--mono); font-size: .75rem; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-small); padding: 12px; overflow-x: auto; margin: 8px 0; }
details summary { cursor: pointer; font-weight: 500; }

/* ---------- Responsiv ---------- */

@media (max-width: 1100px) {
    .stat-grid, .stat-grid-3, .stat-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .field-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .columns { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .icon-button.nav-toggle { display: grid; }
    .sidebar {
        position: fixed; left: 0; top: var(--topbar-h); z-index: 25;
        height: calc(100vh - var(--topbar-h)); transform: translateX(-100%);
        transition: transform .18s ease; box-shadow: var(--shadow-raised);
    }
    body.nav-open .sidebar { transform: translateX(0); }
    body.nav-open .sidebar-backdrop {
        display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 20; background: rgba(16, 24, 40, .3);
    }
    .main { padding: 20px 16px 40px; }
    .user-name, .topbar-context { display: none; }
    .details { grid-template-columns: 1fr; gap: 2px; }
    .details dd { margin-bottom: 10px; }
    .field-row, .field-row-3 { grid-template-columns: 1fr; }
    .card { padding: 16px; }
    .card-flush { padding: 0; }
    .card-header-padded { padding: 14px 16px; }
    .table th:first-child, .table td:first-child { padding-left: 16px; }
    .table th:last-child, .table td:last-child { padding-right: 16px; }
    .field-inline { flex: 1 1 160px; }
}

@media (max-width: 480px) {
    .stat-grid, .stat-grid-3, .stat-grid-5 { grid-template-columns: 1fr; }
    .page-header .button { width: 100%; }
    .roadmap-item { grid-template-columns: 1fr auto; }
    .roadmap-phase { grid-column: 1 / -1; }
}

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