/* ============================================================
   HSP Rechnungen — style.css
   Helle Oberfläche im HSP-Stil (Tokens aus der Checkliste / dem Prototyp).
   Bewusst EINE Fassung — keine Dunkel-Variante.
   Aufbau: Tokens → Grundregeln → Gerüst → Bausteine → Rechnungen →
           Verwaltung → Dialoge/Meldungen → Startseite → Handy
   ============================================================ */

:root {
  --gruen-900: #064e3b;
  --gruen-700: #024d3b;
  --gruen-600: #059669;
  --gruen-500: #10b981;
  --gruen-100: #d1fae5;
  --gruen-50:  #ecfdf5;
  --logo:      #009747;
  --grund:     #f4f7f6;
  --flaeche:   #ffffff;
  --flaeche-2: #f8faf9;
  --flaeche-3: #eef3f1;
  --text:      #0f2027;
  --text-2:    #33454b;
  --text-3:    #5b6b70;
  --linie:     #e3ebe8;
  --linie-2:   #cfdcd7;
  --akzent:    var(--gruen-700);
  --akzent-text: #ffffff;
  --akzent-weich: var(--gruen-50);
  --akzent-weich-text: var(--gruen-900);
  /* Statusfarben (reserviert, nie als Serienfarbe) */
  --st-offen:      #0f3f79; --st-offen-bg:      #eef5fd;
  --st-ueber:      #b3261e; --st-ueber-bg:      #fdeeec;
  --st-teil:       #5f3a04; --st-teil-bg:       #fefaec;
  --st-bezahlt:    #065f46; --st-bezahlt-bg:    #ecfdf5;
  --st-storno:     #4b5563; --st-storno-bg:     #f1f3f4;
  --st-entwurf:    #4b5563; --st-entwurf-bg:    #f1f3f4;
  --rot:           #b3261e; --rot-bg:           #fdeeec;
  --balken:        #0a7a5d;
  --r-sm: 10px; --r: 14px; --r-lg: 20px;
  --schatten:   0 1px 2px rgba(15,32,39,.05), 0 2px 8px rgba(15,32,39,.04);
  --schatten-2: 0 2px 4px rgba(15,32,39,.06), 0 8px 24px rgba(15,32,39,.07);
  --nav-breit: 252px;
  --tippziel: 44px;
  --fokus: 0 0 0 3px rgba(5,150,105,.35);
  color-scheme: light;
}

/* ---------- Grundregeln ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--grund); color: var(--text);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* die Seite scrollt nie waagerecht — Tabellen scrollen in .tabelle-wrap */
}
button, select, input, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--akzent); }
:focus-visible { outline: none; box-shadow: var(--fokus); }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.leise { color: var(--text-3); }
.klein { font-size: .85rem; }
.rot { color: var(--st-ueber); }
.gruen { color: var(--st-bezahlt); }
.fett { font-weight: 600; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Gerüst ---------- */
.p-shell { display: flex; min-height: 100%; }
.p-nav {
  width: var(--nav-breit); flex-shrink: 0; background: var(--flaeche);
  border-right: 1px solid var(--linie); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; height: 100dvh;
}
.p-nav-kopf { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--linie); }
.p-logo { width: 84px; flex-shrink: 0; }
.p-logo svg { display: block; width: 100%; height: auto; }
.p-marke-titel { font-weight: 700; font-size: 1rem; line-height: 1.15; }
.p-marke-unter { font-size: .78rem; color: var(--text-3); letter-spacing: .02em; }
.p-nav-liste { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; overflow-y: auto; }
.p-nav-gruppe { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 12px 10px 6px; }
.p-nav-link {
  display: flex; align-items: center; gap: 10px; min-height: var(--tippziel); padding: 0 12px;
  border: 0; border-radius: var(--r-sm); background: transparent; text-align: left; width: 100%;
  font-weight: 500; color: var(--text-2); text-decoration: none;
}
.p-nav-link:hover { background: var(--flaeche-2); color: var(--text); }
.p-nav-link.aktiv { background: var(--akzent-weich); color: var(--akzent-weich-text); font-weight: 600; }
.p-nav-link .ico { width: 20px; text-align: center; opacity: .8; flex-shrink: 0; }
.p-nav-link .z { margin-left: auto; font-size: .75rem; background: var(--st-ueber-bg); color: var(--st-ueber); border-radius: 999px; padding: 1px 7px; font-weight: 600; }
.p-nav-fuss { margin-top: auto; padding: 12px 10px 16px; border-top: 1px solid var(--linie); display: grid; gap: 6px; }
.p-nav-version { font-size: .72rem; color: var(--text-3); padding: 0 12px; }

.p-haupt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.p-kopf {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--flaeche);
  border-bottom: 1px solid var(--linie); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; min-height: 64px;
}
.p-menue-knopf { display: none; width: var(--tippziel); height: var(--tippziel); border: 1px solid var(--linie); border-radius: var(--r-sm); background: var(--flaeche); font-size: 1.2rem; flex-shrink: 0; }
.p-kopf-titel { font-weight: 700; font-size: 1.15rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.p-wer { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 4px 6px 4px 4px; border-radius: var(--r-sm); text-align: left; min-height: var(--tippziel); }
.p-wer:hover { background: var(--flaeche-2); }
.p-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--akzent); color: var(--akzent-text); display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.p-wer-name { font-weight: 600; font-size: .92rem; line-height: 1.2; }
.p-wer-rolle { font-size: .78rem; color: var(--text-3); }

.inhalt { padding: 20px 24px 40px; display: grid; gap: 18px; max-width: 1480px; width: 100%; align-content: start; }
.inhalt > * { min-width: 0; }

/* ---------- Bausteine ---------- */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); box-shadow: var(--schatten); min-width: 0; }
.karte-inhalt { padding: 16px 18px; }
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--linie-2); background: var(--flaeche); font-weight: 600; font-size: .92rem;
  text-decoration: none; color: var(--text); white-space: nowrap;
}
.knopf:hover { background: var(--flaeche-2); }
.knopf-primaer { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
.knopf-primaer:hover { filter: brightness(1.08); background: var(--akzent); }
.knopf-gefahr { background: var(--st-ueber); color: #fff; border-color: var(--st-ueber); }
.knopf-gefahr:hover { filter: brightness(1.08); background: var(--st-ueber); }
.knopf-stumm { border-color: transparent; color: var(--text-2); }
.knopf-klein { min-height: 34px; padding: 0 10px; font-size: .85rem; }
.icon-knopf { width: var(--tippziel); height: var(--tippziel); display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: var(--r-sm); color: var(--text-2); flex-shrink: 0; }
.icon-knopf:hover { background: var(--flaeche-3); color: var(--text); }
.icon-knopf svg { width: 18px; height: 18px; }
select, input[type="search"], input[type="text"], input[type="password"], input[type="date"], input[type="email"], textarea, .eingabe {
  min-height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--linie-2); background: var(--flaeche); color: var(--text); max-width: 100%;
}
textarea { padding: 10px 12px; min-height: 90px; resize: vertical; }
input[type="search"] { width: 100%; }
input::placeholder { color: var(--text-3); }
select { padding-right: 30px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select.klein { min-height: 34px; font-size: .88rem; padding: 0 26px 0 10px; }

.hinweis {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--st-teil-bg); color: var(--st-teil); font-size: .88rem; border: 1px solid rgba(95,58,4,.2);
}
.hinweis svg { flex-shrink: 0; margin-top: 2px; }
.hinweis.info { background: var(--st-offen-bg); color: var(--st-offen); border-color: rgba(15,63,121,.2); }
.hinweis.fehler { background: var(--st-ueber-bg); color: var(--st-ueber); border-color: rgba(179,38,30,.2); }
.hinweis.ok { background: var(--st-bezahlt-bg); color: var(--st-bezahlt); border-color: rgba(6,95,70,.2); }
.hinweis a { color: inherit; font-weight: 600; }

.schalter { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: .88rem; color: var(--text-2); cursor: pointer; user-select: none; }
.schalter input { width: 18px; height: 18px; accent-color: var(--akzent); margin: 0; cursor: pointer; }

.laden { display: flex; align-items: center; gap: 10px; padding: 32px 18px; justify-content: center; color: var(--text-3); font-size: .9rem; }
.ring { width: 22px; height: 22px; border: 3px solid var(--linie); border-top-color: var(--akzent); border-radius: 50%; animation: dreh .9s linear infinite; flex-shrink: 0; }
.ring.klein { width: 14px; height: 14px; border-width: 2px; }
@keyframes dreh { to { transform: rotate(360deg); } }

/* Kennzahlen */
.kacheln { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kachel {
  padding: 16px 18px; display: grid; gap: 4px; text-align: left; border-radius: var(--r); cursor: pointer;
  background: var(--flaeche); border: 1px solid var(--linie); box-shadow: var(--schatten); color: inherit; font: inherit; min-width: 0;
}
.kachel:hover { border-color: var(--linie-2); box-shadow: var(--schatten-2); }
.kachel.aktiv { border-color: var(--akzent); box-shadow: 0 0 0 1px var(--akzent) inset; }
.kachel.passiv { cursor: default; }
.kachel.passiv:hover { border-color: var(--linie); box-shadow: var(--schatten); }
.kachel-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kachel-wert { font-size: 1.7rem; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kachel-wert.mittel { font-size: 1.25rem; }
.kachel-unter { font-size: .85rem; color: var(--text-2); }
.kachel.ueber .kachel-wert { color: var(--st-ueber); }
.kachel.fehler .kachel-wert { color: var(--st-ueber); }
.punkt { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--gruen-500); }
.punkt.rot { background: var(--st-ueber); }
.punkt.grau { background: var(--linie-2); }

/* Balkenliste */
.zeilen-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 18px 0; flex-wrap: wrap; }
.zeilen-kopf h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.balken-liste { display: grid; gap: 10px; padding: 12px 18px 16px; }
.balken-zeile { display: grid; grid-template-columns: 170px 1fr 120px 70px; align-items: center; gap: 12px; font-size: .9rem; }
.balken-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.balken-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.balken-spur { height: 8px; background: var(--flaeche-3); border-radius: 4px; overflow: hidden; }
.balken-fuellung { height: 100%; background: var(--balken); border-radius: 4px; }
.balken-wert { text-align: right; font-weight: 600; }
.balken-anzahl { text-align: right; color: var(--text-3); }

.mono {
  width: 26px; height: 26px; border-radius: 7px; display: inline-grid; place-items: center; flex-shrink: 0;
  background: var(--akzent-weich); color: var(--akzent-weich-text); font-size: .7rem; font-weight: 700; letter-spacing: .02em;
}
.mono.grau { background: var(--flaeche-3); color: var(--text-3); }

/* Filterleiste */
.filter { padding: 14px 18px; display: grid; gap: 12px; }
.filter-zeile { display: grid; grid-template-columns: minmax(200px, 1.4fr) repeat(3, minmax(150px, 1fr)); gap: 10px; }
.filter-zeile.zwei { grid-template-columns: minmax(200px, 1.4fr) repeat(2, minmax(150px, 1fr)); }
.filter-zeile.eins { grid-template-columns: minmax(200px, 1.4fr) minmax(150px, 1fr); }
.such { position: relative; }
.such input { padding-left: 36px; }
.such svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--linie-2); background: var(--flaeche);
  font-weight: 500; font-size: .88rem; display: inline-flex; align-items: center; gap: 8px; color: var(--text-2);
}
.chip .z { font-size: .78rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.chip:hover { background: var(--flaeche-2); }
.chip.aktiv { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.chip.aktiv .z { color: inherit; opacity: .8; }
.chips .rechts { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Tabelle */
.tabelle-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600;
  padding: 10px 12px; border-bottom: 1px solid var(--linie); white-space: nowrap; background: var(--flaeche-2);
}
thead th:first-child { padding-left: 18px; }
thead th.sort { cursor: pointer; user-select: none; }
thead th.sort:hover { color: var(--text); }
thead th .pfeil { display: inline-block; width: 10px; margin-left: 4px; opacity: .35; }
thead th.aktiv { color: var(--text); }
thead th.aktiv .pfeil { opacity: 1; }
th.r, td.r { text-align: right; }
tbody tr { border-bottom: 1px solid var(--linie); }
tbody tr.klickbar { cursor: pointer; }
tbody tr.klickbar:hover { background: var(--flaeche-2); }
tbody tr.gewaehlt { background: var(--akzent-weich); }
tbody tr.inaktiv td { color: var(--text-3); }
tbody td { padding: 10px 12px; vertical-align: middle; }
tbody td:first-child { padding-left: 18px; }
td.pdf, th.pdf { width: 52px; padding-left: 4px; padding-right: 8px; }
td.pdf .icon-knopf { width: 40px; height: 40px; }
.nr { font-weight: 600; }
.typ-chip { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--flaeche-3); color: var(--text-2); vertical-align: 1px; }
.typ-chip.gutschrift { background: var(--st-offen-bg); color: var(--st-offen); }
.betreff { color: var(--text-3); font-size: .84rem; display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unter { color: var(--text-3); font-size: .82rem; display: block; }
.nur-handy { display: none; }
.steller-zelle { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.faellig-hinweis { display: block; font-size: .78rem; color: var(--text-3); }
.faellig-hinweis.rot { color: var(--st-ueber); font-weight: 600; }
.offen-betrag { font-weight: 600; }
.offen-betrag.null { color: var(--text-3); font-weight: 400; }
.storno { text-decoration: line-through; color: var(--text-3); }
.status {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap;
  background: var(--flaeche-3); color: var(--text-2);
}
.status svg { width: 12px; height: 12px; flex-shrink: 0; }
.status.offen { background: var(--st-offen-bg); color: var(--st-offen); }
.status.ueberfaellig { background: var(--st-ueber-bg); color: var(--st-ueber); }
.status.teilbezahlt { background: var(--st-teil-bg); color: var(--st-teil); }
.status.bezahlt { background: var(--st-bezahlt-bg); color: var(--st-bezahlt); }
.status.storniert { background: var(--st-storno-bg); color: var(--st-storno); }
.status.entwurf { background: var(--st-entwurf-bg); color: var(--st-entwurf); border: 1px dashed var(--linie-2); }
.status.ok { background: var(--st-bezahlt-bg); color: var(--st-bezahlt); }
.status.fehler { background: var(--st-ueber-bg); color: var(--st-ueber); }
.status.warn { background: var(--st-teil-bg); color: var(--st-teil); }
.status.neutral { background: var(--flaeche-3); color: var(--text-2); }
tfoot td { padding: 12px 12px; font-weight: 600; border-top: 1px solid var(--linie-2); background: var(--flaeche-2); }
tfoot td:first-child { padding-left: 18px; }
.leer { padding: 40px 18px; text-align: center; color: var(--text-3); }
.leer-karte { padding: 48px 24px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.leer-karte h2 { margin: 0; font-size: 1.1rem; }
.leer-karte p { margin: 0; color: var(--text-2); max-width: 520px; }
.leer-karte .ico { width: 48px; height: 48px; border-radius: 50%; background: var(--akzent-weich); color: var(--akzent-weich-text); display: grid; place-items: center; font-size: 1.4rem; }
.tab-fuss { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px; font-size: .85rem; color: var(--text-3); flex-wrap: wrap; }

/* Detail-Schublade */
.schublade-hinter { position: fixed; inset: 0; background: rgba(15,32,39,.35); z-index: 20; }
.schublade {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: var(--flaeche); z-index: 21;
  box-shadow: -8px 0 32px rgba(0,0,0,.15); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px);
}
.schublade-kopf { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--linie); }
.schublade-kopf h2 { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.schublade-kopf .icon-knopf { margin-left: auto; }
.schublade-inhalt { overflow: auto; padding: 16px 20px 24px; display: grid; gap: 18px; flex: 1; align-content: start; }
.schublade-fuss { padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--linie); display: flex; gap: 8px; flex-wrap: wrap; }
.fakten { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.fakt { display: grid; gap: 2px; min-width: 0; }
.fakt-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; }
.fakt-wert { font-weight: 500; overflow-wrap: anywhere; }
.fakt.breit { grid-column: 1 / -1; }
.abschnitt h3 { margin: 0 0 8px; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; }
.mini { width: 100%; border-collapse: collapse; font-size: .9rem; }
.mini td, .mini th { padding: 7px 0; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
.mini th { font-size: .75rem; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.mini td.r, .mini th.r { text-align: right; white-space: nowrap; padding-left: 10px; }
.mini tr:last-child td { border-bottom: 0; }
.zeitleiste { display: grid; gap: 8px; }
.zeit { display: grid; grid-template-columns: 18px 1fr; gap: 10px; font-size: .9rem; }
.zeit .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--linie-2); margin-top: 6px; }
.zeit .dot.gruen { background: var(--gruen-500); }
.zeit .dot.rot { background: var(--st-ueber); }

/* ---------- Verwaltung ---------- */
.werkzeug-zeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.werkzeug-zeile h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.werkzeug-zeile .rechts { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.werkzeug-zeile .such { min-width: 220px; flex: 1; max-width: 360px; }
.tabelle-dicht tbody td { padding: 8px 12px; font-size: .92rem; }
.tabelle-dicht tbody td:first-child { padding-left: 18px; }
.aktionen { display: flex; gap: 4px; justify-content: flex-end; align-items: center; white-space: nowrap; }
.aktionen .knopf-klein { min-height: 34px; }
.zelle-stapel { display: grid; gap: 1px; min-width: 0; }
.zelle-stapel .haupt { font-weight: 600; }
.zelle-stapel > .status { justify-self: start; }
.schluessel { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.seiten { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 10px 18px; font-size: .88rem; color: var(--text-3); flex-wrap: wrap; }
.protokoll-detail { font-size: .85rem; color: var(--text-2); overflow-wrap: anywhere; max-width: 520px; }
.protokoll-detail .aenderung { display: block; color: var(--text-3); }
.anleitung { font-size: .85rem; color: var(--text-2); background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: var(--r-sm); padding: 10px 12px; display: grid; gap: 4px; }
.anleitung strong { color: var(--text); }
.menue-popup {
  position: fixed; z-index: 40; min-width: 220px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r-sm);
  box-shadow: var(--schatten-2); padding: 6px; display: grid; gap: 2px;
}
.menue-popup button { display: flex; align-items: center; gap: 10px; min-height: var(--tippziel); padding: 0 12px; border: 0; background: transparent; border-radius: 8px; text-align: left; width: 100%; font-weight: 500; color: var(--text); }
.menue-popup button:hover { background: var(--flaeche-2); }
.menue-popup button.gefahr { color: var(--st-ueber); }
.menue-popup button:disabled { color: var(--text-3); }
.menue-popup .trenner { height: 1px; background: var(--linie); margin: 4px 0; }
.menue-popup .kopfzeile { padding: 8px 12px 6px; font-size: .8rem; color: var(--text-3); }
.menue-popup .kopfzeile strong { display: block; color: var(--text); font-size: .92rem; }

/* ---------- Dialoge & Meldungen ---------- */
.dlg-grund { position: fixed; inset: 0; background: rgba(15,32,39,.45); z-index: 50; display: grid; place-items: center; padding: 16px; overflow: auto; }
.dlg { width: 100%; max-width: 520px; background: var(--flaeche); border-radius: var(--r-lg); box-shadow: var(--schatten-2); animation: dlgAuf .18s ease; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.dlg.breit { max-width: 640px; }
@keyframes dlgAuf { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dlg-kopf { padding: 22px 24px 0; display: flex; gap: 14px; align-items: flex-start; }
.dlg-symbol { font-size: 1.5rem; flex-shrink: 0; line-height: 1.2; }
.dlg-titel { margin: 0; font-size: 1.1rem; font-weight: 700; line-height: 1.35; min-width: 0; }
.dlg-text { padding: 12px 24px 0; color: var(--text-2); font-size: .95rem; white-space: pre-line; }
.dlg-koerper { padding: 18px 24px 0; overflow: auto; }
.formular-raster { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.feld { display: grid; gap: 6px; min-width: 0; }
.feld.voll { grid-column: 1 / -1; }
.feld-name { font-size: .85rem; font-weight: 600; color: var(--text-2); }
.feld .eingabe { width: 100%; }
.feld-hinweis { font-size: .8rem; color: var(--text-3); }
.dlg-fehler { padding: 8px 24px 0; color: var(--st-ueber); font-size: .88rem; min-height: 20px; font-weight: 500; }
.dlg-fuss { padding: 16px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.melder { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.meldung { display: flex; gap: 10px; align-items: flex-start; background: var(--text); color: var(--grund); padding: 10px 16px; border-radius: var(--r-sm); font-size: .9rem; box-shadow: var(--schatten-2); border-left: 4px solid var(--gruen-500); pointer-events: auto; animation: dlgAuf .18s ease; }
.meldung-fehler { border-left-color: #f28b82; }
.meldung-info { border-left-color: #8ab4f8; }
.meldung-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Startseite / SSO ---------- */
.start-seite { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.start-karte { width: 100%; max-width: 460px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r-lg); box-shadow: var(--schatten-2); padding: 32px 28px; display: grid; gap: 14px; text-align: center; justify-items: center; }
.start-logo { width: 150px; }
.start-logo svg { display: block; width: 100%; height: auto; }
.start-karte h1 { margin: 4px 0 0; font-size: 1.35rem; }
.start-karte .unter { color: var(--text-3); font-size: .9rem; margin-top: -8px; }
.start-karte p { margin: 0; color: var(--text-2); font-size: .95rem; }
.start-karte .knopf { min-height: 46px; padding: 0 22px; width: 100%; max-width: 320px; }
.start-karte .hinweis { text-align: left; width: 100%; }
.start-fuss { font-size: .8rem; color: var(--text-3); }
.start-karte .fehler { color: var(--st-ueber); font-weight: 600; }

/* ---------- Handy / Tablet ---------- */
@media (max-width: 1100px) {
  .kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-zeile, .filter-zeile.zwei, .filter-zeile.eins { grid-template-columns: 1fr 1fr; }
  .balken-zeile { grid-template-columns: 130px 1fr 110px 60px; }
}
@media (max-width: 860px) {
  .p-nav { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; z-index: 25; box-shadow: var(--schatten-2); }
  .p-nav.offen { transform: none; }
  .p-nav-hinter { position: fixed; inset: 0; background: rgba(15,32,39,.35); z-index: 24; }
  .p-menue-knopf { display: inline-grid; place-items: center; }
  .p-kopf { padding: 10px 16px; }
  .p-wer > div:not(.p-avatar) { display: none; }
  .p-wer { padding: 4px; }
  .inhalt { padding: 14px 16px 32px; }
  .col-md { display: none; }
  .betreff { max-width: 210px; }
  .balken-zeile { grid-template-columns: 1fr 100px; }
  .balken-zeile .balken-spur { grid-column: 1 / -1; }
  .balken-zeile .balken-anzahl { display: none; }
  .werkzeug-zeile .such { max-width: none; min-width: 0; flex-basis: 100%; }
  .werkzeug-zeile .rechts { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .kacheln { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kachel { padding: 12px 12px; }
  .kachel-wert { font-size: 1.3rem; }
  .kachel-wert.mittel { font-size: 1.05rem; }
  .filter-zeile, .filter-zeile.zwei, .filter-zeile.eins { grid-template-columns: 1fr; }
  .col-sm { display: none; }
  tbody td, thead th { padding-left: 8px; padding-right: 8px; }
  tbody td:first-child, thead th:first-child, tfoot td:first-child { padding-left: 14px; }
  .betreff { max-width: 175px; }
  .nur-handy { display: block; margin-top: 2px; }
  .zelle-stapel .nur-handy { margin-top: 6px; }
  .tabelle-dicht select.klein { max-width: 150px; }
  #tabelle { font-size: .92rem; }
  #tabelle .status .t { display: none; }          /* Status nur als Symbol — der Text steht im title */
  #tabelle .status { padding: 5px 7px; }
  .schublade { width: 100%; }
  .fakten { grid-template-columns: 1fr 1fr; }
  .formular-raster { grid-template-columns: 1fr; }
  .dlg-kopf, .dlg-koerper, .dlg-fuss, .dlg-text, .dlg-fehler { padding-left: 18px; padding-right: 18px; }
  .dlg-fuss .knopf { flex: 1; }
  .start-karte { padding: 26px 18px; }
  .tab-fuss { justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .p-nav { transition: none; } .dlg, .meldung { animation: none; } .ring { animation-duration: 2s; } }
