:root {
  --bg: #f4f5f7; --panel: #fff; --ink: #1d2330; --muted: #6b7280; --line: #e3e6eb; --line2: #d0d5dd;
  --accent: #1f5fbf; --accent-soft: #e8f0fc; --ok: #2f7d32; --warn: #b26a00; --bad: #c62828;
  --haupt: #2f7d32; --kann: #1f5fbf; --notfall: #b26a00; --none: #c62828;
  --chip: #eef1f5; --note: #fff4c2; --radius: 6px;
  font-family: "Segoe UI", system-ui, sans-serif; font-size: 13px; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line2); background: var(--panel); border-radius: var(--radius); padding: 5px 10px; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.primary:hover { filter: brightness(1.1); }
button.ghost { border-color: transparent; background: transparent; }
button.danger { color: var(--bad); border-color: var(--bad); }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { border: 1px solid var(--line2); border-radius: 4px; padding: 4px 6px; background: #fff; }
input[type=checkbox] { width: auto; }
textarea { width: 100%; resize: vertical; }

header.top { display: flex; align-items: center; gap: 16px; padding: 0 16px; height: 46px; background: #16233b; color: #fff; position: sticky; top: 0; z-index: 40; }
header.top h1 { font-size: 15px; margin: 0; font-weight: 600; white-space: nowrap; }
#menu { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; }
nav { display: flex; gap: 2px; min-width: 0; }
/* Menügruppen mit Untermenü (beim Darüberfahren oder per Tastatur) */
.navgroup { position: relative; display: flex; align-items: center; }
.navgroup.active > a.navlink { background: #2d4470; color: #fff; }
.navgroup .submenu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 30; min-width: 220px; flex-direction: column; gap: 1px;
  background: #16233b; padding: 6px; border-radius: 0 0 8px 8px; box-shadow: 0 8px 20px rgba(0,0,0,.25);
}
.navgroup.right .submenu { left: auto; right: 0; }
.navgroup:hover .submenu, .navgroup:focus-within .submenu { display: flex; }
.navgroup .submenu a { color: #c9d3e6; text-decoration: none; padding: 7px 10px; border-radius: 5px; white-space: nowrap; }
.navgroup .submenu a:hover { background: #22324f; color: #fff; }
.navgroup .submenu a.active { background: #2d4470; color: #fff; }
/* Unterbereich im Untermenü (z. B. Admin → Tagessteuerung) und zweite Reiterzeile auf der Seite */
.navgroup .submenu .submenu-head { color: #8fa3c4; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px 2px; }
.navgroup .submenu a.indent { padding-left: 22px; }
.subtabs { margin-top: 6px; padding-left: 4px; }
.subtabs .tabs button { font-size: 12px; }
.menuonly { display: none; }
#menubtn { display: none; margin-left: auto; background: transparent; color: #fff; border: 1px solid #3a4e72; font-size: 15px; padding: 4px 12px; }
#menubtn:hover { background: #22324f; }
#menutitle { font-size: 13px; margin-left: 4px; }
/* Schmales Fenster: Menü passt nicht -> ☰ öffnet es als Liste unter der Kopfleiste */
header.top.compact #menubtn { display: inline-flex; align-items: center; }
header.top.compact #menu { display: none; }
header.top.compact.open #menu {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px; position: absolute; top: 46px; right: 0;
  width: min(320px, 100vw); max-height: calc(100vh - 46px); overflow-y: auto; background: #16233b; padding: 8px 10px 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,.25); border-bottom-left-radius: 8px;
}
header.top.compact.open nav { flex-direction: column; overflow: visible; }
header.top.compact.open nav a { padding: 8px 10px; }
header.top.compact.open #userbox { flex-direction: column; align-items: stretch; margin-left: 0; border-top: 1px solid #2d4470; padding-top: 8px; gap: 2px; }
header.top.compact.open #userbox a { padding: 8px 10px; }
/* im ☰-Menü: Gruppen untereinander, Unterpunkte eingerückt und immer sichtbar */
header.top.compact.open .navgroup { flex-direction: column; align-items: stretch; }
header.top.compact.open .navgroup .submenu { display: flex; position: static; box-shadow: none; background: transparent; padding: 0 0 4px 14px; min-width: 0; }
header.top.compact.open .navgroup > a.navlink { font-weight: 600; }
header.top.compact.open .menuonly { display: inline; }
nav a { color: #c9d3e6; text-decoration: none; padding: 6px 10px; border-radius: 5px; white-space: nowrap; }
nav a:hover { background: #22324f; color: #fff; }
nav a.active { background: #2d4470; color: #fff; }

main { padding: 14px 16px 16px; } /* unten knapp, damit Tabellen bis an den Fensterrand reichen (fitTables) */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.panel h2 { font-size: 14px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hint { background: var(--accent-soft); border-radius: 6px; padding: 8px 10px; margin: 8px 0; }
.error { background: #fdecea; color: var(--bad); border-radius: 6px; padding: 8px 10px; margin: 8px 0; white-space: pre-wrap; }
.warnbox { background: #fff6e0; color: #7a4a00; border-radius: 6px; padding: 8px 10px; margin: 8px 0; }
.okbox { background: #e8f5e9; color: #1e5b25; border-radius: 6px; padding: 6px 10px; margin: 8px 0; }

/* Tagessteuerung */
.daybar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.daybar .date { font-size: 16px; font-weight: 600; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; background: var(--chip); font-size: 12px; }
.tabs { display: inline-flex; border: 1px solid var(--line2); border-radius: 7px; overflow: hidden; }
.tabs button { border: 0; border-radius: 0; padding: 6px 14px; }
.tabs button.active { background: var(--accent); color: #fff; }
.daygrid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .daygrid { grid-template-columns: 1fr; } }

table.grid { width: 100%; border-collapse: collapse; background: var(--panel); }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: middle; }
/* Feste Tabellenköpfe – überall gleich (Chris 06.10.2026): Die Kopfzeile bleibt stehen, darunter wird gescrollt.
   Ohne eigenen Scrollbereich klebt sie unter der Kopfleiste (bzw. unter der Bearbeiten-Leiste); Tabellen, die seitlich
   scrollen können, liegen in .tscroll (höchstens bildschirmhoch, scrollt selbst) – dort klebt sie oben im Bereich. */
:root { --th-top: 46px; }
main:has(.editbar) { --th-top: 92px; } /* Kopfleiste 46px + Bearbeiten-Leiste (46px) – Kopf schließt ohne Spalt an */
table.grid th { position: sticky; top: var(--th-top); background: #f0f2f5; font-weight: 600; font-size: 12px; z-index: 5; white-space: nowrap; }
.tscroll { overflow: auto; max-height: calc(100vh - var(--th-top) - 24px); max-width: 100%; }
.tscroll table.grid th, div[style*="overflow"] table.grid th, .modal table.grid th, .pop table.grid th { top: 0; }
.daygrid > .panel > table.grid th { top: var(--th-top); } /* Tagessteuerung: Panel hat overflow: visible – Kopf klebt unter der Kopfleiste */
/* Legende am Ende einer Tabelle mit eigenem Scrollbereich: erst beim Scrollen ans Ende sichtbar, bleibt beim
   seitlichen Scrollen links stehen (fitTables in app.js) */
/* Feste erste Spalten beim seitlichen Scrollen (editorTable stickyFirst, z. B. Kanäle) */
table.grid .stick { position: sticky; z-index: 3; }
table.grid td.stick { background: var(--panel); }
table.grid th.stick { z-index: 6; }
table.grid .stick-sort { width: 56px; min-width: 56px; max-width: 56px; box-sizing: border-box; }
table.grid .stick-end { box-shadow: inset -2px 0 0 var(--line2); }
.scroll-foot { position: sticky; left: 0; width: max-content; max-width: 100%; padding: 0 2px 4px; }
.scroll-foot.lv-legend { width: auto; }
/* Zuklappbarer Bereich unter einem Kalender (foldPanel in app.js), Standard zu */
details.fold > summary { font-size: 14px; font-weight: 600; cursor: pointer; }
details.fold[open] > summary { margin-bottom: 10px; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid tr.zero td { color: #a0a6b0; }
/* Infos: Personen & Zuständigkeiten als Karten (wie im Organigramm der TGS-Vorlage) */
.info-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; align-items: start; }
.info-person { border: 1px solid #b9d7f0; border-radius: 8px; background: #fff; overflow: hidden; }
.info-person-head { padding: 8px 10px; border-bottom: 1px solid #b9d7f0; text-align: center; }
.info-person ul { margin: 0; padding: 8px 10px 10px 26px; background: #e8f4fd; min-height: 40px; }
.info-person ul li { margin: 2px 0; }
.info-person > .row, .info-person > input, .info-person > div, .info-person > details, .info-person > textarea { margin-left: 8px; margin-right: 8px; }
.info-person > .row:first-child { margin-top: 8px; }
.info-person > textarea { width: calc(100% - 16px) !important; margin-bottom: 8px; }
/* Aktionskalender bearbeiten: breitere Karten, Felder bleiben in ihrer Karte */
.info-people.info-acts { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.info-acts .info-person { min-width: 0; }
.info-acts .info-person input, .info-acts .info-person textarea { box-sizing: border-box; max-width: 100%; }
.info-acts .info-person input[type=date] { flex: 1; min-width: 0; }
.info-acts .info-person > textarea { margin-bottom: 0; }
.info-acts .info-person > textarea:last-child { margin-bottom: 8px; }
.info-chans { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 4px 0; }
/* Organigramm: Ebenen untereinander, Personen nebeneinander, Verbindungslinie dazwischen */
.org { display: flex; flex-direction: column; align-items: stretch; }
.org-level { text-align: center; }
.org-level-name { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.org-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.org-card { border: 1px solid #b9d7f0; border-top: 3px solid var(--accent); border-radius: 6px; background: #fff; padding: 6px 10px; min-width: 150px; max-width: 240px; text-align: center; }
.org-card .small { color: var(--muted); }
.org-line { width: 2px; height: 18px; background: #b9d7f0; margin: 6px auto; }
.org-edit { border: 1px dashed var(--line2); border-radius: 8px; padding: 8px; margin-bottom: 8px; text-align: left; }
.org-edit .org-row { justify-content: flex-start; }
/* Jede zweite Zeile leicht abgesetzt – in allen Tabellen (Chris 07.10.2026). :where() hält das schwach, damit farbige
   Zeilen (SLA-Status, Gruppen) und farbige Zellen ihre Farbe behalten; klebende Namensspalten ziehen mit. */
:root { --zebra: #f6f8fb; }
table.grid > tbody > tr:where(:nth-child(even)),
table.matrix > tbody > tr:where(:nth-child(even)),
table.cal > tbody > tr:where(:nth-child(even)) { background: var(--zebra); }
table.matrix > tbody > tr:nth-child(even) > td.name,
table.cal.lv > tbody > tr:nth-child(even):not(.lv-team) > td.lv-name,
.tscroll table.cal > tbody > tr:nth-child(even) > td.name { background: var(--zebra); }
table.grid tr.groupstart td { border-top: 2px solid var(--line2); }
table.grid tfoot td { font-weight: 600; background: #f7f8fa; border-top: 2px solid var(--line2); }
/* SLA-Ampel */
table.grid tr.st-verletzt td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
table.grid tr.st-verletzt { background: #fdf0ef; }
table.grid tr.st-droht td:first-child { box-shadow: inset 4px 0 0 #e8710a; }
table.grid tr.st-droht { background: #fff4e8; }
table.grid tr.st-knapp td:first-child { box-shadow: inset 4px 0 0 #d4a900; }
table.grid tr.st-knapp { background: #fffbe6; }
td.over { color: var(--bad); font-weight: 700; }
.short { color: #c25400; font-weight: 700; }
.sla-badge { display: inline-block; border-radius: 10px; padding: 1px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.sla-badge.verletzt { background: var(--bad); color: #fff; }
.sla-badge.droht { background: #e8710a; color: #fff; }
.sla-badge.knapp { background: #f5d547; color: #4a3b00; }
.sla-badge.ok { background: #e3f2e3; color: var(--ok); font-weight: 500; }
.sla-banner { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; display: grid; gap: 4px; }
.delta.up { color: var(--bad); } .delta.down { color: var(--ok); }
/* Einstellungs-Formulare (Admin): Beschriftung links, Feld nutzt die Breite; schmal: untereinander */
.set-grid { display: grid; grid-template-columns: minmax(220px, 420px) minmax(0, 1fr); gap: 8px 18px; align-items: center; max-width: 1280px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.set-label { font-size: 13px; line-height: 1.35; color: #374151; }
/* „?“ hinter einer Einstellung: Erklärung mit Beispiel */
.helpq { margin-left: 6px; width: 18px; height: 18px; padding: 0; border-radius: 50%; font-size: 11px; font-weight: 700; line-height: 16px; border: 1px solid var(--line2); background: #fff; color: var(--accent); cursor: pointer; vertical-align: 1px; }
.helpq:hover { background: var(--accent); color: #fff; }
.set-field { min-width: 0; }
.set-field .set-text, .set-field textarea { width: 100%; box-sizing: border-box; }
.set-field textarea { min-height: 64px; resize: vertical; font-family: inherit; line-height: 1.4; }
.set-field .set-num { width: 140px; }
.set-field .set-date { width: 180px; }
.form-wide { max-width: 1280px; }
.form-wide td:first-child { width: 260px; }
.form-wide input:not([type=checkbox]):not([type=time]):not([type=number]) { width: 100%; box-sizing: border-box; }
@media (max-width: 800px) { .set-grid { grid-template-columns: 1fr; gap: 4px; } .set-label { margin-top: 6px; font-weight: 600; } }
.editnum { cursor: pointer; }
.editnum:hover { text-decoration: underline dotted; }
.old { color: var(--bad); font-weight: 600; }      /* Ältestes: SLA-Frist schon gerissen */
.oldsoon { color: #c2410c; font-weight: 600; }      /* Ältestes: Frist reißt bis zum nächsten Slot */
.chips { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 3px; background: var(--chip); border-radius: 12px; padding: 1px 4px 1px 8px; border: 1px solid transparent; white-space: nowrap; }
.chip .x { border: 0; background: none; padding: 0 3px; color: var(--muted); font-size: 13px; line-height: 1; }
.chip .x:hover { color: var(--bad); }
.chip.l3 { border-color: var(--haupt); } .chip.l2 { border-color: var(--kann); } .chip.l1 { border-color: var(--notfall); }
.chip.l0 { border-color: var(--none); border-style: dashed; }
.chip.auto { font-style: italic; }
.chip.gone { text-decoration: line-through; opacity: .6; }
.chip.note { background: var(--note); }
.chip.team { background: #e8f0fc; border: 1px solid #9db8e6; color: #1b3f7a; font-weight: 600; } /* „Alle“ mit Zeitraum */
.chip.team small { font-weight: 400; }
.chip .startmark { color: var(--accent); }   /* ▶ Start-Kanal */
.chip .hintnote { color: #b4530a; font-weight: 600; } /* Hinweis zur Person, z. B. „nur Tickets“ (wie in der Veröffentlichung) */
/* rechte Seite: Überschrift je Schicht / Gruppe */
.shiftgroup { margin: 10px 0 3px; padding: 2px 6px; font-size: 12px; font-weight: 600; color: #34425c; background: #eef1f5; border-left: 3px solid var(--accent); border-radius: 3px; }
.chip small { color: var(--muted); }
.add { border: 1px dashed var(--line2); border-radius: 12px; padding: 0 8px; background: none; color: var(--muted); }
.lvl3 { color: var(--haupt); } .lvl2 { color: var(--kann); } .lvl1 { color: var(--notfall); } .lvl0 { color: var(--none); }

.side h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 0 6px; }
.side h3:first-child { margin-top: 0; }
.person { display: flex; justify-content: space-between; gap: 6px; padding: 3px 0; border-bottom: 1px dotted var(--line); }
.person .load { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.person.idle .n { color: var(--warn); font-weight: 600; }
.bar { height: 4px; background: var(--line); border-radius: 2px; margin-top: 2px; }
.bar > i { display: block; height: 4px; border-radius: 2px; background: var(--accent); }

/* Popover */
.pop { position: absolute; z-index: 50; background: #fff; border: 1px solid var(--line2); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 8px; width: 290px; max-height: 420px; overflow: auto; }
.pop .opt { display: flex; justify-content: space-between; width: 100%; border: 0; border-radius: 4px; padding: 4px 6px; text-align: left; background: none; }
.pop .opt:hover { background: var(--accent-soft); }
.pop .sep { font-size: 11px; color: var(--muted); margin: 6px 4px 2px; text-transform: uppercase; }
/* Überschriften im „+“-Menü der Tagessteuerung: farbig abgesetzte Leisten je Kompetenzstufe (Chris 20.10.2026) */
.pop .sep.lvl3, .pop .sep.lvl2, .pop .sep.lvl0, .pop .sep.grp { font-weight: 700; padding: 3px 8px; border-radius: 4px; border-left: 4px solid; margin: 8px 0 3px; }
.pop .sep.lvl3 { color: var(--haupt); background: #e7f3e8; }
.pop .sep.lvl2 { color: var(--kann); background: #e6eefb; }
.pop .sep.lvl0 { color: var(--none); background: #fbe9e9; }
.pop .sep.grp { color: #444; background: #eef0f3; border-left-color: #8a8f98; }
.pop details > summary.sep.grp { cursor: pointer; text-transform: uppercase; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding-top: 6vh; }
.modal { background: #fff; border-radius: 10px; width: min(760px, 94vw); max-height: 88vh; overflow: auto; padding: 16px 18px; }
.modal h2 { margin-top: 0; font-size: 16px; }

/* Editor-Tabellen */
.edit td { padding: 2px 3px; }
.edit input[type=text], .edit input:not([type]), .edit select { width: 100%; min-width: 70px; }
.edit input.w-s, .edit input[type=number] { width: 64px; min-width: 0; }
.edit input.w-l { min-width: 170px; }
.edit input.w-xl { min-width: 290px; } /* lange Listen, z. B. Queue-IDs */
.hours { display: grid; grid-template-columns: repeat(7, 86px); gap: 2px; }
.hours label { font-size: 10px; color: var(--muted); display: block; }
.hours input { width: 86px; font-size: 12px; padding: 2px 4px; }

/* Kompetenzmatrix */
.matrix-wrap { overflow: auto; max-height: calc(100vh - var(--th-top) - 24px); border: 1px solid var(--line); border-radius: 8px; background: #fff;
  width: fit-content; max-width: 100%; margin-left: auto; margin-right: auto; } /* Rahmen so breit wie die Tabelle, mittig */
table.matrix { border-collapse: separate; border-spacing: 0; margin: 0 auto; } /* mittig, Breite nach Inhalt (Chris 27.10.2026) */
table.matrix.langs td.c { width: 56px; min-width: 56px; } /* Sprachen doppelt so breit (Chris 27.10.2026) */
table.matrix.langs th.name { min-width: 170px; padding-left: 8px; }
table.matrix.langs thead th { height: auto; vertical-align: middle; padding: 6px 2px; }
table.matrix.langs thead th.lang { text-align: center; font-weight: 600; cursor: help; }
table.matrix th, table.matrix td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
table.matrix thead th { position: sticky; top: 0; background: #f0f2f5; z-index: 3; height: 150px; vertical-align: bottom; padding: 4px 2px; }
table.matrix thead th .v { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-weight: 500; font-size: 12px; }
table.matrix th.name, table.matrix td.name { position: sticky; left: 0; background: #fff; z-index: 2; padding: 3px 8px; white-space: nowrap; text-align: left; }
table.matrix thead th.name { z-index: 4; background: #f0f2f5; }
table.matrix td.c { width: 28px; min-width: 28px; height: 26px; text-align: center; cursor: pointer; user-select: none; font-weight: 700; }
table.matrix td.c:hover { background: var(--accent-soft); }
table.matrix td.c.l3 { background: #dff1df; color: var(--haupt); }
table.matrix td.c.l2 { background: #e3ecfa; color: var(--kann); }
table.matrix td.c.l1 { background: #fff0d6; color: var(--notfall); }

/* Übersicht */
table.cal { border-collapse: collapse; font-size: 12px; width: 100%; max-width: 1400px; margin: 0 auto; } /* alle Kalender gleich breit, mittig, nicht zu gestreckt (Chris 27.10.2026) */
table.cal th, table.cal td { border: 1px solid var(--line); padding: 2px 4px; text-align: center; min-width: 30px; }
table.cal td.name { text-align: left; white-space: nowrap; }
table.cal .we { background: #f3f4f6; }
/* Kalender in einem Scrollbereich (Abwesenheiten-Übersicht): Kopf mit Datum/Tag und Namensspalte bleiben stehen */
.tscroll table.cal thead th { position: sticky; top: 0; z-index: 3; background: #f7f8fa; }
.tscroll table.cal td.name, .tscroll table.cal th:first-child { position: sticky; left: 0; z-index: 2; background: #fff; }
.tscroll table.cal thead th:first-child { z-index: 4; background: #f7f8fa; }
table.cal td.off { background: #eceef1; color: #a0a6b0; }
/* Kalenderwoche über den Tagen (Dienstplan, Personalplan); feste Höhe, damit die Tageszeile darunter beim Scrollen anschließt */
table.cal thead tr.kw th { height: 20px; padding: 0 4px; font-size: 11px; font-weight: 600; color: #34425c; background: #eef1f5; white-space: nowrap; }
table.cal thead tr.kw th[rowspan] { background: #f7f8fa; }
table.cal thead tr.kw + tr th { top: 19px; } /* leichte Überlappung – sonst scheint beim Scrollen eine Linie durch */

.chart { width: 100%; height: 220px; }

/* Produktivität → Diagramm: Hinweis beim Darüberfahren, kleine Diagramme je Person (Chris 23.10.2026) */
.pv-tip { position: fixed; z-index: 300; display: none; pointer-events: none; background: #fff; border: 1px solid var(--line2); border-radius: 6px; padding: 6px 9px; font-size: 12px; line-height: 1.5; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.pv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px 18px; }
.pv-card { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
@media print {
  header.top, .noprint, .daybar button, .add, .chip .x { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .daygrid { grid-template-columns: 1fr 220px; }
  table.grid th { position: static; }
  .panel { border: 0; padding: 0; }
  .tscroll, .lv-scroll, .matrix-wrap { max-height: none !important; height: auto !important; overflow: visible !important; }
}
/* Fenster lässt sich unten rechts größer ziehen */
.tscroll, .lv-scroll, .matrix-wrap { resize: vertical; }

/* Bearbeitungsmodus der Stammdaten */
.editbar { background: #f3f4f6; border: 1px solid #e3e6eb; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; position: sticky; top: 46px; z-index: 15; } /* klebt unter der Kopfleiste (46px), nicht darüber */
.editbar.active { background: #fff6e0; border-color: var(--warn); }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.plain.locked input, fieldset.plain.locked select, fieldset.plain.locked textarea { background: transparent; border-color: transparent; color: inherit; opacity: 1; }
fieldset.plain.locked button { visibility: hidden; }
table.matrix td.c.locked { cursor: not-allowed; }
table.matrix td.c.locked:hover { background: inherit; }

/* Prio-3-Filter */
.badge.p3 { background: #e6f4ea; color: #1e6b34; margin-left: 4px; font-size: 10px; padding: 0 5px; }
.chip.p3 { background: #e6f4ea; color: #1e6b34; border: 1px dashed #1e6b34; border-radius: 10px; padding: 1px 7px; font-size: 12px; }

/* Auswertung: Werte je Monat */
details.month { border-top: 1px solid var(--line); padding: 6px 0; }
details.month > summary { cursor: pointer; padding: 4px 2px; }
details.month > table { margin-top: 6px; }

/* Vorschau des Teams-Posts (so, wie er eingefügt wird) */
.teams-preview { font-family: "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; }
.teams-preview p { margin: 0 0 12px; }
.teams-preview p:first-child b { font-size: 15px; }

/* Anmeldung, Benutzer */
#userbox { margin-left: auto; display: flex; gap: 10px; align-items: center; white-space: nowrap; font-size: 13px; color: #c9d3e6; }
#userbox a { color: #c9d3e6; text-decoration: none; padding: 6px 8px; border-radius: 5px; }
#userbox a:hover { background: #22324f; color: #fff; }
#userbox a.active { background: #2d4470; color: #fff; }
body.loggedout #menu, body.loggedout #menubtn { display: none !important; }
form.login { max-width: 420px; margin: 40px auto; display: flex; flex-direction: column; gap: 10px; }
.loginrow { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.loginrow input { padding: 7px 8px; font-size: 14px; }
table.perm td.c { text-align: center; }
table.perm td.mod { padding-left: 22px; color: #555; }

/* Personalplan (public/urlaub.js) */
/* Personalplan: Kalender mittig, Tageszellen etwas breiter (Chris 06.10.2026) */
.lv-scroll { overflow: auto; max-width: 100%; max-height: calc(100vh - var(--th-top) - 24px); } /* wie .tscroll */
table.cal.lv td, table.cal.lv th { min-width: 31px; padding: 3px 4px; height: 25px; }
table.cal.lv .lv-name { position: sticky; left: 0; z-index: 2; background: #fff; text-align: left; white-space: nowrap; min-width: 210px; }
table.cal.lv thead th { position: sticky; top: 0; z-index: 3; background: #f7f8fa; }
table.cal.lv thead th.lv-name { z-index: 4; }
table.cal.lv tr.lv-info td { height: 12px; padding: 0; }
/* Summenspalte „UR“ am Ende des Kalenders farblich abgesetzt (Chris 17.11.2026) */
table.cal.lv .lv-sum, table.cal.lv > tbody > tr > td.lv-sum { background: var(--accent-soft); border-left: 2px solid var(--accent); font-weight: 600; color: var(--accent); }
table.cal.lv thead th.lv-sum { background: #d3e2f8; }
table.cal.lv tr.lv-info td.lv-name { font-size: 11px; color: #555; padding: 0 4px; }
/* Schicht-/Teamüberschrift in Personalplan und Dienstplan: mattes Blau mit weißer Schrift, deutliche
   Linie zur Schicht davor (Chris 20.10.2026) */
table.cal.lv tr.lv-team td, table.cal tr.cal-team td, table.grid tr.ab-team td { background: #6d8cba; color: #fff; font-weight: 600; text-align: left; position: sticky; left: 0; padding: 4px 8px; border-top: 3px solid #4d6890; }
/* 3CX Einsatzplanung: breiter und luftiger (Chris 21.10.2026) – Kopf waagerecht in zwei Zeilen (Sprache, Q1/Q2),
   dicke Linie zwischen den Sprachen, je Schichtgruppe eine Überschrift wie im Personalplan */
table.matrix.tel thead th { height: auto; vertical-align: middle; padding: 6px 8px; font-size: 13px; text-align: center; }
table.matrix.tel thead tr:first-child th { height: 31px; box-sizing: border-box; }
table.matrix.tel thead tr:nth-child(2) th { top: 31px; }
table.matrix.tel td.c { width: 58px; min-width: 58px; height: 34px; font-size: 15px; }
table.matrix.tel td.name { padding: 5px 12px; min-width: 190px; }
table.matrix.tel td.ext { padding: 5px 10px; text-align: center; color: #555; }
table.matrix.tel td.note { padding: 5px 10px; min-width: 240px; max-width: 360px; white-space: pre-line; font-size: 12px; }
table.matrix.tel .lsep { border-left: 3px solid var(--line2); }
table.matrix.tel tr.tel-team td { background: #6d8cba; color: #fff; font-weight: 600; text-align: left; padding: 4px 12px; border-top: 3px solid #4d6890; }
table.matrix.tel tr.tel-team td.name { background: #6d8cba; }
/* Besetzung je halbe Stunde (3CX Einsatzplanung) */
table.matrix.tel.cover td.c { width: 30px; min-width: 30px; height: 28px; font-size: 13px; }
table.matrix.tel.cover td.name { min-width: 110px; }
table.matrix.tel.cover thead th { padding: 4px 2px; text-align: center; }
table.matrix.tel.cover thead tr:nth-child(2) th { font-size: 11px; font-weight: 400; }
table.matrix.tel.cover .lsep { border-left: 2px solid var(--line2); }
table.cal td[data-pop] { cursor: pointer; }
table.cal td[data-pop]:hover { outline: 2px solid var(--accent); outline-offset: -2px; } /* Personalplan + Abwesenheiten */
.lv-parent { font-size: 11px; }/* Legende des Personalplans: vier Blöcke nebeneinander (schmal: untereinander) */
/* Sprung aus den Odesos-Hinweisen: Kästchen blinkt kurz auf */
/* deutlich: dicker Rahmen, Leuchten nach außen, pulsiert; dazu Name der Person und Tag im Kopf hervorgehoben */
.lv-flash { position: relative; z-index: 5; outline: 4px solid #e8710a !important; outline-offset: 1px;
  box-shadow: 0 0 0 7px rgba(232, 113, 10, .35), 0 0 18px 6px rgba(232, 113, 10, .55) !important; animation: lv-flash 1s ease-in-out 6; }
@keyframes lv-flash { 50% { outline-color: #ffb066; box-shadow: 0 0 0 3px rgba(232, 113, 10, .2), 0 0 6px 2px rgba(232, 113, 10, .3); } }
.lv-flash-mark { background: #ffe2c2 !important; color: #8a3d00 !important; font-weight: 700; transition: background .4s; }
/* Vergleich „hier ↔ Odesos“ im Fenster eines Eintrags */
.lv-cmp { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; background: #fafbfc; }
.lv-cmp .lv-cmp-head { font-weight: 600; margin-bottom: 4px; }
.lv-cmp table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
.lv-cmp th, .lv-cmp td { padding: 3px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.lv-cmp tr.diff td { background: #fdecea; }
.lv-cmp tr.free td { color: #9aa1ab; }
.lv-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.lv-legend section { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fafbfc; }
.lv-legend h4 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #5b6472; }
.lv-li { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 12px; line-height: 1.2; }
.lv-li .muted { font-size: 11px; }
.lv-sw { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 20px; border-radius: 3px; font-size: 11px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }/* Tagessteuerung: Person rechts angeklickt -> ihre Einteilungen links markiert */
.plancount { display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 8px; font-size: 10px; font-weight: 600; background: var(--accent-soft); color: var(--accent); vertical-align: 1px; }
.plancount.none { background: #f1f2f4; color: #9aa1ab; }
.person.sel { background: #fff3c4; box-shadow: inset 3px 0 0 #f59e0b; border-radius: 4px; }
.chip.hl { background: #ffe58a !important; color: #3d2e00 !important; box-shadow: 0 0 0 2px #f59e0b; font-weight: 700; }
tr.hlrow > td { background: #fffbea; }/* Live-Betrieb: Anwesenheit oben rechts, Hinweise auf Änderungen anderer */
.presence { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #c9d3e6; }
.presence b { color: #ffd479; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ecf6e; box-shadow: 0 0 0 2px rgba(62,207,110,.25); display: inline-block; }
.live-dot.off { background: #e05d5d; box-shadow: 0 0 0 2px rgba(224,93,93,.25); }
.live-notice { position: fixed; left: 16px; bottom: 16px; z-index: 210; max-width: 460px; box-shadow: 0 6px 20px rgba(0,0,0,.15); font-size: 13px; }
.live-notice div + div { margin-top: 3px; opacity: .75; }/* Mitarbeiter: kompakte Liste + Detailfenster */
table.agent-list tr.clickable { cursor: pointer; }
table.agent-list tr.clickable:hover td { background: var(--accent-soft); }
table.agent-list tr.inactive td { color: #9aa1ab; }
table.agent-list td { vertical-align: middle; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 12px; }
.form-section { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0; min-width: 0; }
.form-section legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.form-row { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: center; margin: 5px 0; }
.form-row > label { font-size: 12px; color: #5b6472; }.form-section.wide { grid-column: 1 / -1; }
.form-section .hours { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.form-section .hours input { width: 100%; min-width: 0; }/* Mitarbeiter-Liste: Team-Überschriften deutlich als Gliederung */
table.agent-list tr.team-head td { background: #e3ebf8; border-top: 14px solid var(--panel, #fff); border-left: 4px solid var(--accent); padding: 7px 10px; }
table.agent-list tbody tr.team-head:first-child td { border-top-width: 0; }
table.agent-list .team-name { font-size: 14px; font-weight: 700; color: #1d3a6b; letter-spacing: .02em; text-transform: uppercase; }
table.agent-list .team-count { margin-left: 10px; font-size: 12px; color: #5b6472; }
/* Handbuch (public/handbuch.js) */
.hb-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.hb-toc { position: sticky; top: 56px; max-height: calc(100vh - 70px); overflow: auto; font-size: 13px; padding: 10px 8px; }
.hb-toc-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 8px 6px; }
.hb-toc a { display: flex; gap: 8px; align-items: baseline; color: var(--ink); text-decoration: none; padding: 5px 8px; border-radius: 6px; line-height: 1.35; white-space: normal; }
.hb-toc a:hover { background: #f1f3f6; }
.hb-toc-ch > a { font-weight: 600; }
.hb-toc-no { flex: 0 0 18px; text-align: right; color: var(--muted); font-weight: 400; font-size: 12px; }
.hb-toc-ch.active > a { background: var(--accent-soft); color: var(--accent); }
.hb-toc-ch.active .hb-toc-no { color: var(--accent); }
.hb-toc-secs { margin: 2px 0 6px 25px; border-left: 2px solid var(--line); }
.hb-toc-sec { font-weight: 400; color: #374151; padding: 3px 8px 3px 10px !important; border-radius: 0 6px 6px 0 !important; margin-left: -2px; border-left: 2px solid transparent; }
.hb-toc-sec.active { border-left-color: var(--accent); color: var(--accent); background: transparent; }
.hb-article { font-size: 14px; line-height: 1.6; max-width: 900px; }
.hb-article h1 { font-size: 20px; margin: 0 0 8px; }
.hb-article h2 { font-size: 16px; margin: 22px 0 6px; padding-top: 10px; border-top: 1px solid var(--line); scroll-margin-top: 60px; }
.hb-article h4 { font-size: 14px; margin: 14px 0 4px; }
.hb-article p { margin: 0 0 10px; }
.hb-article ul, .hb-article ol { margin: 0 0 10px; padding-left: 22px; }
.hb-article li { margin-bottom: 3px; }
.hb-go { margin: 0 0 8px; font-size: 13px; }
.hb-ui { background: #eef1f5; border: 1px solid #d0d5dd; border-radius: 4px; padding: 0 5px; font-size: 13px; white-space: nowrap; }
.hb-tip { background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 4px; padding: 8px 10px; margin: 0 0 10px; }
.hb-table { margin: 0 0 10px; }
.hb-results { max-height: 50vh; overflow: auto; }
.hb-hit { display: block; color: inherit; text-decoration: none; padding: 6px 8px; border-radius: 6px; border-bottom: 1px solid var(--line); }
.hb-hit:hover { background: var(--accent-soft); }
mark { background: #ffe58a; color: inherit; padding: 0 1px; border-radius: 2px; }
@media (max-width: 800px) { .hb-layout { grid-template-columns: 1fr; } .hb-toc { position: static; max-height: none; } }
@media print { .hb-layout { display: block; } .hb-toc { display: none; } }

/* Personalplan → Gruppentermine (public/gruppentermine.js) */
.gt-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 16px; align-items: start; }
.gt-field { display: flex; flex-direction: column; gap: 3px; }
.gt-ranges, .gt-weights { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.gt-weights label { display: flex; justify-content: space-between; gap: 8px; width: 100%; }
.gt-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 4px 20px; margin-top: 8px; }
.gt-people h4 { margin: 6px 0 4px; }
.gt-person { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 0; border-bottom: 1px solid var(--line); }
.gt-days { margin-bottom: 10px; }
.gt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.gt-card { border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; background: var(--panel); }
.gt-pool { background: var(--bg); border-style: dashed; }
.gt-chip { padding: 2px 4px; border-radius: 4px; }
.gt-chip:hover { background: var(--accent-soft); }
.gt-chip.no { background: #fde8e8; }
.gt-mark { display: inline-block; min-width: 1.4em; font-weight: 700; }
.gt-sec { font-size: 12px; color: var(--muted); margin: 6px 0 2px; border-bottom: 1px solid var(--line); }
.gt-sec-main { color: var(--ink); font-weight: 600; margin-top: 10px; }
.gt-shift { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 8px; background: var(--chip); font-size: 11px; font-weight: 600; }
.gt-foot { font-size: 12px; margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.gt-days summary { cursor: pointer; margin-bottom: 6px; }
tr.gt-bad td { color: var(--bad); }
.gt-change { margin-left: 6px; padding: 0 5px; border-radius: 8px; background: #fff1e6; color: #b45309; font-size: 11px; font-weight: 600; }
.gt-wizard { min-width: min(560px, 85vw); }
.gt-steps { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.gt-steps span { padding: 2px 10px; border-radius: 12px; background: var(--chip); font-size: 12px; color: var(--muted); }
.gt-steps span.active { background: var(--accent); color: #fff; font-weight: 600; }
.gt-steps span.done { background: var(--accent-soft); color: var(--accent); }
.gt-form-step { grid-template-columns: 1fr; }
/* Übersicht „1. Termin“: Karten über die ganze Breite, ✏ direkt neben der Überschrift */
.gt-sumcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.gt-sumcard { border: 1px solid var(--line2); border-radius: 8px; padding: 8px 12px; background: var(--panel); }
.gt-sumcard.gt-click { cursor: pointer; }
.gt-sumcard.gt-click:hover { border-color: var(--accent); background: var(--accent-soft); }
.gt-sumhead { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.gt-edit-icon { color: var(--accent); font-size: 13px; }
.gt-sumcard dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 3px 10px; font-size: 13px; }
.gt-sumcard dt { color: var(--muted); }
.gt-sumcard dd { margin: 0; font-weight: 500; }
/* Assistent, Schritt Regeln: Beschriftung links, Auswahlfelder gleich breit untereinander */
.gt-rules { display: grid; grid-template-columns: max-content 260px; gap: 8px 14px; align-items: center; }
.gt-rules select { width: 100%; }
/* Auswertung → Einsatztreue: Kanal-Chips nach Ampel (Text immer in Schriftfarbe, Farbe nur als Fläche + Rand) */
.et-chip { display: inline-block; padding: 1px 7px; margin: 1px 4px 1px 0; border: 1px solid; border-radius: 10px; font-size: 12px; white-space: nowrap; color: var(--ink); }
.et-chip b { font-weight: 600; margin-left: 3px; }
.et-green { background: #e2f3e6; border-color: #6dbb83; }
.et-orange { background: #fde6d4; border-color: #e8833f; }
.et-red { background: #fbe0e0; border-color: #d65c5c; }
.et-grey { background: #f0f1f3; border-color: #cfd3d9; color: var(--muted); }
.et-neutral { background: #fff; border-color: #c3c7cf; border-style: dashed; color: var(--muted); }
td.et-cell { vertical-align: top; min-width: 120px; }
td.et-hour { vertical-align: top; min-width: 74px; padding: 3px 4px; }
td.et-hour .et-chip { display: block; margin: 1px 0; text-align: left; }
.et-pct { font-weight: 700; font-size: 15px; }
