/* Controlling HUB - PKS-Design (Christian 10.11.2026: "Design etwas ändern, hier kannst du Davids Skill verwenden").
   Quelle: Skill pks-design von David Tchorz (Stand 10.11.2026). Ebenen wie in PKS:
     1 css/pks/msp-theme.css  Marken-Rampen (Blau handelt, Türkis trägt), Schrift Lato
     2 css/pks/msp-ui.css     Tokens hell, Glas/Fläche, Status-Punkt, Grund mit Orbs (liegt in @layer, verliert gegen app.css)
     3 diese Datei            bildet die Klassen des HUB (app.css + theme-horizon.css) auf die PKS-Tokens ab.
   Aufbau der Seiten bleibt, nur das Aussehen wechselt. Zurück zum Horizon-Design: die drei <link> auf pks/* und theme-pks.css in
   index.html entfernen (Grund-Markup .mx-ground darf bleiben, ohne msp-ui.css ist es unsichtbar). Dunkle Darstellung gibt es noch nicht (app.css hat feste Weißtöne). */

@font-face { font-family: 'Lato'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/lato-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-style: italic; font-weight: 400; font-display: swap; src: url('../fonts/lato-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/lato-latin-700-normal.woff2') format('woff2'); }

/* ---------- Tokens des HUB auf PKS umlegen */
:root {
  --navy: var(--text-heading);                 /* Überschriften, starke Werte */
  --text: var(--text-body);
  --muted: var(--text-muted);
  --blue: var(--primary);                      /* handelt: Knöpfe, Links, aktive Auswahl */
  --cyan: var(--primary-hover);
  --teal: var(--text-label);                   /* trägt: Eyebrows, Spaltenköpfe, nie klickbar */
  --accent: var(--primary);
  --surface: var(--surface-muted);             /* Innenflächen (Akte, Details, Kacheln in Karten) */
  --white: var(--surface-card);
  --hair: color-mix(in srgb, var(--text-heading) 7%, transparent);
  --hair-strong: var(--border-default);
  --font: var(--font-sans);
  --radius: var(--radius-card);
  --sidebar: var(--mx-sidebar-width);
  --schatten: none;
  --verlauf: linear-gradient(150deg, var(--action-tile-from), var(--action-tile-to) 70%);
  /* Ampel aus den Status-Rampen der UI-Schicht (Petrol, Gelb, Rot) */
  --amp-gruen: var(--text-success); --amp-gruen-bg: color-mix(in srgb, var(--status-success) 12%, var(--surface-card));
  --amp-orange: var(--text-warning); --amp-orange-bg: color-mix(in srgb, var(--status-warning) 14%, var(--surface-card));
  --amp-rot: var(--text-error); --amp-rot-bg: color-mix(in srgb, var(--status-error) 9%, var(--surface-card));
}

html { font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-sans); font-size: 13px; line-height: 20px; color: var(--text-body); background: var(--surface-page); }
a { color: var(--link); }
a:hover, a:focus-visible { color: var(--primary-hover); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
h1 { font-size: 26px; line-height: 34px; letter-spacing: -0.01em; font-weight: 700; color: var(--text-heading); }
h2 { font-size: 15px; line-height: 22px; font-weight: 700; color: var(--text-heading); }
h3 { font-size: 13px; line-height: 20px; font-weight: 700; color: var(--text-heading); }
b, strong { font-weight: 700; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; line-height: 16px; }
.mono { font-family: var(--font-mono); }
td, .num, .v, .tabular { font-variant-numeric: tabular-nums; }

/* ---------- Grund: Seitenfarbe, zwei Orbs, ruhiges Punktraster (Markup in index.html) */
.mx-ground { z-index: 0; }
.mx-orb.orb-a { width: 600px; height: 600px; left: -160px; top: -180px; --orb-color: var(--orb-1); --orb-strength: 32%; }
.mx-orb.orb-b { width: 460px; height: 460px; right: -100px; top: 30%; --orb-color: var(--orb-2); --orb-strength: 16%; animation-direction: alternate-reverse; }
.shell, .login-page { position: relative; z-index: 1; }

/* ---------- Shell: Glas-Seitenleiste links, Glas-Kopf oben, Inhalt dazwischen */
.shell { grid-template-columns: var(--mx-sidebar-width) minmax(0, 1fr); gap: 14px; padding: 0 16px 0 14px; }
.sidebar {
  position: sticky; top: 14px; height: calc(100vh - 28px); margin-top: 14px; padding: 14px 10px 10px;
  background: var(--card-glass); color: var(--text-body);
  backdrop-filter: blur(var(--gblur)) saturate(1.9); -webkit-backdrop-filter: blur(var(--gblur)) saturate(1.9);
  border: 1px solid var(--glass-border); border-radius: var(--radius-card);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.brand { display: flex; align-items: center; justify-content: center; height: 48px; padding: 0 0 12px; margin: 0 4px 6px; border-bottom: 1px solid var(--hair); text-align: left; }
.brand-logo { display: inline-flex; align-items: center; --logo-h: 20px; }
.brand-logo img { height: var(--logo-h); width: auto; display: block; margin: 0; }
.brand-logo-kurz { margin-left: calc(var(--logo-h) * .37); padding-left: calc(var(--logo-h) * .44); border-left: 1px solid var(--text-label);
  color: var(--text-label); font-size: var(--logo-h); line-height: 1; font-weight: 400; letter-spacing: .08em; }
.brand .product { display: none; }

.nav { padding: 4px 0 8px; }
.nav .group { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; padding: 4px 12px; font-size: 10.5px; line-height: 14px; letter-spacing: .08em;
  font-weight: 700; text-transform: uppercase; color: var(--text-body); }
.nav .group::after { content: ''; flex: 1; height: 1px; background: color-mix(in srgb, var(--text-heading) 8%, transparent); }
.nav a { gap: 12px; padding: 7px 12px; margin: 1px 0; border-radius: var(--radius-control); color: var(--text-body); font-weight: 400; font-size: 13px; line-height: 20px;
  white-space: nowrap; transition: background 150ms; }
.nav a .ico { width: 20px; height: 20px; color: var(--text-muted); }
.nav a.sub { padding-left: 44px; font-size: 12.5px; color: var(--text-muted); }
.nav a:hover { background: color-mix(in srgb, var(--text-heading) 7%, transparent); color: var(--text-heading); }
.nav a:hover .ico { color: var(--text-heading); }
.nav a.active { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--text-heading); font-weight: 400;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 28%, transparent); }
.nav a.active .ico { color: var(--primary); }
.nav a.active::after { display: none; }
.nav .count { margin-right: 0; padding: 1px 6px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--text-heading) 8%, transparent);
  color: var(--text-label); font-size: 10.5px; line-height: 14px; font-weight: 700; }
.sidebar .nav-hilfe { border-top: 1px solid var(--hair); padding-top: 6px; }
.sidebar .foot { border-top: 1px solid var(--hair); padding: 10px 12px 2px; font-size: 12px; line-height: 16px; color: var(--text-muted); }

/* Kopf: Glas-Leiste mit Brotkrume links, Konto rechts */
.topbar {
  position: sticky; top: 14px; z-index: 30; height: var(--mx-header-height); margin-top: 14px; padding: 0 18px; gap: 14px;
  background: var(--card-glass); backdrop-filter: blur(var(--gblur)) saturate(1.9); -webkit-backdrop-filter: blur(var(--gblur)) saturate(1.9);
  border: 1px solid var(--glass-border); border-radius: var(--radius-tile);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.topbar .krume { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .krume b { color: var(--text-heading); }
.topbar .pille { background: transparent; box-shadow: none; padding: 0; border-radius: 0; }
.topbar .search { background-color: var(--inset-fill); border: 1px solid var(--glass-border); border-radius: var(--radius-control); }
.mode-chip { background: var(--inset-fill); border: 1px solid var(--glass-border); color: var(--text-muted); border-radius: var(--radius-pill); }
.avatar { width: 34px; height: 34px; background: var(--avatar-fill); color: #fff; font-size: 12px; font-weight: 700; }
.user-btn { display: inline-flex; align-items: center; gap: 10px; padding: 3px 12px 3px 3px; border-radius: var(--radius-pill);
  background: var(--inset-fill); border: 1px solid var(--glass-border); }
.user-btn:hover { background: color-mix(in srgb, var(--text-heading) 10%, transparent); }
.user-btn .uname { font-weight: 700; color: var(--text-heading); }
.role { border-radius: var(--radius-pill); }
.role.admin { background: color-mix(in srgb, var(--primary) 12%, transparent); border-color: transparent; color: var(--primary-badge-text); font-weight: 700; }
.user-menu .menu { top: 48px; background: var(--card-glass-pop); border: 1px solid var(--glass-border); border-radius: var(--radius-tile);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, .5); }
.menu-btn { border-radius: var(--radius-pill); }

.content { padding: 18px 2px 48px; }
.page-head { margin-bottom: 18px; align-items: flex-end; }
.page-head h1 { margin: 0; }
.page-head .crumbs, .crumbs { font-size: 10.5px; line-height: 14px; letter-spacing: .08em; font-weight: 700; text-transform: uppercase; color: var(--text-label); margin-bottom: 4px; }
.page-head .muted.small { color: var(--text-muted); }

/* ---------- Arbeitsflächen: deckend, Haarlinie, kein Schatten */
.card, .project-head, .tl-card, .bcard, .step, .crm-k, .kl-akte-teil, .ab-bereich, .stand-inhalt {
  background: var(--surface-card); border: 1px solid var(--border-default); box-shadow: none; }
.card { border-radius: var(--radius-card); padding: 22px 24px; }
.card + .card { margin-top: 14px; }
.grid { gap: 14px; }
.card-head { gap: 10px; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--hair); }
.card-head h2 { font-size: 15px; }
.tl-card, .bcard, .step, .kl-akte-teil, .ab-bereich { border-radius: var(--radius-tile); }
.column { background: var(--inset-fill); border-radius: var(--radius-tile); }
.card[style*="padding:0"], .card[style*="padding: 0"] { overflow: hidden; }

/* Hinweise: ruhige Innenfläche statt Rahmen */
.readonly-note, .info-box { background: var(--inset-fill); border: 1px solid color-mix(in srgb, var(--text-heading) 5%, transparent); border-left: 0;
  border-radius: var(--radius-tile); box-shadow: none; padding: 12px 16px; color: var(--text-body); }
.empty { color: var(--text-muted); }
.cta-box { background: var(--verlauf); color: #fff; border-radius: var(--radius-card); border: 1px solid color-mix(in srgb, #fff 14%, transparent);
  box-shadow: 0 12px 30px -16px rgba(var(--ink), .35), inset 0 1px 0 color-mix(in srgb, #fff 26%, transparent); }
.cta-box .btn.primary { background: #fff; color: var(--primary); }

/* ---------- Kennzahlen: Glas in Ruhe (liegen auf der Bühne) */
.kpis { gap: 14px; margin-bottom: 14px; }
.kpi, .summen > div, .aw-kachel {
  background: var(--card-glass); backdrop-filter: blur(var(--gblur)) saturate(1.9); -webkit-backdrop-filter: blur(var(--gblur)) saturate(1.9);
  border: 1px solid var(--glass-border) !important; border-radius: var(--radius-card); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); padding: 18px; color: var(--text-body); }
.kpi:hover { border-color: color-mix(in srgb, var(--primary) 35%, transparent) !important; color: var(--text-body); }
.summen { gap: 14px; margin-bottom: 14px; }
/* Kennzahlenleisten mit vielen Kacheln (Rohertrag, Kontrolle): kleinere Zahl, Silbentrennung im Etikett */
.summen > div { padding: 14px 16px; min-width: 0; }
.summen .l { letter-spacing: .05em; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
.summen .v { font-size: 22px; line-height: 28px; white-space: nowrap; }
.kpi .l, .summen .l, .aw-kachel .l { font-size: 10.5px; line-height: 14px; letter-spacing: .08em; font-weight: 700; text-transform: uppercase; color: var(--text-label); }
.kpi .v, .summen .v, .aw-kachel .v { font-size: 26px; line-height: 32px; font-weight: 700; color: var(--text-heading); margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.summen .s, .aw-kachel .s { font-size: 12px; line-height: 16px; color: var(--text-muted); }
/* die eine dunkle Fläche je Seite (Aktionskachel) */
.kpi.primary, .summen .cta, .aw-kachel.haupt {
  background: var(--verlauf); border: 1px solid color-mix(in srgb, #fff 14%, transparent) !important;
  box-shadow: 0 12px 30px -16px rgba(var(--ink), .35), inset 0 1px 0 color-mix(in srgb, #fff 26%, transparent); color: #fff; }
.kpi.primary .v, .summen .cta .v, .aw-kachel.haupt .v { color: #fff; }
.kpi.primary .l, .summen .cta .l, .summen .cta .s, .aw-kachel.haupt .l, .aw-kachel.haupt .s { color: rgba(255, 255, 255, .78); }

/* ---------- Tabellen: Spaltenköpfe im Träger-Ton, Haarlinien, Zahlen rechtsbündig */
table { font-size: 13px; line-height: 20px; }
th { font-size: 10.5px; line-height: 14px; letter-spacing: .08em; font-weight: 700; text-transform: uppercase; color: var(--text-label);
  background: var(--surface-card); border-bottom: 1px solid var(--hair); padding: 9px 12px; }
td { color: var(--text-body); border-bottom: 1px solid color-mix(in srgb, var(--text-heading) 6%, transparent); padding: 9px 12px; }
td .title, td b, td strong { color: var(--text-heading); }
tbody tr:nth-child(even) td { background: transparent; }
tbody tr { transition: background-color 150ms; }
tr.click:hover td { background: color-mix(in srgb, var(--text-heading) 4%, transparent); }
tfoot td { color: var(--text-heading); font-weight: 700; border-top: 1px solid var(--border-default); }

/* Kompakte Tabelle (Rohertrag, feste Spaltenbreiten): engere Laufweite, damit Köpfe nicht mitten im Wort brechen */
table.ro-kompakt thead th { letter-spacing: .02em; font-size: 10px; hyphens: auto; -webkit-hyphens: auto; }
table.ro-kompakt thead tr.gruppen th { letter-spacing: .04em; }
table.ro-kompakt td { font-size: 12px; line-height: 17px; }

/* Gruppenköpfe der Kontrolle: getönt statt gefüllter Balken */
table.kontrolle thead tr.gruppen th { color: var(--text-heading); font-size: 10.5px; letter-spacing: .08em; }
table.kontrolle .g-vorgang, table.kontrolle .g-erg, table.kontrolle thead tr.gruppen th:last-child { background: color-mix(in srgb, var(--text-heading) 7%, var(--surface-card)); }
table.kontrolle .g-prov { background: color-mix(in srgb, var(--primary) 12%, var(--surface-card)); color: var(--primary-badge-text) !important; }
table.kontrolle .g-hw { background: color-mix(in srgb, var(--text-label) 14%, var(--surface-card)); color: var(--domain-text-2) !important; }
table.kontrolle .grp { border-left: 1px solid var(--hair); }
table.kontrolle tbody tr.row:nth-child(4n+3) td { background: transparent; }
table.kontrolle tbody tr.row:hover td,
table.vp-tab tr.vp-row:hover td,
table.in-monate tr.in-monat:hover td { background: color-mix(in srgb, var(--text-heading) 4%, transparent); }
table.kontrolle tbody tr.row.offen td, tr.detail > td, table.vp-tab tr.vp-row.offen td, table.in-monate tr.in-monat.aktiv td, tr.offen > td {
  background: color-mix(in srgb, var(--primary) 6%, var(--surface-card)); }
table.vp-tab tr.vp-vorgang td, tr.kl-detail > td, tr.ab-details > td { background: var(--surface-muted); }
table.in-monate tr.in-monat.aktiv td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
table.in-tab .balken { background: var(--inset-fill); border-radius: var(--radius-pill); }
table.in-tab .balken span { background: var(--primary); border-radius: var(--radius-pill); }
table.kontrolle tfoot td { border-top: 1px solid var(--border-default); }
/* Ampelzeilen: nur leicht getönt, die Kante trägt die Farbe */
table.kontrolle tbody tr.row.amp-gruen td { background: color-mix(in srgb, var(--status-success) 6%, var(--surface-card)) !important; }
table.kontrolle tbody tr.row.amp-orange td { background: color-mix(in srgb, var(--status-warning) 8%, var(--surface-card)) !important; }
table.kontrolle tbody tr.row.amp-rot td { background: color-mix(in srgb, var(--status-error) 5%, var(--surface-card)) !important; }
table.kontrolle tbody tr.row.amp-gruen td:first-child { box-shadow: inset 3px 0 0 var(--status-success); }
table.kontrolle tbody tr.row.amp-orange td:first-child { box-shadow: inset 3px 0 0 var(--status-warning); }
table.kontrolle tbody tr.row.amp-rot td:first-child { box-shadow: inset 3px 0 0 var(--status-error); }

/* ---------- Formulare: erhaben, weil berührbar */
label { color: var(--text-heading); font-weight: 700; font-size: 12px; line-height: 16px; }
/* :where() hält die Spezifität bei "input", damit kompakte Felder (Filterzeilen, Rohertrag) ihre eigenen Maße behalten */
input:where(:not([type="checkbox"], [type="radio"], [type="range"], [type="file"])), select, textarea {
  background-color: var(--surface-card); border: 1px solid color-mix(in srgb, var(--text-heading) 6%, transparent); border-radius: var(--radius-control);
  box-shadow: var(--input-shadow); color: var(--text-heading); font-size: 13px; line-height: 20px; padding: 7px 12px; min-height: 36px; }
input:where(:not([type="checkbox"], [type="radio"])):hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--primary) 45%, transparent); }
input:focus, select:focus, textarea:focus { border-color: color-mix(in srgb, var(--primary) 45%, transparent); box-shadow: var(--input-shadow); outline: 2px solid var(--ring); outline-offset: 2px; }
select:not([multiple]) { padding-right: 2.25rem; }
/* Kästchen und Optionsfelder wie in PKS (die UI-Schicht zeichnet sie, app.css/Horizon gaben ihnen Feld-Innenabstand und Radius) */
input[type="checkbox"], input[type="radio"] { appearance: none; display: inline-grid; place-content: center; flex: none; width: 1rem !important; height: 1rem; min-width: 1rem;
  min-height: 0; padding: 0; margin: 0; vertical-align: middle; cursor: pointer; accent-color: var(--primary);
  border: 1.5px solid color-mix(in srgb, var(--text-heading) 32%, transparent); background: var(--surface-card) center / 100% 100% no-repeat; box-shadow: var(--input-shadow);
  transition: background-color 120ms ease-out, border-color 120ms ease-out; }
input[type="checkbox"] { border-radius: 4px; }
input[type="radio"] { border-radius: 9999px; }
input:is([type="checkbox"], [type="radio"]):hover:not(:disabled) { border-color: color-mix(in srgb, var(--primary) 60%, transparent); }
input:is([type="checkbox"]:is(:checked, :indeterminate), [type="radio"]:checked) { border-color: var(--primary); background-color: var(--primary); }
input[type="checkbox"]:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.8 8.3 2.7 2.7 5.7-6'/%3E%3C/svg%3E"); }
input[type="checkbox"]:indeterminate { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M4.5 8h7'/%3E%3C/svg%3E"); }
input[type="radio"]:checked { background-image: radial-gradient(circle, white 0 28%, transparent 32%); }
input:is([type="checkbox"], [type="radio"]):disabled { cursor: not-allowed; opacity: .5; }
input:is([type="checkbox"], [type="radio"]):focus { box-shadow: var(--input-shadow); outline: none; }
input:is([type="checkbox"], [type="radio"]):focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
::placeholder { color: var(--text-dimmed); }

/* ---------- Knöpfe: gefüllt nur die Primäraktion, sonst erhaben mit Blau beim Zeigen */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--radius-control);
  font-weight: 700; font-size: 13px; line-height: 20px; color: var(--text-heading); background: var(--surface-card);
  border: 1px solid color-mix(in srgb, var(--text-heading) 9%, transparent); box-shadow: var(--input-shadow);
  transition: background-color 150ms, border-color 150ms, color 150ms, scale 150ms; }
.btn:hover { background: color-mix(in srgb, var(--primary) 7%, var(--surface-card)); border-color: color-mix(in srgb, var(--primary) 35%, transparent); color: var(--primary); }
.btn:active:not(:disabled) { scale: .97; }
.btn:disabled { color: var(--text-dimmed); cursor: not-allowed; box-shadow: none; }
.btn.primary { background: var(--primary); border-color: transparent; color: var(--primary-foreground); border-radius: var(--radius-tile); box-shadow: var(--shadow-gradient-primary); }
.btn.primary:hover { background: color-mix(in srgb, var(--primary) 86%, black); color: var(--primary-foreground); border-color: transparent; }
.btn.primary:disabled { color: color-mix(in srgb, var(--primary-foreground) 72%, transparent); }
.btn.small { min-height: 30px; padding: 0 11px; font-size: 12px; line-height: 16px; border-radius: var(--radius-control); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-muted); }
.btn.ghost:hover { background: color-mix(in srgb, var(--text-heading) 7%, transparent); color: var(--text-heading); border-color: transparent; }
.btn.danger, .btn.rot { color: var(--destructive); border-color: color-mix(in srgb, var(--destructive) 40%, transparent); }
.icon-btn { border-radius: var(--radius-pill); color: var(--text-muted); }
.icon-btn:hover { color: var(--text-heading); background: color-mix(in srgb, var(--text-heading) 8%, transparent); }

/* Auswahl: eine Spur, der aktive Schritt eine erhabene Platte */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 0; padding: 2px; border: 0; border-radius: var(--radius-control);
  background: var(--segmented-track); box-shadow: var(--segmented-track-inset); }
.segmented a, .segmented button { position: relative; border: 0 !important; border-radius: var(--radius-control); padding: 7px 13px; font-size: 12.5px; line-height: 1.4;
  font-weight: 400; color: var(--text-body); background: transparent; }
.segmented a:hover, .segmented button:hover { color: var(--text-heading); background: transparent; }
.segmented a.active, .segmented button.active { background: var(--surface-card); color: var(--text-heading); font-weight: 700; box-shadow: var(--segmented-step-shadow); }
.tabs { border-bottom: 1px solid var(--hair); }
.tabs a { color: var(--text-muted); font-weight: 700; }
.tabs a:hover { color: var(--text-heading); }
.tabs a.active { color: var(--text-heading); border-bottom-color: var(--primary); }

/* ---------- Status: Punkt plus Wort, keine Pille (PKS-Regel) */
.badge { gap: 7px; padding: 0; border: 0 !important; border-radius: 0; background: transparent !important; color: var(--text-body) !important;
  font-size: 12px; line-height: 16px; font-weight: 400; }
.badge::before { content: ''; width: 7px; height: 7px; flex: none; border-radius: var(--radius-pill); background: var(--dot, var(--text-dimmed));
  box-shadow: 0 0 6px color-mix(in srgb, var(--dot, var(--text-dimmed)) 55%, transparent); }
.badge.st-treffer, .badge.kl-erledigt, .badge.t-erledigt, .badge.m-erreicht, .badge.s-abgeschlossen { --dot: var(--status-success); }
.badge.st-differenz, .badge.in-rueck { --dot: var(--status-error); }
.badge.c-freigabe_offen, .badge.in-vorjahr, .badge.t-wartet, .badge.s-pausiert { --dot: var(--status-warning); }
.badge.st-storno, .badge.kl-in_bearbeitung, .badge.t-in_bearbeitung, .badge.s-in_umsetzung, .badge.c-in_klaerung, .badge.s-geplant { --dot: var(--primary); }
.badge.st-offen, .badge.kl-neu, .badge.s-entwurf, .badge.c-manuell { --dot: var(--text-dimmed); }
.badge.s-abgebrochen, .badge.t-entfaellt, .badge.m-entfaellt, .badge.kl-entfaellt { --dot: transparent; color: var(--text-muted) !important; }
table.ro-kompakt .badge { padding: 0; }
.tag { border-radius: var(--radius-chip); background: var(--inset-fill); border-color: transparent; color: var(--text-muted); }

/* Abschluss- und Ampel-Chips: ruhig, Farbe nur am Punkt bzw. als Text */
.ab-chip { border-radius: var(--radius-pill); border: 1px solid var(--glass-border); background: var(--inset-fill); color: var(--text-body); }
.ab-chip.ok { background: color-mix(in srgb, var(--status-success) 12%, transparent); border-color: transparent; color: var(--text-success); }
.ab-chip.da { background: color-mix(in srgb, var(--status-warning) 16%, transparent); border-color: transparent; color: var(--text-warning); }
.ab-chip.fehlt { background: color-mix(in srgb, var(--status-error) 10%, transparent); border-color: transparent; color: var(--text-error); }
.amp-chip { border-radius: var(--radius-pill); border: 1px solid var(--glass-border); background: var(--inset-fill); color: var(--text-body); padding: 5px 12px; }
.amp-chip:hover { border-color: color-mix(in srgb, var(--primary) 35%, transparent); color: var(--text-heading); }
.amp-chip .punkt { width: 7px; height: 7px; box-shadow: 0 0 6px currentColor; }
.amp-chip.amp-gruen, .amp-chip.amp-orange, .amp-chip.amp-rot { background: var(--inset-fill); }
.amp-chip.amp-gruen .punkt { background: var(--status-success); color: var(--status-success); }
.amp-chip.amp-orange .punkt { background: var(--status-warning); color: var(--status-warning); }
.amp-chip.amp-rot .punkt { background: var(--status-error); color: var(--status-error); }
.amp-chip.aktiv { background: color-mix(in srgb, var(--primary) 12%, transparent); border-color: color-mix(in srgb, var(--primary) 30%, transparent);
  box-shadow: none; color: var(--text-heading); font-weight: 700; }

/* Monatsabschluss-Hinweise */
.ab-hinweis { background: var(--surface-card); border: 1px solid var(--border-default); border-left: 3px solid var(--text-label); border-radius: var(--radius-tile); box-shadow: none; }
.ab-hinweis.festgeschrieben { border-left-color: var(--status-success); }
.ab-hinweis.vorgelegt { border-left-color: var(--status-warning); }
.ab-hinweis.gross { border-left-width: 4px; }
.ab-badge { border-radius: var(--radius-pill); }
.ab-badge.festgeschrieben { background: var(--success-600); }
.ab-badge.vorgelegt { background: var(--warning-600); }

/* Ablauf der Durchläufe */
.ablauf li.ok .n { background: var(--primary); border-color: var(--primary); }
.ablauf li.laeuft .n { border-color: var(--primary); color: var(--primary); }

/* ---------- Überlagerungen: deckend, kräftiger Schatten */
.modal-back { background: var(--backdrop); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal { background: var(--surface-card); border: 1px solid var(--glass-border); border-radius: var(--radius-card); padding: 22px 24px;
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, .5); }
.modal h2 { padding-bottom: 14px; border-bottom: 1px solid var(--hair); }
.popover { background: var(--card-glass-pop); border: 1px solid var(--glass-border); border-radius: var(--radius-tile); box-shadow: var(--glass-shadow); }
.toast { background: var(--brand-neutral-950); color: #fff; border-radius: var(--radius-tile); box-shadow: var(--glass-shadow); }

/* Kacheln in Einstellungen, Auswertungen, Prüfliste */
.kachel-tabellen > div, .kl-airtime > div { background: var(--inset-fill); border-radius: var(--radius-tile); }
.kachel-tabellen b { color: var(--text-heading); }
.ordner-chip { border-radius: var(--radius-control); background: var(--surface-card); border-color: var(--border-default); }
.aw-anteil { background: var(--inset-fill); }
.aw-anteil span { background: var(--primary); }
.kl-auf { background: var(--inset-fill); color: var(--text-heading); border-radius: var(--radius-chip); }
.kl-auf:hover { background: color-mix(in srgb, var(--text-heading) 10%, transparent); }
.lauf-aktiv { border-radius: var(--radius-tile); }
.ampel-kopf { border-radius: var(--radius-tile); }
.markdown pre { background: var(--brand-neutral-950); border-radius: var(--radius-tile); }

/* Ist laut Abrechnung je Provider (11.11.2026, views/kontrolle.js eingangKachel) */
.eingang-kachel { margin-bottom: 14px; }
.eingang-kachel .an-kopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.eingang-kachel .an-kopf h2 { margin: 0 0 2px; }
.eingang-kachel .an-kopf .small.muted { max-width: 860px; }
.eingang-kachel .an-gesamt { text-align: right; }
.eingang-kachel .an-gesamt .v { font-size: 22px; line-height: 28px; font-weight: 700; color: var(--text-heading); font-variant-numeric: tabular-nums; }
.eingang-kachel .an-fuss { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; }
.eingang-kachel .an-delta { font-size: 12px; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.eingang-kachel .an-delta.auf { color: var(--text-success); }
.eingang-kachel .an-delta.ab { color: var(--text-error); }
.eg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.eg-karte { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 14px; border-radius: var(--radius-tile);
  background: var(--surface-card); border: 1px solid var(--border-default); overflow: hidden; }
.eg-karte::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--prov); }
.eg-name { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.eg-name b { font-size: 15px; color: var(--text-heading); }
.eg-betrag { font-size: 26px; line-height: 32px; font-weight: 700; color: var(--text-heading); font-variant-numeric: tabular-nums; }
.eg-balken { display: flex; height: 8px; border-radius: var(--radius-pill); overflow: hidden; background: var(--inset-fill); margin: 4px 0 6px; }
.eg-balken span { display: block; height: 100%; }
.eg-balken span + span { box-shadow: inset 1px 0 0 var(--surface-card); }
.eg-teile { display: flex; flex-direction: column; gap: 3px; }
.eg-zeile { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12.5px; line-height: 18px; color: var(--text-body); font-variant-numeric: tabular-nums; }
.eg-zeile > span { display: inline-flex; align-items: baseline; gap: 7px; padding-left: 14px; }
.eg-zeile > span small { color: var(--text-muted); font-size: 11px; margin-left: 2px; }
.eg-zeile i { width: 8px; height: 8px; border-radius: var(--radius-pill); flex: none; align-self: center; }
.eg-zeile b { font-weight: 700; color: var(--text-heading); white-space: nowrap; }
.eg-zeile.eg-haupt { padding-top: 4px; margin-top: 2px; border-top: 1px solid var(--hair); }
.eg-zeile.eg-haupt:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.eg-zeile.eg-haupt > span { padding-left: 0; font-weight: 700; color: var(--text-heading); }
/* je Ordner der Ist-Provisionen (17.11.2026): eigener Block unter Einmal/Airtime */
.eg-teile.eg-ordner { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--hair); }
.eg-teile.eg-ordner .eg-zeile.eg-haupt:first-child > span { font-weight: 600; color: var(--text-label); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }

/* Einstellungen › Ist-Import (12.11.2026, views/istimport.js) */
.ii-kopf .kopfzeile { align-items: flex-start; }
.ii-aktionen { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ii-aktionen select { width: auto; min-width: 180px; }
.ii-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ii-karte { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: var(--radius-tile); background: var(--surface-card); border: 1px solid var(--border-default); }
.ii-karte.offen { box-shadow: inset 3px 0 0 var(--status-warning); }
.ii-karte.problem { box-shadow: inset 3px 0 0 var(--status-error); }
/* Prüfbericht der letzten Abholung (24.11.2026) */
.ii-bericht { margin-bottom: 16px; }
.ii-bericht.problem { box-shadow: inset 3px 0 0 var(--status-error); }
.ii-bericht-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ii-bericht-liste li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.ii-abholen-monate { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 12px; }
.dl-zeile.umbruch { align-items: start; }
.dl-zeile.umbruch span:nth-child(2) { white-space: normal; overflow: visible; }
.ii-zahlen { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; }
.ii-zahlen span { display: inline-flex; align-items: center; gap: 6px; }
.eingang-kachel .an-kopf, .card .an-kopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.card .an-gesamt { text-align: right; }
.card .an-gesamt .v { font-size: 22px; line-height: 28px; font-weight: 700; color: var(--text-heading); font-variant-numeric: tabular-nums; }
table.ii-tab td { vertical-align: top; }
.ii-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
table.ii-tab .mx-status { gap: 7px; }

/* Provision andere Provider: Abrechnungen in SharePoint öffnen (10.11.2026) */
.an-dateien { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.an-dateien:empty { display: none; }
a.an-sp { color: var(--link); }
a.an-sp:hover { text-decoration: underline; }

/* Alle Läufe für einen Monat (17.11.2026, views/betrieb.js) */
.kette-box { margin-bottom: 14px; padding: 14px 16px; border-radius: var(--radius-tile); background: var(--surface-muted); border: 1px solid var(--border-default); }
.kette-kopf { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.kette-stand { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--hair); }
.kette-schritte { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: ks; }
.kette-schritte li { display: grid; grid-template-columns: 22px 200px auto 1fr; align-items: baseline; gap: 10px; counter-increment: ks; }
.kette-schritte li::before { content: counter(ks); width: 20px; height: 20px; border-radius: var(--radius-pill); background: var(--inset-fill); color: var(--text-muted);
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; align-self: center; }
.kette-schritte li.ks-ok::before { background: color-mix(in srgb, var(--status-success) 20%, transparent); color: var(--text-success); }
.kette-schritte li.ks-laeuft::before { background: var(--primary); color: var(--primary-foreground); }
.kette-schritte li.ks-fehler::before, .kette-schritte li.ks-abgebrochen::before { background: color-mix(in srgb, var(--status-error) 16%, transparent); color: var(--text-error); }
.kette-schritte .ks-titel { font-weight: 700; color: var(--text-heading); }
.kette-schritte .ks-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .kette-schritte li { grid-template-columns: 22px 1fr auto; } .kette-schritte .ks-text { grid-column: 2 / -1; white-space: normal; } }

/* Updates zur Logik (11.11.2026, views/updates.js) */
.up-eintrag { padding: 10px 0 12px; border-bottom: 1px solid var(--hair); }
.up-eintrag:last-child { border-bottom: 0; padding-bottom: 0; }
.up-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.up-kopf b { color: var(--text-heading); font-size: 14px; }
.up-bereich { font-size: 10.5px; line-height: 14px; letter-spacing: .08em; font-weight: 700; text-transform: uppercase; color: var(--text-label); }
.up-eintrag p { margin: 0 0 4px; max-width: 980px; }
.nav a .count[hidden] { display: none; }
#nav-updates { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary-badge-text); }

/* Diagramme (public/js/charts.js): Gitter und Beschriftung aus den Diagramm-Tokens */
svg.ch .ch-gitter { stroke: var(--chart-grid); }
svg.ch .ch-achse { fill: var(--chart-label); font-size: 11px; }
svg.ch .ch-label { fill: var(--text-heading); font-size: 11.5px; }
svg.ch .ch-wert { fill: var(--text-body); font-size: 10.5px; font-weight: 700; }
svg.ch .ch-innen { fill: #fff; font-weight: 700; }
.ch-legende { color: var(--text-muted); font-size: 12px; line-height: 16px; }
.ch-legende i { border-radius: var(--radius-pill); width: 8px; height: 8px; }
.aw-kachel .punkt { border-radius: var(--radius-pill); width: 8px; height: 8px; }

/* Update-Hinweis unter dem Logo (public/js/update.js) */
.update-hinweis { margin: 0 2px 10px; border-radius: var(--radius-tile); border: 1px solid color-mix(in srgb, var(--status-warning) 35%, transparent); border-left: 1px solid color-mix(in srgb, var(--status-warning) 35%, transparent);
  background: color-mix(in srgb, var(--status-warning) 14%, var(--surface-card)); }
.update-hinweis.u-fertig { background: color-mix(in srgb, var(--status-success) 12%, var(--surface-card)); border-color: color-mix(in srgb, var(--status-success) 35%, transparent); }
.update-hinweis .u-dreh { border-color: var(--status-warning); border-top-color: transparent; }

/* ---------- Anmeldung: Bühne mit Glas links, Anmeldefeld als Glas-Karte rechts */
.login-page { background: transparent; }
.login-hero { background: transparent; }
.login-hero .lh-marke img { height: clamp(22px, 1.8vw, 30px); }
.login-hero .product { font-weight: 400; color: var(--text-heading); }
.login-hero .product b { font-weight: 700; }
.login-hero p.lh-claim { color: var(--text-muted); }
.lh-baustein { background: var(--card-glass); backdrop-filter: blur(var(--gblur)) saturate(1.9); -webkit-backdrop-filter: blur(var(--gblur)) saturate(1.9);
  border: 1px solid var(--glass-border); border-radius: var(--radius-card); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.lh-baustein:hover { transform: translateY(-2px); box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, .55); }
.lh-baustein svg { background: color-mix(in srgb, var(--primary) 10%, transparent); stroke: var(--primary); }
.lh-baustein b { color: var(--text-heading); }
.lh-baustein span { color: var(--text-muted); }
.login-form { margin: 14px; border-radius: var(--radius-card); background: var(--card-glass); backdrop-filter: blur(var(--gblur)) saturate(1.9); -webkit-backdrop-filter: blur(var(--gblur)) saturate(1.9);
  border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, .55); }
.login-form input { border-radius: var(--radius-control); }
.login-form .btn.primary { border-radius: var(--radius-tile); }
.login-hilfe { background: var(--inset-fill); border-left: 0; border-radius: var(--radius-tile); color: var(--text-body); }
.login-hilfe b { color: var(--text-heading); }

/* ---------- Auftritt: Hauptelemente blenden beim Seitenwechsel einmal ein */
@media (prefers-reduced-motion: no-preference) {
  .content.pks-auftritt > * { animation: mx-fade-up var(--dur-reveal) var(--ease-out-expo) both; }
  .content.pks-auftritt > :nth-child(2) { animation-delay: 35ms; }
  .content.pks-auftritt > :nth-child(3) { animation-delay: 70ms; }
  .content.pks-auftritt > :nth-child(4) { animation-delay: 105ms; }
  .content.pks-auftritt > :nth-child(n+5) { animation-delay: 140ms; }
}
@media (prefers-reduced-motion: reduce) { :root { --amb: paused; } }

/* ---------- Schmale Bildschirme: Seitenleiste als Glas-Schublade */
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 0 12px; gap: 0; }
  .sidebar { position: fixed; top: 10px; bottom: 10px; left: 10px; height: auto; margin: 0; width: var(--mx-sidebar-width); transform: translateX(calc(-100% - 20px)); }
  .shell.nav-open .sidebar { transform: none; }
  .topbar { top: 10px; margin-top: 10px; padding: 0 12px; }
  .topbar .krume { display: none; }
  .summen, .aw-kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .summen .l { overflow-wrap: normal; }
  .content { padding: 14px 0 40px; }
  .login-form { margin: 0 12px 12px; }
  h1 { font-size: 22px; line-height: 28px; }
}

/* Seitenstand-Hinweis unten rechts (public/js/stand.js, 12.11.2026): letzter Stand angezeigt, neuer wird gerechnet */
.stand-hinweis { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; gap: 10px; align-items: center; max-width: min(420px, calc(100vw - 32px));
  padding: 10px 12px; border-radius: var(--radius-tile); font-size: 12px; line-height: 1.35; color: var(--text-body);
  background: color-mix(in srgb, var(--status-warning) 12%, var(--surface-card)); border: 1px solid color-mix(in srgb, var(--status-warning) 35%, transparent);
  box-shadow: 0 8px 24px rgba(9, 27, 40, 0.12); }
.stand-hinweis[hidden] { display: none; }
.stand-hinweis b { display: block; font-size: 12.5px; color: var(--text-heading); }
.stand-hinweis span:not(.stand-dreh) { display: block; color: var(--text-muted); }
.stand-hinweis .btn { margin-left: auto; white-space: nowrap; }
.stand-hinweis .stand-zu { border: 0; background: transparent; color: var(--text-muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 2px 4px; }
.stand-hinweis .stand-dreh { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid var(--status-warning); border-top-color: transparent; animation: u-dreh 0.9s linear infinite; }

/* Ist Provisionen Import in Unterreitern (12.11.2026) */
.ii-reiter { margin: 14px 0 0; }
.ii-teil > .kacheln { margin-top: 16px; }
.ii-kennzahlen { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-default); }
.ii-kennzahlen > div { display: flex; flex-direction: column; gap: 2px; }
.ii-kennzahlen .l { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.ii-kennzahlen b { font-size: 18px; line-height: 24px; color: var(--text-heading); font-variant-numeric: tabular-nums; }
button.ii-karte { text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
button.ii-karte:hover, button.ii-karte:focus-visible { border-color: var(--link); outline: none; }
.ii-filter { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ii-filter select { width: auto; min-width: 160px; }
.ii-filter label { display: inline-flex; gap: 8px; align-items: center; font-weight: 400; }

/* Fortschritt eines laufenden Laufs (Einstellungen › Läufe / Ist Provisionen Import, 12.11.2026) */
.lauf-fortschritt { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.lf-balken { height: 6px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--status-warning) 18%, var(--surface-card)); overflow: hidden; }
.lf-balken i { display: block; height: 100%; border-radius: inherit; background: var(--status-warning); transition: width .6s ease; }

/* Aktivität in Benutzer & Rechte (26.11.2026) */
.akt-uebersicht { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.akt-kachel { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--inset-fill); }
.akt-kachel .l { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.akt-kachel .v { font-size: 22px; font-weight: 700; }
.akt-kachel .s { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.akt-kachel.akt-jetzt .v { color: var(--text-success); }
.akt-kachel.akt-weg .v, .akt-kachel.akt-nie .v { color: var(--text-error); }
.akt-chip { display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; background: var(--inset-fill); border: 1px solid var(--glass-border); }
.akt-chip.akt-jetzt { background: color-mix(in srgb, var(--status-success) 14%, transparent); color: var(--text-success); border-color: transparent; }
.akt-chip.akt-heute { background: color-mix(in srgb, var(--status-success) 8%, transparent); color: var(--text-success); border-color: transparent; }
.akt-chip.akt-weg, .akt-chip.akt-nie { background: color-mix(in srgb, var(--status-error) 10%, transparent); color: var(--text-error); border-color: transparent; }
.akt-balken { display: flex; align-items: flex-end; gap: 2px; height: 20px; margin: 4px 0 2px; }
.akt-balken span { width: 6px; background: var(--primary); border-radius: 2px 2px 0 0; opacity: .8; }
.akt-zelle { min-width: 190px; }
@media (max-width: 900px) { .akt-uebersicht { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
