/* ==========================================================================
   style.css – Globales Stylesheet für das Urlaubsmanagementsystem
   Optimiert für Tablets, nutzbar auf Smartphone und Desktop.
   ========================================================================== */

/* Verhindert Flash of Uncompiled Content (FOUC) bei Vue-Templates */
[v-cloak] { display: none; }

/* --------------------------------------------------------------------------
   CSS-Variablen (Design-Token) – hier Farben/Abstände zentral anpassen
   -------------------------------------------------------------------------- */
:root {
  --farbe-primaer:    #8D1336;   /* Dunkelrot – Hauptfarbe, Buttons */
  --farbe-primaer-dunkel: #6e0e29;
  --farbe-hintergrund: #f1f5f9;  /* Hellgrau – Seitenhintergrund */
  --farbe-karte:      #ffffff;   /* Weiß – Karten/Panels */
  --farbe-rahmen:     #e2e8f0;   /* Hellgrau – Trennlinien */
  --farbe-text:       #1e293b;   /* Dunkelgrau – Haupttext */
  --farbe-text-hell:  #64748b;   /* Mittelgrau – Sekundärtext */

  /* Ampelfarben für Antragsstatus */
  --ampel-gruen:      #16a34a;
  --ampel-gruen-hell: #dcfce7;
  --ampel-gelb:       #ca8a04;
  --ampel-gelb-hell:  #fef9c3;
  --ampel-rot:        #dc2626;
  --ampel-rot-hell:   #fee2e2;

  /* Sonderurlaub */
  --sonderurlaub:      #7c3aed;
  --sonderurlaub-hell: #ede9fe;

  /* Krankmeldungen */
  --krank:             #dc2626;   /* red-600 */
  --krank-hell:        #fee2e2;   /* red-100 */
  --kind-krank:        #ca8a04;   /* yellow-600 */
  --kind-krank-hell:   #fef9c3;   /* yellow-100 */

  --radius:     8px;    /* Eckenrundung */
  --schatten:   0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --abstand-s:  0.5rem;
  --abstand-m:  1rem;
  --abstand-l:  1.5rem;
  --abstand-xl: 2rem;

  /* Höhe der Navigationsleiste – wird für sticky-Offsets genutzt */
  --nav-hoehe: 37px;
  /* Höhe der Tab-Leiste (inkl. Padding) – für verschachtelte sticky-Offsets */
  --tabs-hoehe: 56px;
}

/* --------------------------------------------------------------------------
   Basis-Reset & Typographie
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--farbe-hintergrund);
  color: var(--farbe-text);
  line-height: 1.6;
  font-size: 16px;
}

h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.1rem;  font-weight: 600; }

a { color: var(--farbe-primaer); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Layout-Helfer
   -------------------------------------------------------------------------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--abstand-m);
}

/* Desktop-Layout für Admin + Bereichsleitung: nutzt die volle Bildschirmbreite */
.container--desktop {
  max-width: 1600px;
  padding: 0 2rem;
}

@media (min-width: 1800px) {
  .container--desktop {
    padding: 0 3rem;
  }
}

/* Feed + ToDo Spalten: 2:1 auf Desktop, 1:1 kompakt */
.top-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 0;
}

@media (max-width: 1280px) {
  .top-section {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 800px) {
  .top-section {
    grid-template-columns: 1fr;
  }
}

/* Kommunikations-Grid (Neuerungen + Feedback) */
.kommunikation-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (min-width: 1600px) {
  .kommunikation-section {
    grid-template-columns: 2fr 1fr;
  }
}

@media (max-width: 800px) {
  .kommunikation-section {
    grid-template-columns: 1fr;
  }
}

.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-zwischen { display: flex; align-items: center; justify-content: space-between; }
.gap-s       { gap: var(--abstand-s); }
.gap-m       { gap: var(--abstand-m); }
.mt-m        { margin-top: var(--abstand-m); }
.mt-l        { margin-top: var(--abstand-l); }
.mb-m        { margin-bottom: var(--abstand-m); }

/* --------------------------------------------------------------------------
   Karte (Card) – Hauptbaustein der UI
   -------------------------------------------------------------------------- */
.karte {
  background: var(--farbe-karte);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: var(--abstand-l);
}

.karte-klein {
  padding: var(--abstand-m);
}

/* --------------------------------------------------------------------------
   Navigationsleiste (oben)
   -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--farbe-primaer);
  color: white;
  padding: 0.35rem var(--abstand-l);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Buttons in der Navigationsleiste: transparent mit weißem Text */
.nav .btn {
  background: rgba(255,255,255,0.15) !important;
  color: white !important;
  border-color: rgba(255,255,255,0.35) !important;
}
.nav .btn:hover {
  background: rgba(255,255,255,0.28) !important;
}

.nav-titel    { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 0.6rem; }
.nav-trenner  { opacity: 0.4; font-weight: 300; }
.nav-untertitel { font-size: 0.85rem; opacity: 0.85; }

/* --------------------------------------------------------------------------
   Tabs (Reiter-Navigation im Admin-Bereich)
   -------------------------------------------------------------------------- */
/* Tab-Wrapper: klebt unter der Nav beim Scrollen */
.tabs-sticky-wrapper {
  position: sticky;
  top: var(--nav-hoehe);
  z-index: 30;
  background: var(--farbe-hintergrund);
  padding: 0.6rem 0 0.5rem;
  margin-top: -4px;
  padding-top: calc(0.6rem + 4px);
  margin-bottom: 0.75rem;
}


.tabs {
  display: flex;
  gap: 2px;
  background: var(--farbe-rahmen);
  border-radius: var(--radius);
  padding: 3px;
  flex-wrap: wrap;  /* Tabs umbrechen auf kleinen Bildschirmen */
}

/* Subtabs innerhalb eines Tab-Inhalts (z.B. Stammdaten) */
.subtabs {
  display: flex;
  gap: 1px;
  border-bottom: 2px solid var(--farbe-rahmen);
  margin-bottom: 1rem;
}
.subtab {
  padding: 0.4rem 0.9rem;
  border: none;
  background: transparent;
  color: var(--farbe-text-hell);
  font-size: 0.88rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}
.subtab:hover { color: var(--farbe-text); }
.subtab.aktiv { color: var(--farbe-primaer); font-weight: 600; border-bottom-color: var(--farbe-primaer); }

.tab {
  padding: 0.5rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--farbe-text-hell);
  transition: all 0.15s;
  white-space: nowrap;
}

.tab:hover       { background: rgba(255,255,255,0.7); color: var(--farbe-text); }
.tab.aktiv       { background: white; color: var(--farbe-primaer); font-weight: 600;
                   box-shadow: var(--schatten); }

/* --------------------------------------------------------------------------
   Formular-Elemente
   -------------------------------------------------------------------------- */
.formular {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.formular-zeile {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

/* Auf Smartphones: Formularzeilen untereinander statt nebeneinander */
@media (max-width: 600px) {
  .formular-zeile { grid-template-columns: 1fr; }
}

.formular-gruppe {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.formular-gruppe label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--farbe-text-hell);
}

input, select, textarea {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--farbe-rahmen);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--farbe-text);
  background: white;
  transition: border-color 0.15s;
}

input[type="date"] {
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.7;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Tabellensuche – schlankes Filterfeld über Tabellen */
.tabellen-suche {
  display: flex;
  gap: var(--abstand-s);
  flex-wrap: wrap;
  margin-bottom: var(--abstand-m);
}
.tabellen-suche input {
  flex: 1;
  min-width: 180px;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--farbe-primaer);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea { resize: vertical; min-height: 80px; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primaer {
  background: var(--farbe-primaer);
  color: white !important;   /* verhindert dass der Text durch Vererbung weiß-auf-weiß wird */
}
.btn-primaer:hover    { background: var(--farbe-primaer-dunkel); }
.btn-primaer:disabled { background: #93c5fd; color: white !important; }

.btn-sekundaer {
  background: var(--farbe-karte);
  color: var(--farbe-text);
  border: 1px solid var(--farbe-rahmen);
}
.btn-sekundaer:hover { background: var(--farbe-hintergrund); }

.btn-gefahr {
  background: var(--ampel-rot-hell);
  color: var(--ampel-rot);
}
.btn-gefahr:hover { background: #fca5a5; }

.btn-erfolg {
  background: var(--ampel-gruen-hell);
  color: var(--ampel-gruen);
}
.btn-erfolg:hover { background: #86efac; }

.btn-klein { padding: 0.28rem 0.6rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --------------------------------------------------------------------------
   Ampel-Badges (Status-Anzeige)
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;   /* Pill-Form */
  font-size: 0.8rem;
  font-weight: 600;
}

.badge::before { content: '●'; font-size: 0.7rem; }

.badge-genehmigt      { background: var(--ampel-gruen-hell); color: var(--ampel-gruen); }
.badge-ausstehend     { background: var(--ampel-gelb-hell);  color: var(--ampel-gelb);  }
.badge-abgelehnt      { background: var(--ampel-rot-hell);   color: var(--ampel-rot);   }
.badge-nicht_genommen      { background: #f1f5f9; color: #64748b; }
.badge-aenderung-beantragt { background: #fff7ed; color: #c2410c; font-size: 0.7rem; }
.badge-ersetzt             { background: #f8fafc; color: #94a3b8; text-decoration: line-through; }
.badge-aenderung_genehmigt { background: var(--ampel-gruen-hell); color: var(--ampel-gruen); }
.badge-sonderurlaub        { background: var(--sonderurlaub-hell); color: var(--sonderurlaub); }
.urlaub-zeile-ersetzt td   { opacity: 0.55; }

/* Krankmeldungs-Badges */
.badge-km-eau_received { background: var(--ampel-gruen-hell); color: var(--ampel-gruen); }
.badge-km-missing      { background: #ffedd5; color: #c2410c; }
/* Krankmeldungs-Typ-Badge */
.badge-krank     { background: var(--krank-hell); color: var(--krank); }
.badge-kind-krank { background: var(--kind-krank-hell); color: var(--kind-krank); }
/* Krankmeldungs-Zeile in Tabellen */
.km-zeile-krank     { background: #fee2e2 !important; }
.km-zeile-kind-krank { background: #fef9c3 !important; }
/* Sonderurlaub-Zeile in Tabellen dezent lila hinterlegen */
.urlaub-zeile-sonderurlaub { background: #faf7ff !important; }

.btn-icon-gear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid var(--farbe-rahmen);
  border-radius: 4px;
  background: var(--farbe-karte);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--farbe-text-hell);
  padding: 0;
  transition: background 0.1s, color 0.1s;
}
.btn-icon-gear:hover { background: var(--farbe-hintergrund); color: var(--farbe-text); }

/* --------------------------------------------------------------------------
   Tabelle
   -------------------------------------------------------------------------- */
.tabelle-wrapper {
  overflow-x: auto;   /* Horizontales Scrollen auf kleinen Bildschirmen */
}

/* Mitarbeiter-Tabelle: wächst mit Inhalt, kein internes Scrollen */
.ma-tabelle-scroll {
  overflow-x: auto;
}


table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--farbe-rahmen);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--farbe-text-hell);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--farbe-rahmen);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td      { background: var(--farbe-hintergrund); }

/* --------------------------------------------------------------------------
   Hinweis-Boxen (Erfolg, Fehler, Info)
   -------------------------------------------------------------------------- */
.hinweis {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.hinweis-erfolg { background: var(--ampel-gruen-hell); color: var(--ampel-gruen); }
.hinweis-fehler { background: var(--ampel-rot-hell);   color: var(--ampel-rot);   }
.hinweis-info   { background: #dbeafe; color: #1e40af; }

/* --------------------------------------------------------------------------
   Login-Seite (zentriert, kompakte Karte)
   -------------------------------------------------------------------------- */
.login-seite {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--abstand-m);
}

.login-karte {
  width: 100%;
  max-width: 420px;
}

.login-logo {
  text-align: center;
  margin-bottom: var(--abstand-l);
}

/* --------------------------------------------------------------------------
   Fortschrittsbalken (Urlaubsanspruch)
   -------------------------------------------------------------------------- */
.fortschritt-container {
  background: var(--farbe-rahmen);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin-top: 0.3rem;
}

.fortschritt-balken {
  height: 100%;
  border-radius: 999px;
  background: var(--farbe-primaer);
  transition: width 0.3s ease;
}

.fortschritt-balken.warnung  { background: var(--ampel-gelb); }
.fortschritt-balken.kritisch { background: var(--ampel-rot); }

/* --------------------------------------------------------------------------
   Modal (Popup-Dialog)
   -------------------------------------------------------------------------- */
.modal-hintergrund {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--abstand-m);
}

.modal-hintergrund--hintergrund {
  z-index: 90;
}

.modal {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.modal-xl {
  max-width: 900px;
  max-height: 92vh;
}

.modal-kopf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.modal h3 { font-size: 1rem; }
.modal textarea { min-height: 60px; }

.modal-schliessen {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--farbe-text-hell);
  line-height: 1;
}

/* --------------------------------------------------------------------------
   Leer-Zustand (wenn keine Daten vorhanden)
   -------------------------------------------------------------------------- */
.leer-zustand {
  text-align: center;
  padding: var(--abstand-xl);
  color: var(--farbe-text-hell);
}

.leer-zustand-icon { font-size: 2.5rem; margin-bottom: var(--abstand-s); }

/* --------------------------------------------------------------------------
   MA-Tab Header (sticky Suchleiste + Filter + Buttons)
   -------------------------------------------------------------------------- */
.ma-tab-header {
  position: sticky;
  top: calc(var(--nav-hoehe) + var(--tabs-hoehe));
  z-index: 20;
  background: var(--farbe-hintergrund);
  padding: 0.4rem 0;
  margin-bottom: 0.5rem;
}
.ma-tab-header-zeile {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.ma-tab-header h2 {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  margin: 0;
}
.ma-tab-header .tabellen-suche {
  flex: 1;
  min-width: 140px;
  margin-bottom: 0;
}
.ma-tab-header .tabellen-suche input {
  width: 100%;
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   MA-Accordion (Admin Mitarbeiter-Tab)
   -------------------------------------------------------------------------- */
.ma-zeile { cursor: pointer; transition: background 0.1s; }
.ma-zeile:hover td { background: rgba(141,19,54,0.04); }
.ma-zeile-aktiv td {
  background: var(--farbe-primaer);
  color: white;
  font-weight: 600;
}
.ma-zeile-aktiv:hover td { background: var(--farbe-primaer-dunkel); }
.ma-zeile-aktiv td .ma-pfeil { color: rgba(255,255,255,0.7); }
.ma-zeile-aktiv td .badge { opacity: 0.9; }
.ma-pfeil { font-size: 0.65rem; margin-right: 0.35rem; color: var(--farbe-text-hell); display: inline-block; width: 0.8rem; }

.ma-detail-panel {
  background: var(--farbe-hintergrund);
  border-top: 1px solid var(--farbe-rahmen);
}

.ma-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--farbe-karte);
  border-bottom: 1px solid var(--farbe-rahmen);
  flex-wrap: wrap;
}

.ma-detail-stats {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.35rem 1rem;
  background: var(--farbe-karte);
  border-bottom: 1px solid var(--farbe-rahmen);
}
.ma-stat { text-align: center; padding: 0.15rem 0.75rem; }
.ma-stat-zahl { font-size: 1rem; font-weight: 700; line-height: 1.2; }
.ma-stat-label { font-size: 0.65rem; color: var(--farbe-text-hell); margin-top: 1px; }
.ma-stat-trenner { width: 1px; background: var(--farbe-rahmen); align-self: stretch; margin: 0.15rem 0; }
.ma-stat-trenner-gross { background: var(--farbe-primaer); width: 2px; margin: 0 0.25rem; }

.ma-detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--farbe-rahmen);
  background: var(--farbe-karte);
  padding: 0 1rem;
}
.ma-detail-tab {
  padding: 0.4rem 0.9rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--farbe-text-hell);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.12s, border-color 0.12s;
}
.ma-detail-tab:hover { color: var(--farbe-text); }
.ma-detail-tab.aktiv { color: var(--farbe-primaer); font-weight: 600; border-bottom-color: var(--farbe-primaer); }

.ma-detail-content {
  background: var(--farbe-karte);
}

/* --------------------------------------------------------------------------
   Gesamtübersicht (Admin)
   -------------------------------------------------------------------------- */

/* Gesamtrahmen: vertikales Scrollen; Kopf sticky darin */
.go-rahmen {
  border: 1px solid var(--farbe-rahmen);
  border-radius: var(--radius);
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 220px);
  display: flex;
  flex-direction: column;
}

/* ── Sticky Kopfzeile (klebt oben beim vertikalen Scrollen) ── */
.go-kopf {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
  border-bottom: 2px solid var(--farbe-rahmen);
  background: var(--farbe-karte);
}

.go-links-kopf {
  flex-shrink: 0;
  width: 240px;
  display: flex;
  align-items: flex-end;
  padding: 4px 4px 4px 6px;
  border-right: 2px solid var(--farbe-rahmen);
  height: 58px; /* = 22px Monat + 36px Tag */
  background: var(--farbe-karte);
}

.go-rechts-kopf-scroll {
  flex: 1;
  overflow: hidden;   /* kein eigenes Scrollen – wird per JS sync'd */
  min-width: 0;
}

/* ── Body: zwei Geschwister-Spalten ── */
.go-body-wrapper {
  display: flex;
  flex-direction: row;
  flex: 1;
}

/* Linke Spalte: fixiert, kein horizontales Scrollen */
.go-links-spalte {
  flex-shrink: 0;
  width: 240px;
  background: var(--farbe-karte);
  z-index: 1;
}

/* Rechte Spalte: scrollt horizontal */
.go-rechts-spalte {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

/* ── Zeilen: exakte Höhen für Ausrichtung beider Spalten ── */
.go-zeile-standort {
  height: 20px;
  flex-shrink: 0;
  position: relative;
}

.go-zeile-ma {
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}

.go-links-standort {
  width: 240px;
  height: 20px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  background: var(--farbe-primaer);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-right: 2px solid var(--farbe-rahmen);
  overflow: hidden;
}

/* Standort-Hintergrundzeile im Zeitstrahl */
.go-standort-rechts {
  background: rgba(141,19,54,0.07);
  border-bottom: 1px solid var(--farbe-rahmen);
}

.go-links-ma {
  width: 240px;
  height: 22px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--farbe-rahmen);
  border-right: 2px solid var(--farbe-rahmen);
  background: var(--farbe-karte);
  transition: background 0.08s;
}

.go-rechts-ma {
  height: 22px;
  width: 100%;
  border-bottom: 1px solid var(--farbe-rahmen);
  position: relative;
  overflow: visible;
}

/* Hover + Selektion – wirkt auf beide Spalten via Reaktivität */
.go-zeile-ma.go-hover,
.go-zeile-ma.go-hover .go-links-ma { background: rgba(141,19,54,0.06); }
.go-zeile-ma.go-sel,
.go-zeile-ma.go-sel .go-links-ma   {
  background: rgba(141,19,54,0.18);
}
.go-zeile-ma.go-sel {
  border-top: 1px solid rgba(141,19,54,0.35);
  border-bottom: 1px solid rgba(141,19,54,0.35);
  box-shadow: inset 2px 0 0 var(--farbe-primaer);
}
.go-zeile-ma.go-sel .go-rechts-ma::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: rgba(141,19,54,0.35);
  z-index: 4;
  pointer-events: none;
}
.go-zeile-ma { cursor: pointer; }

/* ── Name-Spalte (flexibel) ── */
.go-name-kopf {
  flex: 1;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--farbe-text-hell);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.go-name-zelle {
  flex: 1;
  padding: 0 2px 0 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.25em;
  min-width: 0;
}

.go-pnr  { font-size: 0.65rem; color: var(--farbe-text-hell); white-space: nowrap; flex-shrink: 0; }
.go-name { font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Stat-Spalten (fixe Breite) ── */
.go-stat-kopf {
  flex-shrink: 0;
  width: 26px;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
}

.go-stat-zelle {
  flex-shrink: 0;
  width: 26px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
}

.go-trennlinie {
  flex-shrink: 0;
  width: 1px;
  background: var(--farbe-rahmen);
  align-self: stretch;
  margin: 2px 0;
}

.go-stat-placeholder { color: var(--farbe-text-hell) !important; font-weight: 400 !important; }

/* --------------------------------------------------------------------------
   Urlaubs-Zeitstrahl (Timeline)
   -------------------------------------------------------------------------- */
.zeitstrahl-wrapper {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--farbe-karte);
  border: 1px solid var(--farbe-rahmen);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 0.5rem;
}

.zeitstrahl-namen-spalte {
  width: 100px;
  min-width: 100px;
  flex-shrink: 0;
  background: var(--farbe-karte);
  border-right: 2px solid var(--farbe-rahmen);
}

.zeitstrahl-kopf-leer {
  height: 58px;   /* 22px Monat + 36px Tag */
  border-bottom: 1px solid var(--farbe-rahmen);
}

.zeitstrahl-name-zelle {
  height: 20px;
  line-height: 20px;
  padding: 0 8px;
  font-size: 0.72rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  border-bottom: 1px solid var(--farbe-rahmen);
  color: var(--farbe-text);
  transition: background 0.12s;
}
.zeitstrahl-name-zelle:hover { background: var(--farbe-hintergrund); }
.zeitstrahl-name-zelle.aktiv {
  background: var(--farbe-primaer);
  color: white;
  border-top: 1px solid rgba(255,255,255,0.3);
  border-bottom: 1px solid rgba(255,255,255,0.3);
}

.zeitstrahl-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--farbe-rahmen) transparent;
}

.zeitstrahl-monat-label {
  position: absolute;
  height: 22px;
  line-height: 22px;
  padding: 0 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--farbe-text-hell);
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid var(--farbe-rahmen);
  box-sizing: border-box;
}
.zeitstrahl-monat-label.aktiv {
  color: var(--farbe-primaer);
  font-weight: 800;
  background: rgba(141,19,54,0.05);
}

.zeitstrahl-tag-kopf {
  height: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex-shrink: 0;
  user-select: none;
  border-right: 1px solid rgba(0,0,0,0.06);
}
.zt-tag-zahl {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--farbe-text);
  line-height: 1;
}
.zt-tag-wt {
  font-size: 0.58rem;
  color: var(--farbe-text-hell);
  line-height: 1;
}
.zeitstrahl-tag-kopf.we { background: #fefce8; }
.zeitstrahl-tag-kopf.we .zt-tag-zahl,
.zeitstrahl-tag-kopf.we .zt-tag-wt { color: #92400e; }
.zeitstrahl-tag-kopf.heute { background: var(--farbe-primaer); }
.zeitstrahl-tag-kopf.heute .zt-tag-zahl,
.zeitstrahl-tag-kopf.heute .zt-tag-wt { color: white; font-weight: 700; }
.zeitstrahl-tag-kopf.selected { background: rgba(141,19,54,0.15); outline: 2px solid var(--farbe-primaer); outline-offset: -2px; }
.zeitstrahl-tag-kopf.selected .zt-tag-zahl { color: var(--farbe-primaer); font-weight: 700; }
.zeitstrahl-tag-kopf { cursor: pointer; }
.zeitstrahl-tag-kopf:hover:not(.heute):not(.selected) { background: rgba(0,0,0,0.05); }

.zeitstrahl-hintergrund {
  position: absolute;
  top: 0; left: 0; right: 0;
  pointer-events: none;
}
.zt-hg-we { position: absolute; top: 0; bottom: 0; background: #fefce8; }
.zt-hg-ft { position: absolute; top: 0; bottom: 0; background: rgba(251,207,232,0.65); border-left: 2px solid rgba(141,19,54,0.35); }

.zt-tag-raster {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.zt-woche-linie {
  position: absolute; top: 0; bottom: 0;
  width: 1px; background: rgba(0,0,0,0.08);
}

.zt-heute-linie {
  position: absolute; top: 0; bottom: 0;
  width: 2px; background: var(--farbe-primaer); opacity: 0.85; z-index: 3;
}

.zt-selected-spalte {
  position: absolute; top: 0; bottom: 0;
  pointer-events: none;
  background: rgba(141,19,54,0.1);
  border-left: 1px solid rgba(141,19,54,0.3);
  border-right: 1px solid rgba(141,19,54,0.3);
  z-index: 2;
}

.zeitstrahl-zeile {
  position: relative;
  height: 20px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  cursor: pointer;
}
.zeitstrahl-zeile.aktiv {
  background: rgba(141,19,54,0.18);
  border-top: 1px solid rgba(141,19,54,0.35);
}
.zeitstrahl-zeile.aktiv::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: rgba(141,19,54,0.35);
  z-index: 4;
  pointer-events: none;
}

.zt-balken {
  position: absolute;
  top: 2px; height: 10px;
  border-radius: 3px;
  cursor: pointer;
  min-width: 4px;
  transition: filter 0.1s;
}
.zt-balken:hover { filter: brightness(0.82); z-index: 2; }
.zt-balken-genehmigt           { background: #16a34a; }
.zt-balken-aenderung_genehmigt { background: #16a34a; }
.zt-balken-ausstehend          { background: #ca8a04; }
.zt-balken-abgelehnt           { background: #dc2626; opacity: 0.6; }
/* Sonderurlaub überschreibt Status-Farbe */
.zt-balken-sonderurlaub        { background: var(--sonderurlaub) !important; }
.zt-balken.markiert   { outline: 2px solid var(--farbe-primaer); outline-offset: 1px; z-index: 2; }

/* Krankmeldungs-Balken im Zeitstrahl (unterhalb der Urlaubs-Balken) */
.zt-balken-sick {
  position: absolute;
  bottom: 2px; height: 6px;
  border-radius: 2px;
  cursor: pointer;
  min-width: 4px;
  z-index: 3;
  transition: filter 0.1s;
}
.zt-balken-sick:hover { filter: brightness(0.82); }
.zt-balken-sick-krank { background: var(--krank); }
.zt-balken-sick-kind  { background: var(--kind-krank); }

/* S-Accordion (Sondermeldungen) in der Gesamtübersicht */
.go-s-accordion {
  background: var(--farbe-hintergrund);
  border-bottom: 1px solid var(--farbe-rahmen);
}
.go-s-accordion-inhalt {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1rem;
  padding: 0.4rem 1rem;
}
.go-s-pos {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
}
.go-s-label { color: var(--farbe-text-hell); }
.go-s-wert  { font-weight: 600; color: var(--sonderurlaub); min-width: 2rem; }
.go-s-pos-grau .go-s-wert { color: var(--farbe-text-hell); font-weight: 400; }
.go-s-accordion-rechts { overflow: hidden; }

.zt-tabelle-markiert td { background: rgba(141,19,54,0.07) !important; }

/* --------------------------------------------------------------------------
   Chat-Feed + Todo-Liste (Bereichsleitung & Admin)
   -------------------------------------------------------------------------- */
.chat-feed { display:flex; flex-direction:column; gap:0.5rem; max-height:320px; overflow-y:auto; padding:0.6rem; background:var(--farbe-hintergrund); border:1px solid var(--farbe-rahmen); border-radius:var(--radius); }
.chat-msg { display:flex; flex-direction:column; max-width:75%; }
.chat-msg-admin { align-self:flex-end; }
.chat-msg-bl    { align-self:flex-start; }
.chat-blase { padding:0.4rem 0.7rem; border-radius:10px; font-size:0.85rem; line-height:1.4; }
.chat-msg-admin .chat-blase { background:var(--farbe-primaer); color:#fff; }
.chat-msg-bl    .chat-blase { background:var(--farbe-karte); border:1px solid var(--farbe-rahmen); }
.chat-meta { font-size:0.68rem; color:var(--farbe-text-hell); margin-top:2px; }
.chat-msg-admin .chat-meta  { text-align:right; }

.todo-liste { display:flex; flex-direction:column; gap:0.3rem; width:100%; }
.todo-item { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:0.6rem; padding:0.4rem 0.7rem; background:var(--farbe-karte); border:1px solid var(--farbe-rahmen); border-radius:var(--radius); font-size:0.88rem; box-sizing:border-box; width:100%; }
.todo-item .todo-text { overflow-wrap:break-word; word-break:break-word; }
.todo-item.erledigt { opacity:0.5; }
.todo-item.erledigt .todo-text { text-decoration:line-through; color:var(--farbe-text-hell); }
.todo-archiv-header { font-size:0.72rem; color:var(--farbe-text-hell); margin:0.5rem 0 0.25rem; font-weight:600; letter-spacing:.03em; text-transform:uppercase; }

/* Trennlinie zwischen Feed/Todo und Antragslisten */
.neues-trenner { border:none; border-top:2px solid var(--farbe-rahmen); margin:1.5rem 0; }

/* --------------------------------------------------------------------------
   Rechte-Matrix
   -------------------------------------------------------------------------- */
.rechte-matrix-wrapper { overflow-x:auto; }
.rechte-matrix { border-collapse:collapse; width:100%; font-size:0.83rem; }
.rechte-matrix th,
.rechte-matrix td { padding:0.4rem 0.6rem; border-bottom:1px solid var(--farbe-rahmen); text-align:center; vertical-align:middle; white-space:nowrap; }
.rechte-matrix th { background:var(--farbe-hintergrund); font-weight:700; font-size:0.78rem; position:sticky; top:0; z-index:2; }
.rechte-matrix th.rolle-admin { color:var(--farbe-primaer); }
.rechte-matrix td.aktion-label { text-align:left; white-space:normal; font-size:0.82rem; padding-left:0.5rem; }
.rechte-matrix tr.kategorie-header td { background:var(--farbe-hintergrund); font-weight:700; font-size:0.73rem; color:var(--farbe-text-hell); text-align:left; text-transform:uppercase; letter-spacing:0.04em; padding:0.5rem 0.5rem 0.25rem; border-bottom:2px solid var(--farbe-rahmen); }
.rechte-matrix input[type=checkbox] { width:1.1rem; height:1.1rem; cursor:pointer; accent-color:var(--farbe-primaer); }
.rechte-matrix input[type=checkbox]:disabled { opacity:0.4; cursor:not-allowed; }

/* --------------------------------------------------------------------------
   Anzeigesperre – Urlaubskonto Infobox
   -------------------------------------------------------------------------- */
.anzeige-konto {
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
  position: relative;
}

.anzeige-konto:hover {
  border-color: var(--farbe-primaer) !important;
  box-shadow: 0 0 0 2px rgba(141,19,54,0.12) !important;
}

/* Gesperrt: Werte sind als •• angezeigt, Box wirkt leicht abgedimmt */
.anzeige-konto--gesperrt {
  background: var(--farbe-hintergrund) !important;
}

.anzeige-konto--gesperrt:hover::before {
  content: '🔒';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.4rem;
  opacity: 0.25;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Mitarbeiter-Suche (ma-suche Komponente)
   -------------------------------------------------------------------------- */
.ma-suche {
  position: relative;
  width: 100%;
}

.ma-suche-input {
  width: 100%;
  padding: 0.45rem 0.7rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--farbe-text);
  background: var(--farbe-karte);
  border: 1px solid var(--farbe-rahmen);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ma-suche-input:focus,
.ma-suche-input--offen {
  border-color: var(--farbe-primaer);
  box-shadow: 0 0 0 2px rgba(141,19,54,0.12);
}

.ma-suche-input:disabled {
  background: var(--farbe-hintergrund);
  color: var(--farbe-text-hell);
  cursor: not-allowed;
}

.ma-suche-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--farbe-karte);
  border: 1px solid var(--farbe-rahmen);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ma-suche-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.1s;
}

.ma-suche-item:hover,
.ma-suche-item--aktiv {
  background: #f8e8ec;
  color: var(--farbe-primaer);
}

.ma-suche-name {
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ma-suche-pnr {
  font-size: 0.78rem;
  color: var(--farbe-text-hell);
  flex-shrink: 0;
}

.ma-suche-item--aktiv .ma-suche-pnr {
  color: inherit;
  opacity: 0.75;
}

.ma-suche-leer {
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  color: var(--farbe-text-hell);
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Bestellsystem – 3-Spalten-Layout
   -------------------------------------------------------------------------- */
.bestell-layout {
  display: grid;
  grid-template-columns: 200px 1fr 280px;
  gap: 1rem;
  align-items: start;
}

.bestell-spalte {
  background: var(--farbe-karte);
  border: 1px solid var(--farbe-rahmen);
  border-radius: var(--radius);
  overflow: hidden;
}

.bestell-spalte-kopf {
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  font-size: 0.85rem;
  background: var(--farbe-hintergrund);
  border-bottom: 1px solid var(--farbe-rahmen);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bestell-kat-liste {
  display: flex;
  flex-direction: column;
}

.bestell-kat-eintrag {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.87rem;
  border-bottom: 1px solid var(--farbe-rahmen);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  transition: background 0.1s;
}
.bestell-kat-eintrag:last-child { border-bottom: none; }
.bestell-kat-eintrag:hover { background: var(--farbe-hintergrund); }
.bestell-kat-eintrag.aktiv { background: var(--farbe-primaer); color: white; font-weight: 600; }
.bestell-kat-eintrag.aktiv .badge { background: rgba(255,255,255,0.2); color: white; }

.bestell-artikel-liste {
  display: flex;
  flex-direction: column;
}

.bestell-artikel-zeile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--farbe-rahmen);
  font-size: 0.87rem;
}
.bestell-artikel-zeile:last-child { border-bottom: none; }
.bestell-artikel-zeile:hover { background: var(--farbe-hintergrund); }
.bestell-artikel-highlight {
  background: #fef3c7 !important;
}

.bestell-artikel-nr {
  color: var(--farbe-text-hell);
  font-size: 0.78rem;
  min-width: 70px;
  font-family: monospace;
}

.bestell-artikel-bez {
  flex: 1;
}

.bestell-artikel-favorit {
  cursor: pointer;
  color: #ccc;
  font-size: 1.05rem;
  flex-shrink: 0;
  transition: color 0.15s;
  background: none;
  border: none;
  padding: 0.1rem;
  line-height: 1;
}
.bestell-artikel-favorit:hover { color: #f5c400; }
.bestell-artikel-favorit.aktiv { color: #f5c400; }

.bestell-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.bestell-stepper-btn {
  width: 26px;
  height: 26px;
  background: var(--farbe-hintergrund);
  border: 1px solid var(--farbe-rahmen);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
  flex-shrink: 0;
}
.bestell-stepper-btn:first-child { border-radius: 4px 0 0 4px; }
.bestell-stepper-btn:last-child  { border-radius: 0 4px 4px 0; }
.bestell-stepper-btn:hover { background: var(--farbe-rahmen); }

.bestell-menge-input {
  width: 46px;
  text-align: center;
  padding: 0.2rem 0.2rem;
  border: 1px solid var(--farbe-rahmen);
  border-left: none;
  border-right: none;
  border-radius: 0;
  font-size: 0.85rem;
  height: 26px;
  box-sizing: border-box;
}

.bestell-warenkorb-zeile {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--farbe-rahmen);
  font-size: 0.84rem;
}
.bestell-warenkorb-zeile:last-child { border-bottom: none; }

.bestell-warenkorb-menge {
  background: var(--farbe-primaer);
  color: white;
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  min-width: 28px;
  text-align: center;
}

.bestell-warenkorb-bez {
  flex: 1;
  font-size: 0.83rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bestell-warenkorb-link {
  cursor: pointer;
  color: var(--farbe-primaer);
}
.bestell-warenkorb-link:hover { text-decoration: underline; }

.bestell-historie-btn {
  width: 100%;
  justify-content: center;
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
}

.bestell-suche-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--farbe-rahmen);
  border-radius: var(--radius);
  font-size: 0.85rem;
  background: var(--farbe-karte);
  color: var(--farbe-text);
  outline: none;
  transition: border-color 0.15s;
}
.bestell-suche-input:focus {
  border-color: var(--farbe-primaer);
  box-shadow: 0 0 0 2px rgba(141,19,54,0.12);
}
.bestell-suche-input::placeholder { color: var(--farbe-text-hell); }

@media (max-width: 900px) {
  .bestell-layout {
    grid-template-columns: 160px 1fr;
    grid-template-rows: auto auto;
  }
  .bestell-layout .bestell-spalte:nth-child(3) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .bestell-layout {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Responsive Anpassungen für Smartphones (< 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  body    { font-size: 15px; }
  .karte  { padding: var(--abstand-m); }
  .nav    { padding: var(--abstand-s) var(--abstand-m); }
  h1      { font-size: 1.4rem; }
  .tabs   { gap: 1px; }
  .tab    { padding: 0.45rem 0.7rem; font-size: 0.82rem; }
}
