/* Status-Monitor */
:root {
  --bg: #f1f5f9; --flaeche: #ffffff; --flaeche2: #f8fafc; --rand: #e2e8f0; --text: #0f172a; --leise: #64748b;
  --kopf: #0f172a; --kopf-text: #f8fafc; --primaer: #1d4ed8; --primaer-text: #fff;
  --ok: #16a34a; --ok-bg: #dcfce7; --gestoert: #ea580c; --gestoert-bg: #ffedd5; --ausfall: #dc2626; --ausfall-bg: #fee2e2;
  --wartung: #2563eb; --wartung-bg: #dbeafe; --unbekannt: #94a3b8; --unbekannt-bg: #f1f5f9; --leer: #e2e8f0;
  --radius: 10px; --schatten: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --flaeche: #111827; --flaeche2: #0f172a; --rand: #1f2937; --text: #e5e7eb; --leise: #94a3b8;
    --kopf: #020617; --primaer: #3b82f6;
    --ok-bg: rgba(22, 163, 74, .16); --gestoert-bg: rgba(234, 88, 12, .18); --ausfall-bg: rgba(220, 38, 38, .2);
    --wartung-bg: rgba(37, 99, 235, .2); --unbekannt-bg: rgba(148, 163, 184, .14); --leer: #1f2937;
    color-scheme: dark;
  }
}
body[data-theme="dark"], :root[data-theme="dark"] {
  --bg: #0b1120; --flaeche: #111827; --flaeche2: #0f172a; --rand: #1f2937; --text: #e5e7eb; --leise: #94a3b8;
  --kopf: #020617; --primaer: #3b82f6;
  --ok-bg: rgba(22, 163, 74, .16); --gestoert-bg: rgba(234, 88, 12, .18); --ausfall-bg: rgba(220, 38, 38, .2);
  --wartung-bg: rgba(37, 99, 235, .2); --unbekannt-bg: rgba(148, 163, 184, .14); --leer: #1f2937;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--primaer); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: .2em 0 .6em; display: flex; flex-wrap: wrap; gap: .5em; align-items: center; }
h2 { font-size: 1.1rem; margin: 0 0 .8em; }
h3 { font-size: .95rem; margin: 1.2em 0 .6em; }
code { font: .88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--flaeche2); padding: .1em .35em; border-radius: 4px; }
pre.code { font: .82rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--flaeche2); border: 1px solid var(--rand); padding: .7em .9em; border-radius: 8px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.leise { color: var(--leise); }
.klein { font-size: .85rem; }
.zentriert { text-align: center; }
.warn { color: var(--ausfall); }
.umbruch { word-break: break-all; }

/* Kopfleiste ohne Anmeldung (Einrichtung, Anmeldung) */
.leiste { background: var(--kopf); color: var(--kopf-text); display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; padding-top: max(.6rem, env(safe-area-inset-top)); }
.marke { display: flex; align-items: center; gap: .6rem; color: inherit; font-weight: 650; font-size: 1.05rem; white-space: nowrap; min-width: 0; }
.marke:hover { text-decoration: none; }
.marke span { overflow: hidden; text-overflow: ellipsis; }
.zahl { background: var(--ausfall); color: #fff; border-radius: 99px; padding: 0 .45em; font-size: .78rem; font-weight: 700; }
.inhalt { max-width: 1180px; margin: 0 auto; padding: 1.2rem 16px 3rem; }

/* Rahmen mit Seitenleiste (1.5.0, wie FEZ/BugFix Intern) */
:root { --sl-breite: 260px; --sl-schmal: 68px; --sl-bg: #0f172a; --sl-text: #cbd5e1; --sl-leise: #64748b; }
.rahmen { display: flex; min-height: 100vh; min-height: 100dvh; }
.seitenleiste { position: sticky; top: 0; flex: none; width: var(--sl-breite); height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  background: var(--sl-bg); color: var(--sl-text); overflow-x: hidden; overflow-y: auto; scrollbar-width: none; transition: width .18s ease; z-index: 30;
  padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); }
.seitenleiste::-webkit-scrollbar { display: none; }
.sl-kopf { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .9rem .8rem .9rem 1rem; border-bottom: 1px solid rgba(255,255,255,.07); }
.sl-kopf .marke { color: #fff; font-size: .98rem; gap: .5rem; }
.sl-kopf .marke img { width: 28px; height: 28px; }
.sl-zu { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: rgba(255,255,255,.06); border: 0; color: var(--sl-text); cursor: pointer; }
.sl-zu:hover { background: rgba(255,255,255,.12); color: #fff; }
.sl-nav { padding: .4rem 0 1rem; }
.sl-gruppe { padding: 1rem 1.15rem .35rem; font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--sl-leise); white-space: nowrap; }
.seitenleiste a { position: relative; display: flex; align-items: center; gap: .8rem; margin: 1px .55rem; padding: .6rem .65rem; border-radius: 8px; color: var(--sl-text); font-size: .93rem; white-space: nowrap; }
.seitenleiste a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.seitenleiste a.aktiv { background: var(--primaer); color: #fff; }
.seitenleiste a.leise { color: var(--sl-leise); }
.sl-icon { position: relative; flex: none; display: grid; place-items: center; width: 20px; height: 20px; }
.sl-text { overflow: hidden; text-overflow: ellipsis; display: flex; flex-direction: column; line-height: 1.2; }
.sl-text small { color: var(--sl-leise); font-size: .72rem; }
a.aktiv .sl-text small { color: rgba(255,255,255,.75); }
.sl-zahl { margin-left: auto; min-width: 22px; padding: .05rem .45rem; border-radius: 99px; font-size: .74rem; font-weight: 700; text-align: center; color: #fff; }
.z-rot { background: var(--ausfall); } .z-orange { background: var(--gestoert); } .z-blau { background: var(--wartung); }
.sl-punkt { position: absolute; top: -3px; right: -4px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--sl-bg); display: none; }
.sl-fuss { margin-top: auto; padding: .6rem 0 max(1rem, env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.07); }
.bereich { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mit-leiste .inhalt { width: 100%; max-width: none; margin: 0; padding: 1.4rem clamp(16px, 2vw, 32px) 3rem; } /* ganze Breite neben dem Menü */
.mobil-kopf { display: none; }
.sl-hintergrund { display: none; }

/* eingeklappt: nur Symbole */
@media (min-width: 901px) {
  .leiste-zu .seitenleiste { width: var(--sl-schmal); }
  .leiste-zu .seitenleiste .sl-text, .leiste-zu .seitenleiste .sl-zahl { display: none; }
  .leiste-zu .sl-punkt { display: block; }
  .leiste-zu .sl-gruppe { padding: .8rem 0 .2rem; text-align: center; font-size: 0; border-top: 1px solid rgba(255,255,255,.07); margin: .4rem .8rem 0; }
  .leiste-zu .sl-kopf { flex-direction: column; padding: .8rem .4rem; }
  .leiste-zu .seitenleiste a { justify-content: center; padding: .65rem 0; }
}

/* Handy/Tablet: Menü ausfahren */
@media (max-width: 900px) {
  .seitenleiste { position: fixed; left: 0; top: 0; bottom: 0; width: min(84vw, 290px); transform: translateX(-102%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .menue-offen .seitenleiste { transform: none; }
  .menue-offen .sl-hintergrund { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 25; }
  .sl-zu { display: none; }
  .mobil-kopf { display: flex; align-items: center; gap: .7rem; position: sticky; top: 0; z-index: 20; background: var(--kopf); color: var(--kopf-text);
    padding: .55rem 1rem; padding-top: max(.55rem, env(safe-area-inset-top)); }
  .mobil-kopf .marke { flex: 1; font-size: 1rem; }
  .menue-knopf { background: none; border: 0; color: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; padding: .1rem .2rem; }
  .mobil-kopf .sl-zahl { margin-left: 0; }
  .mit-leiste .inhalt { padding-top: 1rem; }
}

/* Übersicht nutzt breite Bildschirme: Mandanten nebeneinander */
@media (min-width: 1900px) {
  .mit-leiste #uebersicht { display: grid; grid-template-columns: repeat(auto-fill, minmax(620px, 1fr)); gap: 0 1.2rem; align-items: start; }
  .mit-leiste #uebersicht > .gesamt, .mit-leiste #uebersicht > .leer { grid-column: 1 / -1; }
  .ticket-raster { grid-template-columns: minmax(0, 1fr) 360px; }
}

.pfad { margin: 0 0 .2rem; font-size: .85rem; color: var(--leise); }
.titelzeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; }
.titelzeile h1 { margin: 0; }
.werkzeuge { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.werkzeuge .knopf { margin-left: auto; }

/* Karten, Raster */
.karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; box-shadow: var(--schatten); }
.karte.schmal { max-width: 420px; margin: 8vh auto; }
.karte.leer { text-align: center; color: var(--leise); padding: 2.5rem; }
.raster { display: grid; gap: .3rem 1rem; }
.raster-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.raster-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.raster-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kachel { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 1rem; box-shadow: var(--schatten); }
.kachel-zahl { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kachel-text { color: var(--leise); font-size: .85rem; }

/* Hinweise */
.hinweis { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.hinweis-ok { background: var(--ok-bg); border-color: var(--ok); }
.hinweis-warnung { background: var(--gestoert-bg); border-color: var(--gestoert); }
.hinweis-fehler { background: var(--ausfall-bg); border-color: var(--ausfall); }
.push-leiste { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.push-leiste[hidden] { display: none; }
.push-leiste .knoepfe { margin: 0; }

/* Formulare */
.formular label { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .8rem; font-weight: 550; font-size: .9rem; }
.formular label small { font-weight: 400; color: var(--leise); }
input, select, textarea { font: inherit; color: var(--text); background: var(--flaeche); border: 1px solid var(--rand); border-radius: 7px; padding: .5rem .65rem; width: 100%; min-height: 40px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primaer); outline-offset: -1px; border-color: transparent; }
input[readonly] { background: var(--flaeche2); }
.formular label.schalter, label.schalter { flex-direction: row; align-items: center; gap: .5rem; font-weight: 450; cursor: pointer; }
label.schalter input { width: auto; min-height: 0; accent-color: var(--primaer); width: 1.05rem; height: 1.05rem; }
fieldset { border: 1px solid var(--rand); border-radius: 8px; padding: .8rem 1rem .2rem; margin: 0 0 1rem; }
legend { font-weight: 650; padding: 0 .4rem; }
.haken-liste { display: flex; flex-wrap: wrap; gap: .2rem 1.4rem; }
.knoepfe { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.knoepfe form { margin: 0; }
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 550; font-size: .92rem; padding: .5rem 1rem; min-height: 40px; border-radius: 7px; border: 1px solid var(--rand); background: var(--flaeche); color: var(--text); cursor: pointer; text-decoration: none; }
.knopf:hover { background: var(--flaeche2); text-decoration: none; }
.knopf.primaer { background: var(--primaer); border-color: var(--primaer); color: var(--primaer-text); }
.knopf.primaer:hover { filter: brightness(1.1); }
.knopf.gefahr { color: var(--ausfall); border-color: var(--ausfall); }
.knopf.klein { padding: .3rem .7rem; min-height: 32px; font-size: .85rem; }

/* Tabellen */
.tabelle-rahmen { overflow-x: auto; }
.tabelle-rahmen.karte { padding: 0; }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--rand); vertical-align: top; }
.tabelle th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--leise); font-weight: 600; }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle tr.inaktiv { opacity: .5; }
dl.liste { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; margin: 0; }
dl.liste dt { color: var(--leise); }
dl.liste dd { margin: 0; word-break: break-word; }
@media (max-width: 560px) { dl.liste { grid-template-columns: 1fr; gap: .1rem; } dl.liste dd { margin-bottom: .5rem; } }

/* Status-Abzeichen */
.badge { display: inline-flex; align-items: center; gap: .4em; padding: .15em .65em; border-radius: 99px; font-size: .8rem; font-weight: 600; white-space: nowrap; background: var(--unbekannt-bg); color: var(--leise); vertical-align: middle; }
.badge i { width: .55em; height: .55em; border-radius: 50%; background: currentColor; }
.badge.s-ok { background: var(--ok-bg); color: var(--ok); }
.badge.s-eingeschraenkt { background: var(--gestoert-bg); color: var(--gestoert); }
.badge.s-ausfall { background: var(--ausfall-bg); color: var(--ausfall); }
.badge.s-wartung { background: var(--wartung-bg); color: var(--wartung); }

/* Gesamtstatus */
.gesamt { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-radius: var(--radius); margin-bottom: 1rem; color: #fff; background: var(--ok); box-shadow: var(--schatten); }
.gesamt.s-eingeschraenkt { background: var(--gestoert); }
.gesamt.s-ausfall { background: var(--ausfall); }
.gesamt.s-wartung { background: var(--wartung); }
.gesamt-symbol { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; flex: none; }
.gesamt-text { font-size: 1.2rem; font-weight: 700; }
.gesamt-zahlen { opacity: .9; font-size: .88rem; }

/* Mandanten und Systeme */
.mandant { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); margin-bottom: 1rem; box-shadow: var(--schatten); overflow: hidden; }
.mandant-kopf { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1.1rem; border-bottom: 1px solid var(--rand); }
.mandant-kopf h2 { margin: 0; font-size: 1.05rem; }
.gruppe { padding: .45rem 1.1rem .25rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--leise); font-weight: 650; background: var(--flaeche2); }
.system { display: grid; grid-template-columns: 14px minmax(150px, 1.2fr) minmax(0, 1.6fr) 220px 64px 64px; align-items: center; gap: .9rem; padding: .6rem 1.1rem; border-top: 1px solid var(--rand); color: inherit; }
.gruppe + .system, .systeme > .system:first-child { border-top: 0; }
a.system:hover { background: var(--flaeche2); text-decoration: none; }
.system.s-ausfall { background: var(--ausfall-bg); }
.system.s-eingeschraenkt { background: var(--gestoert-bg); }
.punkt { width: 12px; height: 12px; border-radius: 50%; background: var(--unbekannt); flex: none; display: inline-block; }
.s-ok .punkt { background: var(--ok); }
.s-eingeschraenkt .punkt { background: var(--gestoert); }
.s-ausfall .punkt { background: var(--ausfall); box-shadow: 0 0 0 0 rgba(220, 38, 38, .6); animation: puls 1.6s infinite; }
.s-wartung .punkt { background: var(--wartung); }
@keyframes puls { 70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }
@media (prefers-reduced-motion: reduce) { .s-ausfall .punkt { animation: none; } }
.system-name { display: flex; flex-direction: column; min-width: 0; }
.system-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.system-name small { color: var(--leise); font-size: .8rem; }
.system-meldung { font-size: .85rem; color: var(--leise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.system-zahl { text-align: right; font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.balken { display: flex; gap: 2px; height: 26px; align-items: stretch; }
.balken i { flex: 1; border-radius: 2px; background: var(--leer); min-width: 2px; }
.balken i.b-ok { background: var(--ok); opacity: .85; }
.balken i.b-eingeschraenkt { background: var(--gestoert); }
.balken i.b-ausfall { background: var(--ausfall); }
.balken.gross { height: 38px; }
.balken-legende { display: flex; justify-content: space-between; font-size: .78rem; color: var(--leise); margin-top: .3rem; }
@media (max-width: 860px) {
  .system { grid-template-columns: 14px 1fr auto; grid-template-areas: "p n z" "m m m" "b b b"; gap: .3rem .7rem; }
  .system .punkt { grid-area: p; }
  .system-name { grid-area: n; }
  .system-meldung { grid-area: m; white-space: normal; }
  .system .balken { grid-area: b; height: 18px; }
  .system-zahl:nth-last-child(2) { grid-area: z; }
  .system-zahl:last-child:not(:nth-last-child(2)) { display: none; }
}

/* Störungen */
.stoerung-zeile { display: grid; grid-template-columns: 150px 1fr auto; gap: 1rem; align-items: center; padding: .65rem 0; border-top: 1px solid var(--rand); color: inherit; }
.stoerung-zeile:first-of-type { border-top: 0; }
a.stoerung-zeile:hover { text-decoration: none; background: var(--flaeche2); }
.stoerung-zeile small { color: var(--leise); }
.stoerung-zeile > span:last-child { text-align: right; }
.offene { border-left: 4px solid var(--ausfall); }
@media (max-width: 640px) { .stoerung-zeile { grid-template-columns: 1fr; gap: .2rem; } .stoerung-zeile > span:last-child { text-align: left; } }
.zeitstrahl { list-style: none; margin: 0; padding: 0; }
.zeitstrahl li { display: grid; grid-template-columns: 90px 1fr; gap: 1rem; padding: .5rem 0 .5rem; border-left: 2px solid var(--rand); padding-left: 1rem; position: relative; }
.zeitstrahl li::before { content: ""; position: absolute; left: -6px; top: .9rem; width: 10px; height: 10px; border-radius: 50%; background: var(--unbekannt); }
.zeitstrahl li.art-notiz::before { background: var(--primaer); }
.zeitstrahl li.art-uebernahme::before { background: var(--ok); }
.zeitstrahl li.art-benachrichtigung::before { background: var(--wartung); }
.zeitstrahl time { color: var(--leise); font-size: .85rem; font-variant-numeric: tabular-nums; }

/* Detailseite */
.teile { display: grid; gap: .4rem; }
.teil { display: grid; grid-template-columns: 14px max-content 1fr; gap: .7rem; align-items: center; padding: .45rem .7rem; border-radius: 7px; background: var(--flaeche2); }
.teil.s-ausfall { background: var(--ausfall-bg); }
.teil.s-eingeschraenkt { background: var(--gestoert-bg); }
/* Auswahl der Anzeige auf der Detailseite */
.teil.mit-wahl { grid-template-columns: 14px max-content 1fr auto; }
.teil-wahl { display: flex; gap: .8rem; font-size: .8rem; white-space: nowrap; }
.teil-wahl .schalter { margin: 0; }
@media (max-width: 640px) { .teil.mit-wahl { grid-template-columns: 14px 1fr; } .teil.mit-wahl > .leise, .teil-wahl { grid-column: 2; } }
/* Teilprüfungen in Übersicht und Monitor (z. B. Leitstellen-Abruf je Mandant): Liste oder Kacheln */
.teile-liste, .teile-kacheln { padding: 0 1.1rem .7rem calc(1.1rem + 14px + .9rem); }
.system.s-ausfall + .teile-liste, .system.s-ausfall + .teile-kacheln { background: var(--ausfall-bg); }
.system.s-eingeschraenkt + .teile-liste, .system.s-eingeschraenkt + .teile-kacheln { background: var(--gestoert-bg); }
.teile-liste { display: flex; flex-direction: column; gap: .45rem; }
.teile-liste > .tl-block { max-width: 900px; }
.tl-block { border-left: 2px solid var(--rand); padding-left: .7rem; }
.tl-gruppe { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--leise); margin-bottom: .15rem; }
.tl-zeile { display: grid; grid-template-columns: 8px max-content minmax(0, 1fr); gap: .5rem; align-items: center; font-size: .85rem; padding: .12rem 0; }
.tl-zeile .punkt, .tk .punkt { width: 8px; height: 8px; }
.tl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tl-info { color: var(--leise); font-size: .8rem; text-align: right; white-space: normal; font-variant-numeric: tabular-nums; }
.tl-zeile.s-ausfall, .tl-zeile.s-eingeschraenkt { grid-template-columns: 8px minmax(0, 1fr); }
.tl-zeile.s-ausfall .tl-info, .tl-zeile.s-eingeschraenkt .tl-info { grid-column: 2; color: inherit; white-space: normal; text-align: left; }
.teile-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .5rem; }
.tk { display: flex; flex-direction: column; gap: .1rem; min-width: 0; padding: .5rem .65rem; border-radius: 8px; background: var(--flaeche2); border: 1px solid var(--rand); border-left: 4px solid var(--ok); }
.tk small { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk b { display: flex; align-items: center; gap: .4rem; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk span { font-size: .8rem; color: var(--leise); }
.tk.s-eingeschraenkt { border-left-color: var(--gestoert); background: var(--gestoert-bg); }
.tk.s-ausfall { border-left-color: var(--ausfall); background: var(--ausfall-bg); }
.tk.s-ausfall span, .tk.s-eingeschraenkt span { color: inherit; }
.tk.s-wartung { border-left-color: var(--wartung); }
.tk.s-unbekannt { border-left-color: var(--unbekannt); }
body.monitor .tk b { font-size: 1rem; }
body.monitor .tk span { font-size: .88rem; }
body.monitor .tl-zeile { font-size: .95rem; }
@media (max-width: 860px) { .teile-liste, .teile-kacheln { padding-left: 1.1rem; } .teile-kacheln { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }
.diagramm { width: 100%; height: auto; display: block; }
.diagramm text { font-size: 11px; fill: var(--leise); }
.svg-linie { fill: none; stroke: var(--primaer); stroke-width: 1.6; stroke-linejoin: round; }
.svg-raster { stroke: var(--rand); stroke-width: 1; }
.svg-ausfall { fill: var(--ausfall); opacity: .45; }
.svg-eingeschraenkt { fill: var(--gestoert); opacity: .4; }
.svg-unbekannt { fill: var(--unbekannt); opacity: .3; }
.geraet { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem 0; border-top: 1px solid var(--rand); }

/* Anmeldung */
.anmeldung-kopf { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.anmeldung-kopf h1 { margin: 0; }
body.anmeldung .inhalt { padding-top: 0; }

/* TV-Monitor */
body.monitor { font-size: 17px; }
.monitor-kopf { display: flex; align-items: center; gap: 1.5rem; padding: .8rem 1.5rem; background: var(--kopf); color: var(--kopf-text); }
.monitor-kopf .uhr { margin-left: auto; font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
body.monitor #uebersicht { padding: 1rem 1.5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(560px, 100%), 1fr)); gap: 0 1rem; align-items: start; }
body.monitor .gesamt { grid-column: 1 / -1; padding: 1.4rem 1.6rem; }
body.monitor .gesamt-text { font-size: 2rem; }
@media (min-width: 861px) { body.monitor .system { grid-template-columns: 14px minmax(140px, 1fr) minmax(0, 1.2fr) 150px 64px 0; } }
@media (max-width: 860px) {
  .monitor-kopf { gap: .7rem; padding: .6rem 1rem; }
  .monitor-kopf .uhr { font-size: 1.3rem; }
  body.monitor #uebersicht { padding: .7rem; }
  body.monitor .gesamt { padding: 1rem; }
  body.monitor .gesamt-text { font-size: 1.3rem; }
}
body.monitor .system-zahl:last-child { display: none; }
body.monitor.alarm .gesamt { animation: blink 1s 6; }
@keyframes blink { 50% { filter: brightness(1.5); } }

/* App */
@media (display-mode: standalone) {
  .leiste, .mobil-kopf { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
  .inhalt { padding-bottom: max(3rem, env(safe-area-inset-bottom)); }
}

/* Tickets und Meldungen (1.3.0) */
.tbadge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 700; vertical-align: middle; background: var(--flaeche2); border: 1px solid var(--rand); white-space: nowrap; }
.tbadge.t-offen { background: var(--gestoert-bg); border-color: var(--gestoert); }
.tbadge.t-rueckfrage { background: var(--wartung-bg, var(--flaeche2)); border-color: var(--wartung); }
.tbadge.t-in_bearbeitung { border-color: var(--primaer); }
.tbadge.t-erledigt { opacity: .7; }
.tbadge.t-dringend { background: var(--ausfall-bg); border-color: var(--ausfall); }
.zahl-ticket { background: var(--gestoert); }
.ticket-zahlen { display: flex; flex-wrap: wrap; gap: 1rem; margin: .5rem 0 1rem; font-size: .9rem; }
.werkzeuge.filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.werkzeuge.filter select, .werkzeuge.filter input { width: auto; min-width: 140px; }
.ticket-zeile { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .7rem .2rem; border-top: 1px solid var(--rand); color: inherit; }
.ticket-zeile:first-child { border-top: 0; }
.ticket-zeile:hover { background: var(--flaeche2); text-decoration: none; }
.ticket-zeile.t-aktiv strong { font-weight: 700; }
.ticket-art { font-size: 1.3rem; text-align: center; }
.ticket-rechts { text-align: right; }
.ticket-raster { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .ticket-raster { grid-template-columns: 1fr; } }
.ticket-text { white-space: normal; line-height: 1.5; }
.ticket-verlauf { display: grid; gap: .6rem; }
.tv { padding: .6rem .8rem; border-radius: 8px; background: var(--flaeche2); border-left: 3px solid var(--rand); }
.tv-betreiber { border-left-color: var(--primaer); }
.tv-melder { border-left-color: var(--ok); }
.tv-intern { border-left-color: var(--gestoert); background: var(--gestoert-bg); }
.tv > div { margin-top: .2rem; line-height: 1.45; }
.meldung { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--rand); }
.meldung:first-of-type { border-top: 0; }
.meldung p { margin: .3rem 0; }
.meldung-aktionen .formular { gap: .4rem; }
@media (max-width: 760px) { .meldung { grid-template-columns: 1fr; } }

/* KI-Schreibhilfe und Meldungen (1.3.1) */
.ki-leiste { margin-top: .35rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
textarea.ki-arbeitet { opacity: .6; background-image: linear-gradient(90deg, transparent, rgba(124,58,237,.12), transparent); background-size: 200% 100%; animation: ladebalken 1.4s linear infinite; }
.ki-knopf { background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; border: 0; }
.ki-panel { margin-top: .45rem; padding: .6rem; border-radius: 8px; background: var(--flaeche2); border: 1px dashed var(--rand); display: grid; gap: .45rem; }
.ki-panel[hidden] { display: none; }
.ki-status { margin-left: .3rem; }
.neu-meldung > summary { cursor: pointer; list-style: none; }
.neu-meldung > summary h2 { display: inline; margin: 0; }
.neu-meldung[open] > summary { margin-bottom: .8rem; }
.schalter-spalte { display: grid; gap: .3rem; align-content: end; }
.mkarte { border: 1px solid var(--rand); border-left: 5px solid var(--unbekannt); border-radius: 10px; padding: .9rem 1rem; margin-top: .8rem; display: grid; gap: .6rem; background: var(--flaeche); }
.mkarte.m-stoerung { border-left-color: var(--ausfall); }
.mkarte.m-wartung { border-left-color: var(--wartung); }
.mkarte.m-info { border-left-color: var(--primaer); }
.mkarte header { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.mkarte header strong { font-size: 1.05rem; }
.mtext { line-height: 1.5; }
.mfakten { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .5rem 1rem; margin: 0; font-size: .85rem; }
.mfakten dt { color: var(--leise); font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; }
.mfakten dd { margin: .1rem 0 0; }
.mbalken { display: inline-block; width: 90px; height: 8px; border-radius: 4px; background: var(--rand); vertical-align: middle; overflow: hidden; }
.mbalken i { display: block; height: 100%; background: var(--ok); }
.mkarte .knoepfe form { display: inline; }
.behoben-liste { margin-top: 1rem; }
.mbehoben { display: grid; gap: .1rem; padding: .45rem 0; border-top: 1px solid var(--rand); }
.dialog { border: 0; border-radius: 12px; padding: 1.2rem 1.3rem; width: min(560px, calc(100vw - 2rem)); background: var(--flaeche); color: inherit; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.dialog::backdrop { background: rgba(15, 23, 42, .55); }
.dialog h2 { margin-top: 0; }

/* Ladeanzeige beim Absenden (1.5.0) */
.kreisel { display: inline-block; width: 1em; height: 1em; margin-right: .45em; vertical-align: -.15em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: kreisel .7s linear infinite; }
@keyframes kreisel { to { transform: rotate(360deg); } }
button.laedt { opacity: 1 !important; cursor: progress; }
body.sendet::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; background: linear-gradient(90deg, transparent, var(--primaer), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: ladebalken 1.1s ease-in-out infinite; }
@keyframes ladebalken { from { background-position: -50% 0; } to { background-position: 150% 0; } }
@media (prefers-reduced-motion: reduce) { .kreisel, body.sendet::before { animation-duration: 2.5s; } }

/* Übersicht (1.5.1): Systeme links, Meldungen und Tickets rechts; mobil Systeme zuerst */
.uebersicht-raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1.2rem; align-items: start; }
@media (min-width: 1200px) {
  .uebersicht-raster { grid-template-columns: minmax(0, 1fr) clamp(340px, 24vw, 560px); }
  .ur-seite { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; scrollbar-width: thin; }
}
.ur-seite > .karte h2, .meldungen-band h2 { display: flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; font-size: 1.05rem; margin-top: 0; }
.ur-seite > .karte h2 a, .meldungen-band h2 a { margin-left: auto; font-weight: 500; }
.kliste { display: grid; }
.kz { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: .6rem; padding: .6rem .3rem; border-top: 1px solid var(--rand); color: inherit; }
.kliste > .kz:first-child { border-top: 0; }
a.kz:hover { background: var(--flaeche2); text-decoration: none; }
.kz-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--flaeche2); border: 1px solid var(--rand); font-size: .95rem; }
.kz-icon.m-stoerung { background: var(--ausfall-bg); border-color: var(--ausfall); }
.kz-icon.m-wartung { background: var(--wartung-bg); border-color: var(--wartung); }
.kz-inhalt { min-width: 0; display: flex; flex-direction: column; gap: .12rem; }
.kz-inhalt strong { line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kz-inhalt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kz-fuss { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; font-size: .78rem; margin-top: .15rem; }
.tbadge.am-stoerung { background: var(--ausfall-bg); border-color: var(--ausfall); }
.tbadge.am-wartung { background: var(--wartung-bg); border-color: var(--wartung); }
body.monitor .meldungen-band { grid-column: 1 / -1; margin-bottom: 1rem; }
body.monitor .meldungen-band .kliste { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 0 1.2rem; }
body.monitor .meldungen-band .kz { border-top: 0; }
body.monitor .kz-inhalt strong { font-size: 1.1rem; }

/* Sammelmeldungen (1.6.0) */
.anwendungen-wahl { border: 1px solid var(--rand); border-radius: 10px; padding: .6rem .9rem .8rem; margin: 0 0 .8rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .3rem 1rem; }
.anwendungen-wahl legend { padding: 0 .3rem; font-weight: 600; }
.anwendungen-wahl .alle { grid-column: 1 / -1; border-bottom: 1px dashed var(--rand); padding-bottom: .4rem; margin-bottom: .2rem; }
.sammel .mkarte { margin-top: 0; border-left-width: 6px; box-shadow: 0 0 0 2px var(--wartung-bg); }
.sammel-teile { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .4rem 1rem; }
.st-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; padding: .4rem .6rem; border-radius: 8px; background: var(--flaeche2); }
.st-zeile b { margin-right: auto; }

/* Ordnerauswahl (1.7.0) */
.ordner-zeile { display: flex; gap: .5rem; align-items: stretch; }
.ordner-zeile input { flex: 1; min-width: 0; }
.ordner-kopf { display: flex; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.ordner-kopf code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .85rem; }
.ordner-liste { max-height: 50vh; overflow: auto; display: flex; flex-direction: column; gap: 2px; margin: .6rem 0; border: 1px solid var(--rand); border-radius: 8px; padding: 4px; }
.ordner-eintrag { text-align: left; background: none; border: 0; color: inherit; padding: .45rem .6rem; border-radius: 6px; cursor: pointer; font: inherit; }
.ordner-eintrag:hover, .ordner-eintrag:focus-visible { background: rgba(127,127,127,.14); }
.abholungen td, .abholungen th { white-space: nowrap; }
.abholungen td.datei { white-space: normal; overflow-wrap: anywhere; }

/* Versionsstand (1.7.1) */
.version { display: inline-block; font-size: .72rem; font-weight: 600; line-height: 1.3; padding: .05rem .4rem; border-radius: 999px; background: var(--flaeche2); border: 1px solid var(--rand); color: var(--leise); vertical-align: .1em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.version-neu { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .version-neu { background: #1e3a8a; border-color: #1d4ed8; color: #bfdbfe; } }
:root[data-theme="dark"] .version-neu { background: #1e3a8a; border-color: #1d4ed8; color: #bfdbfe; }
.version-runter { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
:root[data-theme="dark"] .version-runter { background: #451a03; border-color: #92400e; color: #fde68a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .version-runter { background: #451a03; border-color: #92400e; color: #fde68a; } }
.name-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .4rem; min-width: 0; }
.name-zeile .version { flex: none; }
.abhol-box { margin-top: .8rem; }
.abhol-box legend { font-weight: 600; }
.abhol-wahl { display: flex; flex-direction: column; gap: .5rem; margin: .8rem 0; max-height: 50vh; overflow: auto; }
.abhol-wahl .schalter { align-items: flex-start; }

/* Fortschritt der Datensicherung (1.7.5) */
.sicherung-fortschritt { display: flex; flex-direction: column; gap: .7rem; border-left: 4px solid #2563eb; }
.sicherung-fortschritt.sf-erfolg { border-left-color: #16a34a; }
.sicherung-fortschritt.sf-misserfolg { border-left-color: #dc2626; }
.sf-zeile { display: flex; gap: .7rem; align-items: flex-start; }
.sf-symbol { width: 1.4rem; flex: none; text-align: center; line-height: 1.4; }
.sf-symbol .kreisel { margin: .15rem 0 0; }
.sf-wartet { opacity: .6; }

/* Versionierung (1.8.0) */
.sl-fuss .sl-version { font-size: .75rem; opacity: .6; padding-top: .2rem; padding-bottom: .2rem; font-variant-numeric: tabular-nums; }
.sl-fuss .sl-version:hover, .sl-fuss .sl-version.aktiv { opacity: 1; }
.neuerungen { display: flex; flex-direction: column; gap: 1rem; }
.neuerungen .karte.aktuell { border-left: 4px solid #2563eb; }
.neuerungen h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; font-size: 1.05rem; margin: 0 0 .5rem; }
.neuerungen ul { margin: 0; padding-left: 1.2rem; }
.neuerungen li + li { margin-top: .25rem; }
