/* Pager-Matrix – eigene Teile. Farben nur über die Variablen aus basis.css (Hell/Dunkel). */

.pm-fuss { padding: 24px 12px 16px; font-size: 12px; color: var(--text-muted); text-align: center; }
.pm-nav-zahl { display: inline-block; min-width: 1.5em; padding: 1px 6px; border-radius: 999px; background: var(--warning); color: #1f2937; font-size: 12px; font-weight: 700; text-align: center; }
.kb-link.aktiv .pm-nav-zahl { background: #fff; }

/* Kopfzeile über der Matrix */
.pm-kopfzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.pm-kopfzeile .pm-suche { width: 220px; }
.pm-os-wahl .form-select { width: auto; min-width: 200px; }
.pm-legende { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 10px; font-size: 12.5px; color: var(--text-secondary); }
.pm-legende > span { display: inline-flex; align-items: center; gap: 6px; }
.pm-muster { display: inline-block; width: 16px; height: 16px; border-radius: 3px; border: 1px solid var(--border-strong); }

/* Matrix */
.pm-matrix-rahmen { overflow: auto; max-height: calc(100vh - 190px); border: 1px solid var(--border-color); border-radius: var(--radius); background: var(--card-bg); box-shadow: var(--shadow-card); }
.pm-matrix { border-collapse: separate; border-spacing: 0; font-size: 13px; width: max-content; min-width: 100%; }
.pm-matrix th, .pm-matrix td { padding: 4px 8px; border-bottom: 1px solid var(--border-color); background: var(--card-bg); vertical-align: middle; }
.pm-matrix thead th { position: sticky; z-index: 3; background: var(--bg-secondary); font-weight: 600; white-space: nowrap; }
.pm-kopf-ebene th { top: 0; }
.pm-kopf-ebene th[rowspan] { vertical-align: bottom; }
.pm-kopf-schleifen th { top: 29px; }
.pm-matrix .pm-fix { position: sticky; z-index: 2; }
.pm-matrix thead .pm-fix { z-index: 5; }
.pm-f1 { left: 0; min-width: 44px; width: 44px; }
.pm-f2 { left: 44px; min-width: 190px; max-width: 240px; border-right: 2px solid var(--border-strong) !important; }
.pm-f2 a { font-weight: 500; }
.pm-funktion { display: block; color: var(--text-secondary); font-size: 11.5px; }
.pm-geraet span { display: block; white-space: nowrap; }
.pm-geraet small { display: block; color: var(--text-secondary); font-family: var(--font-mono); font-size: 11.5px; white-space: nowrap; }
.pm-ric { font-family: var(--font-mono); white-space: nowrap; }
.pm-ric-neu { background: rgba(var(--success-rgb), .22) !important; font-weight: 600; }
.pm-eigen { white-space: nowrap; color: var(--text-secondary); }
.pm-status { white-space: nowrap; }
.pm-knoepfe { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.pm-knoepfe .btn { padding: 1px 7px; }
.pm-badge-extern { background: var(--info); }

/* Ebenen-Kopf */
.pm-ebene { text-align: center; text-transform: uppercase; letter-spacing: .5px; font-size: 11.5px; color: #fff; }
.pm-matrix thead th.pm-ebene-ortsstelle { background: var(--owr-blau); }
.pm-matrix thead th.pm-ebene-bezirk { background: var(--info); }
.pm-matrix thead th.pm-ebene-land { background: var(--secondary); }
.pm-ebene-start { border-left: 2px solid var(--border-strong) !important; }

/* Senkrechte Schleifennamen */
.pm-schleife { height: 150px; padding: 6px 2px !important; vertical-align: bottom !important; min-width: 30px; width: 30px; }
.pm-schleife span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 12px; max-height: 140px; overflow: hidden; text-overflow: ellipsis; }

/* Zellen mit Häkchen */
.pm-z, .pm-summe { text-align: center; padding: 2px !important; width: 30px; }
.pm-z input { width: 17px; height: 17px; margin: 0; cursor: pointer; accent-color: var(--primary-color); vertical-align: middle; }
.pm-dazu, .pm-muster.pm-dazu { background: rgba(var(--success-rgb), .38) !important; }
.pm-dazu input { accent-color: var(--success); }
.pm-weg, .pm-muster.pm-weg { background: rgba(var(--danger-rgb), .32) !important; }
.pm-weg { position: relative; }
.pm-weg::after { content: "\2212"; position: absolute; right: 2px; top: 0; font-size: 11px; font-weight: 700; color: var(--danger); }
.pm-laedt { opacity: .4; }
.pm-matrix tbody tr:hover > td { background-color: var(--hover-bg); }
.pm-matrix tbody tr:hover > td.pm-fix { background-image: linear-gradient(var(--hover-bg), var(--hover-bg)); background-color: var(--card-bg); }
.pm-matrix tr.pm-offen > td.pm-f1 { box-shadow: inset 4px 0 0 var(--warning); }
.pm-matrix tr.pm-geloescht > td { opacity: .5; }
.pm-matrix tr.pm-geloescht > td.pm-f2 a { text-decoration: line-through; }
.pm-matrix tfoot td { position: sticky; bottom: 0; z-index: 2; background: var(--bg-secondary); font-weight: 600; border-top: 2px solid var(--border-strong); border-bottom: 0; }
.pm-matrix tfoot td.pm-fix { z-index: 4; }
.pm-blitz > td { animation: pm-blitz .9s ease-out; }
@keyframes pm-blitz { from { box-shadow: inset 0 0 0 999px rgba(var(--primary-rgb), .18); } to { box-shadow: inset 0 0 0 999px transparent; } }

/* kurze Meldung unten rechts */
#pm-hinweis { position: fixed; right: 16px; bottom: 16px; z-index: 2000; max-width: 380px; padding: 10px 14px; border-radius: var(--radius);
    background: var(--success); color: #fff; box-shadow: var(--shadow-popup); opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s; pointer-events: none; }
#pm-hinweis.zeigen { opacity: 1; transform: none; }
#pm-hinweis.fehler { background: var(--danger); }

/* Pager-Seite */
.pm-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 991px) { .pm-detail { grid-template-columns: 1fr; } }
.pm-felder { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.pm-felder .pm-breit { grid-column: 1 / -1; }
@media (max-width: 575px) { .pm-felder { grid-template-columns: 1fr; } }
.pm-schleifen-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 12px; }
.pm-schleifen-liste label { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: var(--radius-sm); cursor: pointer; }
.pm-schleifen-liste label.pm-dazu, .pm-schleifen-liste label.pm-weg { font-weight: 600; }
.pm-schleifen-ebene { grid-column: 1 / -1; margin: 8px 0 2px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-secondary); }
.pm-aenderung { padding: 10px 14px; margin-bottom: 12px; border-left: 4px solid var(--warning); background: rgba(var(--warning-rgb), .12); border-radius: var(--radius-sm); }
.pm-chip { display: inline-block; padding: 1px 8px; margin: 2px 4px 2px 0; border-radius: 999px; font-size: 12.5px; background: var(--bg-secondary); }
.pm-chip.dazu { background: rgba(var(--success-rgb), .2); color: var(--success); font-weight: 600; }
.pm-chip.weg { background: rgba(var(--danger-rgb), .16); color: var(--danger); font-weight: 600; text-decoration: line-through; }

/* Verlauf */
.pm-verlauf { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.pm-verlauf li { padding: 6px 0; border-bottom: 1px solid var(--border-color); }
.pm-verlauf .pm-v-zeit { color: var(--text-secondary); font-variant-numeric: tabular-nums; margin-right: 6px; }
.pm-verlauf .pm-v-wer { font-weight: 500; }
.pm-v-programmiert { border-left: 3px solid var(--success); padding-left: 8px !important; }
.pm-alt { color: var(--danger); text-decoration: line-through; }
.pm-neu { color: var(--success); font-weight: 500; }

/* Liste offener Änderungen */
.pm-offen-liste td { vertical-align: middle; }

/* Protokoll */
.pm-protokoll td { font-size: 13px; vertical-align: top; }
.pm-protokoll .pm-p-zeit { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-secondary); }

/* Importe */
.pm-kacheln { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pm-kacheln .badge { font-size: 13px; padding: 6px 10px; }
.pm-tabelle-klein td, .pm-tabelle-klein th { font-size: 13px; }

/* Warnungen in der Matrix */
.pm-geraet small.pm-sn-doppelt { color: var(--danger); font-weight: 700; background: rgba(var(--danger-rgb), .12); border-radius: 3px; padding: 0 3px; }
.pm-warnung { padding: 8px 12px; margin-bottom: 10px; border-left: 4px solid var(--danger); background: rgba(var(--danger-rgb), .1); border-radius: var(--radius-sm); }
.pm-warnung.gelb { border-left-color: var(--warning); background: rgba(var(--warning-rgb), .12); }

/* Zu klären */
.pm-matrix tr.pm-klaeren > td.pm-f2 { box-shadow: inset 4px 0 0 var(--danger); }
.pm-klaeren-icon { color: var(--danger); cursor: help; }
.pm-bestaetigen { padding: 1px 6px !important; margin-left: 4px; }
.pm-klaer-os { margin: 18px 0 6px; }
.pm-klaer-os h5 { margin: 0; }
.pm-kontakt { font-size: 12.5px; color: var(--text-secondary); }
.pm-kontakt a { white-space: nowrap; }
.pm-gruende { margin: 0; padding-left: 18px; font-size: 13px; }
.pm-nav-rot { background: var(--danger); color: #fff; }
@media (max-width: 700px) {
    .pm-klaer-tabelle thead { display: none; }
    .pm-klaer-tabelle tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--border-color); }
    .pm-klaer-tabelle td { display: block; border: 0 !important; padding: 2px 4px !important; }
    .pm-klaer-tabelle td.pm-k-nr:empty { display: none; }
    .pm-klaer-tabelle td.pm-k-nr::before { content: "Nr. "; color: var(--text-secondary); }
}
.pm-matrix tr.pm-os-trenner > td { background: rgba(var(--primary-rgb), .1); font-weight: 600; padding-top: 6px; padding-bottom: 6px; }
.pm-matrix tr.pm-os-trenner > td.pm-fix { background-color: var(--card-bg); background-image: linear-gradient(rgba(var(--primary-rgb), .1), rgba(var(--primary-rgb), .1)); }
.pm-badge-dp { background: var(--warning); color: #1f2937; }

/* Hilfemodus in 3 Stufen (26.11.2026): <html data-hilfe="0"> keine · "1" nur „?“ (Erklärung beim Antippen/Darüberfahren) · "2" voll (gelbe Kästchen) */
.kb-hilfe { display: none; }
html[data-hilfe="2"] .kb-hilfe { display: flex; }
.kb-hilfe { gap: 10px; align-items: flex-start; margin: 6px 0 12px; padding: 9px 13px; border-radius: var(--radius);
    background: #fff8db; border: 1px solid #f1dc8a; color: #4a3c00; font-size: 13.5px; line-height: 1.45; max-width: 980px; }
.kb-hilfe > .fa { color: #d9a400; font-size: 17px; margin-top: 1px; flex: 0 0 auto; }
.kb-hilfe-text > *:last-child { margin-bottom: 0; }
.kb-hilfe ul { margin: 4px 0 0; padding-left: 18px; }
.kb-hilfe b { color: #3a2f00; }
.kb-hilfe a { color: #155fab; text-decoration: underline; }
.kb-hilfe-frage { display: none; }
/* Stufe „?“: nur ein kleines Fragezeichen, die Erklärung erscheint als Sprechblase */
html[data-hilfe="1"] .kb-hilfe { display: block; position: relative; width: max-content; max-width: 100%; margin: 0 0 8px; padding: 0;
    background: none; border: 0; }
html[data-hilfe="1"] .kb-hilfe > .fa, html[data-hilfe="1"] .kb-hilfe > .kb-hilfe-text { display: none; }
html[data-hilfe="1"] .kb-hilfe-frage { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 24px; padding: 0 9px 0 4px;
    border-radius: 999px; border: 1px solid #f1dc8a; background: #fff8db; color: #8a6d00; font-size: 12.5px; cursor: pointer; line-height: 1; }
.kb-hilfe-frage b { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%;
    background: #d9a400; color: #fff; font-size: 12px; }
html[data-hilfe="1"] .kb-hilfe-frage:hover, html[data-hilfe="1"] .kb-hilfe.offen .kb-hilfe-frage { background: #ffefb0; }
html[data-hilfe="1"] .kb-hilfe.offen > .kb-hilfe-text,
html[data-hilfe="1"] .kb-hilfe:hover > .kb-hilfe-text { display: block; position: absolute; top: 28px; left: 0; z-index: 60; width: min(460px, 88vw);
    padding: 10px 13px; border-radius: var(--radius); background: #fff8db; border: 1px solid #f1dc8a; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
html[data-theme="dark"] .kb-hilfe, html[data-theme="dark"] .kb-hilfe-text, html[data-theme="dark"] .kb-hilfe-frage { background: #2f2a14; border-color: #5c4f1c; color: #eee3b8; }
html[data-theme="dark"] .kb-hilfe b { color: #fff3c4; }
html[data-theme="dark"] .kb-hilfe a { color: #8cc4ff; }
html[data-theme="dark"][data-hilfe="1"] .kb-hilfe { background: none; border: 0; }
@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] .kb-hilfe, html[data-theme="auto"] .kb-hilfe-text, html[data-theme="auto"] .kb-hilfe-frage { background: #2f2a14; border-color: #5c4f1c; color: #eee3b8; }
    html[data-theme="auto"] .kb-hilfe b { color: #fff3c4; }
    html[data-theme="auto"] .kb-hilfe a { color: #8cc4ff; }
    html[data-theme="auto"][data-hilfe="1"] .kb-hilfe { background: none; border: 0; }
}
html[data-hilfe="1"] .kb-hilfe .kb-hilfe-frage b { color: #fff; }
/* Schalter in der Menüleiste: Glühbirne leuchtet bei „voll“, halb bei „?“ */
.kb-hilfe-schalter .fa-lightbulb-o { transition: color .15s; }
html[data-hilfe="2"] .kb-hilfe-schalter .fa-lightbulb-o { color: #f5b301; text-shadow: 0 0 8px rgba(245, 179, 1, .55); }
html[data-hilfe="1"] .kb-hilfe-schalter .fa-lightbulb-o { color: #d9a400; }
.kb-zeige-hilfe-0, .kb-zeige-hilfe-1, .kb-zeige-hilfe-2 { display: none; }
html[data-hilfe="0"] .kb-zeige-hilfe-0, html[data-hilfe="1"] .kb-zeige-hilfe-1, html[data-hilfe="2"] .kb-zeige-hilfe-2 { display: inline; }
@media (min-width: 1100px) { .kb-hilfe-schalter span { display: none !important; } }
.kb-hilfe-stufen { display: flex; gap: 6px; flex-wrap: wrap; }
.kb-hilfe-stufen button { flex: 1 1 0; }
#kb-hilfe-meldung { position: fixed; left: 50%; top: 70px; transform: translate(-50%, -10px); z-index: 2000; opacity: 0; pointer-events: none;
    background: #3a2f00; color: #fff8db; padding: 9px 16px; border-radius: 999px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); transition: opacity .2s, transform .2s; max-width: 92vw; text-align: center; }
#kb-hilfe-meldung.zeigen { opacity: 1; transform: translate(-50%, 0); }

/* Budget eintragen: Vorjahr + Prognose direkt bei den neuen Positionen (15.11.2026) */
.kb-vg-ref { font-size: 11.5px; color: var(--text-secondary); margin-top: 3px; line-height: 1.35; font-variant-numeric: tabular-nums; }


/* Startseite */
.pm-start { max-width: 1200px; margin: 0 auto; }
.pm-willkommen { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 6px 0 14px; }
.pm-willkommen h3 { margin: 0 0 2px; font-weight: 700; }
.pm-start-suche { position: relative; flex: 1 1 320px; max-width: 460px; }
.pm-start-suche .fa-search { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.pm-start-suche .form-control { padding: 10px 14px 10px 36px; border-radius: 999px; font-size: 15px; }
.pm-start-titel { margin: 18px 0 10px; font-weight: 600; }
.pm-kacheln-gross { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; margin-bottom: 18px; }
.pm-kachel { display: flex; align-items: center; gap: 14px; padding: 16px 14px; border-radius: 12px; border: 1px solid var(--border-color);
    background: var(--card-bg); color: var(--text-primary); text-decoration: none; box-shadow: var(--shadow-card); transition: transform .12s, box-shadow .12s, border-color .12s; }
.pm-kachel:hover, .pm-kachel:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-popup); border-color: var(--primary-color); text-decoration: none; color: var(--text-primary); }
.pm-kachel-symbol { flex: 0 0 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff; background: var(--owr-blau); }
.pm-kachel-rot .pm-kachel-symbol { background: var(--danger); }
.pm-kachel-gelb .pm-kachel-symbol { background: var(--warning); color: #1f2937; }
.pm-kachel-gruen .pm-kachel-symbol { background: var(--success); }
.pm-kachel-grau .pm-kachel-symbol { background: var(--secondary); }
.pm-kachel-text { flex: 1; min-width: 0; }
.pm-kachel-text b { display: block; font-size: 15.5px; }
.pm-kachel-text small { display: block; color: var(--text-secondary); font-size: 12.5px; margin-top: 2px; }
.pm-kachel-zahl { display: inline-block; min-width: 1.6em; padding: 0 7px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 12.5px; text-align: center; vertical-align: 1px; }
.pm-kachel-gelb .pm-kachel-zahl { background: var(--warning); color: #1f2937; }
.pm-kachel-pfeil { color: var(--text-muted); }
.pm-start-raster { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .pm-start-raster { grid-template-columns: 1fr; } }
.pm-start-os td, .pm-start-os th { padding-left: 12px !important; padding-right: 12px !important; }
.pm-start-os .kb-hilfe { margin: 10px 12px; }
.pm-sicherheit { display: flex; gap: 10px; align-items: flex-start; }
@media (max-width: 575px) {
    .pm-kacheln-gross { grid-template-columns: 1fr 1fr; gap: 8px; }
    .pm-kachel { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
    .pm-kachel-pfeil { display: none; }
    .pm-kachel-symbol { flex: none; width: 40px; height: 40px; font-size: 19px; border-radius: 10px; }
    .pm-kachel-text small { font-size: 12px; }
    .pm-nur-breit { display: none; }
    .pm-start-suche { max-width: none; }
}

.pm-sicherheit ul { padding-left: 1.1rem; }
.pm-sicherheit .btn { margin: 2px 4px 2px 0; }

/* Profil, Heimat */
.pm-profil { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; max-width: 1100px; }
.pm-profil .card { margin: 0; }
.pm-heimat-filter { margin-left: auto; }
.pm-heimat-filter .badge { margin-left: 4px; }
.pm-start-os tr.pm-heimat > td { background: var(--bg-secondary); font-weight: 700; }
.pm-start-os tr.pm-heimat > td:first-child { box-shadow: inset 4px 0 0 var(--primary-color); }
.pm-start-os tr.pm-heimat .fa-home { color: var(--primary-color); }
.pm-kachel[data-heimat] { border-color: var(--owr-blau); border-width: 2px; }

/* Eigentum als Verknüpfung */
.pm-eigen a { color: inherit; text-decoration: underline dotted; }
.pm-eigen a.pm-eigen-anders { color: var(--primary-color); font-weight: 600; }
.pm-eigentum-trenner td { font-style: italic; }
.pm-badge-eigentum { background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--primary-color); }

/* Zuordnung Pager ↔ Person */
.pm-zuordnung { border-left: 4px solid var(--primary-color); }
.pm-halter-jetzt { font-size: 15px; }
.pm-frei { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px dashed var(--text-muted); color: var(--text-secondary); font-size: 12.5px; }
.pm-personensuche { position: relative; }
.pm-personensuche .fa-search { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.pm-personensuche .form-control { padding-left: 32px; }
.pm-treffer { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 340px; overflow-y: auto; }
.pm-treffer-zeile { text-align: left; border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-primary); border-radius: 8px; padding: 7px 10px; }
.pm-treffer-zeile:hover, .pm-treffer-zeile:focus-visible { border-color: var(--primary-color); background: var(--bg-secondary); }
.pm-treffer-zeile small { display: block; color: var(--text-secondary); }
.pm-treffer-zeile small.text-warning { color: var(--warning) !important; }
.pm-nr-doppelt { color: var(--danger) !important; font-weight: 700; text-decoration: underline wavy; }

/* Eigentum-Auswahl, vom System vergebene Felder */
.pm-eigentum-wahl { display: flex; flex-direction: column; gap: 4px; }
.pm-eigentum-wahl label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.pm-nur-anzeige { background: var(--bg-secondary); }

[hidden] { display: none !important; }
.pm-matrix .pm-info-start { border-left: 2px solid var(--border-strong) !important; }
.pm-f2 .pm-funktion { font-weight: 600; }
.pm-funktion-zeile { display: flex; gap: 8px; align-items: flex-end; }
.pm-funktion-zeile .form-group { flex: 1; margin-bottom: 0; }

/* Pager-Seite: Schleifen als Matrix-Zeile */
.pm-schleifen-karte .table-responsive { margin: 0; }
.pm-matrix-einzeln { width: auto; margin: 0; }
.pm-matrix-einzeln .pm-f1, .pm-matrix-einzeln .pm-f2, .pm-matrix-einzeln .pm-eigen, .pm-matrix-einzeln .pm-ric, .pm-matrix-einzeln .pm-geraet { display: none; }
.pm-matrix-einzeln tbody tr > td.pm-z:first-of-type { border-left: 0; }
.pm-schleifen-fuss { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding-top: 8px; padding-bottom: 8px; }
.pm-funktion-form { display: flex; gap: 6px; align-items: center; }
.pm-funktion-form .form-control { width: 210px; }

.pm-mono { font-family: var(--font-mono); }
.pm-text-anzeige { height: auto; min-height: 58px; white-space: normal; }
.pm-badge-dp-weg { background: var(--danger); color: #fff; }
.pm-dp-schalter { display: flex; gap: 10px; align-items: center; margin-bottom: 0; }
.pm-dp-schalter { padding-left: 0; }
.pm-dp-schalter .form-check-input { position: static; float: none; width: 1.25em; height: 1.25em; margin: 0; }

/* Zweit-Ortsstelle */
.pm-zweit-info { display: block; color: var(--primary-color); font-size: 11.5px; font-weight: 600; }
.pm-matrix td.pm-fremd { opacity: .4; }
.pm-zweit-trenner td { font-style: italic; }
.pm-matrix .pm-kontext, .pm-matrix .pm-kontext-kopf { white-space: nowrap; font-weight: 600; font-size: 12.5px; padding: 0 10px; text-align: left; vertical-align: middle; }
.pm-zweit-box { border-top: 1px dashed var(--border-color); padding-top: 10px; }
.pm-zweit-chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--border-color); border-radius: 999px; padding: 2px 10px; background: var(--bg-secondary); }

/* syBOS-Abgleich */
.pm-badge-sybos { background: #6f42c1; color: #fff; }
.pm-sybos-knopf { padding: 0 6px; margin-left: 2px; }
.pm-sybos-box { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; margin-bottom: 12px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-secondary); }
.pm-sybos-box > .fa { margin-top: 3px; color: var(--success); }
.pm-sybos-box.pm-sybos-offen { border-color: #6f42c1; }
.pm-sybos-box.pm-sybos-offen > .fa { color: #6f42c1; }

/* Funk & Fahrzeuge */
.pm-funk-tabelle tbody tr { cursor: pointer; }
.pm-funk-tabelle code { color: var(--text-color); font-size: 12px; }
.pm-badge-hinweis { background: #0d6efd; color: #fff; }
.pm-auff { list-style: none; padding: 0; margin: 0; }
.pm-auff li { padding: 3px 0; }
.pm-auff-fehler, .pm-auff-fehler .fa { color: #dc3545; }
.pm-auff-hinweis .fa { color: #0d6efd; }
.pm-auff-karte { border-left: 4px solid #dc3545; }
.pm-feld-wert { min-height: 22px; padding: 2px 0; border-bottom: 1px dotted var(--border-color); word-break: break-word; }
.pm-ws { color: #dc3545; background: rgba(220, 53, 69, .15); border-radius: 2px; padding: 0 1px; }
.pm-dateien { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.pm-datei { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.pm-datei img { width: 100%; height: 100px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border-color); }
.pm-datei .fa-3x { color: var(--text-muted, #888); }
.pm-os-bereich { border-left: 4px solid #198754; }
div.pm-os-bereich { padding: 8px 10px; background: var(--bg-secondary); border-radius: 6px; }
.pm-badge-alarm { background: #fd7e14; color: #fff; }

/* Matrix-Kopf: aufgeräumt, auf dem Handy kompakt (21.11.2026) */
.pm-matrix-werkzeug { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.pm-matrix-werkzeug .pm-suche { flex: 1 1 auto; max-width: 320px; min-width: 0; }
.pm-legende-unten { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border-color); }
@media (max-width: 767px) {
    .pm-matrix-kopf { gap: 4px 10px; }
    .pm-matrix-kopf h4.pm-titel-mit-wahl { display: none; }   /* Name steht schon in der Auswahl */
    .pm-matrix-kopf .pm-os-wahl { flex: 1 1 auto; }
    .pm-matrix-kopf .pm-os-wahl .form-select { width: 100%; min-width: 0; }
    .pm-matrix-zahlen { flex-basis: 100%; font-size: 13px; }
    .pm-matrix-werkzeug .pm-suche { max-width: none; }
    .pm-matrix-werkzeug .pm-btn-text { display: none; }
    .pm-matrix-werkzeug .btn { padding-left: 12px; padding-right: 12px; }
}
.pm-start-summe td { border-top: 2px solid var(--border-color); }
.pm-start-os td.text-end, .pm-start-os th.text-end { white-space: nowrap; }
.pm-start-os .pm-mini { font-size: 10px; padding: 2px 4px; margin-left: 3px; vertical-align: 1px; }
@media (max-width: 575px) { .pm-start-os td, .pm-start-os th { padding-left: 5px !important; padding-right: 5px !important; } .pm-start-os td:first-child, .pm-start-os th:first-child { padding-left: 12px !important; } }

/* Startseite: Überblick je Ortsstelle mit zwei Gruppen und eindeutigen Zahl-Links (21.11.2026) */
.pm-start-gruppen th { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding-top: 8px !important; padding-bottom: 2px !important; text-align: center; border-bottom: 0; }
.pm-start-os .pm-gruppe-pager, .pm-start-os .pm-gruppe-funk { border-left: 2px solid var(--border-color); }
.pm-start-gruppen .pm-gruppe-pager { color: var(--primary-color); }
.pm-start-gruppen .pm-gruppe-funk { color: #fd7e14; }
.pm-start-name { font-weight: 600; }
.pm-zahl-link { display: inline-block; min-width: 2.1em; padding: 1px 7px; border-radius: 999px; text-align: center; font-weight: 600; text-decoration: none;
    border: 1px solid rgba(var(--primary-rgb), .35); background: rgba(var(--primary-rgb), .08); }
.pm-zahl-link:hover { background: var(--primary-color); color: #fff; text-decoration: none; }
.pm-zahl-link.pm-zl-gelb { border-color: rgba(255, 193, 7, .6); background: rgba(255, 193, 7, .15); color: inherit; }
.pm-zahl-link.pm-zl-rot { border-color: rgba(220, 53, 69, .6); background: rgba(220, 53, 69, .15); color: #dc3545; }
.pm-zahl-link.pm-zl-gelb:hover { background: #ffc107; color: #000; }
.pm-zahl-link.pm-zl-rot:hover { background: #dc3545; color: #fff; }
@media (max-width: 575px) { .pm-zahl-link { min-width: 1.8em; padding: 1px 4px; font-size: 13px; } .pm-start-os td { font-size: 13.5px; } }
@media (max-width: 575px) { .pm-start-os td, .pm-start-os th { padding-left: 3px !important; padding-right: 3px !important; } .pm-start-os td:first-child, .pm-start-os th:first-child { padding-left: 10px !important; } .pm-start-os td:last-child, .pm-start-os th:last-child { padding-right: 8px !important; } }
.pm-start-os .pm-gruppe-fzg { border-left: 2px solid var(--border-color); }
.pm-start-gruppen .pm-gruppe-fzg { color: #20c997; }
.pm-start-liste { display: none; list-style: none; margin: 0; padding: 0; }
@media (max-width: 575px) {
    .pm-start-tabelle { display: none; }
    .pm-start-liste { display: block; }
    .pm-start-liste li { padding: 8px 12px; border-bottom: 1px solid var(--border-color); }
    .pm-start-liste li.pm-heimat { background: var(--bg-secondary); box-shadow: inset 4px 0 0 var(--primary-color); }
    .pm-start-liste .pm-heimat .fa-home { color: var(--primary-color); }
    .pm-start-gruppen-zeile { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; }
    .pm-sg { display: inline-flex; align-items: center; gap: 4px; }
    .pm-sg > .fa { width: 1.1em; text-align: center; }
    .pm-sg-pager > .fa { color: var(--primary-color); }
    .pm-sg-funk > .fa { color: #fd7e14; }
    .pm-sg-fzg > .fa { color: #20c997; }
}

/* Fußzeile auf der Anmeldeseite (26.11.2026) */
.pm-fuss-login { padding: 14px 8px 8px; }
.pm-fuss small { display: inline-block; margin-top: 2px; }

/* Rundschreiben – Hinweis oben in der App */
.pm-rundschreiben { border: 1px solid var(--primary-color); border-left-width: 5px; border-radius: 6px; background: var(--card-bg, #fff);
    padding: 10px 14px; margin: 0 0 12px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.pm-rs-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
.pm-rs-kopf .fa { color: var(--primary-color); }
.pm-rs-von { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.pm-rs-text { white-space: normal; line-height: 1.45; margin-bottom: 8px; overflow-wrap: anywhere; }

/* Sicherheits- und Fehlerlog */
.pm-stufe-kritisch { background: rgba(220, 53, 69, .10); }
.pm-stufe-warnung { background: rgba(255, 193, 7, .10); }
.pm-log-spur { white-space: pre-wrap; font-size: 11px; max-height: 260px; overflow: auto; background: var(--bg-secondary); padding: 6px; border-radius: 4px; }
.pm-log-datei { font-size: 11px; white-space: pre-wrap; max-height: 520px; overflow: auto; background: var(--bg-secondary); padding: 8px; border-radius: 4px; }
.pm-kennzahlen { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.pm-kennzahl { border: 1px solid var(--border-color); border-radius: 6px; padding: 8px 12px; min-width: 130px; }
.pm-kennzahl b { display: block; font-size: 20px; }
.pm-kennzahl small { color: var(--text-muted); }

/* Logbuch */
.pm-lb-tag { max-width: 900px; margin-bottom: 14px; }
.pm-lb-tag h5 { font-size: 15px; color: var(--primary-color); border-bottom: 1px solid var(--border-color); padding-bottom: 4px; margin-bottom: 6px; }
.pm-lb-liste { list-style: none; padding: 0; margin: 0; }
.pm-lb-liste li { padding: 6px 0; border-bottom: 1px dashed var(--border-color); }
.pm-lb-liste li:last-child { border-bottom: 0; }
.pm-lb-bereich { font-size: 12px; color: var(--text-muted); margin: 0 4px; }
.pm-lb-text { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }

/* Status1: Untertitel auf der Anmeldeseite (26.11.2026) */
.kb-login-kopf h4 { text-align: center; letter-spacing: .5px; }
.kb-login-kopf h4 small { display: block; margin-top: 4px; font-size: 13.5px; font-weight: 400; letter-spacing: 0; color: rgba(255, 255, 255, .85); }

/* App installieren – Hinweis für iPhone/iPad */
#kb-app-tipp { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 2000; max-width: 340px; width: calc(100% - 2rem);
  background: var(--card-bg, #fff); color: var(--text-primary, inherit); border: 1px solid #155fab; border-radius: 10px; padding: .8rem 1rem;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); font-size: .95rem; line-height: 1.45; cursor: pointer; }

/* ---------------------------------------------------------------- Foto-Galerie (26.11.2026) */
html.pm-gal-offen { overflow: hidden; }
.pm-gal { position: fixed; inset: 0; z-index: 3000; background: rgba(10, 14, 20, .94); display: flex; flex-direction: column; color: #e8edf2; }
.pm-gal[hidden] { display: none; }
.pm-gal-leiste { display: flex; align-items: center; gap: 12px; padding: 8px 12px; font-size: 14px; }
.pm-gal-zahl { font-weight: 600; white-space: nowrap; }
.pm-gal-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .8; }
.pm-gal-knoepfe { display: flex; gap: 4px; }
.pm-gal-knoepfe button, .pm-gal-knoepfe a, .pm-gal-schnitt button { background: rgba(255, 255, 255, .1); border: 0; color: #fff; border-radius: 8px; min-width: 40px; height: 40px; font-size: 17px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; cursor: pointer; text-decoration: none; }
.pm-gal-knoepfe button:hover, .pm-gal-knoepfe a:hover, .pm-gal-schnitt button:hover { background: rgba(255, 255, 255, .22); }
.pm-gal-knoepfe [hidden] { display: none; }
.pm-gal-buehne { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 4px 56px 12px; }
.pm-gal-rahmen-box { position: relative; display: inline-block; line-height: 0; max-width: 100%; max-height: 100%; }
.pm-gal-buehne img { max-width: calc(100vw - 112px); max-height: calc(100vh - 130px); object-fit: contain; border-radius: 4px; user-select: none; -webkit-user-drag: none; touch-action: pinch-zoom; }
.pm-gal-pfeil { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, .1); border: 0; color: #fff; width: 44px; height: 64px; border-radius: 10px; font-size: 22px; cursor: pointer; }
.pm-gal-pfeil.links { left: 6px; } .pm-gal-pfeil.rechts { right: 6px; }
.pm-gal-pfeil[hidden], .pm-gal-schneidet .pm-gal-pfeil { display: none; }
.pm-gal-warte { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 42px; background: rgba(0, 0, 0, .35); }
.pm-gal-warte[hidden] { display: none; }
.pm-gal-rahmen { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); cursor: move; touch-action: none; }
.pm-gal-rahmen[hidden] { display: none; }
.pm-gal-rahmen i { position: absolute; width: 26px; height: 26px; border: 4px solid #4da3ff; background: transparent; }
.pm-gal-rahmen i[data-e=nw] { left: -6px; top: -6px; border-right: 0; border-bottom: 0; cursor: nwse-resize; }
.pm-gal-rahmen i[data-e=ne] { right: -6px; top: -6px; border-left: 0; border-bottom: 0; cursor: nesw-resize; }
.pm-gal-rahmen i[data-e=sw] { left: -6px; bottom: -6px; border-right: 0; border-top: 0; cursor: nesw-resize; }
.pm-gal-rahmen i[data-e=se] { right: -6px; bottom: -6px; border-left: 0; border-top: 0; cursor: nwse-resize; }
.pm-gal-schnitt { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 8px 12px 14px; font-size: 13px; }
.pm-gal-schnitt[hidden] { display: none; }
.pm-gal-schnitt span { opacity: .75; width: 100%; text-align: center; }
.pm-gal-schnitt .pm-gal-ok { background: #155fab; font-weight: 600; }
.pm-gal-meldung { position: absolute; left: 50%; bottom: 80px; transform: translateX(-50%); background: rgba(0, 0, 0, .8); border: 1px solid rgba(255, 255, 255, .25); color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 14px; }
.pm-gal-meldung[hidden] { display: none; }
.pm-gal-schneidet .pm-gal-knoepfe [data-g=links], .pm-gal-schneidet .pm-gal-knoepfe [data-g=rechts], .pm-gal-schneidet .pm-gal-knoepfe [data-g=schneiden], .pm-gal-schneidet .pm-gal-knoepfe [data-g=original] { display: none; }
@media (max-width: 600px) {
    .pm-gal-buehne { padding: 4px 4px 8px; }
    .pm-gal-buehne img { max-width: calc(100vw - 8px); max-height: calc(100vh - 170px); }
    .pm-gal-text { display: none; }
    .pm-gal-pfeil { width: 36px; height: 52px; background: rgba(0, 0, 0, .35); }
}

/* Startseite: Meine Geräte (27.11.2026) */
.pm-meine-geraete { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 1.4rem; }
.pm-mein-geraet { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border-color, #dde3ea); border-radius: 10px; background: var(--card-bg, #fff); color: inherit; text-decoration: none; }
a.pm-mein-geraet:hover { border-color: #155fab; }
.pm-mein-geraet > i { font-size: 26px; width: 28px; text-align: center; color: #155fab; }
.pm-mein-geraet > span { flex: 1; min-width: 0; }

/* Gerätehalter (27.11.2026) */
.pm-halter-daten td { border: 0; padding: 3px 0; }
.pm-halter-schleifen { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-halter-schleife { background: var(--bs-light, #eef3f8); border: 1px solid var(--border-color, #dde3ea); border-radius: 20px; padding: 3px 12px; font-size: 14px; }

/* Benutzer: Zugangs-Stufen (27.11.2026) */
.pm-stufen { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.pm-stufe { display: block; cursor: pointer; margin: 0; }
.pm-stufe input { position: absolute; opacity: 0; pointer-events: none; }
.pm-stufe > span { display: block; height: 100%; border: 2px solid var(--border-color, #dde3ea); border-radius: 10px; padding: 10px 12px; }
.pm-stufe > span small { display: block; color: var(--bs-secondary-color, #6c757d); font-size: 12px; line-height: 1.35; margin-top: 3px; }
.pm-stufe input:checked + span { border-color: #155fab; background: rgba(21, 95, 171, .08); }
.pm-stufe input:focus-visible + span { outline: 2px solid #155fab; outline-offset: 2px; }
.pm-stufe-aus { opacity: .5; cursor: not-allowed; }
.pm-stufe-zeige[hidden], .pm-recht[hidden] { display: none !important; }
