/* ISMS-Portal – appearance of the DSB portal: navy/slate, white top bar with accent
   line, side navigation, rounded cards with soft shadow, dark mode. No external
   resources (CSP). */
:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #1c2430;
    --muted: #5d6b7c;
    --border: #d7dce3;
    --grid: #eaecf0;
    --accent: #1f5f99;
    --accent-text: #ffffff;
    --ok: #1d7a46;
    --ok-bg: #e7f6ec;
    --warn: #8a5a00;
    --warn-bg: #fff6e0;
    --error: #a32020;
    --error-bg: #fdecec;
    --info-bg: #eaf2fb;
    --critical: #d92d20;
    --high: #f79009;
    --radius: 6px;
    --card-radius: 14px;
    --shadow: 0 8px 22px rgba(15, 23, 42, .06);
    --nav-w: 248px;
    --brand-navy: #1f2a44;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
}
.surface-admin { --accent: #5b3a8c; }

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #12161c; --surface: #1b2129; --surface-2: #202833; --text: #e6e9ee; --muted: #9aa6b5;
        --border: #313a46; --grid: #2a323d; --accent: #6ea8de; --accent-text: #0d1117;
        --info-bg: #17283a; --warn-bg: #2e2412; --error-bg: #3a1717; --ok-bg: #12301f;
        --ok: #57c98a; --warn: #e5b45a; --error: #f08a8a;
        --shadow: 0 8px 22px rgba(0, 0, 0, .35);
    }
    .surface-admin { --accent: #b69ae6; }
    .chart-svg { background: #ffffff; border-radius: 10px; }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.45; font-size: 14px; }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: .2em 0 .5em; }
h2 { font-size: 1.12rem; margin: .3em 0 .5em; }
h3 { font-size: 1rem; margin: .4em 0; }
code { font-size: .92em; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }

/* ------------------------------------------------------------------ top bar */
.topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px 16px;
    padding: 8px 16px; min-height: 56px; background: var(--surface);
    border-bottom: 3px solid var(--accent); box-shadow: var(--shadow);
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--text); }
.brand .icon { width: 26px; height: 26px; color: var(--accent); }
.user { margin-left: auto; display: flex; align-items: center; gap: 4px; color: var(--muted); flex-wrap: wrap; }
.user .username { margin-right: 6px; }
.menu-toggle {
    display: none; align-items: center; justify-content: center; width: 40px; height: 40px;
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 18px;
}
.nav-toggle { position: absolute; left: -999px; }

/* ------------------------------------------------------------------ layout + side navigation */
.layout { display: block; }
main { padding: 20px 24px 40px; max-width: 1360px; width: 100%; margin: 0 auto; min-width: 0; }
.anonymous-main { max-width: 560px; }
.sidenav { background: var(--surface); border-right: 1px solid var(--border); }
.mainnav { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px 24px; }
.navlink { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.navlink .icon { color: var(--accent); }
.navlink:hover { background: var(--bg); }
.navlink.current { background: color-mix(in srgb, var(--accent) 13%, transparent); font-weight: 600; }
.navlink.sub { padding: 6px 10px 6px 18px; font-size: .94rem; }
/* accordion: area entries with sub-items only while the area is in focus */
.navlink.navarea::after { content: "›"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.navlink.navarea.open { font-weight: 600; }
.navlink.navarea.open::after { transform: rotate(90deg); }
.navlink.navarea.open + .navlink.sub, .navlink.sub + .navlink.sub { margin-left: 14px; border-left: 2px solid var(--border); border-radius: 0 10px 10px 0; }
.navlink.disabled { color: var(--muted); cursor: default; }
.navlink.disabled .icon { color: var(--muted); }
.navgroup { margin-top: 12px; }
.navgroup.admin .icon { color: #5b3a8c; }
.navhead { display: flex; align-items: center; gap: 10px; padding: 6px 10px; font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.navhead .icon { width: 16px; height: 16px; }

@media (min-width: 1024px) {
    .layout { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); align-items: start; }
    .sidenav { position: sticky; top: 59px; height: calc(100vh - 59px); overflow-y: auto; }
}
@media (max-width: 1023px) {
    .menu-toggle { display: inline-flex; }
    .sidenav { display: none; }
    .nav-toggle:checked + .layout .sidenav { display: block; border-bottom: 1px solid var(--border); }
    main { padding: 16px; }
}

/* ------------------------------------------------------------------ cards, page head */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--card-radius);
    padding: 16px 20px; margin: 0 0 16px; box-shadow: var(--shadow);
}
.card.narrow { max-width: 460px; margin: 48px auto; }
.card > h2:first-child { margin-top: 0; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.pagehead h1 { margin: 0; }
.pagehead .actions { margin: 0; }
.subnav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.subnav a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); }
.subnav a:hover { border-color: var(--accent); }

/* ------------------------------------------------------------------ buttons and forms */
button, .button, .btn {
    font: inherit; border-radius: 6px; padding: 7px 14px; cursor: pointer; border: 1px solid var(--accent);
    background: var(--accent); color: var(--accent-text); display: inline-flex; align-items: center; gap: 6px;
    text-decoration: none; margin: 4px 6px 4px 0; line-height: 1.3;
}
.button.secondary, .btn-secondary { background: var(--surface); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--accent); border-color: transparent; padding: 6px 8px; margin: 0; }
.btn-ghost:hover { background: var(--bg); }
button:disabled, .button[disabled] { opacity: .5; cursor: not-allowed; }
button.link { background: none; border: none; padding: 0; margin: 0; color: var(--accent); }
button.small { padding: 3px 8px; font-size: 12px; margin: 2px 4px 2px 0; }
.btn .icon, button .icon { width: 16px; height: 16px; }
form.inline { display: inline; }

label { display: block; margin: 8px 0 4px; font-weight: 600; font-size: .92rem; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: normal; margin: 4px 10px 4px 0; }
input, select, textarea {
    font: inherit; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--surface); color: var(--text); max-width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
input[type="checkbox"] { width: auto; }
.card.narrow input { width: 100%; }
.formgrid { display: grid; grid-template-columns: 220px minmax(0, 520px); gap: 8px 14px; align-items: center; margin-bottom: 8px; }
.formgrid label { margin: 0; }
.formgrid input:not([type="checkbox"]), .formgrid select { width: 100%; }
.formgrid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .formgrid { grid-template-columns: 1fr; } }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 0 0 12px; }
.filters label { margin: 0; display: flex; flex-direction: column; gap: 4px; }
/* several checkboxes of one filter in a row (e.g. priorities) */
.filters .filter-group { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; padding-bottom: 6px; }
.filters .filter-group label.inline { flex-direction: row; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.actions form { display: inline-block; }
.actions input { width: 160px; padding: 3px 6px; font-size: 12px; }
.signin-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.signin-options .button { justify-content: center; }

/* ------------------------------------------------------------------ messages, badges */
.notice, .error { border-radius: var(--radius); padding: 10px 14px; margin: 10px 0; border: 1px solid var(--border); }
.notice { background: var(--info-bg); border-left: 4px solid var(--accent); }
p.error, div.error { background: var(--error-bg); border-color: var(--error); color: var(--text); }
span.error { color: var(--error); }
.small { font-size: 12px; color: var(--muted); }
.badge { display: inline-block; font-size: .78rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); }
.badge.ok { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.badge.warn { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); }
.badge.err { border-color: var(--error); color: var(--error); background: var(--error-bg); }
pre.log { white-space: pre-wrap; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; max-height: 480px; overflow: auto; }
.qr { display: block; margin: 12px auto; width: 220px; height: 220px; image-rendering: pixelated; background: #fff; padding: 6px; border-radius: 8px; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table.report { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 12.5px; border-radius: 10px; overflow: clip; box-shadow: var(--shadow); }
table.report th, table.report td { padding: 6px 9px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.report th { background: var(--surface-2); color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; position: sticky; top: 59px; }
/* overflow: clip (not hidden) keeps the page as scroll container of the sticky header; inside a
   horizontally scrolling wrapper the wrapper is the container, there the header must not move down. */
.table-wrap table.report th { top: 0; }
/* row header that looks like a normal cell (e.g. key figure labels) */
/* only for screen readers (e.g. column headers of the plan tables) */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
table.report th.row-label { background: none; color: inherit; font-size: inherit; font-weight: normal; text-transform: none; letter-spacing: normal; position: static; }
table.report tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.nowrap { white-space: nowrap; }
td.long { max-width: 460px; }
.reportlist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.reportlist li { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.reportlist li a { font-weight: 600; text-decoration: none; }

/* users page */
.modulerole { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.modulerole span { min-width: 170px; font-size: 12px; }

/* ------------------------------------------------------------------ start page tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tile {
    display: block; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--accent);
    border-radius: var(--card-radius); padding: 18px; color: var(--text); text-decoration: none; box-shadow: var(--shadow);
    transition: transform .12s ease, box-shadow .12s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15, 23, 42, .1); }
.tile h2 { display: flex; align-items: center; gap: 8px; }
.tile h2 .icon { color: var(--accent); width: 24px; height: 24px; }
.icon.icon-color { width: 22px; height: 22px; }
.tile h2 .icon.icon-color { width: 34px; height: 34px; }
.tile.disabled { border-top-color: var(--border); color: var(--muted); }
.tile.disabled:hover { transform: none; }
.tile-main { display: block; color: inherit; text-decoration: none; }
.tile-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.tile-links a { font-size: .85em; padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--accent); background: var(--surface); }
.tile-links a:hover { border-color: var(--accent); }
a.kpi { color: inherit; text-decoration: none; }
a.kpi:hover { border-color: var(--accent); }

/* ------------------------------------------------------------------ dashboard */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--card-radius); padding: 14px 16px;
    box-shadow: var(--shadow); border-left: 5px solid #98a2b3; position: relative;
}
.kpi .label { font-size: .85rem; color: var(--muted); }
.kpi .value { font-size: 2rem; font-weight: 700; line-height: 1.15; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
/* Text bleibt immer im Kasten: Schrift passt sich der Kachelbreite an, lange Werte brechen um */
.kpi { min-width: 0; container-type: inline-size; }
.kpi .label, .kpi .value, .kpi .hint { overflow-wrap: anywhere; hyphens: auto; }
@supports (font-size: 1cqi) { .kpi .value { font-size: clamp(1.05rem, 13cqi, 2rem); } }
.kpi .hint { font-size: .78rem; color: var(--muted); }
.kpi.critical { border-left-color: var(--critical); } .kpi.critical .value { color: var(--critical); }
.kpi.warn { border-left-color: var(--high); } .kpi.warn .value { color: var(--high); }
.kpi.ok { border-left-color: #12b76a; } .kpi.ok .value { color: #12b76a; }
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 560px), 1fr)); gap: 16px; }
.chart-card { margin: 0; }
.chart-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.chart-card header h2 { margin: 0; }
.chart-card .chart-actions { display: flex; gap: 2px; }
.chart-card .chart-actions a, .chart-card .chart-actions button { font-size: 12px; padding: 3px 8px; margin: 0; }
.chart-svg { width: 100%; height: auto; display: block; margin-top: 8px; }
.freshness { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 16px; }
.freshness div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--border); padding: 4px 0; }

/* ------------------------------------------------------------------ print: A4 landscape */
/* ------------------------------------------------------------------ tenants */
.tenant-logo { height: 28px; max-width: 140px; object-fit: contain; }
.tenant-badge { margin-left: 12px; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.tenant-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tenant-tile { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; border-left: 6px solid var(--border); }
.tenant-tile img { height: 40px; max-width: 180px; object-fit: contain; }
.tenant-tile.current { outline: 2px solid var(--accent); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--border); vertical-align: middle; }

/* ------------------------------------------------------------------ IRM forms */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .form-layout { grid-template-columns: 1fr; } }
.form-side { position: sticky; top: 72px; }
.form-tabs a.current, .subnav a.current { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.form-heading { margin: 20px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--grid); font-size: 15px; }
.form-row { display: grid; grid-template-columns: 260px minmax(0, 640px); gap: 6px 14px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--grid); }
.form-row > label, .form-row > .label { margin: 0; font-weight: 500; }
.form-row input:not([type="checkbox"]), .form-row select, .form-row textarea { width: 100%; }
.form-row.computed { background: var(--surface-2); padding: 8px; border-radius: var(--radius); }
@media (max-width: 700px) { .form-row { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; margin: 8px 0 12px; }
table.form-table td { vertical-align: top; }
table.form-table input:not([type="checkbox"]), table.form-table select, table.form-table textarea { width: 100%; min-width: 90px; }
table.form-table td.long { min-width: 260px; }
table.report.compact td, table.report.compact th { padding: 3px 8px; }
details.damage { margin: 8px 0 12px; border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 10px; background: var(--surface-2); }
details.damage summary { cursor: pointer; font-weight: 600; }
.form-actions { position: sticky; bottom: 0; padding: 10px 0 2px; background: var(--surface); border-top: 1px solid var(--grid); margin-top: 12px; }
progress.progress { width: 100%; height: 12px; accent-color: var(--accent); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
ul.changes { list-style: none; padding: 0; margin: 0; font-size: 12px; max-height: 360px; overflow-y: auto; }
ul.changes li { padding: 4px 0; border-bottom: 1px solid var(--grid); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
label.inline { display: inline-flex; align-items: center; gap: 4px; margin: 2px 12px 2px 0; }
form.inline { display: inline-block; }
.question { padding: 8px 0; border-bottom: 1px dashed var(--grid); display: grid; gap: 6px; }
.question > label { font-weight: 500; margin: 0; }
.question textarea { width: 100%; }
.question-review { display: grid; grid-template-columns: max-content 220px minmax(0, 1fr); gap: 6px 10px; align-items: center; background: var(--surface-2); padding: 6px; border-radius: var(--radius); }
@media (max-width: 700px) { .question-review { grid-template-columns: 1fr; } }
table.report tr.row-err td { background: var(--error-bg); }
table.report tr.row-warn td { background: var(--warn-bg); }

@media print {
    @page { size: A4 landscape; margin: 10mm; }
    body { background: #fff; font-size: 9pt; }
    .no-print, .topbar, .sidenav, .filters, .chart-actions, .subnav { display: none !important; }
    .layout { display: block; }
    main { padding: 0; max-width: none; }
    .card, .kpi, table.report { box-shadow: none; }
    .card { border: none; padding: 0; margin-bottom: 8mm; }
    .charts { grid-template-columns: 1fr 1fr; }
    .chart-card { break-inside: avoid; }
    a { color: inherit; text-decoration: none; }
    table.report { font-size: 7.5pt; }
    table.report th { position: static; background: #e6e9ee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    table.report thead { display: table-header-group; }
    table.report tr { break-inside: avoid; }
}

/* BCM: process register, process map, BIA matrices */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; }
details.tree { margin-top: 4px; }
details.tree ul { margin: 4px 0 0 0; padding-left: 18px; }
.legend-item { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; }
.process-map { max-height: 900px; }
table.matrix td, table.matrix th { text-align: center; padding: 3px 6px; }
table.matrix td:first-child, table.matrix th:first-child { text-align: left; white-space: nowrap; }
table.matrix select { min-width: 4.5em; }
table.matrix td.lvl-3 { background: var(--warn-bg); }
table.matrix td.lvl-4 { background: var(--error-bg); }
.facts-inline { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 6px 0; }

/* Reifegrad: Netzdiagramm neben der Ergebnistabelle */
.maturity-result { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 1rem; align-items: start; }
.maturity-result svg.radar { width: 100%; height: auto; }
@media (max-width: 900px) { .maturity-result { grid-template-columns: 1fr; } }
.heatmaps { display: flex; flex-wrap: wrap; gap: 1rem; }
.heatmap { margin: 0; }
.heatmap figcaption { margin-bottom: .25rem; max-width: 16rem; }
.heatmap table { border-collapse: collapse; }
.heatmap th { font-weight: normal; font-size: .8rem; padding: 0 .3rem; }
.heatmap td { width: 2.6rem; height: 2.2rem; text-align: center; font-weight: 600; border: 1px solid var(--border); }
.heat-1 { background: var(--ok-bg); color: var(--ok); }
.heat-2 { background: var(--warn-bg); color: var(--warn); }
.heat-3 { background: #f9d9b8; color: #7a3d00; }
.heat-4 { background: var(--error-bg); color: var(--error); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .heat-3 { background: #4a2d12; color: #f5c08a; } }
:root[data-theme="dark"] .heat-3 { background: #4a2d12; color: #f5c08a; }
.chart-wrap { overflow-x: auto; }
.flow-chart { min-width: 640px; max-height: 1100px; }
.pathnav { margin: 0 0 .5rem; }
.list-filter { align-items: end; }
.list-filter .pager a { margin-left: .5rem; }
.lang-switch { margin-left: auto; display: inline-flex; gap: 2px; }
.lang-switch .current { font-weight: 700; text-decoration: underline; }
.lang-switch.file-lang { margin-left: 8px; align-items: center; }

/* ------------------------------------------------------------------ incidents */
.grid-2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.timeline { list-style: none; padding: 0; margin: 10px 0 0; border-left: 2px solid var(--border); }
.timeline li { padding: 6px 0 6px 12px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

/* large view in its own tab (_LayoutBare) */
body.bare { background: var(--bg); }
.bare-main { padding: 12px 18px; max-width: none; }
.bare-main .chart-wrap svg { width: 100%; height: auto; max-height: none; }
.map-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 10px; }
.map-filters label { display: inline-flex; gap: 6px; align-items: center; }

/* IRM reports: one block per risk, page break friendly */
.report-risk { border-top: 1px solid var(--border); padding: 10px 0; break-inside: avoid; }
.report-risk h3 { margin: 0 0 6px; }
.report-risk table { margin-top: 6px; }
.focus-pick { position: relative; }
.focus-pick summary { cursor: pointer; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.focus-pick .focus-list { position: absolute; z-index: 20; margin-top: 4px; padding: 10px; max-height: 360px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.12); min-width: 320px; }
.focus-pick fieldset { border: 0; padding: 0; margin: 0 0 8px; }
.focus-pick label { display: flex; gap: 6px; padding: 2px 0; }
svg .focus > polygon, svg .focus > a > polygon, svg .focus rect:first-of-type { stroke-width: 3; }
.signature-preview { border: 1px dashed var(--border); border-radius: 10px; padding: 12px; background: #fff; color: #111; }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; width: 100%; }

/* ------------------------------------------------------------------ newsletter editor */
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0 6px; }
.rte-toolbar .button, .rte-toolbar button { padding: 4px 10px; }
.rte-editor, .rte-preview { min-height: 320px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow-wrap: anywhere; }
.rte-editor:focus { outline: 2px solid var(--accent); }
.rte-editor img, .rte-preview img { max-width: 100%; height: auto; }
.rte-editor blockquote, .rte-preview blockquote { margin: 8px 0; padding: 6px 12px; border-left: 4px solid var(--accent); background: var(--surface-2); }

/* inactivity hint and expired session (portal.js) */
.session-box {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1000;
    max-width: 26rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #d0d7de);
    border-left: 5px solid var(--accent, #0b5cad);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.session-box p { margin: 0 0 .75rem; }
.session-expired { border-left-color: #b42318; }
.session-restored button { margin-left: .5rem; }

/* "?" with the explanation of a MESARI requirement (_FormSection) */
.req-help { display: inline-block; margin-left: .35rem; vertical-align: middle; }
.req-help > summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-text);
    font-weight: 700;
    font-size: .8rem;
    cursor: pointer;
}
.req-help > summary::-webkit-details-marker { display: none; }
.req-help[open] { display: block; margin: .5rem 0 0; }
.req-help[open] > summary { margin-bottom: .35rem; }
.req-help-text {
    padding: .6rem .8rem;
    border-left: 3px solid var(--accent);
    background: var(--surface-2);
    border-radius: 6px;
    font-weight: normal;
}
.req-help-text p { margin: 0 0 .4rem; }
.req-help-text p:last-child { margin-bottom: 0; }

/* breadcrumb above the page (portal.js) */
nav.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 10px; font-size: .85rem; color: var(--muted); }
nav.breadcrumb a { color: var(--muted); text-decoration: none; }
nav.breadcrumb a:hover { color: var(--text); text-decoration: underline; }
nav.breadcrumb [aria-current] { color: var(--text); }
nav.breadcrumb .sep { opacity: .6; }
/* loading bar right after a click in the menu */
html.is-loading { cursor: progress; }
html.is-loading body::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 1000;
  background: linear-gradient(90deg, transparent, var(--accent), transparent) no-repeat; background-size: 40% 100%; animation: isms-navload 1s linear infinite; }
@keyframes isms-navload { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@media (prefers-reduced-motion: reduce) { html.is-loading body::before { animation: none; background: var(--accent); } }
@media print { nav.breadcrumb { display: none; } }

/* Awareness game (management pages) */
.game-thumb { max-width: 160px; max-height: 110px; border: 1px solid var(--border); border-radius: 6px; background: #fff; display: block; }
.game-gallery { display: flex; flex-wrap: wrap; gap: 12px; }
.game-gallery a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.game-letter-input { width: 3em; text-align: center; text-transform: uppercase; font-weight: 700; }
.game-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.game-suggest button { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .05em; }
.game-link code { word-break: break-all; font-size: 1rem; }
button.danger { color: var(--error); border-color: var(--error); }
.game-board-admin .game-board { list-style: none; margin: 0; padding: 0; }
.game-board-admin .game-board-team { padding: 8px 0; border-top: 1px solid var(--border); }
.game-board-admin .game-board-team:first-child { border-top: 0; }
.game-board-admin .game-board-head { display: flex; gap: 12px; justify-content: space-between; }
.game-board-admin .game-board-name { font-weight: 700; }
.game-board-admin .game-board-team.is-solved .game-board-status { color: var(--ok); font-weight: 700; }
.game-board-admin .game-board-team.is-failed .game-board-status { color: var(--error); }
.game-board-admin .game-tiles { display: flex; gap: 6px; margin-top: 6px; }
.game-board-admin .game-tile { display: inline-grid; place-items: center; min-width: 30px; height: 34px; border-radius: 6px; font-weight: 800; font-family: ui-monospace, Menlo, Consolas, monospace;
  border: 2px dashed var(--border); color: var(--muted); }
.game-board-admin .game-tile.is-key { border: 3px solid #ef4444; color: var(--text); background: var(--bg); }

/* KPI tiles as filter links (Scan-Abdeckung) */
a.kpi { text-decoration: none; color: inherit; }
a.kpi:hover, a.kpi:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; }

/* Paging of long lists */
nav.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; margin: 0.6rem 0; }
nav.pager a { text-decoration: none; }

/* ---- BCM-CP-Ergänzungen ---- */
.center { text-align: center; }
.banner { padding: 10px 14px; border-radius: var(--radius); margin: 12px 0; }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.warn { background: var(--warn-bg); color: var(--warn); margin: 12px 24px; }
.banner.error { background: var(--error-bg); color: var(--error); }
.banner.info { background: var(--info-bg); }
main.card { margin: 24px; }
main.card.narrow { margin: 48px auto; }
main label { display: block; margin: 10px 0; font-weight: 600; }
main label input { display: block; width: 100%; margin-top: 4px; font-weight: normal; }
main table { width: 100%; border-collapse: collapse; margin: 12px 0; }
main table th, main table td { padding: 6px 9px; border-bottom: 1px solid var(--border); text-align: left; }
button.primary { background: var(--accent); color: var(--accent-text); border: 0; padding: 8px 16px; border-radius: var(--radius); cursor: pointer; }
.topbar nav a { margin: 0 6px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--border); border-radius: var(--card-radius); text-decoration: none; color: var(--text); background: var(--surface); opacity: .75; }
.tile.ready { opacity: 1; border-color: var(--ok); }
.tile span { font-size: 13px; color: var(--muted); }
.tile em { font-style: normal; font-size: 12px; color: var(--muted); }
.tile.ready em { color: var(--ok); font-weight: 600; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
main.crisis { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 24px; }
main.crisis .card { margin: 0; }
main.crisis .span2 { grid-column: span 2; }
@media (max-width: 900px) { main.crisis { grid-template-columns: 1fr; } main.crisis .span2 { grid-column: span 1; } }
.dash { border-top: 4px solid var(--critical); }
.dash-head { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; }
.dash-head h1 { margin: 0; font-size: 1.6rem; }
.dash-head p { margin: 4px 0 0; font-size: 1.1rem; font-weight: 600; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; font-size: 1.05rem; }
.dash-grid h3 { margin: 0 0 6px; font-size: .9rem; text-transform: uppercase; color: var(--muted); }
.steps { display: flex; flex-wrap: wrap; gap: 8px; }
.steps button { padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--surface); color: var(--accent); font-weight: 600; }
.jitsi { min-height: 160px; display: grid; place-items: center; text-align: center; border: 2px dashed var(--border); border-radius: var(--radius); color: var(--muted); }
tr.struck td { text-decoration: line-through; color: var(--muted); }
.topbar .spacer { flex: 1; }
.right { text-align: right; margin: 0; }
a.lang { font-size: 13px; }
