/* 365cloud M365 Dokumentation – gemäss Mockup und 365cloud Corporate Design & Brand Guidelines 1.0:
   Petrol #0B1F2A (Primär), Teal #0E7C86 (Akzent), Light Teal #3FC8D4 (Sekundärakzent), Dark Grey #333333 (Fliesstext),
   Light Grey #F2F4F5. Schrift Aptos / Aptos Display, Ersatz Calibri. Ampelfarben sind funktional (Bewertungen).
   Farben nur über Variablen: hell (Standard), dunkel (Systemeinstellung oder Umschalter, data-theme auf <html>). */
:root {
    --font: "Aptos", "Calibri", "Segoe UI", system-ui, sans-serif;
    --font-display: "Aptos Display", "Aptos", "Calibri", "Segoe UI", system-ui, sans-serif;
    --font-code: "Consolas", "Cascadia Mono", monospace;
    --bg: #F2F4F5;
    --surface: #FFFFFF;
    --surface-soft: #F8FAFA;
    --zebra: #F2F4F5;
    --code-bg: #F2F4F5;
    --ink: #0B1F2A;              /* Petrol: Titel und Markenelemente */
    --text: #333333;             /* Dark Grey: Fliesstext */
    --text-2: #333333;
    --muted: #5C6B73;
    --heading-accent: #0E7C86;   /* H3 in Teal */
    --border: #D9DEE1;
    --line: #E6EAEC;
    --field: #B9C3C8;
    --accent: #0E7C86;
    --accent-hover: #0B6A73;
    --accent-soft: #E3F1F2;
    --on-accent: #FFFFFF;
    --strong: #0B1F2A;           /* Petrol-Flächen: Tabellenköpfe, Kopfzeile, aktive Auswahl */
    --on-strong: #FFFFFF;
    --on-strong-muted: #B9C7CE;
    --brand-eyebrow: #3FC8D4;
    --login-side: #0B1F2A;
    --login-text: #C9D5DB;
    --login-button: #0B1F2A;
    --login-button-text: #FFFFFF;
    --risk-fg: #A01F14; --risk-bg: #F9E6E4;
    --warn-fg: #7A4A00; --warn-bg: #FBEBCF;
    --info-fg: #0B5E66; --info-bg: #DDEFF0;
    --ok-fg: #1B6E2F;   --ok-bg: #E2F1E6;
    --none-fg: #333333; --none-bg: #E6EAEC;
    --mark: #FFF1B8;
    --shadow: 0 20px 50px rgba(11, 31, 42, .12);
    --backdrop: rgba(11, 31, 42, .55);
    --radius: 12px;
    color-scheme: light;
    font-family: var(--font);
}

/* Dunkle Darstellung auf Petrol-Basis, Akzent Light Teal (Petrol auf Light Teal 8.4:1, White auf Petrol 16.9:1).
   Werte einmal pro Fall definiert: Systemeinstellung bzw. ausdrückliche Wahl. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0B1F2A; --surface: #10293A; --surface-soft: #133044; --zebra: #12304A; --code-bg: #0D2433;
        --ink: #FFFFFF; --text: #E4ECEF; --text-2: #D0DCE1; --muted: #9FB4BE; --heading-accent: #3FC8D4;
        --border: #23445A; --line: #1B3A4E; --field: #35576D;
        --accent: #3FC8D4; --accent-hover: #7ADBE3; --accent-soft: #15404F; --on-accent: #0B1F2A;
        --strong: #07161F; --on-strong: #FFFFFF; --on-strong-muted: #9FB4BE;
        --login-side: #07161F; --login-text: #B9C7CE; --login-button: #3FC8D4; --login-button-text: #0B1F2A;
        --risk-fg: #FF9B8F; --risk-bg: #3B1E1B; --warn-fg: #F3C56E; --warn-bg: #3A2D12;
        --info-fg: #7ADBE3; --info-bg: #12404A; --ok-fg: #86D9A0; --ok-bg: #15321F;
        --none-fg: #D0DCE1; --none-bg: #1F3D50;
        --mark: #5C4A00; --shadow: 0 20px 50px rgba(0, 0, 0, .45); --backdrop: rgba(0, 0, 0, .65);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #0B1F2A; --surface: #10293A; --surface-soft: #133044; --zebra: #12304A; --code-bg: #0D2433;
    --ink: #FFFFFF; --text: #E4ECEF; --text-2: #D0DCE1; --muted: #9FB4BE; --heading-accent: #3FC8D4;
    --border: #23445A; --line: #1B3A4E; --field: #35576D;
    --accent: #3FC8D4; --accent-hover: #7ADBE3; --accent-soft: #15404F; --on-accent: #0B1F2A;
    --strong: #07161F; --on-strong: #FFFFFF; --on-strong-muted: #9FB4BE;
    --login-side: #07161F; --login-text: #B9C7CE; --login-button: #3FC8D4; --login-button-text: #0B1F2A;
    --risk-fg: #FF9B8F; --risk-bg: #3B1E1B; --warn-fg: #F3C56E; --warn-bg: #3A2D12;
    --info-fg: #7ADBE3; --info-bg: #12404A; --ok-fg: #86D9A0; --ok-bg: #15321F;
    --none-fg: #D0DCE1; --none-bg: #1F3D50;
    --mark: #5C4A00; --shadow: 0 20px 50px rgba(0, 0, 0, .45); --backdrop: rgba(0, 0, 0, .65);
    color-scheme: dark;
}

/* Logo: Color auf hellem, White auf dunklem Grund (Brand Guidelines 3.5). */
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .logo-light { display: none; }
    :root:not([data-theme="light"]) .logo-dark { display: block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
.topbar .logo { width: 132px; height: auto; display: block; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; }
h1, h2, .page-head h1, .login-side h1 { font-family: var(--font-display); }
pre, code { font-family: var(--font-code); }
a { color: var(--accent); }
a:hover { color: var(--ink); }
button, input, select { font: inherit; }
h1:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* --- Grundbausteine ------------------------------------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card h2 { margin: 0; font-size: 19px; font-weight: 700; color: var(--ink); }
.card.dark { background: var(--strong); color: var(--on-strong); border-color: var(--strong); }
.card.dark h2 { color: var(--on-strong); }
.card.dark .hint { color: var(--on-strong-muted); }
.hint { font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }
.loading { padding: 40px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spacer { flex: 1; }

.btn { min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--ink); background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--accent-soft); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn.dark { background: var(--strong); border-color: var(--strong); color: var(--on-strong); font-weight: 700; }
.btn.dark:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.danger { border-color: var(--risk-fg); color: var(--risk-fg); font-weight: 700; }
.btn.danger:hover { background: var(--risk-bg); }
.btn.subtle { border-color: var(--field); }
.btn.small { min-height: 36px; padding: 0 12px; border-color: var(--border); font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 15px; font-weight: 700; cursor: pointer; align-self: flex-start; text-decoration: none; display: inline-flex; align-items: center; }

.theme-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text-2); font-size: 14px; font-weight: 600; cursor: pointer; }
.theme-toggle:hover { border-color: var(--accent); color: var(--ink); }
.theme-toggle .to-light { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .to-light { display: inline; }
    :root:not([data-theme="light"]) .theme-toggle .to-dark { display: none; }
}
:root[data-theme="dark"] .theme-toggle .to-light { display: inline; }
:root[data-theme="dark"] .theme-toggle .to-dark { display: none; }
.topbar .theme-toggle, .login-side .theme-toggle { border-color: rgba(255, 255, 255, .25); color: var(--on-strong-muted); }
.topbar .theme-toggle:hover, .login-side .theme-toggle:hover { border-color: var(--on-strong); color: var(--on-strong); }

.chip { display: inline-flex; align-items: center; justify-self: start; align-self: flex-start; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.chip.risk { background: var(--risk-bg); color: var(--risk-fg); }
.chip.warn { background: var(--warn-bg); color: var(--warn-fg); }
.chip.info { background: var(--info-bg); color: var(--info-fg); }
.chip.ok { background: var(--ok-bg); color: var(--ok-fg); }
.chip.none { background: var(--none-bg); color: var(--none-fg); }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
input[type=text], input[type=email], input[type=search], select { min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 8px; font-size: 15px; background: var(--surface); color: var(--text); font-weight: 400; }
.check { display: flex; align-items: center; gap: 10px; min-height: 32px; }

/* --- Tabellen ------------------------------------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { background: var(--strong); color: var(--on-strong); text-align: left; padding: 10px 14px; font-weight: 700; }
table.data td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; white-space: pre-line; overflow-wrap: anywhere; }
table.data tbody tr:nth-child(even) td { background: var(--zebra); }
table.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
table.kv th { width: 34%; text-align: left; font-weight: 600; color: var(--text-2); padding: 7px 14px 7px 0; border-top: 1px solid var(--line); vertical-align: top; }
table.kv td { padding: 7px 0; border-top: 1px solid var(--line); white-space: pre-line; overflow-wrap: anywhere; }

/* --- Kundenportal: Rahmen ------------------------------------------------------------------------------------ */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.sidebar { flex: 1 1 240px; max-width: 280px; background: var(--surface); border-right: 1px solid var(--border); padding: 28px 18px; display: flex; flex-direction: column; gap: 28px; }
.sidebar .logo { width: 156px; height: auto; align-self: flex-start; }
.tenant { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.tenant .label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tenant .name { font-size: 16px; font-weight: 700; color: var(--ink); }
.tenant .domain { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { min-height: 44px; padding: 0 12px; border-radius: 8px; display: flex; align-items: center; font-size: 15px; color: var(--text-2); font-weight: 500; text-decoration: none; }
.nav a:hover { background: var(--surface-soft); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--ink); font-weight: 700; }
.account { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px 10px 0; border-top: 1px solid var(--border); }
.account .who { font-weight: 600; color: var(--ink); }
.account a { font-size: 14px; font-weight: 600; }
.partner-banner { background: var(--strong); color: var(--on-strong); border-radius: 10px; padding: 12px 14px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.partner-banner a { color: var(--on-strong); font-weight: 700; }

.main { flex: 999 1 640px; min-width: 0; padding: 32px clamp(16px, 3vw, 44px) 56px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head .titles { display: flex; flex-direction: column; gap: 6px; }
.page-head h1 { margin: 0; font-size: 30px; line-height: 1.2; font-weight: 800; color: var(--ink); }
.page-head .meta { font-size: 14px; color: var(--muted); }

.status-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: 10px; background: var(--strong); color: var(--on-strong); font-weight: 600; }
.status-bar.failed { background: var(--risk-bg); color: var(--risk-fg); }
.status-bar.done { background: var(--ok-bg); color: var(--ok-fg); }
.status-bar .btn { border-color: currentColor; background: transparent; color: inherit; }

.empty { background: var(--surface); border: 1px dashed var(--field); border-radius: var(--radius); padding: 28px; color: var(--text-2); }

/* --- Übersicht ----------------------------------------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi .label { font-size: 14px; font-weight: 700; }
.kpi .label.risk { color: var(--risk-fg); } .kpi .label.warn { color: var(--warn-fg); } .kpi .label.info { color: var(--info-fg); } .kpi .label.ok { color: var(--ok-fg); }
.kpi .count { font-size: 40px; line-height: 1; font-weight: 800; color: var(--ink); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 24px; align-items: start; }
.finding { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.finding .text { font-weight: 600; color: var(--ink); }
.finding a.hint { text-decoration: none; }
.finding a.hint:hover { text-decoration: underline; color: var(--accent); }
.chapter-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--text); text-decoration: none; }
.chapter-link:hover { border-color: var(--accent); color: var(--ink); }
.chapter-link .title { font-weight: 600; }
.chapter-link .count { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* --- Dokumentation ------------------------------------------------------------------------------------------- */
.docs { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 24px; align-items: start; }
.docs-nav { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 16px; }
.docs-nav .chapters { display: flex; flex-direction: column; gap: 4px; }
.docs-nav .chapters a { min-height: 44px; padding: 8px 12px; border-radius: 8px; display: flex; align-items: center; color: var(--text-2); text-decoration: none; font-weight: 500; }
.docs-nav .chapters a:hover { background: var(--surface); color: var(--ink); }
.docs-nav .chapters a.active { background: var(--strong); color: var(--on-strong); font-weight: 700; }
.doc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 32px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.doc > h2 { margin: 0; font-size: 24px; font-weight: 800; color: var(--ink); }
.doc-section { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.doc-section > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.doc-section > summary::-webkit-details-marker { display: none; }
.doc-section > summary h3 { margin: 0; font-size: 17px; font-weight: 600; color: var(--heading-accent); display: flex; align-items: center; gap: 8px; }
.doc-section > summary h3::before { content: "›"; display: inline-block; width: 12px; color: var(--muted); transition: transform .15s; }
.doc-section[open] > summary h3::before { transform: rotate(90deg); }
.doc-section .body { display: flex; flex-direction: column; gap: 12px; padding-left: 20px; }
.doc p { margin: 0; max-width: 80ch; color: var(--text-2); }
.doc h4 { margin: 10px 0 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.doc ul { margin: 0; padding-left: 20px; color: var(--text-2); }
.doc pre { margin: 0; padding: 14px; background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; overflow-x: auto; color: var(--text); }
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; background: var(--surface-soft); border: 1px solid var(--line); }
.callout.risk { border-left: 4px solid var(--risk-fg); } .callout.warn { border-left: 4px solid var(--warn-fg); }
.callout.info { border-left: 4px solid var(--info-fg); } .callout.ok { border-left: 4px solid var(--ok-fg); }
mark { background: var(--mark); color: inherit; border-radius: 2px; }

/* --- Änderungen ---------------------------------------------------------------------------------------------- */
.changes { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 24px; align-items: start; }
.snap-list { display: flex; flex-direction: column; gap: 8px; }
.snap { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 44px; padding: 12px 14px; border-radius: 10px; text-align: left; font-size: 15px; cursor: pointer; background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.snap.active { background: var(--strong); color: var(--on-strong); border-color: var(--strong); }
.snap .date { font-weight: 700; }
.snap .sub { font-size: 13px; }
.change { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.change .text { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.change ul { margin: 4px 0 0; padding-left: 18px; font-size: 14px; color: var(--text-2); }
.change li { overflow-wrap: anywhere; }

/* --- Dialog -------------------------------------------------------------------------------------------------- */
.backdrop { position: fixed; inset: 0; background: var(--backdrop); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.dialog { width: 100%; max-width: 520px; background: var(--surface); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }
.dialog h2 { margin: 0; font-size: 22px; font-weight: 800; color: var(--ink); }
.dialog p { margin: 0; color: var(--text-2); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fact { background: var(--bg); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; }
.fact .k { font-size: 13px; color: var(--muted); }
.fact .v { font-size: 18px; font-weight: 800; color: var(--ink); }
.dialog .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

/* --- Partner-Verwaltung -------------------------------------------------------------------------------------- */
.topbar { background: var(--strong); color: var(--on-strong); padding: 16px clamp(16px, 3vw, 44px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.topbar .brand { display: flex; align-items: center; gap: 16px; }
.topbar .brand strong { font-size: 18px; font-weight: 800; }
.topbar .sub, .topbar .who { font-size: 14px; color: var(--on-strong-muted); }
.topbar a { color: var(--on-strong); font-weight: 600; font-size: 14px; }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav a { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--on-strong-muted); }
.topnav a:hover { color: var(--on-strong); }
.topnav a.active { background: rgba(255, 255, 255, .12); color: var(--on-strong); }
textarea { padding: 10px 12px; border: 1px solid var(--field); border-radius: 8px; font: inherit; font-size: 15px; background: var(--surface); color: var(--text); font-weight: 400; resize: vertical; }
.partner-main { padding: 28px clamp(16px, 3vw, 44px) 56px; display: flex; flex-direction: column; gap: 22px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; background: var(--surface); color: var(--text-2); border: 1px solid var(--border); }
.filter[aria-pressed=true] { background: var(--strong); color: var(--on-strong); border-color: var(--strong); }
.partner-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.customer-table tr.selected td { background: var(--accent-soft) !important; }
.customer-btn { display: flex; flex-direction: column; align-items: flex-start; min-height: 44px; justify-content: center; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--ink); font-size: 15px; }
.customer-btn .name { font-weight: 700; }
.customer-btn .domain { font-size: 13px; color: var(--muted); }
dl.facts-list { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; font-size: 14px; }
dl.facts-list dt { color: var(--muted); }
dl.facts-list dd { margin: 0; overflow-wrap: anywhere; }
.ledger-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) max-content; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.invite { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 14px; align-items: end; }
.copy-box { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: var(--accent-soft); color: var(--text); border-radius: 8px; font-size: 14px; overflow-wrap: anywhere; }

/* --- Rollen ------------------------------------------------------------------------------------------------- */
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 16px; }
.role { border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-soft); }
.role.current { border-color: var(--accent); }
.role h3 { margin: 0; font-size: 17px; font-weight: 800; color: var(--ink); }
.role p { margin: 0; }
.role-lists { display: grid; gap: 10px; }
.role h4 { margin: 0 0 4px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.role h4.yes { color: var(--ok-fg); }
.role h4.no { color: var(--risk-fg); }
.role ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.role dl.facts-list { grid-template-columns: minmax(0, 1fr); gap: 2px; }
.role dl.facts-list dt { font-weight: 700; font-size: 13px; margin-top: 4px; }

/* --- Anmeldung (gemäss Mockup: links Marke, rechts Anmeldekarte) --------------------------------------------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); background: var(--login-side); }
.login-side { padding: clamp(32px, 6vw, 88px); display: flex; flex-direction: column; justify-content: center; align-items: center; color: #FFFFFF; position: relative; }
/* Inhalt der Markenfläche: als Block in der linken Hälfte zentriert (wie die Karte rechts), Text linksbündig. */
.login-hero { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 22px; }
.login-side .eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-eyebrow); }
.login-side h1 { margin: 0; font-size: clamp(32px, 4vw, 52px); line-height: 1.1; font-weight: 800; max-width: 20ch; color: #FFFFFF; }
.login-side p { margin: 0; font-size: 18px; color: var(--login-text); max-width: 46ch; }
.login-side .points { display: flex; flex-direction: column; gap: 10px; font-size: 15px; color: var(--login-text); }
.login-side .points span { display: flex; align-items: center; gap: 10px; }
.login-side .theme-toggle { position: absolute; top: 20px; left: 20px; }
.login-main { padding: clamp(24px, 5vw, 72px); display: flex; align-items: center; justify-content: center; background: var(--bg); min-width: 0; }
/* Hinweis auf der Anmeldeseite: bricht innerhalb der Karte um, auch bei schmalem Fenster. */
.login-message { display: block; padding: 10px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
.login-message.risk { background: var(--risk-bg); color: var(--risk-fg); }
.login-message.warn { background: var(--warn-bg); color: var(--warn-fg); }
.login-card { width: 100%; max-width: 440px; background: var(--surface); border-radius: 16px; padding: 40px 36px; display: flex; flex-direction: column; gap: 22px; box-shadow: var(--shadow); }
.login-card .logo { width: 170px; height: auto; align-self: flex-start; }
.login-card h2 { margin: 0; font-size: 24px; font-weight: 800; color: var(--ink); }
.login-card p { margin: 0; color: var(--text-2); }
.login-button { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; border-radius: 10px; background: var(--login-button); color: var(--login-button-text); font-size: 16px; font-weight: 700; text-decoration: none; border: 1px solid var(--login-button); }
.login-button:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.login-links { display: flex; flex-direction: column; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.login-links a { font-weight: 600; }
.dev-users { display: flex; flex-direction: column; gap: 8px; }
.dev-user { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); }
.dev-user:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.dev-user strong { color: var(--ink); }

/* --- Hilfe ---------------------------------------------------------------------------------------------------- */
.help { width: 100%; max-width: 1180px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 64px; display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: 24px; align-items: start; }
.help-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 16px; }
.help-nav a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; }
.help-nav a:hover { background: var(--surface); color: var(--ink); }
.help-nav a.active { background: var(--strong); color: var(--on-strong); font-weight: 700; }
.help-article h1 { margin: 0; font-size: 28px; color: var(--ink); }
.help-article h2 { margin: 12px 0 0; font-size: 20px; color: var(--ink); }
.help-article h3 { margin: 8px 0 0; font-size: 17px; color: var(--heading-accent); }
.help-article img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 10px; }
.help-article table { width: 100%; border-collapse: collapse; font-size: 14px; }
.help-article th { background: var(--strong); color: var(--on-strong); text-align: left; padding: 8px 12px; }
.help-article td { padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.help-article blockquote { margin: 0; padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--surface-soft); border-radius: 8px; }
@media (max-width: 860px) { .help { grid-template-columns: minmax(0, 1fr); } .help-nav { position: static; } }

/* --- Einzelseiten (Kein Zugang, Fehler, Onboarding) ---------------------------------------------------------- */
.plain-head { background: var(--surface); border-bottom: 1px solid var(--border); padding: 18px clamp(16px, 4vw, 48px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.plain-head .logo { width: 140px; height: auto; }
.plain-main { width: 100%; max-width: 980px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 40px) 64px; display: flex; flex-direction: column; gap: 28px; }
.plain-main h1 { margin: 0; font-size: clamp(26px, 3vw, 34px); line-height: 1.2; font-weight: 800; color: var(--ink); }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login .card { width: 100%; max-width: 480px; padding: 32px; gap: 18px; }
.login .logo { width: 160px; height: auto; }
.login h1 { margin: 0; font-size: 26px; font-weight: 800; color: var(--ink); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 10px; }
.steps li { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.steps li.active { background: var(--strong); color: var(--on-strong); border-color: var(--strong); }
.steps li.done { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bg); }
.steps .n { font-size: 13px; font-weight: 700; }
.steps .t { font-weight: 700; }

/* --- Fehleranzeige von Blazor -------------------------------------------------------------------------------- */
#blazor-error-ui { background: var(--warn-bg); color: var(--warn-fg); bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2); display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: var(--risk-bg); color: var(--risk-fg); padding: 1rem; border-radius: 8px; }
.blazor-error-boundary::after { content: "Dieser Bereich konnte nicht angezeigt werden."; }

@media (max-width: 860px) {
    .sidebar { max-width: none; flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--border); padding: 18px 16px; gap: 16px; }
    .nav { flex-direction: row; flex-wrap: wrap; }
    .account { margin-top: 0; }
    .docs, .changes, .partner-grid { grid-template-columns: minmax(0, 1fr); }
    .docs-nav { position: static; }
    .doc { padding: 20px 18px; }
    .finding { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .change { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .login-side .theme-toggle { position: static; align-self: flex-start; margin-bottom: 8px; }
}
