@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --ink: #1C2530;
  --muted: #6B7280;
  --border: #E5E8EC;
  --accent-run: #0F9D78;
  --accent-run-soft: #E4F5EF;
  --accent-stop: #E2574C;
  --accent-stop-soft: #FBEAE8;
  /* Eigene Akzentfarbe für den Projektzeit-Bereich (bewusst anders als --accent-run),
     damit sofort erkennbar ist "ich bin hier im Projekt-Modus, nicht in der normalen
     Arbeitszeit". Nur auf der Projektzeit-Timer-Seite genutzt (.project-mode). */
  --accent-project: #2F6FED;
  --accent-project-soft: #E7EFFD;
  /* Für Flächen, die IMMER hohen Kontrast zum Hintergrund brauchen (z.B. "Speichern"-
     Buttons) - anders als --ink kippt dieses Paar nicht einfach mit dem Theme, sondern
     wird pro Theme bewusst gegensätzlich gesetzt (dunkle Fläche im Hellmodus, helle
     Fläche im Dunkelmodus). */
  --contrast-bg: #1C2530;
  --contrast-fg: #FFFFFF;
  /* Weicher Schatten für Hover-Effekte auf Buttons/Karten - pro Theme eigene Stärke,
     damit er im Dark Mode nicht unsichtbar (zu schwach) oder im Light Mode zu hart wirkt. */
  --shadow-hover: 0 4px 12px rgba(28, 37, 48, 0.14);
  --radius: 14px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

/* Dunkles Farbschema: automatisch, wenn das Betriebssystem/der Browser Dark Mode
   bevorzugt UND der Nutzer nicht explizit "hell" gewählt hat (siehe public/js/theme.js). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14181F;
    --surface: #1C222B;
    --ink: #F3F5F7;
    --muted: #8B93A1;
    --border: #2A313D;
    --accent-run: #17C994;
    --accent-run-soft: #16332B;
    --accent-stop: #FF6B5E;
    --accent-stop-soft: #3A211E;
    --accent-project: #5B9BFF;
    --accent-project-soft: #1B2A44;
    --contrast-bg: #F3F5F7;
    --contrast-fg: #14181F;
    --shadow-hover: 0 4px 14px rgba(0, 0, 0, 0.4);
  }
}
/* Manuelle Wahl "dunkel" per Umschalter - überstimmt die Systemeinstellung in beide
   Richtungen (siehe public/js/theme.js). */
:root[data-theme="dark"] {
  --bg: #14181F;
  --surface: #1C222B;
  --ink: #F3F5F7;
  --muted: #8B93A1;
  --border: #2A313D;
  --accent-run: #17C994;
  --accent-run-soft: #16332B;
  --accent-stop: #FF6B5E;
  --accent-stop-soft: #3A211E;
  --accent-project: #5B9BFF;
  --accent-project-soft: #1B2A44;
  --contrast-bg: #F3F5F7;
  --contrast-fg: #14181F;
  --shadow-hover: 0 4px 14px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; transition: color 0.15s ease, opacity 0.15s ease; }
a:hover { text-decoration: underline; }

/* Native Checkboxen/Radios in der Markenfarbe statt Browser-Standardblau. */
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent-run); }

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0;
}
.brand span { color: var(--accent-run); }
.admin-tag {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  vertical-align: middle;
  margin-left: 6px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topnav { display: flex; align-items: center; gap: 16px; font-size: 0.9rem; }
.topnav a, .nav-dropdown > summary { transition: color 0.15s ease; }
.topnav a:hover, .nav-dropdown > summary:hover { color: var(--accent-run); text-decoration: none; }
.user-chip { color: var(--muted); }

/* Untermenüs (Zeiterfassung/Verwaltung) - <details>/<summary>, kein JS nötig. */
.nav-dropdown { position: relative; }
.nav-dropdown > summary {
  cursor: pointer;
  list-style: none;
  color: var(--ink);
}
.nav-dropdown > summary::-webkit-details-marker { display: none; }
.nav-chevron {
  display: inline-block;
  font-size: 0.7em;
  color: var(--muted);
  transition: transform 0.2s ease;
}
.nav-dropdown[open] .nav-chevron { transform: rotate(90deg); }
.nav-dropdown-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
}
.nav-dropdown-menu a { padding: 6px 0; font-size: 0.9rem; transition: color 0.15s ease; }
.nav-dropdown-menu a:hover { color: var(--accent-run); }

@media (min-width: 1201px) {
  .nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 14px;
    min-width: 160px;
    box-shadow: 0 10px 20px rgba(28, 37, 48, 0.12);
    z-index: 30;
  }
}

.nav-toggle, .theme-toggle {
  display: block;
  background: none;
  border: none;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  padding: 4px 6px;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.nav-toggle:hover, .theme-toggle:hover { background: var(--border); }
.nav-toggle:active, .theme-toggle:active { transform: scale(0.9); }
.nav-toggle { display: none; font-size: 1.5rem; }

.theme-toggle-fixed {
  position: fixed;
  top: 16px;
  right: 16px;
}

/* 1200px statt z.B. 640px: mit Projektzeit/Projekte hat die Navigation für Nutzer mit
   vielen Rechten (z.B. dich als Superadmin) bis zu 9 Punkte - das passt erst ab
   ca. 1200px bequem in eine Zeile, sonst quetscht/überläuft es sich. */
@media (max-width: 1200px) {
  .topbar { position: relative; }
  .nav-toggle { display: block; }
  .topnav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px 20px;
    box-shadow: 0 10px 20px rgba(28, 37, 48, 0.1);
    z-index: 20;
  }
  .topnav.open { display: flex; }
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Timer signature element */
.timer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.timer-ring {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timer-ring-svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg); /* Start bei 12 Uhr statt 3 Uhr */
}
.timer-ring-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 3;
}
.timer-ring-ticks line {
  stroke: var(--border);
  stroke-width: 2;
}
.timer-ring-progress {
  fill: none;
  stroke: var(--accent-run);
  stroke-width: 3;
  stroke-linecap: round;
  /* Umfang bei r=100: 2 * PI * 100 ≈ 628.3 - Start komplett "leer" */
  stroke-dasharray: 628.3;
  stroke-dashoffset: 628.3;
  transition: stroke-dashoffset 0.6s ease;
}
.timer-ring.running {
  animation: pulse 2.4s ease-in-out infinite;
}
.timer-ring.goal-complete {
  animation: goal-pulse 0.6s ease;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(15, 157, 120, 0.25); }
  50% { box-shadow: 0 0 0 14px rgba(15, 157, 120, 0); }
}
@keyframes goal-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .timer-ring.running { animation: none; }
  .timer-ring.goal-complete { animation: none; }
  .timer-ring-progress { transition: none; }
}

/* Projektzeit-Seite: eigener Puls-Farbton (Blau statt Teal), damit sich der Projekt-
   Modus optisch vom normalen Arbeitszeit-Timer absetzt. */
.project-mode .timer-ring.running { animation: pulse-project 2.4s ease-in-out infinite; }
@keyframes pulse-project {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 111, 237, 0.28); }
  50% { box-shadow: 0 0 0 14px rgba(47, 111, 237, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .project-mode .timer-ring.running { animation: none; }
}

.timer-display {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.timer-status { color: var(--muted); font-size: 0.9rem; margin: 0; }

#noteInput {
  width: 100%;
  max-width: 320px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.timer-actions { display: flex; gap: 12px; }

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease,
    background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.btn:hover { filter: brightness(1.07); }
/* Das Anheben ist eine Bewegung (transform) - separat vom reinen Farb-/Schatten-Hover,
   damit Nutzer mit "Bewegung reduzieren" nur die ruhige Variante sehen. */
@media (prefers-reduced-motion: no-preference) {
  .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
}
.btn:active { transform: translateY(0) scale(0.97); filter: brightness(0.96); box-shadow: none; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-start { background: var(--accent-run); color: white; }
.btn-stop { background: var(--accent-stop); color: white; }
.btn-primary { background: var(--contrast-bg); color: var(--contrast-fg); }
.project-mode .btn-start { background: var(--accent-project); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); color: var(--ink); filter: none; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.panel h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0;
}

select, textarea, input[type="date"], input[type="datetime-local"], input[type="text"], input[type="email"], input[type="password"] {
  font-family: var(--font-body);
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
select:focus, textarea:focus, input[type="date"]:focus, input[type="datetime-local"]:focus,
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus {
  outline: none;
  border-color: var(--accent-run);
  box-shadow: 0 0 0 3px var(--accent-run-soft);
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 16px;
  margin-bottom: 16px;
}
.stats-summary .stat-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 600;
}
.stats-summary .stat-label {
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 480px) {
  .stats-summary {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 14px;
  }
  .stats-summary .stat-value { font-size: 1.05rem; }
  .stats-summary .stat-label { font-size: 0.66rem; line-height: 1.25; }
  .panel { padding: 16px; }
  .panel-footer-link { margin-top: 8px; }
}

/* Überstunden-Saldo (Übertrag aus Vorjahren + Gesamtsaldo) - optisch abgesetzt von den
   reinen Jahreszahlen oben, weil es eine andere Art von Kennzahl ist (laufender Stand
   statt "nur dieses Jahr"). Farbe folgt dem Vorzeichen, wie bei der Wochen-Differenz. */
.balance-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.balance-summary .stat-value { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 600; }
.balance-summary .stat-label { color: var(--muted); font-size: 0.78rem; }
.balance-summary.is-positive .stat-value { color: var(--accent-run); }
.balance-summary.is-negative .stat-value { color: var(--accent-stop); }
@media (max-width: 480px) {
  .balance-summary { grid-template-columns: 1fr; gap: 10px; }
  .balance-summary .stat-value { font-size: 1.1rem; }
  .balance-summary .stat-label { font-size: 0.68rem; }
}

.entries-list { display: flex; flex-direction: column; gap: 10px; }
.entry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  gap: 10px;
}
.entry-row:last-child { border-bottom: none; }
.entry-date { font-weight: 600; }
.entry-meta { color: var(--muted); font-size: 0.82rem; }
.entry-net { font-family: var(--font-mono); font-weight: 600; }
.entry-edit { cursor: pointer; color: var(--muted); font-size: 0.8rem; transition: color 0.15s ease; }
.entry-edit:hover { color: var(--ink); text-decoration: underline; }
.entry-delete { cursor: pointer; color: var(--accent-stop); font-size: 0.8rem; transition: opacity 0.15s ease; }
.entry-delete:hover { opacity: 0.75; text-decoration: underline; }

/* Verhindert, dass breite Tabellen die ganze Seite horizontal aufreißen - stattdessen
   scrollt nur die Tabelle selbst innerhalb ihrer Karte (wichtig auf schmalen Bildschirmen). */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.data-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  padding: 8px 6px;
}
.data-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}
.data-table td.col-actions { width: 1%; white-space: nowrap; }
.data-table tbody tr { transition: background-color 0.15s ease; }
.data-table tbody tr:hover { background: var(--bg); }

/* Kompakter Icon-Button (z.B. Bearbeiten-Stift in Tabellenzeilen) statt ausgeschriebenem
   Textlink - spart auf schmalen Bildschirmen viel Spaltenbreite. */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.icon-btn:hover { background: var(--border); border-color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .icon-btn:hover { transform: translateY(-1px); }
}
.icon-btn:active { transform: scale(0.92); }

/* Spalten, die auf schmalen Bildschirmen nicht überlebenswichtig sind (Detail per Tap
   auf den Bearbeiten-Button erreichbar) - ausgeblendet statt die Tabelle zum Kippeln
   in den Horizontal-Scroll zu zwingen. */
@media (max-width: 560px) {
  .col-optional { display: none; }
}

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.badge-active { background: var(--accent-run-soft); color: var(--accent-run); }
.badge-inactive { background: var(--accent-stop-soft); color: var(--accent-stop); }
/* Neutral statt rot/grün - "offen" ist ein normaler Zwischenzustand, kein Fehler. */
.badge-pending { background: var(--border); color: var(--muted); }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Vorschläge-Übersicht (Feedback-Einreichungen) */
.feedback-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feedback-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.88rem; flex-wrap: wrap; }
.feedback-message { margin: 0; white-space: pre-wrap; }
.feedback-reply-form { display: flex; flex-direction: column; gap: 8px; }
.feedback-reply-form textarea { resize: vertical; }
.feedback-reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* Feedback-Icon + Fenster oben rechts (in partials/nav.ejs, auf jeder eingeloggten Seite) */
.feedback-window { max-width: 420px; }
.feedback-my-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; max-height: 260px; overflow-y: auto; }
.feedback-my-item { border-top: 1px solid var(--border); padding-top: 10px; font-size: 0.85rem; }
.feedback-my-item .entry-meta { margin-bottom: 2px; }
.feedback-my-reply { margin-top: 6px; padding: 8px 10px; background: var(--bg); border-radius: 8px; }

/* Auth page */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; text-align: left; }
.auth-form label { font-size: 0.85rem; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.auth-form input { width: 100%; }
.auth-form .btn { margin-top: 6px; }

.alert-error { color: var(--accent-stop); font-size: 0.88rem; }
.alert-success { color: var(--accent-run); font-size: 0.88rem; }
.demo-btn { display: block; width: 100%; }
.demo-picker { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.demo-picker > .entry-meta { margin-bottom: 10px; }
.demo-picker-buttons { display: flex; flex-direction: column; gap: 8px; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(28, 37, 48, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal[hidden] {
  display: none;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 360px;
}
.modal-box h3 { font-family: var(--font-display); margin-top: 0; }
.modal-box form { display: flex; flex-direction: column; gap: 12px; }
.modal-box label { font-size: 0.85rem; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

@media (max-width: 480px) {
  .timer-ring { width: 180px; height: 180px; }
  .timer-display { font-size: 1.9rem; }
}

.site-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.site-footer a { color: var(--muted); }
.site-footer span { margin: 0 8px; }

.legal-page-body {
  display: flex;
  justify-content: center;
  padding: 40px 16px 64px;
}
.legal-page {
  max-width: 640px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  line-height: 1.6;
}
.legal-page .brand,
.legal-page h2 { text-align: center; }
.legal-page h3 { font-family: var(--font-display); font-size: 1rem; margin-top: 28px; }

.btn-danger { color: var(--accent-stop); border-color: var(--accent-stop); }

.toggle-group {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.toggle-btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  background: var(--surface);
  color: var(--muted);
  padding: 7px 16px;
  cursor: pointer;
}
.toggle-btn.active {
  background: var(--contrast-bg);
  color: var(--contrast-fg);
}
.panel-footer-link {
  text-align: center;
  margin: 14px 0 0;
  font-size: 0.85rem;
}
.panel-footer-link a { color: var(--accent-run); font-weight: 600; }

.schedule-table input {
  width: 100%;
  max-width: 110px;
}
.schedule-table th:first-child,
.schedule-table td:first-child {
  white-space: nowrap;
}

.absence-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  margin-bottom: 16px;
}
.absence-form input[type="text"] { flex: 1; min-width: 140px; }
.absence-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.link-button:hover { opacity: 0.75; text-decoration: underline; }


.entries-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.entries-custom-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
}

.period-list { display: flex; flex-direction: column; gap: 8px; }
.period-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.period-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  list-style: none; /* eigenes Chevron statt Browser-Standardpfeil */
  transition: background-color 0.15s ease;
}
.period-row:hover { background: var(--bg); }
.period-row::-webkit-details-marker { display: none; }
.period-row .period-label {
  font-weight: 600;
  min-width: 56px;
}
.period-chevron {
  display: inline-block;
  color: var(--muted);
  font-weight: 400;
  transition: transform 0.2s ease;
}
.period-item[open] .period-chevron { transform: rotate(90deg); }
.period-row .period-values {
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.v-label {
  font-family: var(--font-body);
  color: var(--muted);
  font-size: 0.7rem;
  margin-right: 6px;
}
.period-days {
  border-top: 1px solid var(--border);
  padding: 6px 12px 10px;
  display: flex;
  flex-direction: column;
}
.period-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  font-size: 0.78rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.period-day:last-child { border-bottom: none; }
.period-day.is-absence { color: var(--accent-run); }
.period-day-values {
  display: flex;
  gap: 12px;
  font-family: var(--font-mono);
}
@media (max-width: 480px) {
  .period-row { font-size: 0.78rem; padding: 8px 10px; }
  .period-row .period-values { gap: 10px; }
}

/* Gruppen-Zeile (Umbenennen-Formular + Mitglieder-Anzahl + Löschen) - eigene Klassen
   statt Inline-Styles, damit sie auf schmalen Bildschirmen sauber untereinander
   umbrechen kann statt zu überlappen (min-width:0 ist hier der Trick: Flex-Kinder mit
   Text-Inhalt schrumpfen sonst nicht unter ihre Inhaltsbreite). */
.group-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.group-row-name-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1 1 220px;
  min-width: 0;
}
.group-row-name-form input { flex: 1; min-width: 0; }
.group-row-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.group-row-meta { white-space: nowrap; }
@media (max-width: 480px) {
  .group-row { flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; }
  /* flex-basis wirkt am Hauptachsen-Maß des Containers - bei column wäre "220px" sonst
     eine Höhenvorgabe statt einer Breitenvorgabe (genau das hat vorhin das riesige
     Leerfeld verursacht). Auf auto zurücksetzen, sobald gestapelt wird. */
  .group-row-name-form { flex: 1 1 auto; }
  .group-row-actions { justify-content: space-between; }
}
