/* Lab Management — Erscheinungsbild „hell mit Blau"
   ════════════════════════════════════════════════════════════════
   Eigene Ebene ÜBER style.css (wird danach geladen). Sie legt das
   Grundgerüst fest: Schrift, Farben, Kopfzeile, Seitenleiste mit
   Symbolen, Seitentitel ohne Kopfbild, Knöpfe, Karten, Eingabefelder
   sowie die Übersicht („Heute zu erledigen", Bereichs-Kacheln).

   style.css bleibt unverändert und enthält weiterhin Layout und die
   modul-spezifischen Regeln. Neue Farben und Maße ausschließlich über
   die --t-Tokens unten; die älteren --lab-Tokens werden hier auf die
   neuen Werte umgebogen, damit bestehende Regeln mitziehen.
   ════════════════════════════════════════════════════════════════ */

/* Schriften liegen lokal (kein Abruf bei Dritten). IBM Plex, SIL Open
   Font License — siehe fonts/LICENSE-IBM-Plex.txt. */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600 700; font-style: normal; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500 700; font-style: normal; font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --t-bg: #f5f7fa;
  --t-surface: #ffffff;
  --t-side: #edf1f6;
  --t-line: #dbe2ec;
  --t-fg: #16202e;
  --t-muted: #5a6779;
  --t-faint: #8693a4;
  --t-accent: #1b5fc1;
  --t-accent-hover: #164fa3;
  --t-accent-soft: #e3ecfa;
  --t-on-accent: #ffffff;
  --t-crit: #b3261e;
  --t-crit-soft: #fbe9e6;
  --t-warn: #8a5a00;
  --t-warn-soft: #faefd6;
  --t-ok: #1f6f3d;
  --t-ok-soft: #e2f2e7;
  --t-radius: 8px;
  --t-sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --t-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  /* Ältere Tokens aus style.css auf das neue Erscheinungsbild umbiegen. */
  --lab-accent: var(--t-accent);
  --lab-canvas: var(--t-bg);
  --lab-surface: var(--t-surface);
  --lab-border: var(--t-line);
  --lab-text: var(--t-fg);
  --lab-text-muted: var(--t-muted);
  --lab-radius-sm: 6px;
  --lab-radius-md: var(--t-radius);
  --lab-radius-lg: var(--t-radius);
  --lab-shadow-card: none;
  --lab-shadow-md: 0 4px 14px rgba(22, 32, 46, .08);

  /* Symbole (Strichzeichnungen) als Masken — eingefärbt über currentColor. */
  --ico-home: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11l8-7 8 7v8a1 1 0 0 1-1 1h-4v-6h-6v6H5a1 1 0 0 1-1-1z'/%3E%3C/svg%3E");
  --ico-alarm: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l9 16H3z'/%3E%3Cpath d='M12 10v4M12 17v.5'/%3E%3C/svg%3E");
  --ico-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E");
  --ico-flask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 3h6M10 3v6l-5 9a2 2 0 0 0 1.8 3h10.4A2 2 0 0 0 19 18l-5-9V3'/%3E%3Cpath d='M7.5 15h9'/%3E%3C/svg%3E");
  --ico-chart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V4M4 20h16M8 16v-4M12 16V8M16 16v-6'/%3E%3C/svg%3E");
  --ico-rocket: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3c3 2 5 5.5 5 9l-2 4H9l-2-4c0-3.5 2-7 5-9z'/%3E%3Ccircle cx='12' cy='10' r='1.6'/%3E%3Cpath d='M10 19l2 2 2-2'/%3E%3C/svg%3E");
  --ico-chamber: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='6' cy='12' rx='3' ry='7'/%3E%3Cpath d='M6 5h12c1.7 0 3 3.1 3 7s-1.300 7-3 7H6'/%3E%3Cpath d='M12 5v14'/%3E%3C/svg%3E");
  --ico-people: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='9' r='3.2'/%3E%3Cpath d='M3 20c0-3.3 2.7-5.5 6-5.5s6 2.2 6 5.5M16 6.2a3 3 0 0 1 0 5.6M18 14.8c1.9.7 3 2.4 3 5.2'/%3E%3C/svg%3E");
  --ico-cap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 9l10-5 10 5-10 5z'/%3E%3Cpath d='M6 11.5V16c1.5 1.6 3.6 2.5 6 2.5s4.5-.9 6-2.5v-4.5'/%3E%3C/svg%3E");
  --ico-folder: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7a1 1 0 0 1 1-1h5l2 2.500h8a1 1 0 0 1 1 1V18a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E");
  --ico-person: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='9' cy='11' r='2.200'/%3E%3Cpath d='M5.500 16c.6-1.600 1.900-2.400 3.500-2.400s2.900.8 3.500 2.400M15 10h3.500M15 13.500h3.500'/%3E%3C/svg%3E");
  --ico-cal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='15' rx='2'/%3E%3Cpath d='M4 10h16M8 3v4M16 3v4'/%3E%3C/svg%3E");
  --ico-book: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h11a3 3 0 0 1 3 3v13H8a3 3 0 0 1-3-3z'/%3E%3Cpath d='M5 17a3 3 0 0 1 3-3h11'/%3E%3C/svg%3E");
  --ico-gear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M5.6 18.4l2.1-2.1M16.3 7.7l2.1-2.1'/%3E%3C/svg%3E");
  --ico-camera: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l1.5-2.5h7L17 8h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E");
  --ico-clip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11.5l-8.2 8.2a5 5 0 0 1-7-7l8.500-8.500a3.300 3.300 0 0 1 4.700 4.700l-8.400 8.400a1.700 1.700 0 0 1-2.400-2.400l7.600-7.600'/%3E%3C/svg%3E");
  --ico-moon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 14.5A8 8 0 0 1 9.500 4a8 8 0 1 0 10.500 10.500z'/%3E%3C/svg%3E");
  --ico-sun: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2.500v2.500M12 19v2.500M2.500 12H5M19 12h2.500M5.300 5.300l1.800 1.800M16.900 16.900l1.800 1.800M5.300 18.700l1.800-1.800M16.900 7.100l1.800-1.800'/%3E%3C/svg%3E");
  --ico-pulse: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h4l2.5-6 4 12 2.5-6h5'/%3E%3C/svg%3E");
}

/* ── Grundfläche und Schrift ───────────────────────────────────── */
body {
  font-family: var(--t-sans);
  color: var(--t-fg);
  background: var(--t-bg);
}
button, input, select, textarea { font-family: inherit; }
code, .mono { font-family: var(--t-mono); }

/* ── Kopfzeile: hell, mit feiner Kante ─────────────────────────── */
body > header {
  background: var(--t-surface);
  color: var(--t-fg);
  box-shadow: none;
  border-bottom: 1px solid var(--t-line);
}
body > header h1 { color: var(--t-fg); font-weight: 600; letter-spacing: -.005em; }
.header-org { color: var(--t-muted); border-left-color: var(--t-line); }
#auth-user-display { color: var(--t-muted) !important; }   /* trägt eine Inline-Farbe */
.btn.btn-logout, .btn.btn-logout:hover:not(:disabled) {
  background: var(--t-surface); color: var(--t-fg); border: 1px solid var(--t-line);
  font-size: 13px; padding: 5px 12px;
}
.btn.btn-logout:hover:not(:disabled) { background: var(--t-bg); }
.search-wrap input[type="search"] {
  background: var(--t-bg); color: var(--t-fg);
  border: 1px solid var(--t-line); border-radius: var(--t-radius);
  padding: 8px 12px; font-size: 14px;
}
.search-wrap input::placeholder { color: var(--t-faint); }
.search-wrap input[type="search"]:focus {
  background: var(--t-surface); color: var(--t-fg);
  outline: 2px solid var(--t-accent); outline-offset: -1px;
}
.search-wrap input[type="search"]:focus::placeholder { color: var(--t-faint); }

/* ── Navigation: helle Fläche, Symbole, ruhiger Aktiv-Zustand ──── */
.tab-bar { background: var(--t-side); }
.tab-bar > .tab-entry,
.tab-bar .nav-group-toggle { color: var(--t-muted); font-weight: 500; }
.tab-bar > .tab-entry:hover,
.tab-bar .nav-group-toggle:hover { color: var(--t-fg); }
.tab-bar .nav-caret { color: var(--t-muted); }
.tab-bar .nav-caret:hover { color: var(--t-fg); background: var(--t-surface); }
.tab-bar > .tab-entry.active,
.tab-bar .nav-group-toggle.active { color: var(--t-accent); border-bottom-color: var(--t-accent); }
.tab-bar > .tab-entry.tab-emergency,
.tab-bar > .tab-entry.tab-emergency:hover { color: var(--t-crit); }
.tab-bar .nav-dropdown {
  background: var(--t-surface); border: 1px solid var(--t-line); border-top: 0;
  box-shadow: var(--lab-shadow-md);
}
.tab-bar .nav-dropdown button { color: var(--t-muted); }
.tab-bar .nav-dropdown button:hover { background: var(--t-bg); color: var(--t-fg); }
.tab-bar .nav-dropdown button.active {
  background: var(--t-accent-soft); color: var(--t-accent); font-weight: 600;
}
.tab-badge { background: var(--t-crit); color: #fff; }

/* Symbol vor Einzel-Reitern und Gruppen. */
.tab-bar > .tab-entry::before,
.tab-bar .nav-group-toggle::before {
  content: ""; flex: 0 0 auto; width: 18px; height: 18px;
  background: currentColor; border-radius: 0; box-shadow: none;
  -webkit-mask: var(--ico, var(--ico-home)) center / contain no-repeat;
          mask: var(--ico, var(--ico-home)) center / contain no-repeat;
}
.tab-entry[data-module="dashboard"] { --ico: var(--ico-home); }
.tab-entry[data-module="emergency"] { --ico: var(--ico-alarm); }
.tab-entry[data-module="deadlines"] { --ico: var(--ico-clock); }
.tab-entry[data-module="teaching"]  { --ico: var(--ico-people); }
.tab-entry[data-module="student_works"] { --ico: var(--ico-cap); }
.tab-entry[data-module="projects"]  { --ico: var(--ico-folder); }
.nav-group-toggle[data-group="labor"]      { --ico: var(--ico-flask); }
.nav-group-toggle[data-group="kampagnen"]  { --ico: var(--ico-chart); }
.nav-group-toggle[data-group="thruster"]   { --ico: var(--ico-rocket); }
.nav-group-toggle[data-group="anlagen"]    { --ico: var(--ico-chamber); }
.nav-group-toggle[data-group="betrieb"]    { --ico: var(--ico-cal); }
.nav-group-toggle[data-group="dokumente"]  { --ico: var(--ico-book); }
.nav-group-toggle[data-group="personen"]   { --ico: var(--ico-person); }
.nav-group-toggle[data-group="verwaltung"] { --ico: var(--ico-gear); }
.nav-group-toggle[data-group="system"]     { --ico: var(--ico-pulse); }

@media (min-width: 901px) {
  .app-shell > .app-sidebar { background: var(--t-side); border-right: 1px solid var(--t-line); }
  .app-shell .tab-bar {
    background: var(--t-side); box-shadow: none; border-right: none;
    padding: 16px 10px 20px; gap: 2px;
  }
  .app-shell .tab-bar > .tab-entry,
  .app-shell .tab-bar .nav-group-toggle,
  .app-shell .tab-bar > .tab-entry.tab-entry-area:not(.active) {
    font-size: 14.5px; font-weight: 500; color: var(--t-muted);
    text-transform: none; letter-spacing: 0;
    padding: 8px 10px; gap: 10px;
    border-left: 0; border-radius: 6px;
  }
  .app-shell .tab-bar > .tab-entry:hover,
  .app-shell .tab-bar .nav-group-toggle:hover { background: var(--t-surface); color: var(--t-fg); }
  .app-shell .tab-bar > .tab-entry.active {
    background: var(--t-surface); color: var(--t-accent); font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--t-line);
  }
  .app-shell .tab-bar .nav-group-toggle.active { color: var(--t-fg); font-weight: 600; }
  .app-shell .tab-bar > .tab-entry.tab-emergency,
  .app-shell .tab-bar > .tab-entry.tab-emergency:hover { color: var(--t-crit); }
  /* Die Symbol-Regel oben gilt auch hier; die Punktmarker aus style.css
     (eigener Hintergrund/Schatten je Zustand) werden damit ersetzt. */
  .app-shell .tab-bar > .tab-entry::before,
  .app-shell .tab-bar > .tab-entry.active::before,
  .app-shell .tab-bar > .tab-entry.tab-emergency::before,
  .app-shell .tab-bar > .tab-entry.tab-entry-area::before {
    display: block; width: 18px; height: 18px; border-radius: 0;
    background: currentColor; box-shadow: none;
  }
  .app-shell .tab-bar .nav-group:first-of-type { border-top-color: var(--t-line); }
  .app-shell .tab-bar .nav-caret { opacity: .55; }
  .app-shell .tab-bar .nav-caret:hover { opacity: 1; }
  .app-shell .tab-bar .nav-group-head { width: 100%; }
  .app-shell .tab-bar .nav-group-head .nav-group-toggle { width: auto; flex: 1 1 auto; }
  .app-shell .tab-bar .nav-dropdown {
    margin-left: 18px; padding-left: 8px; border: 0;
    border-left: 1px solid var(--t-line); box-shadow: none; background: transparent;
  }
  .app-shell .tab-bar .nav-dropdown button {
    font-size: 14px; color: var(--t-muted); padding: 6px 10px;
    border-left: 0; border-radius: 6px;
  }
  .app-shell .tab-bar .nav-dropdown button:hover { background: var(--t-surface); color: var(--t-fg); }
  .app-shell .tab-bar .nav-dropdown button.active {
    background: var(--t-surface); color: var(--t-accent); font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--t-line);
  }
  .app-shell .tab-bar .sidebar-foot { border-top-color: var(--t-line); }
  .app-shell .tab-bar .sidebar-foot:hover { background: var(--t-surface); }
  .sidebar-foot-brand { color: var(--t-fg); }
  .sidebar-foot-role, .sidebar-foot-hint { color: var(--t-muted); }
}

/* ── Seitentitel: schlichte Überschrift statt Kopfbild ─────────── */
.page-hero {
  background: none; box-shadow: none; border-radius: 0; color: var(--t-fg);
  padding: 2px 0 0; margin: 0 0 22px; overflow: visible;
}
.page-hero::before { display: none; }
.page-hero-title { color: var(--t-fg); font-size: 27px; font-weight: 600; letter-spacing: -.01em; }
.page-hero-sub { color: var(--t-muted); font-size: 14.5px; margin-top: 4px; }

/* ── Bausteine ─────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--t-line); border-radius: var(--t-radius); box-shadow: none;
}
.btn {
  background: var(--t-accent); color: var(--t-on-accent);
  border-radius: var(--t-radius); box-shadow: none;
  font-size: 14px; font-weight: 500; padding: 7px 14px;
}
.btn:hover:not(:disabled) { background: var(--t-accent-hover); box-shadow: none; }
/* Grün war die Hauptaktion — sie trägt jetzt die Akzentfarbe. */
.btn-green { background: var(--t-accent); }
.btn-green:hover:not(:disabled) { background: var(--t-accent-hover); }
.btn-red { background: var(--t-crit); }
.btn-red:hover:not(:disabled) { background: #96201a; }
.btn-outline { background: var(--t-surface); color: var(--t-fg); border: 1px solid var(--t-line); }
.btn-outline:hover:not(:disabled) { background: var(--t-bg); }
.btn-small, .btn-sm { font-size: 13px; padding: 4px 10px; }
.btn:focus-visible, .tab-bar button:focus-visible, .dash-area:focus-visible {
  outline: 2px solid var(--t-accent); outline-offset: 2px;
}
main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
main select, main textarea {
  border-color: var(--t-line); border-radius: var(--t-radius);
}
main input:focus, main select:focus, main textarea:focus {
  outline: 2px solid var(--t-accent); outline-offset: -1px; border-color: var(--t-accent);
}
.item-row { border-bottom-color: var(--t-line); }
.item-row:hover { background: var(--t-bg); }
.field-hint, .list-count { color: var(--t-muted); }

/* Abschnittsüberschrift ohne Kasten. */
.sec-label {
  font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--t-muted); margin: 0 0 10px;
}

/* Zustands-Pillen (gemeinsam für Übersicht, Fristen, Veranstaltungen). */
.dl-state-overdue, .t-pill-crit { background: var(--t-crit-soft); color: var(--t-crit); }
.dl-state-due_soon, .t-pill-warn { background: var(--t-warn-soft); color: var(--t-warn); }
.dl-state-on_track, .t-pill-ok { background: var(--t-ok-soft); color: var(--t-ok); }
.dl-state-no_deadline, .t-pill-none { background: var(--t-side); color: var(--t-muted); }

/* ── Übersicht: „Heute zu erledigen" ───────────────────────────── */
.today { margin: 0 0 28px; }
.today-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.today-head .sec-label { margin: 0; }
.today-head .btn { margin-left: auto; }
.today-form {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--t-surface); border: 1px solid var(--t-line);
  border-radius: var(--t-radius); padding: 12px; margin-bottom: 10px;
}
.today-form input { padding: 8px 10px; border: 1px solid var(--t-line); font-size: 14.5px; background: var(--t-surface); }
.today-form input[type="text"] { flex: 1 1 200px; min-width: 0; }
.today-form select {
  padding: 8px 10px; border: 1px solid var(--t-line); font-size: 14.5px;
  background: var(--t-surface); color: var(--t-fg); max-width: 100%;
}
.today-form-pick {
  padding: 8px 10px; border: 1px solid var(--t-line); font: inherit; font-size: 14.5px;
  background: var(--t-surface); color: var(--t-fg); cursor: pointer; text-align: left;
  flex: 0 1 260px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.today-form-roles {
  flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px 16px;
  border: 0; margin: 0; padding: 4px 0 0; font-size: 14.5px;
}
.today-form-roles legend { padding: 0; margin-bottom: 4px; color: var(--t-muted); font-size: 14px; }
.today-form-roles label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.today-form-roles input { padding: 0; }
.today-list {
  background: var(--t-surface); border: 1px solid var(--t-line); border-radius: var(--t-radius);
}
.today-group-label {
  font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--t-faint); padding: 10px 16px 4px;
}
.today-group + .today-group { border-top: 1px solid var(--t-line); }
.today-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  padding: 10px 16px; cursor: pointer; font-size: 15px;
}
.today-row:hover, .today-row:focus-visible { background: var(--t-bg); outline: none; }
.today-row.today-task { cursor: default; }
.today-check { width: 17px; height: 17px; margin: 0; cursor: pointer; accent-color: var(--t-accent); }
.t-pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 2px 10px;
}
.t-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.today-what { font-weight: 500; color: var(--t-fg); }
button.today-edit {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 500;
  color: var(--t-fg); cursor: pointer; text-align: left;
}
button.today-edit:hover, button.today-edit:focus-visible {
  color: var(--t-accent); text-decoration: underline;
}
.today-where { color: var(--t-muted); font-size: 14px; }
.today-due {
  margin-left: auto; font-weight: 500; font-size: 14.5px; white-space: nowrap;
  font-variant-numeric: tabular-nums; color: var(--t-muted);
}
.today-due.is-crit { color: var(--t-crit); }
.today-due.is-warn { color: var(--t-warn); }
.today-del {
  background: none; border: 0; color: var(--t-faint); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 0 4px;
}
.today-del:hover { color: var(--t-crit); }
.today-empty { padding: 18px 16px; color: var(--t-muted); }
.today-later > summary {
  cursor: pointer; list-style: none; padding: 10px 16px; color: var(--t-accent); font-size: 14px;
}
.today-later > summary::-webkit-details-marker { display: none; }

/* ── Übersicht: Jumbo kompakt ──────────────────────────────────── */
.dash-jumbo { margin: 0 0 28px; }
.dash-jumbo-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.dash-jumbo-head .sec-label { margin: 0; }
.dash-jumbo-updated { color: var(--t-muted); font-size: 13px; }
.dash-jumbo-head .btn { margin-left: auto; }
.dash-jumbo-charts {
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.dash-jumbo-chart { padding: 10px 12px 8px; }
.dash-jumbo-chart .msm-chart-title { font-size: 13px; margin-bottom: 4px; }
.dash-jumbo-chart .msm-chart-svg { max-height: 170px; }
.msm-legend-compact { gap: 4px 12px; margin-top: 4px; font-size: 11.5px; }
.msm-legend-compact .msm-legend-item { max-width: 190px; }

/* ── Übersicht: Bereichs-Kacheln ───────────────────────────────── */
.dash-areas { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; margin-bottom: 28px; }
.dash-area {
  border: 1px solid var(--t-line); border-radius: var(--t-radius);
  padding: 15px 16px; gap: 6px; color: var(--t-fg);
}
.dash-area::before { display: none; }           /* kein Akzentbalken mehr */
.dash-area:hover, .dash-area:focus-visible { box-shadow: none; border-color: var(--t-accent); }
.dash-area-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 16.5px; font-weight: 600; color: var(--t-fg);
}
.dash-area-title::before {
  content: ""; flex: 0 0 auto; width: 18px; height: 18px; background: var(--t-accent);
  -webkit-mask: var(--ico, var(--ico-home)) center / contain no-repeat;
          mask: var(--ico, var(--ico-home)) center / contain no-repeat;
}
.dash-area[data-area="labor"]     { --ico: var(--ico-flask); }
.dash-area[data-area="kampagnen"] { --ico: var(--ico-chart); }
.dash-area[data-area="thruster"]  { --ico: var(--ico-rocket); }
.dash-area[data-area="teaching"]  { --ico: var(--ico-people); }
.dash-area[data-area="student_works"] { --ico: var(--ico-cap); }
.dash-area[data-area="projects"]  { --ico: var(--ico-folder); }
.dash-area[data-area="betrieb"]   { --ico: var(--ico-cal); }
.dash-area[data-area="dokumente"] { --ico: var(--ico-book); }
.dash-area[data-area="personen"]  { --ico: var(--ico-person); }
.dash-area-sub { display: none; }               /* Kennzahl genügt; Text steht in der Leiste */
.dash-area-stat { font-size: 14px; font-weight: 400; color: var(--t-muted); margin-top: 2px; }
.dash-area-alert .dash-area-stat { color: var(--t-crit); font-weight: 500; }

/* Bereichsseiten (area.js): dieselben Kacheln, aber hier erklärt die
   Kurzbeschreibung die Unterseite; ohne Symbol, leere Kennzahl entfällt. */
.area-page .dash-area-title::before { display: none; }
.area-page .dash-area-sub { display: block; color: var(--t-muted); font-size: 14px; }
.area-page .dash-area-stat:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  .dash-area, .btn { transition: none; }
}

/* ── Gemeinsame Bausteine der Module ───────────────────────────────
   Wirken auf alle Listen-, Detail- und Formularseiten zugleich. */

/* Leiste: die Gruppe des aktiven Moduls nur durch Schrift hervorheben —
   den Kasten trägt allein der aktive Unterpunkt. */
@media (min-width: 901px) {
  .app-shell .tab-bar .nav-group-toggle.active {
    background: transparent; border-left-color: transparent; box-shadow: none;
  }
  .app-shell .tab-bar .nav-group-toggle.active:hover { background: var(--t-surface); }
}

/* Filterkacheln (Geräte, Arbeiten, Fristen …): „Alle" ist keine dunkle
   Fläche mehr; die gewählte Kachel trägt den Akzent. */
.dev-tile, .swk-tile {
  background: var(--t-surface); border: 1px solid var(--t-line);
  border-radius: var(--t-radius); box-shadow: none;
}
.dev-tile:hover, .swk-tile:hover { border-color: var(--t-accent); box-shadow: none; transform: none; }
.dev-tile-all, .swk-tile[data-tile="all"],
.dev-tile-all.active, .swk-tile[data-tile="all"].swk-tile-active { background: var(--t-surface); }
.dev-tile-all .dev-tile-count, .swk-tile[data-tile="all"] .swk-tile-count { color: var(--t-fg); }
.dev-tile-all .dev-tile-label, .swk-tile[data-tile="all"] .swk-tile-label { color: var(--t-muted); }
.dev-tile.active, .dev-tile-all.active,
.swk-tile-active, .swk-tile[data-tile="all"].swk-tile-active {
  background: var(--t-accent-soft); border-color: var(--t-accent);
  box-shadow: inset 0 0 0 1px var(--t-accent);
}
.dev-tile-count, .swk-tile-count {
  color: var(--t-fg); font-weight: 600; font-variant-numeric: tabular-nums;
}
.dev-tile-label, .swk-tile-label { color: var(--t-muted); font-size: 13px; }
.dl-tile[data-tile="overdue"] .swk-tile-count { color: var(--t-crit); }
.dl-tile[data-tile="due_soon"] .swk-tile-count { color: var(--t-warn); }
.dl-tile[data-tile="on_track"] .swk-tile-count { color: var(--t-ok); }
.dl-tile[data-tile="no_deadline"] .swk-tile-count { color: var(--t-muted); }

/* Schnellfilter-Pillen. */
.swk-quick { border-color: var(--t-line); color: var(--t-muted); background: var(--t-surface); }
.swk-quick:hover { border-color: var(--t-accent); color: var(--t-fg); }
.swk-quick-active, .swk-quick-active:hover {
  background: var(--t-accent); border-color: var(--t-accent); color: var(--t-on-accent);
}
.dash-quickaction-primary, .dash-quickaction-primary:hover {
  background: var(--t-accent); border-color: var(--t-accent); color: var(--t-on-accent);
}

/* Statusmarken: Pillenform, Farben aus den Tokens. */
.item-badge, .swk-badge { border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 600; }
.status-active, .swk-status-active { background: var(--t-ok-soft); color: var(--t-ok); }
.status-inactive, .swk-overdue { background: var(--t-crit-soft); color: var(--t-crit); border: 0; }
.swk-type-badge { background: var(--t-accent-soft); color: var(--t-accent); }
.swk-status-planned, .swk-status-completed { background: var(--t-side); color: var(--t-muted); }

/* Tabellen: ruhiger Kopf, klare Zeilen. */
.dev-table thead th, .dl-table th, .audit-table th {
  background: transparent; color: var(--t-muted); border-bottom: 1px solid var(--t-line);
  font-size: 12px; font-weight: 600; letter-spacing: .05em;
}
.dev-table tbody td, .dl-table td { border-bottom-color: var(--t-line); font-size: 14.5px; }
.dev-table tbody tr.dev-trow:hover, .dl-row:hover, .dl-row:focus { background: var(--t-bg); }
.dev-table th.dev-th-sort:hover { background: var(--t-bg); color: var(--t-fg); }
.dev-table th.dev-th-active { color: var(--t-accent); }

/* Detail- und Formularseiten. */
.detail-title { font-size: 21px; font-weight: 600; color: var(--t-fg); }
.detail-grid, .form-grid { font-size: 14.5px; }
.form-grid label { color: var(--t-muted); font-weight: 500; }
.swk-section-head { color: var(--t-fg); border-bottom-color: var(--t-line); }
.dash-card-title { color: var(--t-fg); }
.dash-card-title::before { background: var(--t-accent); }
.msg { color: var(--t-muted); }
.form-error { color: var(--t-crit); }
.toast-ok { background: var(--t-ok); }
.toast-err { background: var(--t-crit); }

/* ── Symbole im Text (ersetzen die früheren Emoji) ──────────────── */
.t-ico {
  display: inline-block; width: 1.15em; height: 1.15em; flex: 0 0 auto;
  vertical-align: -0.2em; margin-right: 6px; background: currentColor;
  -webkit-mask: var(--ico, var(--ico-home)) center / contain no-repeat;
          mask: var(--ico, var(--ico-home)) center / contain no-repeat;
}
.t-ico-camera { --ico: var(--ico-camera); }
.t-ico-cal { --ico: var(--ico-cal); }
.t-ico-clip { --ico: var(--ico-clip); }
.dev-photo-ph-icon.t-ico { width: 34px; height: 34px; margin: 0; color: var(--t-faint); }
.fc-dropzone-icon.t-ico { width: 20px; height: 20px; color: var(--t-muted); }
/* Leer-, Lade- und Fehlerzustände kommen ohne Bildchen aus. */
.msg-icon { display: none; }

/* ── Umschalter Hell / Dunkel in der Kopfzeile ──────────────────── */
.theme-toggle {
  width: 32px; height: 32px; padding: 0; cursor: pointer; flex: 0 0 auto;
  background: var(--t-surface); color: var(--t-muted);
  border: 1px solid var(--t-line); border-radius: var(--t-radius);
  display: inline-grid; place-items: center;
}
.theme-toggle:hover { color: var(--t-fg); background: var(--t-bg); }
.theme-toggle::before {
  content: ""; width: 17px; height: 17px; background: currentColor;
  -webkit-mask: var(--ico-moon) center / contain no-repeat;
          mask: var(--ico-moon) center / contain no-repeat;
}
:root[data-theme="dark"] .theme-toggle::before {
  -webkit-mask-image: var(--ico-sun); mask-image: var(--ico-sun);
}

/* ── Bibliothek der abgegebenen Arbeiten ─────────────────────────── */
.swk-lib-item { padding: 14px 4px; border-bottom: 1px solid var(--t-line); }
.swk-lib-item:last-child { border-bottom: 0; }
.swk-lib-title { font-size: 16.5px; font-weight: 600; color: var(--t-fg); }
.swk-lib-author { font-size: 15px; color: var(--t-fg); margin-top: 2px; }
.swk-lib-meta { font-size: 13.5px; color: var(--t-muted); margin-top: 2px; }
.swk-lib-summary { font-size: 14.5px; color: var(--t-muted); margin-top: 8px; max-width: 80ch; }
.swk-lib-docs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.swk-lib-doc { text-decoration: none; }

/* ── Rollen-Editor in der Benutzerverwaltung ─────────────────────── */
.usr-roles-group { margin-top: 14px; }
.usr-roles-group-title {
  font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--t-muted);
}

/* ── Arbeiten: Konto-Verknüpfung und „Meine Arbeit" ──────────────── */
.form-grid .swk-link-hint { margin-top: 4px; }
.form-grid .swk-link-hint.swk-link-on { color: var(--t-fg); }
.swk-reviewer-row { display: flex; gap: 8px; align-items: center; }
.swk-reviewer-row select { flex: 1; min-width: 0; }
.swk-rev-table { width: 100%; border-collapse: collapse; }
.swk-rev-table th, .swk-rev-table td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--t-line); }
.swk-rev-table th { font-weight: 600; color: var(--t-muted); }
.swk-rev-inactive td { color: var(--t-muted); }
.swk-rev-address { white-space: pre-line; }
/* ── Systemstatus: Aktionen in einer Karte ───────────────────────── */
.sys-card-actions { margin-top: 12px; }
/* ── Anmeldung: „Passwort vergessen" ─────────────────────────────── */
.login-link { display: block; text-align: center; margin-top: 4px; font-size: 13.5px; color: var(--t-accent); text-decoration: none; }
.login-link:hover { text-decoration: underline; }
.login-title { text-align: center; color: var(--t-fg); margin: 0 0 8px; font-size: 20px; }
.login-sub { text-align: center; color: var(--t-muted); font-size: 13.5px; margin: 0 0 16px; }
.login-note { font-size: 14px; color: var(--t-fg); padding: 8px 0; }
.myroles-mail { grid-template-columns: 150px minmax(0, 1fr); margin-top: 8px; }
/* ── Buchungen: Anlagenverantwortliche ───────────────────────────── */
.bk-resp-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; margin: 10px 0 4px; }
.bk-resp-options label { display: flex; align-items: center; gap: 6px; font-size: 14.5px; }
/* ── Personen: Team ──────────────────────────────────────────────── */
.team-group { margin-bottom: 16px; }
.team-table { table-layout: fixed; }
.team-table td { overflow-wrap: anywhere; }
.team-table th:nth-child(1) { width: 24%; }
.team-table th:nth-child(2) { width: 20%; }
.team-table th:nth-child(3) { width: 9%; }
.team-table th:nth-child(4) { width: 16%; }
.team-table th:nth-child(5) { width: 19%; }
.team-table td:nth-child(4), .team-table td:last-child { overflow-wrap: normal; white-space: nowrap; }
.team-table td:last-child { text-align: right; }
.swk-own { margin-bottom: 16px; }
.swk-own-item + .swk-own-item { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--t-line); }
.swk-own-deadline { margin-top: 8px; font-size: 14.5px; color: var(--t-fg); }
/* ── Sicherheit (nur Super-Administrator) ────────────────────────── */
.sec-periods { display: inline-flex; border: 1px solid var(--t-line); border-radius: var(--t-radius); overflow: hidden; }
.sec-period { border: 0; border-left: 1px solid var(--t-line); background: var(--t-surface); color: var(--t-fg); padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.sec-period:first-child { border-left: 0; }
.sec-period:hover { background: var(--t-bg); }
.sec-period.active { background: var(--t-accent); color: var(--t-on-accent); }
.sec-verdict { border: 1px solid var(--t-line); border-left-width: 4px; border-radius: var(--t-radius); background: var(--t-surface); color: var(--t-fg); padding: 12px 16px; margin-bottom: 18px; }
.sec-verdict-ok { border-left-color: var(--t-ok); }
.sec-verdict-warn { border-left-color: var(--t-warn); background: var(--t-warn-soft); }
.sec-verdict-title { font-weight: 600; }
.sec-verdict ul { margin: 6px 0 0; padding-left: 20px; font-size: 14.5px; }
.sec-block { margin-bottom: 26px; }
.sec-block-head { font-size: 17px; font-weight: 600; color: var(--t-fg); margin: 0 0 4px; }
.sec-block-note { font-size: 13.5px; color: var(--t-muted); margin: 0 0 12px; max-width: 110ch; }
.sec-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; }
.sec-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sec-table th, .sec-table td { padding: 5px 8px 5px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--t-line); color: var(--t-fg); }
.sec-table tr:last-child td { border-bottom: 0; }
.sec-table th { font-weight: 600; color: var(--t-muted); }
.sec-table .sec-num { text-align: right; padding-right: 0; padding-left: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sec-table td.sec-value { font-family: var(--t-mono); font-size: 12.5px; overflow-wrap: anywhere; word-break: break-all; }
.sec-table td.sec-flag { color: var(--t-warn); font-weight: 600; }
.sec-table td.sec-geo { overflow-wrap: anywhere; }
.sec-table td.sec-value { min-width: 9ch; }
.sec-geo-note { font-size: 13.5px; color: var(--t-muted); margin: 0 0 18px; max-width: 110ch; }
.sec-geo-note a { color: var(--t-accent); }
.sec-geo-note code { font-family: var(--t-mono); font-size: 12.5px; color: var(--t-fg); overflow-wrap: anywhere; }
.sec-geo-note-missing { color: var(--t-warn); }
.sec-empty { color: var(--t-muted); font-size: 13.5px; }
.sec-unavailable { color: var(--t-warn); overflow-wrap: anywhere; }
.sec-grid .sys-stat-label { flex: 0 1 auto; }
.sec-card-server { grid-column: 1 / -1; max-width: 680px; }
#sec-thresholds { max-width: 110ch; }
@media (max-width: 600px) { .sec-grid { grid-template-columns: 1fr; } }

/* ── Testanlagen (facility_tech.js) ───────────────────────────── */
.ftc-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin: 12px 0 16px; border-bottom: 1px solid var(--t-line); }
.ftc-tab { padding: 8px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--t-muted); font: inherit; font-size: 14px; cursor: pointer; }
.ftc-tab:hover { color: var(--t-fg); }
.ftc-tab.active { border-bottom-color: var(--t-accent); color: var(--t-accent); font-weight: 600; }
.ftc-scroll { overflow-x: auto; }
.ftc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ftc-table th, .ftc-table td { padding: 8px 10px; border-bottom: 1px solid var(--t-line); text-align: left; vertical-align: top; }
.ftc-table thead th { color: var(--t-muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ftc-table tbody th { font-weight: 600; }
.ftc-table-click tbody tr { cursor: pointer; }
.ftc-table-click tbody tr:hover { background: var(--t-accent-soft); }
.ftc-form-table input, .ftc-form-table select, .ftc-form-table textarea { width: 100%; min-width: 110px; box-sizing: border-box; }
.ftc-form-table .ftc-unit { margin-top: 4px; }
.ftc-muted { color: var(--t-muted); font-weight: 400; }
.ftc-note { margin-top: 2px; font-size: 12px; }
.ftc-kind { display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--t-accent-soft); color: var(--t-accent); font-size: 11px; white-space: nowrap; }
.ftc-kind-measured { background: var(--t-ok-soft); color: var(--t-ok); }
.ftc-kind-estimated { background: var(--t-warn-soft); color: var(--t-warn); }
.ftc-block-title { margin: 22px 0 8px; font-size: 16px; }
.ftc-subform { margin-top: 16px; padding: 14px; border: 1px solid var(--t-line); border-radius: var(--t-radius); }
.ftc-subform h4 { margin: 0 0 10px; }
.ftc-actions { white-space: nowrap; }
.ftc-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.ftc-inline label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.ftc-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; margin-bottom: 10px; }
.ftc-checks label { display: flex; align-items: center; gap: 6px; }
.ftc-old { opacity: .7; }
.ftc-check { display: flex; align-items: center; gap: 6px; }
.ftc-state { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 4px; background: var(--t-warn-soft); color: var(--t-warn); font-size: 11px; font-weight: 500; white-space: nowrap; vertical-align: middle; }
.ftc-state-off { background: var(--t-crit-soft); color: var(--t-crit); }
