/* LockByte – Basis-Stylesheet (ohne Build-Schritt)
   Markenfarben aus dem Logo: Gold #C49F17, Dunkelbraun #52420A */

:root {
    /* Datenreihen (Graphen): feste Reihenfolge, farbfehlsichtig geprüfte Referenzpalette */
    --series-1: #257de0; --series-2: #f47230; --series-3: #00b894; --series-4: #6a4ce2;
    --brand-gold: #c49f17;
    --brand-brown: #52420a;
    --brand-lock: var(--brand-brown);   /* „LOCK“ in der Wortmarke */

    --bg: #f3f4f7;
    --surface: #ffffff;
    --surface-2: #f0f2f6;
    --border: #dde1e8;
    --text: #161a22;
    --text-muted: #596273;
    --primary: #2457c5;            /* Aktionen: Blau – Gold bleibt dem Logo vorbehalten */
    --primary-hover: #1c4aa9;
    --primary-text: #ffffff;
    --primary-soft: #e7eefc;
    --link: #1f4fb5;
    --success: #1d7a4f;
    --success-soft: #e7f4ec;
    --danger: #b9312f;
    --danger-soft: #fbeceb;
    --info: #2e5f9e;
    --info-soft: #e9f0f9;
    --shadow: 0 1px 2px rgb(16 24 40 / 5%), 0 1px 3px rgb(16 24 40 / 8%);
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-w: 248px;
    --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-brand: "Bahnschrift", "DIN Alternate", "D-DIN", "Barlow", "Segoe UI", system-ui, sans-serif;
    --mono: "Cascadia Code", "JetBrains Mono", Consolas, ui-monospace, monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --series-1: #338ced; --series-2: #e76624; --series-3: #00a888; --series-4: #9887ef;
        --brand-lock: #e8dcb4;
        --bg: #0e1116;
        --surface: #161a21;
        --surface-2: #1e232c;
        --border: #2d3340;
        --text: #eceff4;
        --text-muted: #a3abb9;
        --primary: #5b8def;
        --primary-hover: #7aa3f5;
        --primary-text: #0b1220;
        --primary-soft: #1a2540;
        --link: #8db0f7;
        --success: #4cc58a;
        --success-soft: #13261b;
        --danger: #f07471;
        --danger-soft: #301918;
        --info: #7aa7e6;
        --info-soft: #17212f;
        --shadow: 0 1px 2px rgb(0 0 0 / 45%);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --series-1: #338ced; --series-2: #e76624; --series-3: #00a888; --series-4: #9887ef;
    --brand-lock: #e8dcb4;
    --bg: #0e1116;
    --surface: #161a21;
    --surface-2: #1e232c;
    --border: #2d3340;
    --text: #eceff4;
    --text-muted: #a3abb9;
    --primary: #5b8def;
    --primary-hover: #7aa3f5;
    --primary-text: #0b1220;
    --primary-soft: #1a2540;
    --link: #8db0f7;
    --success: #4cc58a;
    --success-soft: #13261b;
    --danger: #f07471;
    --danger-soft: #301918;
    --info: #7aa7e6;
    --info-soft: #17212f;
    --shadow: 0 1px 2px rgb(0 0 0 / 45%);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }   /* hidden gilt immer, auch bei Klassen mit eigenem display */

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

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

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 32px; height: 32px; }

/* ---------- Typografie ---------- */
.h2 { font-size: 1.6rem; font-weight: 650; margin: 0; letter-spacing: -0.01em; }
.h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.muted { color: var(--text-muted); }
.small { font-size: .867rem; }
.eyebrow { margin: 0 0 4px; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; padding: 0 16px;
    font: inherit; font-weight: 600; font-size: .933rem;
    border-radius: var(--radius-sm); border: 1px solid transparent;
    cursor: pointer; transition: background .15s, border-color .15s, color .15s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible, .icon-btn:focus-visible, .link:focus-visible, input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: .867rem; }
.btn-block { width: 100%; }

.icon-btn {
    display: inline-grid; place-items: center; width: 34px; height: 34px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }

.link { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; }
.link:hover { text-decoration: underline; }

/* ---------- Formulare ---------- */
.form { display: grid; gap: 16px; margin-top: 20px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .867rem; font-weight: 600; }
input:not([type]), input[type="text"], input[type="url"], input[type="month"], input[type="time"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
    width: 100%; height: 38px; padding: 0 12px;
    font: inherit; color: var(--text);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 96px; padding: 10px 12px; }
input[type="file"] {
    width: 100%; padding: 6px; font: inherit; font-size: .933rem; color: var(--text-muted);
    background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
input[type="file"]::file-selector-button {
    height: 30px; margin-right: 12px; padding: 0 14px; font: inherit; font-weight: 600; font-size: .867rem;
    color: var(--text); background: var(--surface-2, var(--bg)); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
input[type="file"]:hover { border-color: var(--primary); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.is-invalid { border-color: var(--danger) !important; }
.field-error { margin: 0; color: var(--danger); font-size: .867rem; }
.hint { margin: 0; color: var(--text-muted); font-size: .867rem; }
.input-code { font-family: var(--mono); font-size: 1.467rem; letter-spacing: .3em; text-align: center; height: 52px; }
.form-inline-center { display: flex; justify-content: center; margin-top: 16px; }

/* ---------- Meldungen ---------- */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .933rem; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }

.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-muted { background: var(--surface-2); color: var(--text-muted); }

.secret-text { font-family: var(--mono); font-size: .933rem; white-space: pre-wrap; word-break: break-all; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); user-select: all; text-align: left; margin: 16px 0 8px; }
.card-warning { border-color: color-mix(in srgb, var(--warning) 45%, transparent); background: color-mix(in srgb, var(--warning-soft) 60%, var(--surface)); }

/* Kundengruppen (Tags) */
.tag { --tag: #6b7280; display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; font-size: .75rem; font-weight: 600; white-space: nowrap; background: color-mix(in srgb, var(--tag) 16%, transparent); color: var(--tag); border: 1px solid color-mix(in srgb, var(--tag) 30%, transparent); }
.tag-sm { height: 18px; padding: 0 6px; font-size: .7rem; font-weight: 500; }
.tag-gray { --tag: #6b7280; } .tag-blue { --tag: #2563eb; } .tag-teal { --tag: #0d9488; } .tag-green { --tag: #16a34a; }
.tag-yellow { --tag: #b45309; } .tag-orange { --tag: #ea580c; } .tag-red { --tag: #dc2626; } .tag-purple { --tag: #7c3aed; }
[data-theme="dark"] .tag-yellow { --tag: #fbbf24; } [data-theme="dark"] .tag-blue { --tag: #60a5fa; } [data-theme="dark"] .tag-purple { --tag: #a78bfa; } [data-theme="dark"] .tag-red { --tag: #f87171; } [data-theme="dark"] .tag-green { --tag: #4ade80; } [data-theme="dark"] .tag-teal { --tag: #2dd4bf; } [data-theme="dark"] .tag-orange { --tag: #fb923c; } [data-theme="dark"] .tag-gray { --tag: #9ca3af; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.tag-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pick label { cursor: pointer; }
.tag-pick input { position: absolute; opacity: 0; pointer-events: none; }
.tag-pick input:not(:checked) + .tag { opacity: .45; background: transparent; }
.tag-pick input:focus-visible + .tag { outline: 2px solid var(--focus, var(--brand-gold)); outline-offset: 2px; }

/* ---------- Marke ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark-wrap { display: inline-flex; color: var(--brand-gold); }
.brand-mark { width: 20px; height: 26px; fill: currentColor; stroke: none; }
.brand-word {
    font-family: var(--font-brand);
    font-weight: 700; font-size: 1.133rem; line-height: 1;
    letter-spacing: .16em; text-transform: uppercase;
}
.brand-lock { color: var(--brand-lock); }
.brand-byte { color: var(--brand-gold); }
.brand-lg { gap: 14px; margin-bottom: 28px; }
.brand-lg .brand-mark { width: 30px; height: 39px; }
.brand-lg .brand-word { font-size: 1.6rem; }

/* ---------- Anmeldeseiten ---------- */
.auth { min-height: 100vh; display: grid; place-content: center; justify-items: center; padding: 24px 16px; }
.auth-card {
    width: min(420px, 100%);
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    padding: 32px; box-shadow: var(--shadow);
}
.auth-title { font-size: 1.467rem; margin: 0 0 4px; }
.auth-foot { color: var(--text-muted); font-size: .867rem; margin-top: 20px; }
.steps { margin: 20px 0 0; padding-left: 20px; display: grid; gap: 14px; }
.steps li { display: grid; gap: 6px; }
.secret {
    display: block; padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px dashed var(--border);
    font-size: 1rem; letter-spacing: .08em; word-break: break-all; cursor: copy;
}
.secret.is-copied { border-color: var(--success); color: var(--success); }
.error-code { font-size: 3rem; font-weight: 700; margin: 0; color: var(--brand-gold); }
.error-text { margin: 4px 0 24px; color: var(--text-muted); }

/* ---------- App-Rahmen ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: calc(100dvh / var(--zoom, 1)); }
.sidebar {
    position: sticky; top: 0; height: calc(100dvh / var(--zoom, 1));
    display: flex; flex-direction: column; gap: 18px;
    padding: 18px 12px; background: var(--surface); border-right: 1px solid var(--border);
    overflow-y: auto;
}
.sidebar > .brand { padding: 4px 8px; }
.nav, .nav-section { display: grid; gap: 1px; }
.nav-section { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 10px; border-radius: var(--radius-sm);
    color: var(--text-muted); font-weight: 550; font-size: .933rem; line-height: 1.35;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.is-active { background: var(--primary-soft); color: var(--link); }
.nav-link.is-disabled { opacity: .55; cursor: default; }
.nav-link.is-disabled:hover { background: transparent; color: var(--text-muted); }
.nav-link .badge { margin-left: auto; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 5;
    display: flex; align-items: center; gap: 12px;
    height: 64px; padding: 0 28px;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.page-title { font-size: 1rem; font-weight: 600; margin: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.sidebar-toggle { display: none; }
.user-chip { display: flex; align-items: center; gap: 8px; font-weight: 550; font-size: .933rem; }
.avatar {
    display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary-soft); color: var(--link); font-weight: 700; font-size: .867rem;
}
.content { padding: 24px 28px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; width: 100%; align-content: start; }

/* ---------- Bausteine ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-label { margin: 0; color: var(--text-muted); font-size: .867rem; font-weight: 550; }
.stat-value { margin: 6px 0 2px; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stat-hint { margin: 0; color: var(--text-muted); font-size: .8rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.empty { display: grid; justify-items: center; gap: 8px; padding: 32px 12px; color: var(--text-muted); text-align: center; }
.empty p { margin: 0; }

/* ---------- Responsiv ---------- */
@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar-w);
        transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow);
    }
    .sidebar.is-open { transform: none; }
    .sidebar-toggle { display: inline-grid; }
    .topbar { padding: 0 16px; }
    .content { padding: 16px; }
    .grid-2 { grid-template-columns: 1fr; }
    .user-name { display: none; }
}
@media (max-width: 480px) {
    .stats { grid-template-columns: 1fr; }
    .auth-card { padding: 24px 20px; }
}

/* =====================================================================
   Module: Kunden, Artikel, Angebote, Verträge, Rechnungen, Abrechnung
   ===================================================================== */
:root { --warning: #9a6a00; --warning-soft: #fbf1d9; }
:root[data-theme="dark"] { --warning: #e6b84a; --warning-soft: #2d2410; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --warning: #e6b84a; --warning-soft: #2d2410; } }

.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; min-width: 0; }
.grow { flex: 1; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; }
.center { text-align: center; }
.pre { white-space: pre-line; margin: 0; }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.danger, .link.danger { color: var(--danger); }
.note { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .933rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions form { margin: 0; }
.cell-actions { white-space: nowrap; }
.cell-actions .actions { flex-wrap: nowrap; justify-content: flex-end; }
.page-head { flex-wrap: wrap; }

/* Badges & Buttons */
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }
.btn.is-current { background: var(--primary-soft); border-color: var(--primary); color: var(--link); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn-sm { width: 28px; height: 28px; }
.icon-btn-sm .icon { width: 15px; height: 15px; }
a.icon-btn { color: var(--text); text-decoration: none; }

/* Werkzeugleiste & Segmente */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.toolbar-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.toolbar-filters input[type="search"] { width: 240px; }
input[type="search"] {
    height: 38px; padding: 0 12px; font: inherit; color: var(--text);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.toolbar-filters select { width: auto; height: 38px; }
.segmented { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.segmented a, .segmented label > span {
    display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 6px;
    color: var(--text-muted); font-weight: 550; font-size: .867rem; cursor: pointer;
}
.segmented a:hover { color: var(--text); text-decoration: none; }
.segmented a.is-current, .segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented label { display: inline-flex; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px; }

/* Karten & Layout */
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .empty { padding: 40px 16px; }
.card-head-pad { padding: 16px 20px 0; }
.card-body { display: grid; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); }
.card-body > p { margin: 0; }
.card-flush .card-body .table td:first-child, .card-flush .card-body .table th:first-child { padding-left: 0; }
.card-flush .card-body .table td:last-child, .card-flush .card-body .table th:last-child { padding-right: 0; }
.card-head { gap: 12px; flex-wrap: wrap; }
.layout-aside { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.stats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Tabellen */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .933rem; }
.table th { text-align: left; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table th.num { text-align: right; }
.card-flush .table th:first-child, .card-flush .table td:first-child { padding-left: 20px; }
.card-flush .table th:last-child, .card-flush .table td:last-child { padding-right: 20px; }
.table-hover tbody tr[data-href] { cursor: pointer; }
.table-hover tbody tr:hover td { background: var(--surface-2); }
.table form { margin: 0; display: inline; }
.w-pos { width: 48px; }

/* Definitionslisten, Listen, Verlauf */
.dl { display: grid; gap: 10px; margin: 0; }
.dl > div { display: grid; grid-template-columns: 120px 1fr; gap: 8px; }
.dl dt { color: var(--text-muted); font-size: .867rem; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dl-cols { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 12px; }
.dl-cols > div { grid-template-columns: 1fr; gap: 2px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list form { margin: 0; }
.timeline { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.timeline > li { padding-left: 14px; border-left: 2px solid var(--primary-soft); display: grid; gap: 2px; }

/* Aufklapper */
.disclosure { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.card > .disclosure:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.disclosure > summary { cursor: pointer; font-weight: 600; font-size: .933rem; color: var(--link); list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary { display: flex; align-items: center; gap: 8px; }
.disclosure > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin: 0 2px; }
.disclosure[open] > summary::before { transform: rotate(45deg); }
.disclosure > form { margin-top: 12px; }

/* Formulare */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-address { grid-template-columns: 3fr 1fr; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.span-street { grid-column: span 1; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
/* Feste Aktionsleiste unten in langen Formularen (Summe links, Speichern rechts) */
.form-bar { position: sticky; bottom: 0; z-index: 4; padding: 12px 20px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 -6px 18px rgb(0 0 0 / 8%); }
.form-bar-total { margin-right: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
.form-actions-card { justify-content: space-between; }
.form-tight { margin-top: 0; gap: 8px; }
.form-tight textarea { min-height: 60px; }
.field-inline { display: flex; align-items: center; gap: 10px; }
.field-inline label { white-space: nowrap; }
.field-inline input { width: auto; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: .933rem; cursor: pointer; }
.check input { margin-top: 3px; }
select { padding-right: 28px; }
input[readonly] { background: var(--surface-2); }
.copy-field { display: flex; gap: 8px; margin: 8px 0; }
.copy-field input { font-family: var(--mono); font-size: .8rem; }
[data-copy].is-copied { color: var(--success); border-color: var(--success); }
[data-company-only][hidden] { display: none; }

/* Positionseditor
   Spalten: Griff | Artikel | Bezeichnung | [Abrechnung] | Menge | Einheit | Preis | [EK] | USt. | Netto | Werkzeuge */
.items-editor { display: grid; gap: 8px; }
.items-head, .item-row {
    display: grid; gap: 8px; align-items: start;
    grid-template-columns: 16px minmax(110px, 170px) minmax(180px, 1fr) 72px 84px minmax(84px, 110px) 72px minmax(96px, 130px) 92px;
}
.items-editor.has-mode .items-head, .items-editor.has-mode .item-row {
    grid-template-columns: 16px minmax(110px, 160px) minmax(160px, 1fr) minmax(100px, 124px) 72px 80px minmax(84px, 104px) 72px minmax(96px, 130px) 92px;
}
.items-editor.has-margin .items-head, .items-editor.has-margin .item-row {
    grid-template-columns: 16px minmax(110px, 160px) minmax(160px, 1fr) 72px 80px minmax(84px, 104px) minmax(76px, 96px) 72px minmax(110px, 150px) 92px;
}
.items-editor.has-mode.has-margin .items-head, .items-editor.has-mode.has-margin .item-row {
    grid-template-columns: 16px minmax(100px, 150px) minmax(150px, 1fr) minmax(100px, 120px) 68px 78px minmax(84px, 100px) minmax(76px, 92px) 68px minmax(110px, 150px) 92px;
}
.items-head { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: 0 10px; }
.items-head .num { text-align: right; }
.items-body { display: grid; gap: 8px; }
.item-row { padding: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.item-row.dragging { opacity: .5; outline: 2px dashed var(--primary); }
.item-row.is-group { background: var(--primary-soft); border-color: var(--primary); }
.item-row.is-group input { font-weight: 650; }
.item-row.is-group .item-wide { grid-column: 2 / -3; }
.item-row.is-text .item-wide { grid-column: 2 / -2; }
.item-row.is-text textarea { margin-top: 0; font-style: italic; }
.item-row input, .item-row select { height: 32px; font-size: .933rem; padding: 0 8px; }
.item-row select { padding-right: 20px; }
.item-row select:disabled { opacity: .6; }
.item-row textarea { min-height: 36px; height: 36px; margin-top: 6px; padding: 7px 8px; font-size: .867rem; resize: vertical; }
.item-title { display: grid; }
.item-label { display: none; font-size: .75rem; font-weight: 600; color: var(--text-muted); margin-bottom: 2px; }
.item-price input, .item-qty input, .item-purchase input { text-align: right; }
.item-purchase input { background: transparent; border-style: dashed; }
.item-sum { text-align: right; padding-top: 8px; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.item-sum-label { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.item-margin { display: block; margin-top: 4px; font-size: .75rem; font-weight: 500; color: var(--success, #2e7d32); }
.item-margin.neg { color: var(--danger); }
.item-handle { padding-top: 9px; color: var(--text-muted); cursor: grab; display: flex; justify-content: center; }
.item-handle .icon { width: 16px; height: 16px; }
.item-tools { display: flex; gap: 2px; padding-top: 4px; justify-content: flex-end; }
.items-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 4px; }
.items-summary { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.totals-margin { min-width: 200px; padding: 8px 12px; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--text-muted); }

/* Summen */
.totals { display: grid; gap: 4px; min-width: 260px; margin: 0; font-variant-numeric: tabular-nums; }
.totals > div { display: flex; justify-content: space-between; gap: 24px; }
.totals dt { color: var(--text-muted); }
.totals dd { margin: 0; }
.totals-gross { padding-top: 6px; margin-top: 2px; border-top: 1px solid var(--border); font-weight: 700; font-size: 1rem; }
.totals-gross dt { color: var(--text); }
.totals-static { margin: 12px 0 0 auto; max-width: 380px; }
aside .totals-static { max-width: none; margin: 0 0 8px; }

/* Artikelstatistik: Balken */
.bars { display: grid; grid-template-columns: repeat(12, 1fr); align-items: end; gap: 6px; height: 180px; padding-top: 8px; }
.bar { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 4px; }
.bar-fill { align-self: end; display: block; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--primary); }
.bar-label { font-size: .75rem; color: var(--text-muted); text-align: center; }
.h-0 { height: 0%; }
.h-1 { height: 1%; }
.h-2 { height: 2%; }
.h-3 { height: 3%; }
.h-4 { height: 4%; }
.h-5 { height: 5%; }
.h-6 { height: 6%; }
.h-7 { height: 7%; }
.h-8 { height: 8%; }
.h-9 { height: 9%; }
.h-10 { height: 10%; }
.h-11 { height: 11%; }
.h-12 { height: 12%; }
.h-13 { height: 13%; }
.h-14 { height: 14%; }
.h-15 { height: 15%; }
.h-16 { height: 16%; }
.h-17 { height: 17%; }
.h-18 { height: 18%; }
.h-19 { height: 19%; }
.h-20 { height: 20%; }
.h-21 { height: 21%; }
.h-22 { height: 22%; }
.h-23 { height: 23%; }
.h-24 { height: 24%; }
.h-25 { height: 25%; }
.h-26 { height: 26%; }
.h-27 { height: 27%; }
.h-28 { height: 28%; }
.h-29 { height: 29%; }
.h-30 { height: 30%; }
.h-31 { height: 31%; }
.h-32 { height: 32%; }
.h-33 { height: 33%; }
.h-34 { height: 34%; }
.h-35 { height: 35%; }
.h-36 { height: 36%; }
.h-37 { height: 37%; }
.h-38 { height: 38%; }
.h-39 { height: 39%; }
.h-40 { height: 40%; }
.h-41 { height: 41%; }
.h-42 { height: 42%; }
.h-43 { height: 43%; }
.h-44 { height: 44%; }
.h-45 { height: 45%; }
.h-46 { height: 46%; }
.h-47 { height: 47%; }
.h-48 { height: 48%; }
.h-49 { height: 49%; }
.h-50 { height: 50%; }
.h-51 { height: 51%; }
.h-52 { height: 52%; }
.h-53 { height: 53%; }
.h-54 { height: 54%; }
.h-55 { height: 55%; }
.h-56 { height: 56%; }
.h-57 { height: 57%; }
.h-58 { height: 58%; }
.h-59 { height: 59%; }
.h-60 { height: 60%; }
.h-61 { height: 61%; }
.h-62 { height: 62%; }
.h-63 { height: 63%; }
.h-64 { height: 64%; }
.h-65 { height: 65%; }
.h-66 { height: 66%; }
.h-67 { height: 67%; }
.h-68 { height: 68%; }
.h-69 { height: 69%; }
.h-70 { height: 70%; }
.h-71 { height: 71%; }
.h-72 { height: 72%; }
.h-73 { height: 73%; }
.h-74 { height: 74%; }
.h-75 { height: 75%; }
.h-76 { height: 76%; }
.h-77 { height: 77%; }
.h-78 { height: 78%; }
.h-79 { height: 79%; }
.h-80 { height: 80%; }
.h-81 { height: 81%; }
.h-82 { height: 82%; }
.h-83 { height: 83%; }
.h-84 { height: 84%; }
.h-85 { height: 85%; }
.h-86 { height: 86%; }
.h-87 { height: 87%; }
.h-88 { height: 88%; }
.h-89 { height: 89%; }
.h-90 { height: 90%; }
.h-91 { height: 91%; }
.h-92 { height: 92%; }
.h-93 { height: 93%; }
.h-94 { height: 94%; }
.h-95 { height: 95%; }
.h-96 { height: 96%; }
.h-97 { height: 97%; }
.h-98 { height: 98%; }
.h-99 { height: 99%; }
.h-100 { height: 100%; }

/* Abrechnung */
.steps-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.steps-bar > div { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.steps-bar .muted { grid-column: 2; }
.step-no { grid-row: span 2; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--link); font-weight: 700; }
.qty-input { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.qty-input input { width: 96px; height: 32px; text-align: right; padding: 0 8px; }
.qty-input input.needs-value { border-color: var(--warning); background: var(--warning-soft); }
.log { margin: 0; padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm); font-family: var(--mono); font-size: .8rem; white-space: pre-wrap; }
.month-nav { display: flex; align-items: center; gap: 10px; }

/* Öffentliche Zahlungsseite */
.pay-card { width: min(480px, 100%); }
.quote-card { width: min(900px, 100%); }
.pay-card-wide { width: min(680px, 100%); }
.quote-sheet { margin: 16px 0; }
.quote-sheet .doc-sheet { box-shadow: none; border: 1px solid var(--border); }
.pay-amount { display: grid; gap: 2px; margin: 20px 0; padding: 16px; border-radius: var(--radius); background: var(--primary-soft); text-align: center; }
.pay-amount strong { font-size: 2rem; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.pay-section { padding: 16px 0; border-top: 1px solid var(--border); display: grid; gap: 12px; }
.pay-contact { margin: 16px 0 0; }
/* Rechtstexte: öffentliche Seite und Linkleiste */
.legal-card { width: min(820px, 100%); }
.legal-text { margin-top: 16px; }
.legal-text h2 { margin: 22px 0 6px; font-size: 1.0625rem; }
.legal-text p { margin: 0 0 10px; line-height: 1.6; font-size: .9375rem; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); font-size: .8125rem; }
.legal-links a { color: var(--text-muted); }
.legal-links a:hover { color: var(--link); }
.legal-links span { color: var(--text); font-weight: 600; }
.portal-foot { max-width: 1248px; width: 100%; margin: 0 auto; padding: 0 24px 28px; }
.portal-foot .legal-links { justify-content: flex-start; margin-top: 8px; }

/* Responsiv (Module) */
@media (max-width: 1100px) {
    .layout-aside { grid-template-columns: 1fr; }
    .steps-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1400px) {
    .items-head { display: none; }
    .item-row, .items-editor.has-mode .item-row, .items-editor.has-margin .item-row, .items-editor.has-mode.has-margin .item-row { grid-template-columns: 16px repeat(6, minmax(0, 1fr)); }
    .item-row.is-group .item-wide { grid-column: 2 / span 4; }
    .item-row.is-text .item-wide { grid-column: 2 / span 5; }
    .item-label { display: block; }
    .item-qty { grid-column-start: 2; }
    .item-product, .item-mode { grid-column: span 2; }
    .item-title { grid-column: span 4; }
    .items-editor:not(.has-mode) .item-title { grid-column: span 4; }
    .item-sum { padding-top: 22px; }
    .item-tools { padding-top: 20px; }
    .item-row.is-group .item-tools, .item-row.is-text .item-tools { padding-top: 4px; }
}
@media (max-width: 860px) {
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .span-2, .span-3 { grid-column: auto; }
    .item-row, .items-editor.has-mode .item-row, .items-editor.has-margin .item-row, .items-editor.has-mode.has-margin .item-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .item-product, .item-mode, .item-title, .item-row .item-wide, .item-tools { grid-column: 1 / -1; }
    .item-handle { display: none; }
    .item-qty { grid-column-start: auto; }
    .stats-2 { grid-template-columns: 1fr; }
    .toolbar-filters input[type="search"] { width: 100%; }
}


/* =====================================================================
   Layout Runde 3: volle Breite, Seitenkopf-Band, 8/4-Spalten, Label/Wert-Raster, Tabs, Dialoge
   ===================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.company-filter { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text-muted); }
.company-filter select { height: 34px; min-width: 190px; font-weight: 550; }

.page-heading {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
    padding: 18px 28px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.page-heading-title { margin: 0; font-size: 1.467rem; font-weight: 650; letter-spacing: -0.01em; }
.page-heading-sub { margin: 2px 0 0; color: var(--text-muted); font-size: .933rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; font-size: .867rem; color: var(--text-muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--border-strong, #c9c3b2); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb strong { color: var(--text); font-weight: 600; }
.page-heading-actions { justify-content: flex-end; }

/* 8/4-Raster wie im alten Admin-Panel */
.row-8-4 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.row-6-6 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.row-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }

/* Übersicht als Label/Wert-Raster */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 20px; margin: 0; }
.kv > div { min-width: 0; }
.kv dt { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 3px; }
.kv dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.kv .kv-wide { grid-column: 1 / -1; }

.card-head .actions { margin-left: auto; }
.card-flush { padding: 0; }
.card-flush > .card-head { padding: 16px 20px 0; }
.card-flush > .table-wrap, .card-flush > .empty { margin: 0; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: -4px; }
.tab { padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--text-muted); font-weight: 600; font-size: .933rem; margin-bottom: -1px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { color: var(--link); border-bottom-color: var(--primary); }
.tab .badge { margin-left: 6px; }

/* Dialoge (<dialog>) */
dialog.modal {
    width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
}
dialog.modal-wide { width: min(1180px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(20, 16, 4, .45); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 1.133rem; }
.modal-body { padding: 20px; display: grid; gap: 16px; overflow: auto; max-height: calc(100vh - 190px); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* Grenzen § 19 */
.limit { display: grid; gap: 4px; }
.limit-bar { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.limit-bar > span { display: block; height: 100%; background: var(--success); width: 0; }
.limit.is-warn .limit-bar > span { background: var(--warning); }
.limit.is-over .limit-bar > span { background: var(--danger); }
.limit-row { display: flex; justify-content: space-between; gap: 8px; font-size: .867rem; }

/* PDF-Vorschau */
.pdf-frame { width: 100%; height: 78vh; min-height: 560px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #525659; }
.checklist { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: .933rem; }
.checklist li { display: flex; gap: 8px; align-items: flex-start; }
.checklist .ok { color: var(--success); }
.checklist .bad { color: var(--danger); }
.checklist .warn { color: var(--warning); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; border: 1px solid var(--border); }
.logo-preview { max-width: 240px; max-height: 100px; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.token-box { display: grid; gap: 6px; padding: 12px; border: 1px dashed var(--primary); border-radius: var(--radius-sm); background: var(--primary-soft); }
.rate-rules { display: grid; gap: 8px; }
.rate-rule { display: grid; grid-template-columns: minmax(140px, 1.4fr) auto 92px 92px 110px 36px; gap: 8px; align-items: center; padding: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.weekday-picks { display: flex; gap: 2px; flex-wrap: wrap; }
.weekday-picks label { display: inline-flex; align-items: center; gap: 2px; font-size: .8rem; padding: 2px 5px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.weekday-picks input { width: auto; height: auto; }

@media (max-width: 1200px) {
    .row-8-4 { grid-template-columns: 1fr; }
    .row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rate-rule { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    .page-heading { padding: 14px 16px; }
    .row-6-6, .row-4 { grid-template-columns: 1fr; }
    .company-filter select { min-width: 0; max-width: 150px; }
}

.card-flush > .token-box { margin: 4px 20px 12px; }
fieldset.field { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
fieldset.field legend { font-weight: 600; font-size: .867rem; margin-bottom: 4px; }

/* Ticket-Verlauf */
.thread { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.thread-item { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.thread-item p { margin: 6px 0 0; }
.thread-customer { background: var(--primary-soft); border-color: transparent; }
.thread-system { background: transparent; border-style: dashed; color: var(--text-muted); font-size: .867rem; }
.thread-item.is-internal { border-left: 3px solid var(--warning); }
.thread-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .867rem; }
.inline-checks label { display: inline-flex; gap: 6px; align-items: center; }
.inline-checks input { width: auto; height: auto; }

/* Kundenportal */
.portal-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding: 12px 28px; background: var(--surface); border-bottom: 1px solid var(--border); }
.portal-top .brand { padding: 0; }
.portal-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.portal-nav a { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-muted); font-weight: 600; }
.portal-nav a:hover { text-decoration: none; color: var(--text); background: var(--surface-2); }
.portal-nav a.is-active { color: var(--link); background: var(--primary-soft); }
.portal-user { display: flex; align-items: center; gap: 12px; text-align: right; }
.portal-user form { margin: 0; }
.list-pad > li { padding-left: 20px; padding-right: 20px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.shop-item { display: grid; gap: 10px; align-content: start; }
.shop-item h2 { margin: 0; }
.shop-price { margin: 0; font-size: 1.133rem; }
.nowrap { white-space: nowrap; }
.table-compact th, .table-compact td { padding: 6px 10px; font-size: .867rem; white-space: nowrap; }
.steps.small { margin-top: 0; gap: 8px; }

/* Balken (Umsatz je Monat) – Breite über data-width */
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hbars li { display: grid; grid-template-columns: 64px 1fr 110px; gap: 10px; align-items: center; font-size: .867rem; }
.hbars-label { color: var(--text-muted); }
.hbars-track { height: 14px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hbars-fill { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 4px; }
.hbars-value { text-align: right; font-variant-numeric: tabular-nums; }

/* Formulare und Fließtext nicht endlos breit */
.form-narrow, .prose { max-width: 1100px; }

/* Große Bildschirme: nur leicht vergrößern, damit Text lesbar bleibt (Aufteilung regeln die Layouts) */
@media (min-width: 2400px) { :root { --zoom: 1.12; } html { zoom: 1.12; } }
@media (min-width: 3200px) { :root { --zoom: 1.25; } html { zoom: 1.25; } }

/* ---------- Akte (Detailseite): Reiter links, Stammdaten rechts ---------- */
.record { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
@media (min-width: 1800px) { .record { grid-template-columns: minmax(0, 1fr) 420px; } }
@media (max-width: 1100px) { .record { grid-template-columns: 1fr; } }
.record-tabs { padding: 4px 12px 0; margin: 0; }
.tab-panel { padding: 16px 20px 20px; }
.tab-panel[hidden] { display: none; }
.tab-panel > .card-head { justify-content: flex-end; margin-bottom: 8px; }
.tab-panel > .card-head .h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.record-aside .card { padding: 16px 18px; }
.record-tabs { flex-wrap: wrap; row-gap: 0; }
.record-tabs .tab { white-space: nowrap; }
/* Leseansicht ↔ Bearbeiten (data-editable): die Ansicht ist Standard, „Bearbeiten“ blendet das Formular ein */
[data-editable] .dl { margin-top: 4px; }
[data-editable] .dl > div { grid-template-columns: 9rem 1fr; }
.record-aside [data-editable] .dl > div { grid-template-columns: 7.5rem 1fr; }
.kv-edit { margin-top: 16px; }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.form-grid-4 .span-4 { grid-column: 1 / -1; }
/* Aktionen als gleich gebaute Zeilen (Titel + Hinweis links, Bedienung rechts) */
.action-rows { display: grid; }
.action-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); margin: 0; }
.action-row:first-child { border-top: 0; padding-top: 0; }
.action-row:last-child { padding-bottom: 0; }
.action-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.action-ctl { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.action-ctl select { width: auto; }
.item-row.is-break { background: transparent; border-style: dashed; padding: 6px 10px; }
.item-row.is-break .item-wide { grid-column: 2 / -2; }
.item-break-label { font-size: .8rem; font-weight: 600; color: var(--text-muted); letter-spacing: .02em; }
.totals-charge { border-right: 1px solid var(--border); padding-right: 16px; }
.items-table .row-group td { background: var(--primary-soft); font-weight: 650; }
.items-table .row-text td { font-style: italic; color: var(--text-muted); }
.items-table .row-break td { padding: 4px 12px; font-size: .8rem; color: var(--text-muted); text-align: center; border-bottom-style: dashed; }
.item-row.is-break { background: transparent; border-style: dashed; padding: 6px 10px; }
.item-row.is-break .item-wide { grid-column: 2 / -2; }
.item-break-label { font-size: .8rem; font-weight: 600; color: var(--text-muted); letter-spacing: .02em; }
.totals-charge { border-right: 1px solid var(--border); padding-right: 16px; }
.items-table .row-group td { background: var(--primary-soft); font-weight: 650; }
.items-table .row-text td { font-style: italic; color: var(--text-muted); }
.items-table .row-break td { padding: 4px 12px; font-size: .8rem; color: var(--text-muted); text-align: center; border-bottom-style: dashed; }
.items-editor { overflow-x: auto; }
@media (max-width: 1400px) { .item-row.is-break .item-wide { grid-column: 2 / span 5; } }

/* ---------- Artikel: Bezugsquellen, Stammdaten in der Seitenspalte ---------- */
.form-grid-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-1 .field:has(textarea), .form-grid-1 .fieldset-plain, .form-grid-1 .field:first-child { grid-column: 1 / -1; }
.fieldset-plain { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.fieldset-plain legend { font-weight: 600; font-size: .867rem; margin-bottom: 4px; }
.num-input { text-align: right; font-variant-numeric: tabular-nums; }
.sticky-card { position: sticky; top: 80px; }
.supplier-list { display: grid; gap: 6px; }
.supplier-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) minmax(90px, .8fr) 96px minmax(160px, 1.6fr) 72px auto; gap: 8px; align-items: center; margin: 0; padding: 6px 8px; border-radius: var(--radius-sm); }
.supplier-row.is-preferred { background: var(--primary-soft); }
.supplier-row.is-new { border: 1px dashed var(--border); }
.supplier-head { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding-bottom: 0; }
.supplier-head .num { text-align: right; }
.supplier-link { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.supplier-link:not(:has(a)) { grid-template-columns: 1fr 1fr; }
.supplier-row .check { justify-content: center; }
.supplier-actions { display: flex; gap: 4px; justify-content: flex-end; }
@media (max-width: 1400px) { .supplier-row { grid-template-columns: 1fr 1fr; } .supplier-head { display: none; } .supplier-link { grid-column: 1 / -1; } }

/* ---------- Beleg als HTML (Rechnung) ---------- */
.strong { font-weight: 650; }

/* Belegansicht im PDF-Design (partials/doc-sheet.php) – Papier bleibt auch im Dunkelmodus hell */
.sheet {
    position: relative; overflow: hidden; width: 100%; max-width: 820px; margin: 0 auto;
    padding: 40px 52px 28px; background: #fff; color: #222; border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.06)); font-size: .933rem; line-height: 1.45;
    --sheet-muted: #7a7a7a; --sheet-line: #e3e3e3; --sheet-rule: #bdbdbd;
}
.sheet > * { position: relative; }
.sheet-watermark {
    position: absolute !important; left: 50%; top: 55%; transform: translate(-50%, -50%) rotate(-35deg);
    font-size: 7.5rem; font-weight: 800; letter-spacing: .06em; color: rgba(0,0,0,.045); pointer-events: none; user-select: none; white-space: nowrap;
}
.sheet-brand { display: flex; justify-content: flex-end; min-height: 44px; margin-bottom: 28px; }
.sheet-brand img { max-height: 56px; max-width: 200px; width: auto; height: auto; }
.sheet-brand-name { width: min(100%, 380px); height: 40px; }
.sheet-brand-name text { font-size: 26px; font-weight: 700; font-family: inherit; }
.sheet-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 42%); gap: 28px; align-items: start; margin-bottom: 36px; }
.sheet-address { font-size: .933rem; }
.sheet-sender { margin: 0 0 10px; font-size: .75rem; color: #555; }
.sheet-meta { margin: 0; display: grid; gap: 1px; font-size: .867rem; }
.sheet-meta > div { display: flex; justify-content: space-between; gap: 16px; }
.sheet-meta dt { font-weight: 700; white-space: nowrap; }
.sheet-meta dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.sheet-title { margin: 0; font-size: 1.6rem; font-weight: 700; color: #2b2b2b; letter-spacing: 0; }
.sheet-subject { margin: 4px 0 0; color: #555; }
.sheet-text { margin: 18px 0 0; }
.sheet-table-wrap { overflow-x: auto; margin-top: 22px; }
.sheet-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sheet-table th { text-align: left; font-weight: 700; padding: 0 6px 7px; border-bottom: 1px solid var(--sheet-rule); white-space: nowrap; }
.sheet-table td { padding: 9px 6px; vertical-align: top; }
.sheet-table tbody tr + tr td { border-top: 1px solid var(--sheet-line); }
.sheet-table tbody tr:last-child td { border-bottom: 1px solid var(--sheet-rule); }
.sheet-table th:first-child, .sheet-table td:first-child { padding-left: 0; }
.sheet-table th:last-child, .sheet-table td:last-child { padding-right: 0; }
.sheet-table .num { text-align: right; white-space: nowrap; }
.sheet-table .c-pos { width: 1%; text-align: right; padding-right: 12px; white-space: nowrap; }
.sheet-table .c-unit { white-space: nowrap; }
.sheet-desc { margin-top: 2px; font-size: .8rem; color: var(--sheet-muted); }
.sheet-group td { padding-top: 16px; font-weight: 700; font-size: 1rem; }
.sheet-accent { display: block; margin-top: 4px; }
.sheet-subtotal td { font-weight: 700; text-align: right; }
.sheet-note-row td { font-style: italic; color: #555; font-size: .867rem; }
.sheet-table tbody tr.sheet-group td, .sheet-table tbody tr.sheet-group + tr td { border-top: 0; }
.sheet-totals { margin: 14px 0 0 auto; width: min(100%, 300px); display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.sheet-totals > div { display: flex; justify-content: space-between; gap: 16px; }
.sheet-totals dd { margin: 0; text-align: right; white-space: nowrap; }
.sheet-totals .is-strong dt { font-weight: 700; }
.sheet-totals .is-small { font-size: .8rem; color: #555; }
.sheet-closing { margin-top: 26px; font-size: .867rem; }
.sheet-closing p { margin: 0 0 6px; }
.sheet-greeting { margin-top: 16px !important; }
.sheet-foot {
    display: grid; grid-template-columns: 38fr 37fr 25fr; gap: 16px; margin-top: 40px; padding-top: 12px;
    border-top: 1px solid var(--sheet-line); font-size: .75rem; line-height: 1.5; color: var(--sheet-muted);
}
.sheet-foot strong { display: block; color: #555; }
.sheet-foot span { display: block; overflow-wrap: anywhere; }
@media (max-width: 900px) {
    .sheet { padding: 24px 20px; }
    .sheet-head { grid-template-columns: 1fr; gap: 20px; }
    .sheet-foot { grid-template-columns: 1fr; }
    .sheet-watermark { font-size: 4rem; }
}

/* ---------- Tastaturkürzel ---------- */
kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; font: 600 .78rem/1.5 var(--mono); text-align: center; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; }
.shortcuts-dialog { width: min(760px, calc(100vw - 32px)); }
.shortcuts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 12px; }
.shortcut-list { margin: 0 0 16px; display: grid; gap: 6px; }
.shortcut-list > div { display: flex; align-items: center; gap: 12px; }
.shortcut-list dt { min-width: 84px; }
.shortcut-list dd { margin: 0; }
@media (max-width: 640px) { .shortcuts-grid { grid-template-columns: 1fr; } }

/* ---------- Ampel (Cron-Check, später Sicherheitscheck) ---------- */
.health { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.health p { margin: 2px 0 0; }
.health-action { margin-left: auto; }
.health-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.health-warn .health-dot, .health-never .health-dot { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.health-bad .health-dot { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.health-bad { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.health-link { color: inherit; text-decoration: none; }
.health-link:hover { text-decoration: none; border-color: var(--primary); }
.log-cell { white-space: normal !important; max-width: 420px; }
.disclosure-inline { margin: 0; border: 0; padding: 0; }
.disclosure-inline > summary { font-weight: 500; color: var(--text); font-size: .867rem; }
.disclosure-inline pre { margin: 6px 0 0; white-space: pre-wrap; }

/* ---------- Benachrichtigungen ---------- */
.bell { position: relative; }
.bell .icon-btn { position: relative; }
.bell-count { position: absolute; top: -3px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .75rem; font-weight: 700; line-height: 18px; text-align: center; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(420px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; padding: 14px 8px 8px; z-index: 20; box-shadow: 0 12px 32px rgb(0 0 0 / 18%); }
.bell-panel .card-head { padding: 0 8px; }
.bell-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.bell-list > .muted { padding: 8px; }
.bell-item > a, .bell-item > div { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: start; padding: 8px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: .933rem; }
.bell-item > a:hover { background: var(--surface-2); text-decoration: none; }
.bell-item.is-unread > a, .bell-item.is-unread > div { background: var(--primary-soft); }
.bell-item .icon { margin-top: 1px; color: var(--text-muted); }
.bell-time { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
.checklist-detail li { display: flex; gap: 10px; align-items: flex-start; }
.checklist-detail li > div { display: grid; gap: 1px; }
.probe-state { width: 1.1em; flex: none; font-weight: 700; }

/* ---------- Revision 1: feste Spalten, Dichte, Lebendigkeit ---------- */
/* Feste Spalten; die Hauptspalte (ohne w-Klasse) bekommt den Rest. Nebenspalten verschwinden je nach Fensterbreite
   (entspricht ca. 1300/1000/760 px Tabellenbreite neben der Seitenleiste). Bewusst Media- statt Container-Queries:
   Container-Queries rechnen bei html { zoom } (große Bildschirme) erst nach einem Neuaufbau richtig. */
.table-fixed { table-layout: fixed; min-width: 600px; }
@media (max-width: 1600px) { .table .hide-lg { display: none; } }
@media (max-width: 1300px) { .table .hide-md { display: none; } }
@media (max-width: 900px) { .table .hide-sm { display: none; } }
.kv dd .sub { display: block; margin-top: 2px; font-size: .8rem; color: var(--text-muted); }
.table .sub { display: block; margin-top: 2px; font-size: .8rem; color: var(--text-muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
/* Belegnummern in Textfarbe, Gold erst beim Überfahren */
.table td.mono > a { color: var(--text); font-weight: 550; }
.table td.mono > a:hover, .table-hover tbody tr:hover td.mono > a { color: var(--link); }
.table-fixed td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-fixed td.wrap { white-space: normal; }
.table-fixed .w-no { width: 8.5rem; }
.table-fixed .w-date { width: 9.5rem; }
.table-fixed .w-money { width: 8.5rem; }
.table-fixed .w-period { width: 13.5rem; }
.card-flush > .alert { margin: 12px 18px 0; }
.table-fixed .w-status { width: 8.5rem; }
.table-fixed .w-num { width: 6.5rem; }
.table-fixed .w-mid { width: 11rem; }
.table-fixed .w-act { width: 7.5rem; }
.table-fixed .w-act-2 { width: 10rem; }
.table-fixed td:has(form), .table-fixed td:has(.btn) { overflow: visible; }
.table thead th { background: var(--surface-2); }
.card-flush .table thead th { border-top: 1px solid var(--border); }
.table-hover tbody tr { transition: background-color .12s ease; }
.table-hover tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.table td.num, .table td .mono { font-variant-numeric: tabular-nums; }

body { background: radial-gradient(1400px 340px at 75% -140px, var(--primary-soft), transparent 70%) no-repeat, var(--bg); }
.content { padding: 20px 24px 36px; gap: 16px; }
.card { padding: 16px 18px; transition: border-color .15s ease, box-shadow .15s ease; }
.card-flush { padding: 0; }
.card-flush > .card-head, .card-head-pad { padding: 14px 18px 0; }
.stats { gap: 12px; }
.stat { position: relative; padding: 14px 18px 14px 20px; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); opacity: .85; }
.stat.stat-danger::before { background: var(--danger); }
.stat.stat-success::before { background: var(--success); }
.stat.stat-info::before { background: var(--info); }
.stat.stat-warning::before { background: var(--warning); }
.stat.stat-muted::before { background: var(--border); }
a.stat { color: inherit; display: block; }
a.stat:hover { text-decoration: none; border-color: var(--primary); box-shadow: 0 4px 14px rgb(60 46 6 / 10%); }
.stat-value { font-size: 1.467rem; margin: 4px 0 2px; }
.stat-trend { font-size: .8rem; font-weight: 650; margin-left: 6px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }
.tab { border-radius: 8px 8px 0 0; transition: color .12s ease, background-color .12s ease; }
.tab.is-active { background: var(--primary-soft); }
.empty::before { content: ""; width: 40px; height: 40px; border-radius: 50%; background: var(--primary-soft) radial-gradient(circle, var(--primary) 0 4px, transparent 5px); }
.btn, .icon-btn, .nav-link { transition: background-color .12s ease, border-color .12s ease, color .12s ease; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.form-sub { margin: 14px 0 6px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.form-sub:first-of-type { margin-top: 10px; }
.form-actions-tight { margin-top: 12px; justify-content: flex-end; }
.history { list-style: none; margin: 0; padding: 0 0 0 4px; }
.history-item { position: relative; display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 12px; padding: 8px 0 8px 18px; border-left: 2px solid var(--border); }
.history-item::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); }
.history-item.is-start::before { background: var(--primary); }
.history-time { color: var(--text-muted); font-size: .867rem; font-variant-numeric: tabular-nums; }
.history-changes { list-style: none; margin: 4px 0 0; padding: 0; font-size: .867rem; display: grid; gap: 2px; }
.history-changes del { color: var(--danger); text-decoration: line-through; opacity: .8; }
.history-changes ins { color: var(--success); text-decoration: none; font-weight: 600; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.list-tight li { padding: 4px 0; }
.record-aside .form-grid-1 .form-sub { grid-column: 1 / -1; margin-bottom: 0; }
/* Übersicht */
.todo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.todo-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-right: 4px; }
.todo-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .933rem; transition: border-color .12s ease, transform .12s ease; }
a.todo-chip:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-1px); }
.todo-chip strong { font-variant-numeric: tabular-nums; }
/* Farbe nur für Dringendes (todo-danger); alles andere neutral mit farbiger Zahl */
.todo-gold strong { color: var(--link); }
.health-slim { padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); gap: 10px; font-size: .933rem; flex-wrap: wrap; }
.health-slim .health-dot { width: 9px; height: 9px; box-shadow: 0 0 0 3px var(--warning-soft); }
.todo-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.todo-danger strong { color: var(--danger); }
.todo-info strong { color: var(--info); }
.todo-muted { color: var(--text-muted); }
.todo-done { background: var(--success-soft); color: var(--success); border-color: transparent; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: 1fr; } }
.bars-lg { height: 220px; }
.bars-lg .bar { grid-template-rows: auto 1fr auto; }
.bar-value { font-size: .75rem; color: var(--text-muted); text-align: center; font-variant-numeric: tabular-nums; min-height: 1em; }
.bar-fill { background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 65%, var(--brand-brown))); opacity: .75; transition: opacity .12s ease; }
.bar:hover .bar-fill, .bar.is-current .bar-fill { opacity: 1; }
.bar.is-current .bar-label { color: var(--text); font-weight: 700; }
.share { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.share li { display: grid; gap: 4px; }
.share-head { display: flex; justify-content: space-between; gap: 8px; font-size: .933rem; }
.share-head a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share .hbars-track { height: 8px; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; }
.feed li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--border); }
.feed-time { color: var(--text-muted); font-size: .867rem; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .feed { grid-template-columns: 1fr; } }
.shortcuts-grid { gap: 28px; margin-bottom: 0; }
.shortcuts-grid .eyebrow { margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.shortcuts-grid .eyebrow:not(:first-child) { margin-top: 18px; }
.shortcut-list { gap: 8px; margin: 0; }
.shortcut-list dt { min-width: 96px; display: flex; gap: 4px; align-items: center; }
.shortcuts-foot { margin: 0; padding-top: 12px; border-top: 1px solid var(--border); }
.record-aside .card-head { flex-wrap: nowrap; align-items: flex-start; }
.record-aside .card-head > div { min-width: 0; }
.record-aside .segmented { margin-bottom: 8px; }
/* Modul Domains / allgemein */
.tabs-inline { border-bottom: 0; margin: 0; }
.search-inline { margin-left: auto; }
.search-inline input { width: min(280px, 40vw); }
.input-row { display: flex; gap: 8px; }
.input-row > input { flex: 1; min-width: 0; }
.check-result { margin: 8px 0 0; padding: 8px 12px; border-radius: var(--radius-sm); font-size: .933rem; }
.check-result.is-free { background: var(--success-soft); color: var(--success); }
.check-result.is-taken { background: var(--info-soft); color: var(--info); }
.dl-inline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.stack-tight { display: grid; gap: 10px; }
.dl-inline > div { grid-template-columns: 1fr; gap: 2px; }
/* Listen: Suche und Filter rechts über der Tabelle, „Neu“-Knopf links */
.toolbar { flex-direction: row-reverse; }
.toolbar-filters { justify-content: flex-end; margin-left: auto; }
.toolbar-filters input[type="search"] { order: 10; }
.toolbar-filters .btn { order: 11; }
/* Sortierbare Spalten */
th[data-sort-col] { cursor: pointer; user-select: none; }
th[data-sort-col]:hover { color: var(--text); }
th[data-sort-col]::after { content: "↕"; margin-left: 4px; opacity: .3; font-size: .9em; }
th[data-sort-col][aria-sort="ascending"]::after { content: "↑"; opacity: 1; color: var(--link); }
th[data-sort-col][aria-sort="descending"]::after { content: "↓"; opacity: 1; color: var(--link); }
.table-fixed th { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Suchauswahl, Live-Suche, Sammelauswahl (Revision 2) ---------- */
.combo { position: relative; }
.combo-native { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; opacity: 0; pointer-events: none; }
.combo-input { width: 100%; }
.combo-list { position: absolute; z-index: 40; left: 0; min-width: max(100%, 340px); max-width: min(560px, 90vw); top: calc(100% + 4px); max-height: 280px; overflow: auto; margin: 0; padding: 4px; list-style: none;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.combo-item, .combo-empty { padding: 6px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-item.is-none, .combo-empty { color: var(--text-muted); }
.combo-item.is-active { background: var(--accent-soft, rgba(196,159,23,.14)); }
.combo-item[aria-selected="true"] { font-weight: 600; }
[data-live-results].is-loading { opacity: .55; transition: opacity .15s; }
.tabs-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tabs-row > .tabs { flex: 1; }
.card-head .tabs-inline, .card-head .search-inline { align-self: center; }
.search-inline { display: flex; align-items: center; margin: 0 0 0 auto; }
.w-check { width: 40px; }
.cell-check { cursor: pointer; }
tr.is-selected td { background: var(--accent-soft, rgba(196,159,23,.10)); }
.bulk-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding: 12px 18px;
    background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -6px 16px rgba(0,0,0,.06); }
.bulk-bar[hidden] { display: none; }
.bulk-fields { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; flex: 1; }
.bulk-fields .field { min-width: 260px; margin: 0; }
.row-actions form { display: inline; margin: 0 8px 0 0; }
.bank-remember { margin: 0; white-space: nowrap; }
.input-prefix { display: flex; align-items: center; gap: 2px; }
.input-prefix > span { color: var(--text-muted); }
tr.row-warning td { background: var(--warning-soft); }
.table-edit input { height: 32px; }

/* ---------- Seitenleiste: ausklappbare Gruppen ---------- */
.nav-group { display: grid; }
.nav-summary { cursor: pointer; list-style: none; user-select: none; }
.nav-summary::-webkit-details-marker { display: none; }
.nav-summary.has-active { color: var(--text); }
.nav-chevron { margin-left: auto; width: 14px; height: 14px; opacity: .55; transition: transform .15s ease; }
.nav-group:not([open]) > .nav-summary .nav-chevron { transform: rotate(-90deg); }
.nav-summary-badges { display: none; gap: 4px; margin-left: auto; }
.nav-group:not([open]) > .nav-summary .nav-summary-badges { display: inline-flex; }
.nav-group:not([open]) > .nav-summary .nav-summary-badges + .nav-chevron { margin-left: 6px; }
.nav-sub { display: grid; gap: 1px; margin: 1px 0 4px 17px; padding-left: 8px; border-left: 1px solid var(--border); }
.nav-sub .nav-link { padding-left: 8px; }
.nav-sub .nav-link .icon { width: 16px; height: 16px; }
/* ---------- Seitenleiste als Symbolleiste (eingeklappt): per Knopf gemerkt, zwischen 861 und 1100 px automatisch ---------- */
.rail-toggle { display: inline-grid; }
@media (max-width: 860px) { .rail-toggle { display: none; } }
@media (min-width: 861px) {
    html.nav-rail .shell { grid-template-columns: 64px 1fr; }
    html.nav-rail .sidebar { padding: 18px 8px; overflow-x: hidden; }
    html.nav-rail .brand-word, html.nav-rail .nav-link > span, html.nav-rail .nav-chevron, html.nav-rail .nav-summary-badges { display: none !important; }
    html.nav-rail .sidebar > .brand { padding: 4px 0; display: grid; justify-items: center; }
    html.nav-rail .nav-link { justify-content: center; padding: 8px 0; position: relative; }
    html.nav-rail .nav-link .badge { position: absolute; top: 1px; right: 4px; margin: 0; padding: 0 4px; min-width: 16px; font-size: .75rem; line-height: 16px; }
    html.nav-rail .nav-sub { margin: 1px 0 4px; padding: 0; border-left: 0; }
    html.nav-rail .nav-sub .nav-link { padding-left: 0; }
    html.nav-rail .nav-group[open] > .nav-summary { opacity: .6; }
}
@media (min-width: 861px) and (max-width: 1100px) {
    .shell { grid-template-columns: 64px 1fr; }
    .sidebar { padding: 18px 8px; overflow-x: hidden; }
    .brand-word, .nav-link > span, .nav-chevron, .nav-summary-badges { display: none !important; }
    .sidebar > .brand { padding: 4px 0; display: grid; justify-items: center; }
    .nav-link { justify-content: center; padding: 8px 0; position: relative; }
    .nav-link .badge { position: absolute; top: 1px; right: 4px; margin: 0; padding: 0 4px; min-width: 16px; font-size: .75rem; line-height: 16px; }
    .nav-sub { margin: 1px 0 4px; padding: 0; border-left: 0; }
    .nav-sub .nav-link { padding-left: 0; }
    .rail-toggle { display: none; }
}

.nav-section .nav-sub { margin-bottom: 0; }

/* Einstellungen › Mahnwesen */
.form-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-4 { grid-column: 1 / -1; }
.dunning-levels { display: grid; gap: 14px; }
.dunning-level { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px 16px; margin: 0; min-width: 0; }
.dunning-level legend { font-weight: 650; font-size: .933rem; padding: 0 6px; }
@media (max-width: 900px) { .form-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Mandanten als Karten ---------- */
.company-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; padding: 0 20px 20px; }
.company-card { display: grid; gap: 8px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.company-card:hover { text-decoration: none; border-color: var(--primary); }
.company-card header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1rem; }
.company-card p { margin: 0; }
.company-card .dl > div { grid-template-columns: 9rem 1fr; }

/* Symbolleiste: Gruppenköpfe nur als Trennlinie, Gruppeninhalt immer sichtbar (auch wenn zugeklappt gemerkt) */
@media (min-width: 861px) {
    html.nav-rail .nav-summary { display: none; }
    html.nav-rail .nav-group { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
    html.nav-rail .nav-group::details-content { content-visibility: visible; display: contents; }
}
@media (min-width: 861px) and (max-width: 1100px) {
    .nav-summary { display: none; }
    .nav-group { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
    .nav-group::details-content { content-visibility: visible; display: contents; }
}
/* Reiter der Akte kompakter, damit sie bei 1280 px in eine Zeile passen */
.record-tabs { gap: 0; padding: 4px 8px 0; }
.record-tabs .tab { padding: 10px 10px; font-size: .867rem; }
.record-tabs .tab .badge { margin-left: 4px; }
/* Akte: unter 1280 px einspaltig (rechte Spalte rutscht nach unten), bis 1400 px schmalere rechte Spalte */
@media (max-width: 1279px) { .record { grid-template-columns: 1fr; } }
@media (min-width: 1280px) and (max-width: 1400px) { .record { grid-template-columns: minmax(0, 1fr) 300px; } }

/* Proxmox: laufende Aufgabe */
.task-live p { display: flex; align-items: center; gap: 10px; margin: 0; }
.task-live.is-ok { border-color: var(--success); }
.task-live.is-error { border-color: var(--danger); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--primary); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.form-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.form-inline input { flex: 1 1 160px; min-width: 0; }
.action-ctl form { display: inline-flex; }
/* Proxmox: Auslastung */
.spark { display: block; width: 100%; height: 120px; border-bottom: 1px solid var(--border); }
.spark-line { fill: none; stroke: var(--series-1); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark-area { fill: color-mix(in srgb, var(--series-1) 14%, transparent); stroke: none; }
/* Moduleinstellungen: Rechte unter den Einstellungen, nicht daneben */
.perm-matrix { max-width: 760px; margin-top: 12px; display: grid; gap: 10px; justify-items: start; }
.perm-matrix .table-wrap { width: 100%; }
.perm-matrix-wide { max-width: none; margin-top: 0; justify-items: stretch; }
.perm-matrix-wide .form-actions { padding: 0 16px 16px; }
.perm-matrix .row-group td { background: var(--primary-soft); font-weight: 650; }
.perm-matrix td.num, .perm-matrix th.num { text-align: center; width: 1%; white-space: nowrap; }
.ns-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
@media (max-width: 700px) { .ns-grid { grid-template-columns: 1fr; } }
.contact-rows { container-type: inline-size; display: grid; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.contact-row + .contact-row { border-top: 1px solid var(--border); }
.contact-row > summary, .contact-row-same { display: grid; grid-template-columns: 80px 100px minmax(0, 1fr) minmax(0, 220px) auto; align-items: center; gap: 12px; padding: 9px 14px; }
.contact-row > summary { cursor: pointer; list-style: none; }
.contact-row > summary::-webkit-details-marker { display: none; }
.contact-row > summary:hover { background: var(--surface-2, rgb(0 0 0 / 3%)); }
.contact-row-same { grid-template-columns: 80px 100px minmax(0, 1fr); color: var(--text-muted); }
.contact-role { font-weight: 600; font-size: .867rem; }
.contact-sum, .contact-mail { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-more { color: var(--link); display: inline-flex; align-items: center; gap: 6px; }
.contact-more::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-top: -3px; transition: transform .15s; }
.contact-row[open] > summary { background: var(--surface-2, rgb(0 0 0 / 3%)); }
.contact-row[open] .contact-more::after { transform: rotate(-135deg); margin-top: 3px; }
.contact-body { padding: 14px 14px 16px; border-top: 1px dashed var(--border); }
.contact-body .dl-compact { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 20px; }
@container (max-width: 820px) {
    .contact-row > summary { grid-template-columns: 80px 100px minmax(0, 1fr) auto; }
    .contact-mail { display: none; }
}
@container (max-width: 460px) {
    .contact-row > summary { grid-template-columns: 80px minmax(0, 1fr) auto; }
    .contact-row > summary .mono, .contact-mail { display: none; }
    .contact-row-same { grid-template-columns: 80px minmax(0, 1fr); }
    .contact-row-same .mono { display: none; }
}
.dl.dl-compact { gap: 4px; }
.dl-compact > div { grid-template-columns: 90px 1fr; }
.dl-compact dt { font-size: .8rem; }

/* ---------- Feinschliff (Designrunde 2) ---------- */
/* Einheitliche Inhaltsbreite: auf großen Bildschirmen nicht über die volle Breite ziehen */
.content { max-width: 1560px; margin-inline: auto; }
/* Formularseiten (Anlegen/Bearbeiten) etwas schmaler, damit Felder nicht endlos lang werden */
.content:has(> form.form-page), .content:has(> .form-page) { max-width: 1280px; }
/* Kein Überblenden beim Seitenwechsel: wirkte mit html-zoom (4K) wie ein Hineinzoomen */
/* Bedienelemente: spürbare, aber kurze Rückmeldung */
.btn { transition: background .12s, border-color .12s, color .12s, transform .06s, box-shadow .12s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { box-shadow: 0 1px 0 rgb(0 0 0 / 8%); }
.icon-btn { transition: background .12s; }
.table-hover tbody tr { transition: background .1s; }
/* Erfolgsmeldungen blenden nach einigen Sekunden aus */
.alert[data-autohide] { transition: opacity .3s, margin .3s, padding .3s, max-height .3s; max-height: 200px; overflow: hidden; }
.alert.is-hiding { opacity: 0; max-height: 0; margin: 0; padding-block: 0; border-width: 0; }
/* Karten: gleichmäßige Innenabstände, Kopfzeile ruhiger */
.card-head { min-height: 32px; }
.card-head .h3 { font-size: 1rem; }
/* Seitenkopf: Titel und Aktionen auf einer Linie */
.page-heading { align-items: center; }

/* Proxmox: interaktive Auslastung */
.pve-charts { position: relative; }
.pve-chart-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.segmented .seg { border: 0; background: transparent; font: inherit; font-size: .867rem; padding: 4px 10px; border-radius: 6px; color: var(--text-muted); cursor: pointer; }
.segmented .seg:hover { color: var(--text); }
.segmented .seg.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.pve-chart-hint { margin: 0 0 8px; }
.pve-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.pve-chart { margin: 0; min-width: 0; }
.pve-chart-wide { grid-column: 1 / -1; }
.pve-chart figcaption { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; font-size: .933rem; }
.pve-chart canvas { display: block; width: 100%; cursor: crosshair; user-select: none; }
.pve-traffic { margin-left: auto; font-size: .867rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.chart-legend { display: inline-flex; align-items: center; gap: 6px; font-size: .867rem; color: var(--text-muted); }
.key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; }
.key-1 { background: var(--series-1); } .key-2 { background: var(--series-2); margin-left: 8px; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 200px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgb(0 0 0 / 14%); font-size: .867rem; display: grid; gap: 3px; }
.tip-row { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; }
.tip-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tip-row .key { width: 10px; height: 10px; border-radius: 50%; }
.pve-charts.is-loading canvas { opacity: .4; transition: opacity .15s; }
@media (max-width: 1000px) { .pve-chart-grid { grid-template-columns: 1fr; } }
/* Serverliste: CPU 24 h */
.cpu-spark { display: inline-flex; align-items: center; gap: 6px; }
.cpu-spark svg { width: 96px; height: 22px; display: block; }
.cpu-spark-line { fill: none; stroke: var(--series-1); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.cpu-spark-area { fill: color-mix(in srgb, var(--series-1) 16%, transparent); stroke: none; }
.cpu-spark-val { font-size: .8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; min-width: 32px; }

/* Einstellungen › Module: ein Reiter je Modul */
.tabs-sub { border-bottom: 0; gap: 6px; margin: 0; }
.tabs-sub .tab { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; background: var(--surface); }
.tabs-sub .tab.is-active { border-color: var(--text); background: var(--text); color: var(--surface); }
.mod-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); opacity: .5; }
.mod-dot.is-on { background: var(--series-3); opacity: 1; }
.module-card[hidden] { display: none; }
.tabs-sub .tab { margin-bottom: 0; }
.module-card { min-width: 0; }
.module-card pre { max-width: 100%; overflow-x: auto; }
.stack > *, .stack-tight > * { min-width: 0; }   /* breite Inhalte (Code, Tabellen) sprengen Raster nicht */

/* ---------- Farbrunde: dunkle Seitenleiste, Gold nur als Markenakzent ---------- */
.sidebar {
    --text: #e8ebf1; --text-muted: #9aa3b2; --surface-2: rgb(255 255 255 / 6%); --border: rgb(255 255 255 / 9%);
    --primary-soft: rgb(255 255 255 / 9%); --link: #ffffff; --brand-lock: #e9edf3;
    background: #141922; border-right-color: #0b0e14; color: var(--text);
}
.sidebar .nav-link.is-active { position: relative; }
.sidebar .nav-link.is-active::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-gold); }
.sidebar .badge { box-shadow: none; }
/* Kennzahlen: ohne eigene Bedeutung je Position eine Graphfarbe statt überall Gold */
.stats > .stat:not(.stat-danger, .stat-success, .stat-info, .stat-muted, .stat-warning):nth-child(4n+1)::before { background: var(--series-1); }
.stats > .stat:not(.stat-danger, .stat-success, .stat-info, .stat-muted, .stat-warning):nth-child(4n+2)::before { background: var(--series-3); }
.stats > .stat:not(.stat-danger, .stat-success, .stat-info, .stat-muted, .stat-warning):nth-child(4n+3)::before { background: var(--series-4); }
.stats > .stat:not(.stat-danger, .stat-success, .stat-info, .stat-muted, .stat-warning):nth-child(4n+4)::before { background: var(--series-2); }

/* Einstellungen › Allgemein: Inhaltsverzeichnis links, Abschnitte rechts, Speichern läuft mit */
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-toc { position: sticky; top: 84px; display: grid; gap: 2px; }
.settings-toc a { padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text-muted); font-weight: 550; font-size: .933rem; border-left: 2px solid transparent; }
.settings-toc a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.settings-toc a.is-active { color: var(--link); border-left-color: var(--primary); background: var(--primary-soft); }
.settings-layout .card { scroll-margin-top: 84px; }
.settings-save { position: sticky; bottom: 0; z-index: 4; margin: 0; padding: 12px 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); justify-content: flex-end; }
@media (max-width: 1000px) { .settings-layout { grid-template-columns: 1fr; } .settings-toc { position: static; display: flex; flex-wrap: wrap; } }

/* Ladezustände: Graphen und Listenzellen schimmern statt leer und weiß zu bleiben */
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.pve-charts.is-empty canvas, td.is-pending::after {
    background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 40%, var(--surface)) 50%, var(--surface-2) 75%);
    background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--radius-sm);
}
td.is-pending { position: relative; color: transparent; }
td.is-pending::after { content: ""; position: absolute; left: 8px; right: 8px; top: 50%; height: 14px; margin-top: -7px; }
.pve-charts.is-loading canvas { opacity: .55; }
.traffic-cell { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .pve-charts.is-empty canvas, td.is-pending::after { animation: none; } }

/* ---------- Kundenportal: dunkle Kopfleiste wie die Admin-Seitenleiste, Inhalt mittig ---------- */
.portal-top {
    --text: #e8ebf1; --text-muted: #9aa3b2; --surface-2: rgb(255 255 255 / 7%); --border: rgb(255 255 255 / 12%);
    --primary-soft: rgb(255 255 255 / 10%); --link: #ffffff; --brand-lock: #e9edf3; --surface: #1c2330;
    display: block; padding: 0 24px; background: #141922; border-bottom: 1px solid #0b0e14; color: var(--text);
}
.portal-top-inner { display: flex; align-items: center; gap: 12px 28px; max-width: 1200px; margin: 0 auto; min-height: 60px; }
.portal-nav a { position: relative; }
.portal-nav a.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -11px; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand-gold); }
.portal-user .btn-ghost { color: var(--text); border-color: var(--border); background: transparent; }
.portal-heading, .portal-content { max-width: 1248px; margin-left: auto; margin-right: auto; width: 100%; }
.portal-heading { border-bottom: 0; background: transparent; padding-bottom: 0; }
a.stat-link { color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
a.stat-link:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 18px rgb(16 24 40 / 10%); }
@media (max-width: 860px) {
    .portal-top { padding: 0 12px; }
    .portal-top-inner { flex-wrap: wrap; padding: 10px 0 0; gap: 8px 12px; }
    .portal-user { margin-left: auto; }
    .portal-nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
    .portal-nav a { white-space: nowrap; }
    .portal-nav a.is-active::after { bottom: -8px; }
    .portal-user .small br, .portal-user .small .muted { display: none; }
}

/* Tabellen als Karten auf schmalen Bildschirmen (Portal): je Zeile eine Karte, Beschriftung links, Wert rechts */
@media (max-width: 700px) {
    .table-wrap:has(> .table-cards) { overflow: visible; }
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards thead { display: none; }
    .table-cards tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
    .table-cards tr:last-child { border-bottom: 0; }
    .table-cards td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
    .table-cards td[data-label]::before { content: attr(data-label); color: var(--text-muted); font-size: .8rem; font-weight: 600; text-align: left; flex: none; }
    .table-cards td:first-child { font-weight: 600; font-size: 1rem; text-align: left; }
    .table-cards td:first-child::before { display: none; }
    .table-cards td:empty, .table-cards td.hide-sm { display: none; }
    .table-cards td:not([data-label]), .table-cards td[data-label=""] { justify-content: flex-end; }
}

/* Admin-Kopfleiste auf dem Handy: nichts läuft über den Rand */
@media (max-width: 600px) {
    .topbar { padding: 0 10px; gap: 6px; }
    .topbar .rail-toggle, .topbar .user-name, .topbar [data-dialog-open="shortcuts"] { display: none; }
    .company-filter select { min-width: 0; width: 104px; }
    .company-filter > .icon { display: none; }
    .topbar-right { gap: 6px; }
    .topbar .btn-sm { padding-left: 8px; padding-right: 8px; }
}

/* Einstellungen › Benutzer: aufklappbare Zeilen wie bei den Domain-Kontakten */
.user-rows { container-type: inline-size; display: grid; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.user-row + .user-row { border-top: 1px solid var(--border); }
.user-row > summary { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto 96px auto; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; }
.user-row > summary::-webkit-details-marker { display: none; }
.user-row > summary:hover, .user-row[open] > summary { background: var(--surface-2); }
.user-row[open] .contact-more::after { transform: rotate(-135deg); margin-top: 3px; }
.user-main { display: grid; min-width: 0; }
.user-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row.is-locked .user-main, .user-row.is-locked .avatar { opacity: .55; }
.user-row .contact-body { display: grid; gap: 14px; }
@container (max-width: 620px) {
    .user-row > summary { grid-template-columns: 32px minmax(0, 1fr) auto auto; }
    .user-seen, .user-row .contact-more { display: none; }
}
@container (max-width: 420px) { .user-row > summary .badge-info, .user-row > summary .badge-muted { display: none; } }

/* Segment-Auswahl als Radiogruppe (z. B. Mindestlaufzeit) */
.seg-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.seg-field legend { padding: 0; margin-bottom: 6px; font-weight: 600; font-size: .867rem; }
.seg-radio { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.seg-radio label { position: relative; margin: 0; cursor: pointer; }
.seg-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-radio span { display: grid; place-items: center; min-width: 40px; height: 30px; padding: 0 10px; border-radius: 6px; font-size: .867rem; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; transition: background-color .12s, color .12s; }
.seg-radio label:hover span { color: var(--text); }
.seg-radio input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg-radio input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px; }

/* Seitenleiste unter Listen (templates/partials/pager.php) */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 16px; border-top: 1px solid var(--border); }
.pager-info { margin: 0; }
.pager-pages, .pager-per { display: flex; align-items: center; gap: 2px; }
.pager-per .muted { margin-right: 6px; }
.pager-link { min-width: 30px; height: 30px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--text-muted); font-size: .867rem; font-variant-numeric: tabular-nums; }
a.pager-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.pager-link.is-current { background: var(--primary); color: #fff; font-weight: 600; }
.pager-link.is-disabled { opacity: .35; }
.pager-gap { padding: 0 4px; color: var(--text-muted); }
@media (max-width: 640px) { .pager { justify-content: center; } .pager-info { width: 100%; text-align: center; } }

/* GiroCode auf der Zahlungsseite */
.girocode { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.girocode svg { width: 128px; height: 128px; flex: none; border-radius: 4px; }
.girocode p { margin: 0; }

/* Mandant: E-Mail-Versand und Stripe unter den Firmendaten */
.integrations { margin-top: 20px; align-items: start; }
.integrations #stripe .form-grid { grid-template-columns: minmax(0, 1fr); }
.integrations .secret { font-size: .85rem; letter-spacing: 0; }

/* Kontenabgleich */
.bank-upload { margin-bottom: 20px; }
.bank-upload-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr) auto; gap: 16px; align-items: end; }
.bank-upload-form .field { margin: 0; }
.bank-upload-form .hint { margin-bottom: 0; }
@media (max-width: 900px) { .bank-upload-form { grid-template-columns: 1fr; } }
.bank-table td { vertical-align: top; }
.bank-col-match { width: 34%; }
.bank-payer .mono { display: block; }
.bank-purpose { color: var(--text-muted); overflow-wrap: anywhere; margin-top: 2px; }
.bank-suggest { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; margin-bottom: 8px; }
.bank-suggest .muted.small:not(div) { margin-right: 4px; }
.bank-suggest div { flex-basis: 100%; }
.bank-table .bank-actions { display: flex; gap: 6px; align-items: center; }
.bank-table .bank-actions input { flex: 1 1 auto; min-width: 0; padding: 4px 8px; font-size: .875rem; }
.bank-file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }

/* Rechnungslauf: E-Mail-Versand */
.run-mail { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mail-templates summary { cursor: pointer; font-weight: 600; }
.mail-templates[open] { display: grid; gap: 14px; }
.mail-templates .fieldset-plain { margin-top: 8px; }

/* Globale Suche (Strg+K) */
.gsearch-trigger { display: inline-flex; align-items: center; gap: 8px; margin-left: 12px; padding: 6px 10px; min-width: 240px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-muted); font: inherit; font-size: .875rem; cursor: pointer; }
.gsearch-trigger:hover { border-color: var(--text-muted); }
.gsearch-trigger kbd, .gsearch kbd { margin-left: auto; font-size: .72rem; padding: 1px 5px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); }
.gsearch-foot kbd { margin-left: 0; }
@media (max-width: 900px) { .gsearch-trigger { min-width: 0; } .gsearch-trigger span, .gsearch-trigger kbd { display: none; } }
dialog.gsearch { width: min(680px, calc(100vw - 32px)); margin-top: 10vh; padding: 0; }
.gsearch-box { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.gsearch-box input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 1.05rem; padding: 4px 0; box-shadow: none; }
.gsearch-list { list-style: none; margin: 0; padding: 6px; max-height: 60vh; overflow-y: auto; }
.gsearch-item { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.gsearch-item[aria-selected="true"] { background: var(--surface-2); outline: 1px solid var(--border); }
.gsearch-item.is-hint .gsearch-text strong { color: var(--primary); }
.gsearch-text { display: grid; min-width: 0; }
.gsearch-text strong, .gsearch-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsearch-type { flex: 0 0 84px; text-align: center; font-size: .72rem; font-weight: 600; padding: 2px 6px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.gsearch-type-customer { color: #2563eb; border-color: #2563eb55; }
.gsearch-type-invoice { color: #b45309; border-color: #b4530955; }
.gsearch-type-quote { color: #7c3aed; border-color: #7c3aed55; }
.gsearch-type-contract { color: #0f766e; border-color: #0f766e55; }
.gsearch-type-ticket { color: #be123c; border-color: #be123c55; }
.gsearch-type-domain, .gsearch-type-server { color: #4d7c0f; border-color: #4d7c0f55; }
.gsearch-empty { padding: 14px 10px; }
.gsearch-foot { margin: 0; padding: 8px 16px 12px; border-top: 1px solid var(--border); }

/* Notizen & Wiedervorlagen (Kundenakte, Übersicht, Liste) */
.history-item.is-note::before { border-color: #d97706; }
.history-item.is-mail::before { border-color: #0f766e; }
.history-item .pre { margin: 4px 0 0; }
.history-item .badge { margin-left: 6px; }
.history-del { display: inline; }
.note-form .segmented { align-self: flex-start; }
.note-more { display: grid; gap: 8px; }
.note-more[open] summary { margin-bottom: 6px; }
.note-more summary { cursor: pointer; color: var(--text-muted); }
.note-more .field-inline { justify-content: space-between; }
.note-more .field-inline select, .note-more .field-inline input { width: 62%; }
.followup-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.followup { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border); }
.followup:first-child { border-top: 0; }
.followup.is-done .followup-text { text-decoration: line-through; color: var(--text-muted); }
.followup-body { min-width: 0; display: grid; gap: 3px; }
.followup-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.followup-customer { font-weight: 600; }
.followup-text { margin: 0; }
.record-aside .followup-list { margin-top: 6px; }
.record-aside .eyebrow { margin-top: 16px; }

/* SEPA-Lastschrift */
.sepa-actions { display: flex; gap: 12px; align-items: center; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--border); margin: 0; }
.sepa-steps { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.sepa-steps li.is-done { color: var(--text-muted); }
.sepa-steps li.is-done strong::after { content: " ✓"; color: var(--success); }
.sepa-step-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.table form.sepa-return { display: flex; gap: 6px; align-items: center; }
.sepa-return select { max-width: 170px; font-size: .8rem; padding: 3px 6px; }
.sepa-return .sepa-fee, .bank-return-form input[name=fee] { width: 80px; font-size: .8rem; padding: 3px 6px; }
.sepa-portal-toggle { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); background: var(--surface-2, transparent); }
.mandate-text { border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); padding: 10px 14px; margin: 12px 0; background: var(--surface-2, transparent); }
.mandate-text p { margin: 0 0 6px; } .mandate-text p:last-child { margin: 0; }
.bank-return-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bank-return-form input[type=text] { width: 80px; }

/* ---------- Kundenportal: Admin-Ansicht („Als Kunde anmelden“) ---------- */
.impersonation-bar { position: sticky; top: 0; z-index: 50; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; padding: 8px 16px; background: #b45309; color: #fff; font-size: .933rem; }
.impersonation-bar form { margin: 0; }
.impersonation-bar .btn { background: #fff; color: #7c2d12; border-color: #fff; }
.impersonate-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }

/* Portal: Modul-Seiten unter „Produkte“ */
.portal-nav-group { position: relative; }
.portal-nav-group > summary { list-style: none; cursor: pointer; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.portal-nav-group > summary::-webkit-details-marker { display: none; }
.portal-nav-group > summary::after { content: "▾"; margin-left: 6px; font-size: .8em; }
.portal-nav-group > summary:hover { color: var(--text); background: var(--surface-2); }
.portal-nav-group > summary.is-active { color: var(--link); background: var(--primary-soft); }
.portal-nav-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 180px; display: flex; flex-direction: column; gap: 2px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,.12)); }
.portal-nav-menu a.is-active::after { display: none; }
@media (max-width: 860px) {
    .portal-nav-group[open] { display: contents; }
    .portal-nav-group[open] > summary { display: none; }
    .portal-nav-group[open] .portal-nav-menu { position: static; flex-direction: row; padding: 0; border: 0; box-shadow: none; background: none; min-width: 0; }
}
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; cursor: pointer; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; width: min(380px, 86vw); padding: 12px; text-align: left; white-space: normal; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,.12)); }
.card-menu-host { overflow: visible; }

/* Cloud-Server: Festplatten-Graph, Auswahlkarten für Tarif und Betriebssystem (Radio in der Karte, ohne Skript) */
.key-3 { background: var(--series-3); } .key-4 { background: var(--series-4); margin-left: 8px; }
.pick-group { margin: 14px 0 8px; font-size: .8rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); display: flex; align-items: baseline; gap: 8px; }
.pick-group:first-child { margin-top: 0; }
.pick-group small { font-weight: 400; letter-spacing: 0; text-transform: none; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.pick-grid-os { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pick { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.pick:hover { border-color: var(--primary); }
.pick > input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.pick:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); background: var(--surface-2); }
.pick:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.pick-title { font-weight: 650; }
.pick-price { margin-top: 4px; font-weight: 650; font-variant-numeric: tabular-nums; }
.pick-os { align-items: flex-start; cursor: default; }
.pick-os-head { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.os-mark { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: #fff; font-weight: 700; font-size: .933rem; letter-spacing: -.02em; background: #64748b; }
.os-ubuntu { background: #e95420; } .os-debian { background: #a80030; } .os-fedora { background: #3c6eb4; } .os-rocky { background: #10b981; }
.os-alma { background: #0f4266; } .os-centos { background: #932279; } .os-opensuse { background: #73ba25; } .os-app { background: #6a4ce2; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: .867rem; cursor: pointer; background: var(--surface); font-variant-numeric: tabular-nums; }
.chip span:hover { border-color: var(--primary); }
.chip input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Cloud-Server: Konsole (noVNC) */
.vnc-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.vnc-bar .vnc-status { margin-right: auto; display: inline-flex; align-items: center; gap: 8px; }
.vnc-screen { height: min(72vh, 820px); min-height: 360px; background: #000; border-radius: var(--radius-sm); overflow: hidden; }
.vnc-screen:fullscreen { height: 100vh; border-radius: 0; }
.pick.is-soldout { opacity: .55; cursor: not-allowed; }
.pick.is-soldout:hover { border-color: var(--border); }
/* Cloud-Server: Bestellung in Schritten */
.wizard-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 18px; padding: 0 0 14px; border-bottom: 1px solid var(--border); }
.wizard-steps .step { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-weight: 550; font-size: .933rem; }
.wizard-steps .step-no { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); font-size: .8rem; font-variant-numeric: tabular-nums; }
.wizard-steps .step.is-active { color: var(--text); }
.wizard-steps .step.is-active .step-no { background: var(--primary); border-color: var(--primary); color: #fff; }
.wizard-steps .step.is-done { cursor: pointer; }
.wizard-steps .step.is-done .step-no { background: var(--success-soft); border-color: transparent; color: var(--success); }
form[data-wizard]:not(.is-wizard) .wizard-steps { display: none; }
form[data-wizard] > section + section { margin-top: 18px; }
form[data-wizard] [hidden] { display: none !important; }
form[data-wizard] fieldset + .check { margin-top: 12px; }
.chip.is-soldout { opacity: .45; cursor: not-allowed; }

/* Doppelklick-Schutz: Formular wird gerade gesendet */
form.is-submitting button[type="submit"], form.is-submitting button:not([type]) { opacity: .6; cursor: progress; }

/* ---------- Modul SSL-Zertifikate ---------- */
.ssl-level { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 20px; padding: 0 6px; border-radius: 6px; font-size: .72rem; font-weight: 750; letter-spacing: .04em; vertical-align: middle; }
.ssl-level-dv { background: var(--info-soft); color: var(--info); }
.ssl-level-ov { background: var(--success-soft); color: var(--success); }
.ssl-level-ev { background: linear-gradient(135deg, #d9b23a, var(--brand-gold)); color: #2a2104; box-shadow: 0 0 0 1px rgb(196 159 23 / 35%); }
.ssl-level-other { background: var(--surface-2, var(--bg)); color: var(--text-muted); }
.ssl-level-lg { min-width: 52px; height: 36px; font-size: 1rem; border-radius: 10px; }
.ssl-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
@media (max-width: 1100px) { .ssl-tiers { grid-template-columns: 1fr; } }
.ssl-tier { position: relative; display: flex; flex-direction: column; gap: 10px; }
.ssl-tier p { margin: 0; }
.ssl-tier-head { display: flex; align-items: center; gap: 12px; }
.ssl-tier-head h2 { margin: 0; }
.ssl-tier-ev { border-color: var(--brand-gold); box-shadow: 0 0 0 1px var(--brand-gold), var(--shadow); }
.ssl-tier-flag { position: absolute; top: -10px; right: 16px; padding: 2px 10px; border-radius: 999px; background: var(--brand-gold); color: #2a2104; font-size: .72rem; font-weight: 700; }
.ssl-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .867rem; }
.ssl-checks li { display: flex; gap: 8px; align-items: baseline; }
.ssl-checks li > span:first-child { width: 14px; font-weight: 700; }
.ssl-checks .is-yes > span:first-child { color: var(--success); }
.ssl-checks .is-no { color: var(--text-muted); }
.ssl-tier-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--border); font-size: .867rem; }
.ssl-tier-price strong { font-size: 1.05rem; }
.ssl-brand { font-weight: 700; }
.ssl-catalog .ssl-row-sold td:first-child { box-shadow: inset 3px 0 0 var(--success); }
.ssl-catalog .ssl-row-muted td { color: var(--text-muted); }
.ssl-life { height: 6px; margin-top: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.ssl-life > span { display: block; height: 100%; background: var(--success); }
.stat-danger .ssl-life > span { background: var(--danger); }
.ssl-stat-text { font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.ssl-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ssl-files li { display: grid; grid-template-columns: 20px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.ssl-files li:last-child { border-bottom: 0; }
.ssl-files li.is-muted { color: var(--text-muted); }
.ssl-files .icon { width: 18px; height: 18px; color: var(--text-muted); }
.ssl-names { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ssl-howto { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 10px 0 0; font-size: .867rem; }
.ssl-howto dt { font-weight: 650; }
.ssl-howto dd { margin: 0; }
.ssl-empty .icon { width: 32px; height: 32px; }
.ssl-files .sub { display: block; color: var(--text-muted); font-size: .8rem; }
.ssl-pick { display: grid; gap: 16px; }
.ssl-pick-group { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.ssl-pick-group legend { margin-bottom: 8px; font-weight: 650; }
.ssl-pick-item, .ssl-method { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.ssl-method { grid-template-columns: auto 1fr; align-items: start; }
.ssl-pick-item:has(input:checked), .ssl-method:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--primary-soft); }
.ssl-pick-item.is-recommended { border-style: dashed; }
.ssl-pick-item .sub, .ssl-method .sub { display: block; color: var(--text-muted); font-size: .8rem; }
.ssl-pick-price { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.ssl-method select { margin-top: 6px; max-width: 320px; }
.ssl-code { display: block; margin-top: 6px; padding: 6px 8px; border-radius: 6px; background: var(--surface-2); font-family: var(--mono); font-size: .78rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.ssl-steps { list-style: none; display: flex; gap: 0; margin: 0 0 10px; padding: 0; counter-reset: s; }
.ssl-steps li { flex: 1; position: relative; padding: 8px 0 0; border-top: 3px solid var(--border); font-size: .8rem; color: var(--text-muted); }
.ssl-steps li.is-done { border-color: var(--success); color: var(--text); }
.ssl-steps li.is-current { border-color: var(--primary); color: var(--text); font-weight: 650; }
.ssl-order.is-failed { border-color: var(--danger); }
.ssl-validation { margin-top: 8px; }
.ssl-pfx { display: flex; gap: 6px; }
.ssl-pfx input { width: 130px; }
/* SSL: Marken, Arten, Katalog und Produktkarten */
.ssl-brand-mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: #fff; font-weight: 800; font-size: .8rem; flex: none; vertical-align: middle; background: #6b7280; }
.ssl-brand-sectigo { background: #2e8b57; }
.ssl-brand-digicert { background: #1f5fbf; }
.ssl-brand-globalsign { background: #0b6e8a; }
.ssl-brand-thawte { background: #c8372d; }
.ssl-brand-geotrust { background: #3b8c3f; }
.ssl-brand-rapidssl { background: #e2671b; }
.ssl-brand-internetx { background: #24345c; }
.ssl-kind { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: .72rem; font-weight: 650; vertical-align: middle; white-space: nowrap; }
.ssl-kind-wildcard { background: #f3e8fd; color: #7a3fb8; }
.ssl-kind-multi { background: #e6f6f6; color: #17797a; }
.ssl-catalog-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.ssl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2, var(--bg)); font-size: .8rem; }
.ssl-chip strong { font-variant-numeric: tabular-nums; }
.ssl-chip.is-sell { background: var(--success-soft); color: var(--success); }
.ssl-chip.is-portal { background: var(--primary-soft); color: var(--primary); }
.ssl-catalog .row-group td { background: var(--surface-2, var(--bg)); padding-top: 10px; padding-bottom: 10px; }
.ssl-brand-head { display: flex; align-items: center; gap: 10px; }
.ssl-brand-head .ssl-brand { font-size: .95rem; }
.ssl-catalog tbody tr:not(.row-group) td:first-child { box-shadow: inset 3px 0 0 transparent; }
.ssl-catalog tr.ssl-lv-dv td:first-child { box-shadow: inset 3px 0 0 var(--info); }
.ssl-catalog tr.ssl-lv-ov td:first-child { box-shadow: inset 3px 0 0 var(--success); }
.ssl-catalog tr.ssl-lv-ev td:first-child { box-shadow: inset 3px 0 0 var(--brand-gold); }
.ssl-catalog tr.ssl-row-sold td { background: color-mix(in srgb, var(--success-soft) 55%, transparent); }
.ssl-catalog .ssl-prod { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.ssl-catalog .ssl-prod .sub { flex-basis: 100%; }
.ssl-pick-group { padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2, var(--bg)); }
.ssl-pick-group legend { float: left; width: 100%; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ssl-pick-item { grid-template-columns: auto auto 1fr auto; background: var(--surface); border-left: 4px solid var(--border); }
.ssl-pick-dv .ssl-pick-item { border-left-color: var(--info); }
.ssl-pick-ov .ssl-pick-item { border-left-color: var(--success); }
.ssl-pick-ev .ssl-pick-item { border-left-color: var(--brand-gold); }
.ssl-pick-ev legend::after { content: "Höchstes Vertrauen"; margin-left: auto; padding: 2px 10px; border-radius: 999px; background: var(--brand-gold); color: #2a2104; font-size: .72rem; font-weight: 700; }
.ssl-pick-item:hover { border-color: var(--primary); }
.ssl-pick-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.ssl-feats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: .78rem; color: var(--text-muted); }
.ssl-feats span::before { content: "✓ "; color: var(--success); font-weight: 700; }
.ssl-pick-price { font-size: 1.1rem; }
.ssl-catalog td:nth-child(3) { white-space: nowrap; }
.ssl-catalog tr:not(.row-group) td { vertical-align: middle; }
/* SSL: Portal und Freigabe */
.ssl-portal-title { margin: 24px 0 12px; }
.ssl-offers { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ssl-offers li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.ssl-offers li.is-recommended { border-color: var(--success); box-shadow: inset 3px 0 0 var(--success); }
.ssl-offers .sub { display: block; color: var(--text-muted); font-size: .78rem; }
.ssl-offers .btn { font-variant-numeric: tabular-nums; font-weight: 700; }
.ssl-summary-product { display: flex; gap: 10px; align-items: center; margin: 0 0 10px; }
.ssl-summary-product .ssl-brand-mark { width: 36px; height: 36px; font-size: 1rem; border-radius: 9px; }
.ssl-summary-price { font-size: 1.15rem; }
.ssl-approve { margin: 8px 0; }
.ssl-portal-access { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.ssl-approvals a { font-weight: 650; }
.portal-rates summary { cursor: pointer; color: var(--text-muted); }
.portal-rates ul { margin: 4px 0 0; padding-left: 18px; }

/* Auswertungen */
.report-filter { margin-bottom: 16px; }
.report-chart { display: block; width: 100%; height: auto; overflow: visible; }
.report-grid { stroke: var(--border); stroke-width: 1; }
.report-base { stroke: var(--text-muted); stroke-width: 1; opacity: .5; }
.report-axis { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.report-bar { fill: var(--series-1); }
.report-bar-prev { fill: color-mix(in srgb, var(--text-muted) 45%, transparent); }
.report-hit { fill: transparent; }
.report-group:hover .report-hit { fill: color-mix(in srgb, var(--text-muted) 8%, transparent); }
.report-group.is-selected .report-hit { fill: color-mix(in srgb, var(--series-1) 8%, transparent); }
.key-prev { background: color-mix(in srgb, var(--text-muted) 45%, transparent); }
.chart-legends { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chart-legends .key { width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
td .hbars-track { display: block; height: 4px; margin-top: 4px; }
.small-limit { display: grid; gap: 6px; }
.small-limit-row { display: grid; grid-template-columns: 2.5rem 1fr 7rem; align-items: center; gap: 10px; }
.small-limit-row .hbars-track { height: 8px; }
.hbars-fill.is-warn { background: var(--warning); }

.report-table td:first-child { width: 100%; }
.report-table th.num, .report-table td.num { white-space: nowrap; }

/* Portal-Startseite: Hinweise und laufende Dienste */
.portal-warnings { margin: 0; }
.list > li.portal-warning { display: grid; grid-template-columns: 18px 1fr auto; justify-content: stretch; align-items: center; gap: 10px; }
.portal-warning .icon { width: 16px; height: 16px; }
.portal-warning-danger .icon { color: var(--danger); }
.portal-warning-warning .icon { color: var(--warning); }
.portal-warning-info .icon { color: var(--info); }
.portal-services { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 20px; }
.portal-service { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin: 0; color: var(--text); }
a.portal-service:hover { text-decoration: none; border-color: var(--primary); }
.portal-service strong, .portal-service .small { display: block; }
.portal-service-count { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--link); font-weight: 700; font-variant-numeric: tabular-nums; }
.portal-service.has-warning .portal-service-count { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--text); }

/* Portal: Dokumentenkorb */
.nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--primary); color: #fff; font-size: .72rem; font-weight: 700; vertical-align: 1px; }
.doc-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.doc-tabs a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); font-weight: 600; font-size: .867rem; background: var(--surface); }
.doc-tabs a:hover { text-decoration: none; border-color: var(--primary); }
.doc-tabs a.is-active { background: var(--primary-soft); border-color: var(--primary); color: var(--link); }
.doc-box tr.is-new td:first-child { box-shadow: inset 3px 0 0 var(--info); }

/* Portal: Meine Daten · Admin: Änderungsanträge */
.portal-user-link { color: var(--text); text-align: right; }
.portal-user-link:hover { text-decoration: none; color: var(--link); }
.change-table td:first-child { width: 28%; color: var(--text-muted); }
.change-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border-top: 1px solid var(--border); }
.change-actions form { margin: 0; }
.change-reject { display: flex; gap: 8px; flex: 1; min-width: 260px; }
.change-reject input { flex: 1; }
.card.is-muted { opacity: .8; }

/* 2FA: Wiederherstellungscodes und QR-Code */
.recovery-codes { padding: 12px 14px; margin-bottom: 12px; border: 1px dashed var(--warning); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--warning) 8%, transparent); }
.recovery-codes ol { columns: 2; margin: 8px 0 10px; padding-left: 22px; font-size: .95rem; }
.totp-qr { width: 168px; margin: 10px 0 6px; padding: 8px; background: #fff; border-radius: 8px; }
.totp-qr svg { display: block; width: 100%; height: auto; }
a.user-chip { color: inherit; }
a.user-chip:hover { text-decoration: none; }

/* Weiße Marke: Logo bzw. Name des Mandanten statt LockByte */
.brand-logo { display: block; max-height: 40px; max-width: 220px; width: auto; height: auto; }
.brand-lg .brand-logo { max-height: 64px; max-width: 280px; margin: 0 auto; }
.brand-text { font-weight: 750; font-size: 1.15rem; letter-spacing: -0.01em; color: var(--text); }
.brand-lg .brand-text { font-size: 1.5rem; }
.inline-check { display: flex; align-items: center; gap: 12px; }

/* Protokoll (Einstellungen › Protokoll) */
.audit-filter { margin-bottom: 16px; }
.audit-details summary { cursor: pointer; list-style: none; }
.audit-details summary::-webkit-details-marker { display: none; }
.audit-details summary::after { content: " ▸"; color: var(--text-muted); font-size: .8em; }
.audit-details[open] summary::after { content: " ▾"; }
.audit-details ul { margin: .35rem 0 0; padding-left: 1rem; overflow-wrap: anywhere; }

/* Runde 12 E4: Textbausteine je Belegart */
.doc-texts { display: grid; gap: 8px; }
.doc-texts-kind { border: 1px solid var(--border, #e3e6ea); border-radius: 8px; padding: 8px 12px; }
.doc-texts-kind > summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline; }
.doc-texts-kind[open] > summary { margin-bottom: 10px; }

/* Runde 12 E5: API-Rechte je Bereich */
.api-rights { width: 100%; }
.api-rights th, .api-rights td { white-space: normal; padding: 6px 4px; }
.api-rights th:not(:first-child), .api-rights td:not(:first-child) { width: 1%; text-align: center; white-space: nowrap; }

/* Runde 12 E6: Status & Wartung */
.pre-line { white-space: pre-line; }
.status-notify { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.status-timeline { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.status-timeline li { border-left: 3px solid var(--border); padding-left: 12px; }
.status-timeline p { margin: 4px 0 0; }
.status-card { max-width: 760px; }
.status-banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 10px; font-weight: 600; margin: 12px 0 20px; }
.status-banner.is-ok { background: var(--success-soft); color: var(--success); }
.status-banner.is-maintenance { background: var(--info-soft); color: var(--info); }
.status-banner.is-minor { background: var(--warning-soft); color: var(--warning); }
.status-banner.is-major { background: var(--danger-soft); color: var(--danger); }
.status-services { list-style: none; padding: 0; margin: 0 0 20px; border: 1px solid var(--border); border-radius: 10px; }
.status-services li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.status-services li + li { border-top: 1px solid var(--border); }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--success); }
.status-dot.is-maintenance { background: var(--info); }
.status-dot.is-minor { background: var(--warning); }
.status-dot.is-major { background: var(--danger); }
.status-event { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.status-event h3 { margin: 0 0 4px; font-size: 1rem; }
.portal-status-notice { margin-bottom: 16px; }

/* Tickets: Textbausteine, Inline-Formulare in Tabellen */
.snippet-bar { display: flex; align-items: center; gap: 8px; }
.snippet-bar select { width: auto; min-width: 220px; height: 32px; }
form.inline { display: inline; }
@media (min-width: 1100px) { .integrations #mail, .integrations #imap { grid-column: 1; } .integrations #stripe { grid-column: 2; grid-row: 1 / span 2; } }
.inbox-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 10px; }
.inbox-assign { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inbox-assign select { min-width: 260px; }
.attach-list { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 0; padding: 0; list-style: none; font-size: .867rem; }

/* Stoppuhr im Kopf der Verwaltung (Runde 13 E3) */
.timer-pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: .867rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.timer-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: timer-pulse 1.6s ease-in-out infinite; }
.timer-pill:hover { filter: brightness(.96); }
@keyframes timer-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .timer-pill::before { animation: none; } }
.toolbar-filters input[type="month"] { width: auto; height: 38px; }
.toolbar-filters select[name="customer"] { max-width: 260px; }

/* ---------------------------------------------------------------- Wissensdatenbank (Runde 13 E4) */
.btn-xs { height: 26px; padding: 0 8px; font-size: .8rem; }
.label-like { display: block; margin-bottom: 6px; font-size: .867rem; font-weight: 600; }
.input-lg { height: 44px; font-size: 1.067rem; font-weight: 600; }
.kb-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.kb-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.kb-label-row label { margin: 0; }
.kb-toolbar { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.kb-textarea { min-height: 420px; line-height: 1.55; font-size: .867rem; resize: vertical; tab-size: 4; }
.kb-preview { min-height: 420px; max-height: 70vh; overflow: auto; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.kb-en > summary { cursor: pointer; list-style-position: inside; }
.kb-en[open] > summary { margin-bottom: 12px; }
.kb-side .check { margin-top: 6px; }
.kb-cheats dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; margin: 0; }
.kb-cheats dt { white-space: nowrap; }
.kb-cheats dd { margin: 0; color: var(--text-muted); }
.kb-cat-list { list-style: none; margin: 0; padding: 0; }
.kb-cat-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 18px; border-top: 1px solid var(--border); }
.kb-cat-list li:first-child { border-top: 0; }
.kb-cat-list li > a { font-weight: 600; }
.kb-cat-list .actions-inline { margin-left: auto; display: inline-flex; gap: 10px; }
.kb-inline { display: inline; }
.kb-help { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.kb-delete { margin-top: 16px; }
@media (max-width: 1100px) { .kb-split { grid-template-columns: 1fr; } .kb-preview { min-height: 0; } }

/* Markdown-Darstellung */
.md-body { line-height: 1.65; overflow-wrap: anywhere; }
.md-body > :first-child { margin-top: 0; }
.md-body > :last-child { margin-bottom: 0; }
.md-body h2 { font-size: 1.333rem; margin: 1.6em 0 .5em; letter-spacing: -0.01em; scroll-margin-top: 80px; }
.md-body h3 { font-size: 1.133rem; margin: 1.4em 0 .4em; scroll-margin-top: 80px; }
.md-body h4, .md-body h5 { font-size: 1rem; margin: 1.2em 0 .3em; }
.md-body p { margin: 0 0 .9em; }
.md-body ul, .md-body ol { margin: 0 0 1em; padding-left: 1.4em; }
.md-body li { margin: .25em 0; }
.md-body li > ul, .md-body li > ol { margin: .25em 0 0; }
.md-body code { font-family: var(--mono); font-size: .88em; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }
.md-body pre.md-code { margin: 0 0 1em; padding: 12px 14px; border-radius: var(--radius-sm); background: #141922; color: #e8ebf1; overflow-x: auto; font-size: .867rem; line-height: 1.5; }
.md-body pre.md-code code { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; }
.md-body blockquote { margin: 0 0 1em; padding: 4px 0 4px 14px; border-left: 3px solid var(--border); color: var(--text-muted); }
.md-body blockquote > :last-child, .md-callout > :last-child { margin-bottom: 0; }
.md-callout { margin: 0 0 1em; padding: 12px 14px 12px 16px; border-radius: var(--radius-sm); border-left: 4px solid var(--info); background: var(--info-soft); }
.md-callout > strong:first-child { display: block; margin-bottom: 2px; }
.md-callout.md-warning { border-left-color: var(--warning); background: var(--warning-soft); }
.md-callout.md-tip { border-left-color: var(--success); background: var(--success-soft); }
.md-body hr { border: 0; border-top: 1px solid var(--border); margin: 1.6em 0; }
.md-body img { max-width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.md-body .md-table { margin: 0; }
.md-body .table-wrap { margin: 0 0 1em; border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* Hilfe für Kunden (öffentlich und Portal) */
.help-body { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.help-top { background: #141922; color: #e8ebf1; padding: 0 24px; --brand-lock: #e9edf3; --text: #e8ebf1; --text-muted: #9aa3b2; }
.help-top-inner { display: flex; align-items: center; gap: 14px; max-width: 1100px; margin: 0 auto; min-height: 60px; }
.help-top-label { padding-left: 14px; border-left: 1px solid rgb(255 255 255 / 18%); font-weight: 600; color: #9aa3b2; }
.help-top-nav { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.help-top-nav a.small { color: #c9d0db; }
.help-top .btn-ghost { color: #e8ebf1; border-color: rgb(255 255 255 / 18%); background: transparent; }
.help-main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 24px 32px; }
.help-hero { margin: 0 0 24px; }
.help-body .help-hero { margin: 0 -24px 28px; padding: 40px 24px 28px; text-align: center; background: linear-gradient(180deg, #141922 0, #1d2430 100%); color: #f3f5f8; }
.help-body .help-hero h1 { margin: 0 0 18px; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.02em; }
.help-search { display: flex; align-items: center; gap: 8px; max-width: 640px; padding: 6px 6px 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }
.help-body .help-search { margin: 0 auto; }
.help-search .icon { flex: none; color: var(--text-muted); }
.help-search input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; box-shadow: none; font-size: 1rem; color: var(--text); }
.help-search input:focus { outline: none; box-shadow: none; }
.help-search .btn { border-radius: 999px; }
.help-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.help-body .help-cats { justify-content: center; }
.help-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-size: .867rem; font-weight: 550; text-decoration: none; }
.help-chip:hover { text-decoration: none; border-color: var(--primary); }
.help-chip.is-active { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.help-chip.is-active .muted { color: inherit; opacity: .75; }
.help-body .help-chip:not(.is-active) { background: rgb(255 255 255 / 8%); border-color: rgb(255 255 255 / 16%); color: #e8ebf1; }
.help-section { margin: 0 0 28px; }
.help-section > h2 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.help-article { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease; }
.help-article:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 6px 18px rgb(16 24 40 / 8%); }
.help-article strong { color: var(--link); }
.help-article span { color: var(--text-muted); font-size: .867rem; line-height: 1.45; }
.help-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.help-cta > div { display: flex; flex-direction: column; gap: 2px; }
.help-article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.help-doc { padding: 28px 32px; }
.help-doc-title { margin: 4px 0 18px; font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -0.02em; }
.help-crumb { margin: 0; color: var(--text-muted); }
.help-updated { margin: 24px 0 0; padding-top: 14px; border-top: 1px solid var(--border); }
.help-side { position: sticky; top: 16px; }
.help-toc ol, .help-related ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .933rem; }
.help-related ul { list-style: none; padding: 0; }
.help-cta-small p { margin: 4px 0 10px; }
.help-body .help-main > .help-article-layout { margin-top: 28px; }
.help-foot { margin-top: 32px; text-align: center; }
.help-suggest { margin: -4px 0 4px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-soft); border-left: 4px solid var(--info); }
.help-suggest p { margin: 0 0 6px; }
.help-suggest ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.help-suggest li span { display: block; color: var(--text-muted); font-size: .8rem; }
@media (max-width: 900px) {
    .help-article-layout { grid-template-columns: 1fr; }
    .help-side { position: static; }
    .help-doc { padding: 20px; }
    .help-top-label { display: none; }
}

/* ---------- Projekte ---------- */
.pbar { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; font-size: .8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pbar progress { flex: 1; min-width: 60px; height: 6px; border: 0; border-radius: 3px; background: var(--surface-2); overflow: hidden; appearance: none; -webkit-appearance: none; }
.pbar progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 3px; }
.pbar progress::-webkit-progress-value { background: var(--success); border-radius: 3px; }
.pbar progress::-moz-progress-bar { background: var(--success); border-radius: 3px; }
.pbar-warn progress::-webkit-progress-value { background: var(--warning); }
.pbar-warn progress::-moz-progress-bar { background: var(--warning); }
.pbar-over progress::-webkit-progress-value { background: var(--danger); }
.pbar-over progress::-moz-progress-bar { background: var(--danger); }
.pbar-over { color: var(--danger); font-weight: 600; }
.stat .pbar { display: flex; margin-top: 10px; }
.kv-1 { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.form-inline { display: inline; margin: 0; }
.task-phase { border-top: 1px solid var(--border); }
.task-phase-head { display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: var(--surface-2); }
.task-phase-head .form-inline { margin-left: auto; }
.task-empty { padding: 10px 20px; margin: 0; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 20px; border-top: 1px solid var(--border); }
.task:first-child { border-top: 0; }
.task-status select { height: 30px; font-size: .8rem; padding: 0 8px; }
.task-main .sub { display: block; margin-top: 2px; font-size: .8rem; color: var(--text-muted); }
.task-meta { display: flex; gap: 10px; white-space: nowrap; }
.task-actions { display: flex; gap: 6px; align-items: center; }
.task-done .task-main strong { color: var(--text-muted); text-decoration: line-through; }
@media (max-width: 760px) { .task { grid-template-columns: 1fr; } .task-meta { flex-wrap: wrap; } }
.form-inline-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-inline-row select { flex: 1; min-width: 0; }
.bill-summary { display: grid; grid-template-columns: 1fr 1fr minmax(160px, 1fr); gap: 16px; align-items: center; padding: 4px 20px 16px; }
.bill-summary > div { display: flex; flex-direction: column; gap: 2px; }
.bill-summary strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.report-store { margin-top: 12px; gap: 6px; }
.plain-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
@media (max-width: 760px) { .bill-summary { grid-template-columns: 1fr; } }
.form-inline-row .w-num { width: 80px; flex: none; }
.form-inline-row .w-auto { width: auto; flex: none; }
.form-inline-row input:not([type]) { flex: 1; min-width: 140px; }
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.project-card { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.project-card:hover { border-color: var(--primary); text-decoration: none; }
.project-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; font-size: 1.05rem; }
.project-card-facts { display: flex; gap: 24px; margin: 10px 0 4px; }
.project-card-facts dt { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.project-card-facts dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.project-card .pbar { display: flex; }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-value-sm { font-size: 1.1rem; }
.task-portal { grid-template-columns: 100px minmax(0, 1fr) auto; }
@media (max-width: 760px) { .stats-3 { grid-template-columns: 1fr; } }

/* Monitoring */
.mon-badge { display: inline-flex; align-items: center; gap: 6px; }
.mon-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.mon-down .mon-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
.mon-chart { width: 100%; height: 200px; display: block; }
.mon-grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mon-axis { fill: var(--text-muted); font-size: 11px; }
.mon-line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mon-point { fill: var(--primary); }
.mon-fail { stroke: var(--danger); stroke-width: 2; opacity: .55; vector-effect: non-scaling-stroke; }
.mon-fail:hover { opacity: 1; }
.mon-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mon-key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-left: 8px; }
.mon-key:first-child { margin-left: 0; }
.mon-key-line { background: var(--primary); }
.mon-key-fail { background: var(--danger); width: 3px; height: 12px; }
.mon-days-title { margin: 20px 0 8px; }
.mon-days { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 2px; height: 32px; }
.mon-day { border-radius: 2px; background: var(--surface-2); }
.mon-day-ok { background: var(--success); }
.mon-day-warn { background: var(--warning); }
.mon-day-bad { background: var(--danger); }
.mon-day:hover { opacity: .75; }
.mon-days-scale { display: flex; justify-content: space-between; margin-top: 4px; }
.mon-alert { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger-soft) 55%, var(--surface)); }
.mon-open { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mon-open .sub { display: block; }
.tabs-sm { border-bottom: 0; margin: 0; }
.tabs-sm .tab { padding: 4px 10px; font-size: .867rem; }
.break { word-break: break-word; overflow-wrap: anywhere; }
.status-components li { display: block; }
.status-component-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.status-components .mon-days { height: 26px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }

/* Domain-Suche (öffentlich und Portal) */
.domain-hero-hint { margin: 14px auto 0; max-width: 640px; font-size: .9rem; color: #c9d0db; }
.domain-hero-hint a { color: #9ec1ff; }
.domain-result-card .table-wrap + .domain-suggest-head, .card .domain-suggest-head { margin: 0; padding: 16px 16px 4px; }
.domain-result-card > p, .domain-result-card > .alert { margin: 12px 16px; }
.domain-foot { margin-top: 16px; text-align: center; }
