/* PatchRecon Portal
   Farben: Seenacht-Blau #0F1B2D, Papier #F7F4EE, Zürirot #C0202A.
   Schriften: Geist (Text), Monomaniac One (Wortmarke). Alle Schriften lokal (SIL Open Font License, siehe /fonts). */

@font-face { font-family: "Geist"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/geist-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/geist-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/geist-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/geist-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/geist-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/geist-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Monomaniac One"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/monomaniac-one-latin-400-normal.woff2") format("woff2"); }

[hidden] { display: none !important; }

:root {
    --navy: #0F1B2D;
    --navy-2: #16253B;
    --paper: #F7F4EE;
    --ground: #F6F4F0;
    --red: #C0202A;
    --red-dark: #9E1A22;
    --red-hover: #A51B24;
    --red-light: #F0625A;
    --ink: #0F1B2D;
    --muted: #5B6474;
    --line: #E6E1D8;
    --line-soft: #F0ECE4;
    --field: #D4CDBF;
    --card: #FFFFFF;
    --card-alt: #FAF8F4;
    --side-text: #C9D1DC;
    --side-muted: #B8C4D3;
    --teal: #0E8A7E;
    --ok-bg: #D9F2EC; --ok-fg: #0B6A60;
    --crit-bg: #FBE4E4; --crit-fg: #9E1A22;
    --high-bg: #FDEBD9; --high-fg: #8F3B06;
    --med-bg: #FAF0CF; --med-fg: #6B4D00;
    --neutral-bg: #EFEBE3; --neutral-fg: #3B4656;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(15, 27, 45, 0.04);
    --shadow-lg: 0 18px 40px rgba(15, 27, 45, 0.14);
    --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--ground); }
a { color: var(--red); }
a:hover { color: var(--red-dark); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
code, .mono { font-family: var(--mono); }
.icon { flex: 0 0 auto; }
.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; }
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--card); color: var(--ink); padding: 10px 14px; border-radius: var(--radius-sm); z-index: 10; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid #2F6FDB; outline-offset: 2px; }
main:focus { outline: none; }

/* Wortmarke */
.brand { display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none; }
.wordmark { font-family: "Monomaniac One", var(--font); font-size: 24px; line-height: 1; color: var(--paper); }
.wordmark-red { color: var(--red); }
.brand-tag { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--side-muted); }
.brand-lg .wordmark { font-size: 34px; }
.brand-lg .brand-tag { font-size: 13px; }

/* App-Rahmen (Layout D): dunkle Kopfzeile, helle Reiterleiste, Inhalt mittig */
.wrap { max-width: 1360px; margin: 0 auto; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); box-sizing: border-box; width: 100%; }
.topbar { background: var(--navy); color: #E9EEF5; }
.topbar-inner { display: flex; align-items: center; gap: 14px; min-height: 60px; }
.logo { display: flex; align-items: center; align-self: stretch; padding-right: 18px; border-right: 1px solid rgba(233, 238, 245, 0.16); }
.logo img { display: block; height: 26px; width: auto; }
.org { display: inline-flex; align-items: center; gap: 8px; color: #E9EEF5; text-decoration: none; font-weight: 500; min-width: 0; }
.org:hover { color: #fff; }
.org-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; }
.plan { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; padding: 1px 8px; border-radius: 999px; background: rgba(240, 98, 90, 0.2); color: #FFB3AD; }
.topbar-spacer { flex: 1 1 auto; }
.topbtn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid rgba(233, 238, 245, 0.18); color: #E9EEF5; cursor: pointer; list-style: none; font-size: 14px; font-weight: 500; }
.topbtn::-webkit-details-marker { display: none; }
.topbtn:hover { background: rgba(233, 238, 245, 0.08); }
.topbtn-user { padding: 0 8px 0 4px; }
.topbtn .avatar { width: 28px; height: 28px; font-size: 12px; }
.topbtn-name { max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 34px; height: 34px; border-radius: 999px; background: var(--red); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: 0 0 auto; }
.menu { position: relative; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 260px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; animation: menu-in .14s ease-out; }
.menu-narrow { min-width: 190px; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-head { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.menu-head span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.menu-list { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.menu-foot { border-top: 1px solid var(--line-soft); margin-top: 4px; padding-top: 4px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--card-alt); color: var(--ink); }
.menu-item[aria-current] { font-weight: 600; }
.menu-item .icon { color: var(--muted); }
.menu-check { margin-left: auto; color: var(--teal); }
.menu-danger { color: var(--red-dark); }
.menu-danger .icon { color: var(--red-dark); }
.tabbar { background: var(--card); border-bottom: 1px solid var(--line); }
.tabbar-inner { display: flex; align-items: center; gap: 16px; }
/* Reiter behalten ihre Breite; zuerst weicht der Status (Text gekürzt, unter 1100 px nur «x von y online»).
   Erst wenn auch dann der Platz fehlt, scrollen die Reiter. position: relative hält versteckte Texte (sr-only)
   im Scrollbereich, sonst wird die Seite auf dem Telefon breiter als der Bildschirm. */
.tabbar-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 0 1 auto; min-width: 0; position: relative; }
.tabbar-tabs::-webkit-scrollbar { display: none; }
@media (max-width: 720px) { .tabbar-tabs { mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); } }
.tabbar-tab { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px; color: #4E5A6B; text-decoration: none; border-bottom: 2px solid transparent; font-weight: 500; white-space: nowrap; }
.tabbar-tab:hover { color: var(--ink); }
.tabbar-tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--red); }
.tabbar-count { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tabbar-badge { font-family: var(--mono); font-size: 11px; font-weight: 600; background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.tabbar-status { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; flex: 1 1 0; min-width: 0; overflow: hidden; }
.tabbar-status-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tabbar-status .dot { flex: 0 0 auto; }
@media (max-width: 1099px) { .tabbar-status-extra { display: none; } }
.content { padding-top: 28px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.footer { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-top: 18px; padding-bottom: 28px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.footer a { color: var(--muted); }
.dot.pulse { animation: dot-pulse 1.8s ease-in-out infinite; }
@keyframes dot-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(14, 138, 126, 0.5); } 50% { box-shadow: 0 0 0 5px rgba(14, 138, 126, 0); } }
@media (max-width: 899px) {
    .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
    .content { padding-top: 20px; }
    .tabbar-status, .topbtn-name, .org .plan { display: none; }
    .logo { padding-right: 12px; }
    .logo img { height: 22px; }
    .org-name { max-width: 16ch; }
    h1 { font-size: 26px; }
}
@media (max-width: 520px) {
    .org { display: none; }
}

/* Auftritt beim Laden: Karten erscheinen kurz nacheinander */
.rise { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
.rise-2 { animation-delay: .06s; }
.rise-3 { animation-delay: .12s; }
.rise-4 { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Kopfbereich einer Seite */
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.page-title { display: flex; flex-direction: column; gap: 6px; }
.page-sub { font-size: 15px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.breadcrumb { font-size: 14px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }

/* Knöpfe */
.btn { transition: background-color .15s, border-color .15s, transform .1s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--radius-sm); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-hover); color: #fff; }
.btn-outline { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-outline:hover { background: var(--navy-2); color: #fff; }
.btn-quiet { background: var(--card); color: var(--ink); border-color: var(--field); }
.btn-quiet:hover { border-color: var(--ink); color: var(--ink); }
.btn-danger { background: var(--card); color: var(--red-dark); border-color: #E8B4B4; }
.btn-danger:hover { background: var(--crit-bg); color: var(--red-dark); }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-light { background: transparent; color: #fff; border-color: rgba(247, 244, 238, 0.4); }
.btn-light:hover { background: rgba(247, 244, 238, 0.08); color: var(--paper); }
.btn:active { transform: translateY(1px); }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--red); text-decoration: underline; cursor: pointer; }
.link-button:hover { color: var(--red-dark); }

/* Karten und Raster */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.card-flush { padding: 8px 20px; }
.row { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col-2 { flex: 2 1 520px; min-width: 0; }
.col-1 { flex: 1 1 320px; min-width: 0; }
.col-half { flex: 1 1 400px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi { display: flex; flex-direction: column; gap: 8px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s, border-color .2s; }
a.kpi:hover { border-color: #CFC6B6; color: var(--ink); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 27, 45, 0.08); }
.kpi-label { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.kpi-value { font-size: 32px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 16px; color: var(--muted); font-weight: 500; }
.kpi-sub { font-size: 13px; color: var(--muted); }
.text-crit { color: var(--crit-fg); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Hinweise */
.notice { padding: 14px 18px; border-radius: var(--radius); font-size: 14px; border: 1px solid; }
.notice-success { background: var(--ok-bg); border-color: #A9D9BF; color: #0F3D27; }
.notice-error { background: var(--crit-bg); border-color: #F0C4C4; color: #6E1218; }
.notice-warn { background: var(--high-bg); border-color: #EBD3A8; color: #5C3A06; }
.notice-warn p { margin: 0; }
.notice.requirement { margin-bottom: 20px; }
.notice-warn a { color: inherit; font-weight: 600; }
.alert { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 18px 20px; background: var(--card); border: 1px solid #F0C4C4; border-radius: var(--radius); }
.alert-body { display: flex; gap: 14px; align-items: center; min-width: 0; }
.alert-icon { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; background: var(--crit-bg); color: var(--red); display: inline-flex; align-items: center; justify-content: center; }
.alert-text { display: flex; flex-direction: column; gap: 2px; }
.alert-text strong { font-size: 16px; font-weight: 600; }
.alert-text span { font-size: 14px; color: var(--muted); }
.info { display: flex; gap: 14px; align-items: flex-start; padding: 16px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; line-height: 1.55; }

/* Chips und Punkte */
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip-critical { background: var(--crit-bg); color: var(--crit-fg); }
.chip-high { background: var(--high-bg); color: var(--high-fg); }
.chip-medium { background: var(--med-bg); color: var(--med-fg); }
.chip-neutral { background: var(--neutral-bg); color: var(--neutral-fg); font-weight: 500; }
.chip-ok { background: var(--ok-bg); color: var(--ok-fg); }
.chip-kev { background: var(--red); color: #fff; }
.chip-outline { border: 1px solid #DDD6C8; font-weight: 500; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; flex: 0 0 auto; }
.dot-ok { background: #1F8A5B; }
.dot-muted { background: #A0A7B2; }
.dot-warn { background: #C87A12; }
.dot-error { background: var(--red); }
.dot-info { background: #7A8290; }
.status { display: inline-flex; align-items: flex-start; gap: 6px; font-size: 13px; }
.status > .dot { flex: none; margin-top: .42em; }
.table td .chips { flex-wrap: nowrap; }

/* Tabellen */
.table-wrap { overflow-x: auto; position: relative; }
.table-wrap:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover td { background: var(--card-alt); }
.table tr:last-child td, .table tr:last-child th { border-bottom: 0; }
.table .sub { display: block; font-size: 13px; color: var(--muted); }
.table .strong { font-weight: 600; }
.table a.strong { color: var(--ink); text-decoration: none; }
.table a.strong:hover { text-decoration: underline; }
.table .right { text-align: right; }
.table .center { text-align: center; }
.notify-table th[scope="row"] { font-weight: 400; text-align: left; font-size: 14px; color: var(--ink); white-space: normal; }
.notify-table thead th { white-space: normal; vertical-align: bottom; }
.notify-table thead th.center { width: 17%; }
.notify-table td { vertical-align: middle; }
.notify-table input[type="checkbox"] { width: 22px; height: 22px; }
.table-wide { min-width: 720px; }
.table-mid { min-width: 560px; }

/* Listen */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.list > li:first-child { border-top: 0; }
.list-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 260px; }
.list-main strong { font-size: 14px; font-weight: 600; }
.list-main span { font-size: 13px; color: var(--muted); }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.feed li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; font-size: 14px; line-height: 1.45; }
.feed time { font-size: 13px; color: var(--muted); }
.feed-msg { display: flex; gap: 8px; align-items: baseline; }
.feed-msg .dot { transform: translateY(-1px); }

/* Balken (SVG) */
.bars { display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 36px; gap: 12px; align-items: center; }
.bar { width: 100%; height: 10px; display: block; }
.bar .track { fill: var(--neutral-bg); }
.bar .fill { fill: var(--red); }
.bar-row strong { text-align: right; }

/* Reiter */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14px; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--red); }

/* Filter */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.activity-filters { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.activity-filters .select { width: auto; max-width: 100%; }
.pill { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--field); color: var(--ink); text-decoration: none; font-size: 14px; }
.pill:hover { border-color: var(--ink); color: var(--ink); }
.pill[aria-current="true"] { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }

/* Formulare */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 14px; font-weight: 500; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.input, .select { height: 44px; padding: 0 14px; border: 1px solid var(--field); border-radius: var(--radius-sm); background: var(--card); font: inherit; font-size: 15px; color: var(--ink); width: 100%; }
.select { padding: 0 12px; height: 44px; }
.input:focus, .select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(15, 27, 45, 0.08); outline: none; }
.input:focus-visible, .select:focus-visible, textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.input-code { font-family: var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.5; }
.field-error, .validation { font-size: 13px; color: var(--crit-fg); }
.validation ul { margin: 0; padding-left: 18px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; min-height: 44px; }
.check input, input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--red); margin: 0; flex: 0 0 auto; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: #DDD6C8; }
.inline-form { display: inline; margin: 0; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }

/* Freigaben */
.approval { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.approval:first-of-type { border-top: 0; }
.approval-main { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.approval-main strong { font-size: 15px; font-weight: 600; }
.approval-main > span:not(.chips) { font-size: 13px; color: var(--muted); }
.approval-effect { flex: 1 1 220px; min-width: 0; font-size: 13px; color: var(--neutral-fg); }
.approval-when { flex: 0 0 auto; }
.approval-when .select { height: 40px; font-size: 13px; width: auto; }
.actionbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 16px 20px; background: var(--navy); color: var(--paper); border-radius: var(--radius); }

/* Schritte (Gerät verbinden) */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.step { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--line-soft); border-radius: 12px; }
.step-no { font-size: 12px; font-weight: 600; color: var(--red); letter-spacing: 0.04em; }
.codeline { position: relative; display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; background: var(--navy); color: var(--paper); padding: 10px 12px; border-radius: 8px; overflow-x: auto; }
.codeline code { flex: 1; white-space: nowrap; }
.copy { background: transparent; border: 0; color: var(--side-muted); cursor: pointer; padding: 4px; border-radius: 6px; display: inline-flex; }
.copy:hover { color: #fff; }

/* Leere Zustände */
.empty { padding: 40px 20px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; color: var(--muted); }
.empty strong { color: var(--ink); font-size: 16px; font-weight: 600; }
.empty .icon { color: #1F8A5B; }

/* Beschreibungsliste */
.facts { display: flex; flex-direction: column; gap: 10px; font-size: 14px; margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; }

/* Fortschritt Kontingent */
.quota-bar { width: 100%; height: 10px; display: block; }

/* QR-Code */
.qr { width: 200px; height: 200px; background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.qr svg { width: 100%; height: 100%; display: block; }
.secret { font-family: var(--mono); font-size: 14px; letter-spacing: 0.06em; word-break: break-all; background: var(--neutral-bg); padding: 10px 12px; border-radius: 8px; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-family: var(--mono); font-size: 15px; list-style: none; padding: 0; margin: 0; }
.codes li { background: var(--neutral-bg); padding: 8px 12px; border-radius: 8px; text-align: center; }

/* Anmeldeseiten */
.auth-shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth-brand { flex: 1 1 480px; min-width: 0; background: var(--navy); color: var(--paper); padding: 56px 64px; display: flex; flex-direction: column; gap: 48px; justify-content: space-between; }
.auth-pitch { display: flex; flex-direction: column; gap: 32px; max-width: 520px; }
.auth-pitch h2 { font-size: 38px; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; }
.pitch-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.pitch-list li { display: flex; gap: 14px; align-items: flex-start; color: var(--red-light); }
.pitch-list div { display: flex; flex-direction: column; gap: 4px; color: var(--paper); }
.pitch-list strong { font-size: 16px; font-weight: 600; }
.pitch-list span { font-size: 15px; color: var(--side-muted); line-height: 1.5; }
.auth-note { font-size: 14px; color: var(--side-muted); line-height: 1.6; max-width: 520px; }
.auth-main { flex: 1 1 420px; min-width: 0; padding: 40px 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 20px; }
.auth-card h1 { font-size: 32px; }
.auth-footer { display: flex; flex-wrap: wrap; gap: 20px; font-size: 13px; justify-content: center; }
.auth-footer a { color: var(--muted); }
.lang-switch { gap: 4px; margin-top: -8px; }
.lang-btn { background: none; border: 1px solid transparent; border-radius: 6px; padding: 4px 9px; font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--muted); cursor: pointer; }
.lang-btn:hover { color: var(--ink); border-color: var(--line); }
.lang-btn[aria-current="true"] { color: var(--ink); background: #fff; border-color: var(--line); }
.lang-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.brand-lg { display: inline-flex; align-items: center; gap: 12px; }
.brand-lg img { display: block; height: 30px; width: auto; }
@media (max-width: 899px) {
    .auth-brand { padding: 28px 20px; gap: 24px; }
    .auth-pitch h2 { font-size: 26px; }
    .pitch-list, .auth-note { display: none; }
    .auth-main { padding: 28px 16px; }
}

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

/* Wortmarke auf hellem Grund */
.wordmark-dark { color: var(--ink); font-size: 24px; }
h2.brand { display: inline-flex; align-items: center; gap: 10px; }
.input-small { height: 36px; font-size: 13px; padding: 0 10px; width: 180px; max-width: 100%; border-radius: 10px; }
.form-card { max-width: 640px; }
.fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fieldset legend { margin-bottom: 4px; }
.check span { line-height: 1.4; }
.card-title-flush { padding-top: 14px; }
.list-foot { padding: 12px 0; }
.table th.cell-label { color: var(--ink); font-size: 14px; font-weight: 500; white-space: normal; padding: 14px 8px; border-bottom: 1px solid var(--line-soft); }
.table th a { color: var(--muted); }
.feed-wide li { grid-template-columns: 130px 1fr; }
.strong-link { color: var(--ink); text-decoration: none; }
.strong-link:hover { text-decoration: underline; color: var(--ink); }
.info .icon { color: var(--ink); margin-top: 1px; }
@media (max-width: 599px) {
    .feed-wide li { grid-template-columns: 1fr; gap: 2px; }
    .bar-row { grid-template-columns: 110px 1fr 28px; }
    .kpi-value { font-size: 28px; }
}
@media (max-width: 599px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .kpi { padding: 16px; }
    .kpi-sub { font-size: 12px; }
}

/* Tabellen auf dem Telefon als Karten: jede Zeile ein Block, Spaltenname vor dem Wert */
@media (max-width: 599px) {
    .table-wrap:has(.table-stack) { overflow-x: visible; }
    .table-stack { min-width: 0 !important; }
    .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; }
    .table-stack tr { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
    .table-stack tr:last-child { border-bottom: 0; }
    .table-stack td { border: 0 !important; padding: 3px 0 !important; }
    .table-stack td:first-child { padding-bottom: 8px !important; }
    .table-stack td[data-label] { position: relative; padding-left: 38% !important; min-height: 24px; }
    .table-stack td[data-label]::before { content: attr(data-label); position: absolute; left: 0; top: 5px; width: 34%; color: var(--muted); font-size: 12px; font-weight: 600; }
    .table-stack td .chips { flex-wrap: wrap; }
    .table-stack .stack-hide { display: none; }
}

/* Verwaltung */
.narrow { max-width: 680px; }
.card-pad { padding-top: 12px; }
.stack-tight { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-muted td { color: var(--muted); }
.search { display: flex; gap: 8px; max-width: 560px; }
.search .input { flex: 1 1 auto; min-width: 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.disclosure { flex: 0 0 auto; }
.disclosure > summary { list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure[open] { flex: 1 1 100%; }
.disclosure-body { margin-top: 12px; padding: 16px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--paper); }
.admin-action { display: grid; grid-template-columns: 1fr; gap: 8px; }
.admin-action + .admin-action { padding-top: 12px; border-top: 1px solid var(--line-soft); }
.admin-action .btn { justify-self: start; }
.admin-action .input, .disclosure-body .input { height: 40px; font-size: 14px; }
.input-small { max-width: 120px; }
.list-main .chips { margin-top: 4px; }
.list-main .chip-ok { color: var(--ok-fg); }
.list-main .chip-high { color: var(--high-fg); }
.list-main .chip-critical { color: var(--crit-fg); }
.list-main .chip-neutral { color: var(--neutral-fg); }
.list-main .chip-outline { color: var(--ink); }
.list-main .chip-kev { color: #fff; }
.admin-tabs { margin-top: -4px; }
.list-main a.strong { color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.list-main a.strong:hover { text-decoration: underline; }

/* Live-Ansicht */
.live-state { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ok-fg); padding: 6px 12px; border-radius: 999px; background: var(--ok-bg); }
.live-state.live-off { color: var(--muted); background: var(--neutral-bg); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.live-state:not(.live-off) .live-dot { animation: live-pulse 2s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.feed li.live-new { animation: live-in 1.6s ease-out; border-radius: 8px; }
@keyframes live-in { from { background: var(--ok-bg); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) {
    .live-state:not(.live-off) .live-dot, .feed li.live-new { animation: none; }
}
