/* LokLöwen Leitstelle — App-Shell und gemeinsame Bausteine.
   Dunkle Seitenleiste (Schwarz/Gold), helle Arbeitsfläche (Paper). Brand-Regel: keine Rundungen an Buttons.
   Sizes, spacing and colours come from tokens.css (type pairs --fs and --lh, 4px scale --space). */

:root {
  --sidebar: 236px;
}

html { scroll-behavior: smooth; }
[hidden] { display: none !important; }
body { background: var(--paper); color: var(--text); min-height: 100vh; font-size: var(--fs-body); line-height: var(--lh-body); }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; position: relative; z-index: 1; }

.sidebar { background: var(--black); color: var(--white); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: var(--space-6) 0 var(--space-5); }
.sidebar .marke { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-6) var(--space-6); position: relative; z-index: 1; }
.sidebar .marke img { height: 30px; }
.sidebar .marke small { display: block; font-size: var(--fs-caption); line-height: var(--lh-caption); letter-spacing: 2px; text-transform: uppercase; color: var(--gold); margin-top: var(--space-1); }
.sidebar nav { display: flex; flex-direction: column; gap: var(--space-1); padding: 0 var(--space-3); position: relative; z-index: 1; }
.sidebar nav .gruppe { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--gray); padding: var(--space-4) var(--space-3) var(--space-2); }
.sidebar nav a { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); color: var(--gray); text-decoration: none; font-size: var(--fs-ui); line-height: var(--lh-ui); font-weight: 600; border-left: 2px solid transparent; transition: color .15s, background .15s, border-color .15s; }
.sidebar nav a svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; opacity: .85; }
.sidebar nav a:hover { color: var(--white); background: color-mix(in srgb, var(--white) 4%, transparent); }
.sidebar nav a.aktiv { color: var(--gold); border-left-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }
.sidebar nav a .zaehler { margin-left: auto; font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 700; padding: var(--space-1) var(--space-2); background: var(--crit-text); color: var(--white); }
.sidebar .fuss { margin-top: auto; padding: var(--space-4) var(--space-6) 0; position: relative; z-index: 1; border-top: 1px solid var(--gray-dark); }
.sidebar .persona { display: flex; flex-direction: row; align-items: center; gap: var(--space-3); text-decoration: none; white-space: nowrap; }
.sidebar .persona .avatar { width: 34px; height: 34px; background: var(--gold); color: var(--black); font-family: var(--font-display); font-weight: 700; display: grid; place-items: center; font-size: var(--fs-ui); flex-shrink: 0; }
.sidebar .persona b { display: inline; font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--white); }
.sidebar .persona:hover b { color: var(--gold); }
.sidebar .fuss a.persona { display: flex; text-transform: none; letter-spacing: 0; margin-top: 0; font-size: var(--fs-ui); line-height: var(--lh-ui); }
.sidebar .persona small { display: block; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--gray); }
.sidebar .fuss a { display: inline-block; margin-top: var(--space-3); color: var(--gold); font-size: var(--fs-ui); line-height: var(--lh-ui); font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; text-decoration: none; }
.sidebar .fuss a + a { margin-left: var(--space-4); color: var(--gray); }
.sidebar .fuss a:hover { color: var(--white); }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-5) var(--space-7) 0; }
.topbar h1 { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: var(--fs-title); line-height: var(--lh-title); letter-spacing: 0.5px; margin: 0; }
.topbar .sub { color: var(--text-soft); font-size: var(--fs-caption); line-height: var(--lh-caption); margin: 0; }
.topbar h1 .firma { color: var(--gold-text); }
.topbar .rechts { margin-left: auto; display: flex; align-items: center; gap: var(--space-4); color: var(--text-soft); font-size: var(--fs-caption); line-height: var(--lh-caption); }
.firmenwahl { display: inline-flex; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-1); }
.firmenwahl button { font-family: var(--font-body); font-weight: 700; font-size: var(--fs-ui); line-height: var(--lh-ui); text-transform: uppercase; letter-spacing: 0.5px; padding: var(--space-2) var(--space-4); border: 0; background: transparent; color: var(--text-soft); cursor: pointer; transition: background .15s, color .15s; }
.firmenwahl button[aria-pressed="true"] { background: var(--ink); color: var(--gold); }
.firmenwahl button[aria-pressed="true"][data-firma="akademie"] { background: var(--akademie); color: var(--black); }
.firmenwahl button[aria-pressed="false"]:hover { color: var(--ink); }
.topbar .live { display: inline-flex; align-items: center; font-weight: 700; color: var(--ok-text); }
.topbar .live::before { content: ''; margin-right: var(--space-2); width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); animation: puls 2s infinite; }
.topbar .live.veraltet { color: var(--crit-text); }
.topbar .live.veraltet::before { background: var(--crit); animation: none; }
@keyframes puls { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.inhalt { padding: var(--space-5) var(--space-7) var(--space-8); display: flex; flex-direction: column; gap: var(--space-4); }

/* Einblenden beim Laden. Only blocks without tooltips or the popover: a finished animation with
   fill-mode both keeps a stacking context, which painted the next block over every tooltip (C1). */
.inhalt > .kpis, .inhalt > .antwort { animation: rein .45s var(--ease) both; }
@keyframes rein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .inhalt > .kpis, .inhalt > .antwort { animation: none; } .topbar .live::before { animation: none; } }

/* ---------- Bausteine ---------- */
.karte { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.karte > h2.kopf, h2.kopf { font-size: var(--fs-ui); line-height: var(--lh-ui); font-weight: 700; text-transform: uppercase; letter-spacing: 1.6px; color: var(--text-soft); margin: 0; padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--line); display: flex; gap: var(--space-3); align-items: baseline; }
h2.kopf .hint { margin-left: auto; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-soft); font-size: var(--fs-caption); line-height: var(--lh-caption); }
h2.kopf a { color: var(--gold-text); text-decoration: none; font-size: var(--fs-ui); line-height: var(--lh-ui); }
.karte .fehlertext { padding: 0 var(--space-5) var(--space-5); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-4); }
.kpi { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--line); padding: var(--space-4) var(--space-5) var(--space-3); text-align: left; font-family: var(--font-body); box-shadow: var(--shadow-1); transition: transform .18s var(--ease), box-shadow .18s; }
button.kpi { cursor: pointer; }
button.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.kpi .zahl { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-display); line-height: var(--lh-display); }
.kpi .lbl { font-size: var(--fs-ui); line-height: var(--lh-ui); font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-soft); margin-top: var(--space-1); }
.kpi .sem { font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--text-soft); margin-top: var(--space-1); }
/* KPI numbers are large text (3:1): bright green and red pass on white, amber does not */
.kpi--ok { border-top-color: var(--ok); } .kpi--ok .zahl { color: var(--ok); }
.kpi--warn { border-top-color: var(--warn); } .kpi--warn .zahl { color: var(--warn-text); }
.kpi--crit { border-top-color: var(--crit); } .kpi--crit .zahl { color: var(--crit); }
.kpi--gold { border-top-color: var(--gold); }
.kpi.aktiv { outline: 2px solid var(--ink); outline-offset: -1px; }

.tabelle { overflow: visible; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-ui); line-height: var(--lh-ui); }
thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-head); text-align: left; font-size: var(--fs-ui); line-height: var(--lh-ui); font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-soft); padding: var(--space-2) var(--space-4); border-bottom: 2px solid var(--line); white-space: nowrap; }
thead th.sortierbar { cursor: pointer; user-select: none; }
/* Sorting sits on a button inside the head: a click on the head's tooltip must not sort */
thead th .sortieren { background: none; border: 0; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
/* Erklärung beim Hovern über Spaltenköpfe — bewusst nicht dauerhaft sichtbar.
   WCAG 1.4.13: shown on hover and keyboard focus, hoverable (no gap, takes the pointer), Escape hides
   it (shell.js sets data-tip-aus). Hidden means display: none, so it adds no page width (C2). */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; left: 0; top: 100%; z-index: var(--z-tooltip); display: none; opacity: 0; box-sizing: border-box; width: max-content; max-width: min(280px, calc(100vw - var(--space-7))); background: var(--ink); color: var(--white); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 400; text-transform: none; letter-spacing: 0; padding: var(--space-2) var(--space-3); box-shadow: var(--shadow-2); white-space: normal; pointer-events: auto; transition: opacity .15s, display .15s allow-discrete; }
[data-tip]:hover:not([data-tip-aus])::after { display: block; opacity: 1; transition-delay: .35s; }
@starting-style { [data-tip]:hover:not([data-tip-aus])::after { opacity: 0; } }
[data-tip]:is(:focus-visible, :has(:focus-visible)):not([data-tip-aus])::after { display: block; opacity: 1; transition-delay: .35s; }
@starting-style { [data-tip]:is(:focus-visible, :has(:focus-visible)):not([data-tip-aus])::after { opacity: 0; } }
[data-tip][data-tip-aus]::after { transition: none; }
[data-tip][data-tip-rechts]::after, th.n[data-tip]::after { left: auto; right: 0; }
/* Sticky heads form their own layer; lift the one whose tooltip is open above the following heads */
thead th[data-tip]:is(:hover, :has(:focus-visible)) { z-index: var(--z-tooltip); }
thead th .pfeil { color: var(--gold-text); margin-left: var(--space-1); }
/* Arrows of the columns that are not sorted right now */
thead th .pfeil-aus { color: var(--text-soft); }
tbody td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-head); }
tbody tr.r-crit { background: #fdf3f2; } tbody tr.r-crit:hover { background: #fbeae9; }
tbody tr.r-crit td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
tbody tr.r-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tbody tr.r-ok td:first-child { box-shadow: inset 3px 0 0 transparent; }
td.n { text-align: right; font-variant-numeric: tabular-nums; }

.badge { display: inline-block; font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; padding: var(--space-1) var(--space-2); border: 1px solid var(--line); color: var(--text-soft); white-space: nowrap; }
.badge--gold { border-color: var(--gold); color: var(--gold-text); }
.badge--ink { background: var(--ink); border-color: var(--ink); color: var(--gold); }
.badge--ok { background: var(--ok-text); border-color: var(--ok-text); color: var(--white); }
.badge--soft { background: var(--paper); }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot--ok { background: var(--ok); } .dot--warn { background: var(--warn); } .dot--crit { background: var(--crit); box-shadow: 0 0 8px color-mix(in srgb, var(--crit) 50%, transparent); }
.dot--frei { background: var(--ok); } .dot--entwurf { background: var(--warn); } .dot--unklar { background: var(--line); }
/* A status dot always comes with its word, in the text-safe colour (WCAG 1.4.1) */
.status-text { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 700; white-space: nowrap; }
.status-text--ok { color: var(--ok-text); } .status-text--warn { color: var(--warn-text); } .status-text--crit { color: var(--crit-text); }

/* One button: compact (14px, 8x12) by default, brand size with --marke (16px, the brand's 15x30 padding).
   Black label on gold (8.0:1, hover 5.92:1), a deliberate deviation from BRAND.md (see Dashboard-Ableitung). */
.btn { display: inline-flex; align-items: center; gap: var(--space-2); background: var(--gold); color: var(--black); border: 0; font-family: var(--font-body); font-weight: 700; font-size: var(--fs-ui); line-height: var(--lh-ui); text-transform: uppercase; letter-spacing: 0.5px; padding: var(--space-2) var(--space-3); cursor: pointer; text-decoration: none; transition: background .15s, transform .15s; }
.btn--marke { font-size: var(--fs-body); line-height: var(--lh-body); padding: 15px 30px; }
.btn:hover { background: var(--gold-deep); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn--aus { background: var(--surface-sunken); color: var(--text-soft); cursor: not-allowed; }
.btn--ghost { background: transparent; border: 1px solid var(--line); color: var(--text-soft); }
.btn--ghost:hover { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn--dark { background: var(--ink); color: var(--gold); }
.btn--dark:hover { background: var(--black); }

input, select { font-family: var(--font-body); font-size: var(--fs-ui); line-height: var(--lh-ui); padding: var(--space-2) var(--space-3); border: 1px solid var(--line); background: var(--card); color: var(--text); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { border-color: var(--gold); }

/* Keyboard focus: dark ring on light surfaces, white ring on dark ones (sidebar, filter bar, login) */
:focus-visible, .kpi:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sidebar :focus-visible, .leiste :focus-visible, .seite-anmelden :focus-visible, .seite-bestaetigen :focus-visible { outline-color: var(--focus-on-dark); }

.leiste { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; background: var(--ink); color: var(--white); padding: var(--space-3) var(--space-4); font-size: var(--fs-ui); line-height: var(--lh-ui); box-shadow: var(--shadow-1); }
/* Fields on dark surfaces use the brand form tint (white at 7%), as on the client websites */
.leiste input, .leiste select { padding: var(--space-2); border-color: var(--gray-dark); background: color-mix(in srgb, var(--white) 7%, transparent); color: var(--white); }
.leiste input:focus, .leiste select:focus { border-color: var(--gold); box-shadow: none; }
.leiste .abstand { margin-left: var(--space-2); }
.leiste .n { margin-left: auto; color: var(--gold); font-weight: 700; }
.leiste button { background: none; border: 1px solid var(--gray-dark); color: var(--white); font-size: var(--fs-ui); line-height: var(--lh-ui); padding: var(--space-1) var(--space-3); cursor: pointer; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; font-family: var(--font-body); }
.leiste button:hover { border-color: var(--gold); color: var(--gold); }
.leiste.versteckt { display: none; }

.hinweis { background: var(--ink); color: var(--white); padding: var(--space-3) var(--space-4); }
.hinweis b { color: var(--gold); }
.hinweis em { font-style: normal; color: var(--gray); }
.leer { padding: var(--space-7); text-align: center; color: var(--text-soft); }
.fussnote { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-soft); }

.wisch-hinweis { display: none; }

/* Below 960px the navigation is one row of links (no group headings, compact identity) */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; gap: var(--space-2); padding: 0 var(--space-4); overflow-x: auto; }
  .sidebar .marke { padding: 0; }
  .sidebar nav { flex-direction: row; padding: 0; }
  .sidebar nav .gruppe, .sidebar .persona b { display: none; }
  .sidebar nav a { min-height: 44px; white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .sidebar nav a.aktiv { border-bottom-color: var(--gold); }
  .sidebar .fuss { margin: 0 0 0 auto; padding: 0; border: 0; }
  .topbar, .inhalt { padding-left: var(--space-5); padding-right: var(--space-5); }
}

/* ---------- Page: anmelden (and bestaetigen, the click-to-confirm page of the login mails) ---------- */
body:is(.seite-anmelden, .seite-bestaetigen) { background: var(--black); color: var(--white); min-height: 100vh; display: grid; place-items: center; padding: var(--space-8) var(--space-6); }
:is(.seite-anmelden, .seite-bestaetigen) .box { position: relative; width: min(460px, 100%); }
:is(.seite-anmelden, .seite-bestaetigen) .kopf { margin-bottom: var(--space-7); }
:is(.seite-anmelden, .seite-bestaetigen) .kopf img { height: 36px; }
:is(.seite-anmelden, .seite-bestaetigen) h1 { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: var(--fs-title); line-height: var(--lh-title); margin: 0 0 var(--space-3); }
:is(.seite-anmelden, .seite-bestaetigen) p { color: var(--gray); margin: 0 0 var(--space-6); }
.seite-bestaetigen .btn--marke { justify-content: center; width: 100%; }
.seite-bestaetigen .meldung { color: var(--white); border-left: 3px solid var(--gold); padding: var(--space-2) var(--space-3); background: color-mix(in srgb, var(--white) 7%, transparent); }
.seite-bestaetigen .meldung a { color: var(--gold); }
.seite-anmelden form { background: var(--ink); border: 1px solid var(--gray-dark); border-top: 3px solid var(--gold); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }
.seite-anmelden label { font-size: var(--fs-ui); line-height: var(--lh-ui); font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--gray); }
.seite-anmelden input { background: color-mix(in srgb, var(--white) 7%, transparent); border: 1px solid var(--gray-dark); color: var(--white); padding: var(--space-3); }
.seite-anmelden input:focus { border-color: var(--gold); }
.seite-anmelden .btn--marke { justify-content: center; }
.seite-anmelden .meldung { color: var(--white); border-left: 3px solid var(--gold); padding: var(--space-2) var(--space-3); background: color-mix(in srgb, var(--white) 7%, transparent); }
.seite-anmelden .meldung--fehler { border-left-color: var(--crit); }

/* ---------- Page: dashboard (Leitstelle) ---------- */
.seite-dashboard td.tn { font-weight: 700; }
/* A missing owner reads as a gap, not as a name (m1) */
.seite-dashboard td.ohne, .seite-dashboard .zustaendig td.person.ohne { color: var(--text-soft); font-weight: 400; }
.seite-dashboard table.fest { table-layout: fixed; }
.seite-dashboard td.proz { font-weight: 600; }
.seite-dashboard td.extern { color: var(--text-soft); }
.seite-dashboard .schritt { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.seite-dashboard .schritt .mini { display: flex; gap: var(--space-1); }
.seite-dashboard .schritt .seg { width: 7px; height: 7px; background: var(--line); }
.seite-dashboard .schritt .seg.voll { background: var(--gold); }
.seite-dashboard .schritt small { color: var(--text-soft); font-size: var(--fs-ui); line-height: var(--lh-ui); }
.seite-dashboard td.faellig { font-variant-numeric: tabular-nums; }
.seite-dashboard td.faellig b { font-weight: 700; }
.seite-dashboard td.faellig .spaet { display: block; color: var(--crit-text); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 700; }
.seite-dashboard td.la { color: var(--text-soft); max-width: 170px; }
.seite-dashboard td.la.frisch { color: var(--ok-text); font-weight: 700; }
.seite-dashboard .aktion-zelle { text-align: right; padding-left: var(--space-2); padding-right: var(--space-2); }
.seite-dashboard .aktion-zelle .btn { white-space: nowrap; }
.seite-dashboard #zeilen td.abt { color: var(--text-soft); }
.seite-dashboard .zustaendig td.person { font-weight: 700; }
.seite-dashboard .zustaendig td.abt { color: var(--text-soft); }
.seite-dashboard .log td.wann { color: var(--gold-text); font-weight: 700; width: 70px; font-variant-numeric: tabular-nums; }
.seite-dashboard .log td.prozsp, .seite-dashboard .log td.wer { color: var(--text-soft); white-space: nowrap; }
/* Narrow desktops (Jan, 2026-09-30): the case table keeps its columns and scrolls inside its card */
@media (max-width: 1199px) {
  .seite-dashboard .tabelle { overflow-x: auto; }
  .seite-dashboard table.fest { min-width: 60rem; }
}

/* ---------- Page: prozessschritte ---------- */
.seite-prozessschritte .tabs { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.seite-prozessschritte .tabs button { background: var(--card); border: 1px solid var(--line); font-family: var(--font-body); font-weight: 700; font-size: var(--fs-ui); line-height: var(--lh-ui); text-transform: uppercase; letter-spacing: 0.5px; padding: var(--space-2) var(--space-4); cursor: pointer; color: var(--text-soft); box-shadow: var(--shadow-1); transition: all .15s; }
.seite-prozessschritte .tabs button:hover { border-color: var(--ink); color: var(--ink); }
.seite-prozessschritte .tabs button.aktiv { background: var(--ink); border-color: var(--ink); color: var(--gold); }
.seite-prozessschritte .filter { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--text-soft); flex-wrap: wrap; }
.seite-prozessschritte .filter button { background: var(--card); border: 1px solid var(--line); font-family: var(--font-body); font-size: var(--fs-ui); line-height: var(--lh-ui); font-weight: 700; padding: var(--space-1) var(--space-3); cursor: pointer; color: var(--text-soft); display: inline-flex; align-items: center; gap: var(--space-2); }
.seite-prozessschritte .filter button.aktiv { border-color: var(--ink); background: var(--ink); color: var(--white); }
.seite-prozessschritte .filter .dot { width: 8px; height: 8px; }
/* Filter ohne Treffer: sonst stehen nur leere Spalten da (Design-Fix, Weekly 07.09.2026). */
.seite-prozessschritte .hinweis { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-1); padding: var(--space-3) var(--space-4); color: var(--text-soft); }
.seite-prozessschritte .hinweis b { color: var(--ink); }

.seite-prozessschritte .buehne { position: relative; }
.seite-prozessschritte .pipe { display: grid; grid-template-columns: repeat(var(--schritte), minmax(118px, 1fr)); gap: var(--space-3); overflow-x: auto; padding-bottom: var(--space-2); }
.seite-prozessschritte .stufe { background: var(--surface-sunken); padding: var(--space-3); min-height: 250px; position: relative; min-width: 118px; }
.seite-prozessschritte .stufe + .stufe::before { content: '→'; position: absolute; left: -11px; top: 8px; color: var(--gold-text); font-weight: 700; }
.seite-prozessschritte .stufe .nr { font-family: var(--font-display); font-weight: 700; color: var(--gold-text); font-size: var(--fs-body); line-height: var(--lh-body); }
.seite-prozessschritte .stufe .gesamt { color: var(--text-soft); }
.seite-prozessschritte .stufe .sname { font-size: var(--fs-ui); line-height: var(--lh-ui); font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-soft); margin: var(--space-1) 0; min-height: 28px; hyphens: auto; overflow-wrap: anywhere; }
.seite-prozessschritte .stufe .rolle { font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--text-soft); margin-bottom: var(--space-2); }
.seite-prozessschritte .fall, .seite-prozessschritte .stapel { display: block; width: 100%; border: 0; font: inherit; color: inherit; text-align: left; }
.seite-prozessschritte .fall .name, .seite-prozessschritte .stapel .name, .seite-prozessschritte .stapel .detail { display: block; }
.seite-prozessschritte .fall { background: var(--card); border-left: 3px solid var(--ok); box-shadow: var(--shadow-1); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-2); cursor: pointer; transition: opacity .15s, transform .15s; }
.seite-prozessschritte .fall:hover { transform: translateX(2px); }
.seite-prozessschritte .fall--warn { border-left-color: var(--warn); } .seite-prozessschritte .fall--crit { border-left-color: var(--crit); }
.seite-prozessschritte .fall .name { font-weight: 700; font-size: var(--fs-ui); line-height: var(--lh-ui); }
.seite-prozessschritte .fall.gedimmt { opacity: 0.3; }
.seite-prozessschritte .fall.gewaehlt { outline: 2px solid var(--ink); }
.seite-prozessschritte .stapel { background: var(--card); border-left: 3px solid var(--ok); box-shadow: 1px 1px 0 var(--line), 3px 3px 0 var(--line); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-2); cursor: pointer; }
.seite-prozessschritte .stapel .name { font-weight: 700; font-size: var(--fs-ui); line-height: var(--lh-ui); }
.seite-prozessschritte .stapel .detail { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-soft); }

/* Detail als kleines Fenster direkt an der Karte */
.seite-prozessschritte .popover { position: absolute; z-index: var(--z-popover); width: 260px; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--gold); box-shadow: var(--shadow-2); padding: var(--space-4) var(--space-4) var(--space-3); animation: auf .18s var(--ease) both; }
@keyframes auf { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.seite-prozessschritte .popover h3 { font-family: var(--font-display); text-transform: uppercase; font-size: var(--fs-body); line-height: var(--lh-body); margin: 0 0 var(--space-1); }
.seite-prozessschritte .popover .art { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: var(--space-3); }
.seite-prozessschritte .popover .zeile { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--fs-ui); line-height: var(--lh-ui); padding: var(--space-2) 0; border-top: 1px solid var(--line); }
.seite-prozessschritte .popover .zeile span:first-child { color: var(--text-soft); white-space: nowrap; }
.seite-prozessschritte .popover .zeile b { text-align: right; }
.seite-prozessschritte .popover .zeile .spaet { display: block; color: var(--crit-text); font-size: var(--fs-caption); line-height: var(--lh-caption); }
.seite-prozessschritte .popover .zu { position: absolute; top: 6px; right: 8px; background: none; border: 0; color: var(--text-soft); font-size: var(--fs-body); line-height: var(--lh-body); cursor: pointer; }

/* ---------- Page: management (Zahlen & Entwicklung) ---------- */
.seite-management .antwort { border-left: 8px solid var(--line); padding: var(--space-5) var(--space-6); display: flex; align-items: center; gap: var(--space-5); }
.seite-management .antwort .kreis { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; }
.seite-management .antwort--ok { border-left-color: var(--ok); } .seite-management .antwort--ok .kreis { background: var(--ok); }
.seite-management .antwort--warn { border-left-color: var(--warn); } .seite-management .antwort--warn .kreis { background: var(--warn); }

.seite-management .zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); }
.seite-management .zahl { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--gold); padding: var(--space-4) var(--space-5); box-shadow: var(--shadow-1); }
.seite-management .zahl .wert { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-display); line-height: var(--lh-display); white-space: nowrap; }
.seite-management .zahl .lbl { font-size: var(--fs-ui); line-height: var(--lh-ui); font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-soft); margin-top: var(--space-2); }
.seite-management .zahl .trend { font-size: var(--fs-ui); line-height: var(--lh-ui); margin-top: var(--space-2); font-weight: 700; }
.seite-management .zahl .trend small { font-weight: 400; color: var(--text-soft); font-size: var(--fs-caption); line-height: var(--lh-caption); }
.seite-management .trend--gut { color: var(--ok-text); } .seite-management .trend--schlecht { color: var(--crit-text); } .seite-management .trend--neutral { color: var(--text-soft); }

/* Chart: eine Reihe, eine Achse, Hover mit Fadenkreuz */
.seite-management .chart { position: relative; padding: var(--space-5) var(--space-5) var(--space-2); }
.seite-management .chart svg { width: 100%; height: 240px; display: block; overflow: visible; }
.seite-management .chart .grid { stroke: var(--line); stroke-width: 1; }
.seite-management .chart .achse { fill: var(--text-soft); font-size: var(--fs-ui); font-family: var(--font-body); }
.seite-management .chart .linie { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.seite-management .chart .flaeche { fill: color-mix(in srgb, var(--gold) 12%, transparent); }
.seite-management .chart .punkt { fill: var(--card); stroke: var(--gold); stroke-width: 2; }
.seite-management .chart .punkt.aktiv { fill: var(--gold); }
.seite-management .chart .kreuz { stroke: var(--text-soft); stroke-width: 1; stroke-dasharray: 3 3; }
.seite-management .chart .endwert { font-family: var(--font-display); font-size: var(--fs-body); fill: var(--text); }
.seite-management .chart .tip { position: absolute; background: var(--ink); color: var(--white); font-size: var(--fs-ui); line-height: var(--lh-ui); padding: var(--space-2) var(--space-3); pointer-events: none; transform: translate(-50%, -100%); white-space: nowrap; box-shadow: var(--shadow-2); }
.seite-management .chart .tip b { color: var(--gold); }

.seite-management td.reihe { font-weight: 700; white-space: nowrap; }
.seite-management td.wert { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.seite-management td.wert.max { background: var(--surface-sunken); font-weight: 700; }
.seite-management td.wert.min { color: var(--text-soft); }

.seite-management .hakt { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.seite-management .hakt > a, .seite-management .hakt > div { display: block; padding: var(--space-4) var(--space-5); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.seite-management .hakt > a:hover { background: var(--surface-head); }
.seite-management .hakt .name { font-weight: 700; font-size: var(--fs-ui); line-height: var(--lh-ui); }
.seite-management .hakt .satz { margin-top: var(--space-2); }
.seite-management .hakt .satz b { font-family: var(--font-display); font-size: var(--fs-title); line-height: var(--lh-title); }
.seite-management .hakt .satz b.krit { color: var(--crit-text); } .seite-management .hakt .satz b.warn { color: var(--warn-text); }
.seite-management .hakt .ruhig { color: var(--ok-text); font-weight: 700; }

/* ---------- Page: team ---------- */
/* A select is as wide as its longest option (a person's name): cap it so one long name cannot widen the page */
.seite-team td select { max-width: 12rem; }
.seite-team thead th { white-space: normal; }
/* The process table needs more room than 1024px leaves: it scrolls inside its card, not the page */
.seite-team .rollbar { overflow-x: auto; }
.seite-team td.name { font-weight: 700; white-space: nowrap; }
.seite-team td.mail { color: var(--text-soft); }
.seite-team td.firma { white-space: nowrap; }
/* Deactivated people: muted text instead of row opacity, which would fail contrast */
.seite-team tr.inaktiv td, .seite-team tr.inaktiv select { color: var(--text-soft); }
.seite-team .status { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: var(--space-1) var(--space-2); }
.seite-team .status--aktiv { color: var(--ok-text); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); }
.seite-team .status--eingeladen { color: var(--gold-text); border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); }
.seite-team .beteiligte { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.seite-team .beteiligte .chip { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--fs-ui); line-height: var(--lh-ui); background: var(--paper); border: 1px solid var(--line); padding: var(--space-1) var(--space-1) var(--space-1) var(--space-2); white-space: nowrap; }
.seite-team .beteiligte .chip button { background: none; border: 0; cursor: pointer; color: var(--text-soft); font-size: var(--fs-ui); line-height: var(--lh-ui); padding: 0 var(--space-1); }
.seite-team .beteiligte .chip button:hover { color: var(--crit-text); }
.seite-team .beteiligte select { padding: var(--space-1) var(--space-2); color: var(--text-soft); }
.seite-team .einladen { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-5); background: var(--surface-head); border-top: 1px solid var(--line); flex-wrap: wrap; }
.seite-team .einladen .lbl { font-size: var(--fs-ui); line-height: var(--lh-ui); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-soft); margin-right: var(--space-1); }
.seite-team #meldung { color: var(--ok-text); } .seite-team #meldung.fehler { color: var(--crit-text); }
.seite-team main .fuss { padding: var(--space-3) var(--space-5); }
.seite-team .reset { margin-left: auto; }

/* ---------- Phones (below 768px); last, so it overrides the page sections ---------- */
/* Two-row top bar, 44px touch targets, visible scroll hints */
@media (max-width: 767px) {
  .topbar { flex-wrap: wrap; gap: var(--space-2); padding: var(--space-4) var(--space-4) 0; }
  .topbar > div:first-child { flex-basis: 100%; }
  .topbar .rechts { margin-left: 0; flex: 1; justify-content: space-between; }
  .topbar .live .zeit { display: none; }
  .inhalt { padding: var(--space-4) var(--space-4) var(--space-8); }
  .btn, .firmenwahl button, select, .seite-prozessschritte .filter button, .seite-prozessschritte .tabs button { min-height: 44px; }
  .wisch-hinweis { display: block; margin: 0; padding: var(--space-2) var(--space-4); color: var(--text-soft); font-size: var(--fs-caption); line-height: var(--lh-caption); }
  /* Small tables stack their cells */
  .seite-dashboard .karte table:not(.fest), .seite-dashboard .karte table:not(.fest) :is(tbody, tr, td) { display: block; }
  .seite-dashboard .karte table:not(.fest) thead { display: none; }
  .seite-dashboard .karte table:not(.fest) tr { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-3); border-bottom: 1px solid var(--line); }
  .seite-dashboard .karte table:not(.fest) td { padding: 0; border: 0; }
  /* Leitstelle: every case is a card from the same markup, primary fields first */
  .seite-dashboard table.fest { min-width: 0; }
  .seite-dashboard table.fest :is(colgroup, thead) { display: none; }
  .seite-dashboard table.fest, .seite-dashboard table.fest :is(tbody, td) { display: block; }
  .seite-dashboard table.fest tr { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-4); border-bottom: 1px solid var(--line); }
  .seite-dashboard table.fest tr.r-crit { box-shadow: inset 3px 0 0 var(--crit); } .seite-dashboard table.fest tr.r-warn { box-shadow: inset 3px 0 0 var(--warn); }
  .seite-dashboard table.fest td { padding: 0; border: 0; box-shadow: none !important; }
  .seite-dashboard .karte td[data-label]::before { content: attr(data-label) ': '; color: var(--text-soft); font-weight: 400; }
  .seite-dashboard table.fest td.faellig b { white-space: nowrap; }
  .seite-dashboard table.fest .proz { order: 1; } .seite-dashboard table.fest .status-zelle { order: 2; } .seite-dashboard table.fest .liegt { order: 3; }
  .seite-dashboard table.fest .schritt-zelle { order: 4; } .seite-dashboard table.fest .faellig { order: 5; } .seite-dashboard table.fest .aktion-zelle { order: 6; text-align: left; }
  .seite-dashboard table.fest :is(.tn, .abt, .la) { order: 7; }
  /* Team stays a table and scrolls inside its card */
  .seite-team .rollbar table { min-width: 960px; }
  /* Board: one column per step, the next one peeks in, snapping to columns */
  .seite-prozessschritte .pipe { grid-template-columns: repeat(var(--schritte), min(80vw, 320px)); gap: var(--space-3); scroll-snap-type: x proximity; }
  .seite-prozessschritte .stufe { scroll-snap-align: start; }
  .seite-prozessschritte .wisch-hinweis { padding: 0; }
  .seite-prozessschritte .popover .zu { width: 44px; height: 44px; top: 0; right: 0; }
}
