/* ─────────────────────────────────────────────────────────
   Zeiterfassung – Design System
   ───────────────────────────────────────────────────────── */

:root {
  color-scheme: light;
  --surface-1:      #fcfcfb;
  --surface-2:      #ffffff;
  --page:           #f4f4f2;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --muted:          #898781;
  --border:         rgba(11,11,11,0.09);
  --border-strong:  rgba(11,11,11,0.14);

  --accent:         #2a78d6;
  --accent-dark:    #184f95;
  --accent-deep:    #0d2b52;
  --accent-light:   #cde2fb;
  --accent-cyan:    #7dd3fc;

  --good:           #0ca30c;
  --good-bg:        #e7f7e7;
  --warning:        #fab219;
  --warning-bg:     #fff6e2;
  --critical:       #d03b3b;
  --critical-bg:    #fbe9e9;

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-sm: 0 1px 2px rgba(11,11,11,0.06), 0 1px 1px rgba(11,11,11,0.04);
  --shadow-md: 0 8px 24px rgba(13,43,82,0.10), 0 2px 6px rgba(13,43,82,0.06);
  --shadow-lg: 0 20px 48px rgba(13,43,82,0.16), 0 6px 16px rgba(13,43,82,0.08);

  --header-gradient: radial-gradient(120% 140% at 15% -10%, #2a78d6 0%, #184f95 45%, #0d2b52 100%);
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1: #1a1a19;
    --surface-2: #222221;
    --page:      #0d0d0d;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --muted:          #898781;
    --border:         rgba(255,255,255,0.10);
    --border-strong:  rgba(255,255,255,0.16);
    --accent-light:   #1c3454;
    --good-bg:        #103410;
    --warning-bg:     #3a2c05;
    --critical-bg:    #3a1414;
    --shadow-md: 0 8px 24px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.3);
    --shadow-lg: 0 20px 48px rgba(0,0,0,0.55), 0 6px 16px rgba(0,0,0,0.35);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}
button { font-family: inherit; }
h1,h2,h3,p { margin: 0; }
a { color: inherit; }

.hidden { display: none !important; }

/* ─── Buttons ──────────────────────────────────────────── */
.btn {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  padding: 15px 22px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background-color .15s ease, opacity .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(42,120,214,0.35);
}
.btn-primary.is-out {
  background: linear-gradient(135deg, #e34948 0%, #b53131 100%);
  box-shadow: 0 10px 24px rgba(211,59,59,0.30);
}
.btn-secondary {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn-ghost {
  background: transparent;
  color: var(--accent);
}
.btn-block { width: 100%; display: block; text-align: center; }

/* ─── Cards ────────────────────────────────────────────── */
.card {
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* ─── Avatar ───────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  /* Fester, kraeftiger Hintergrund mit weisser Schrift statt der hellen/
     dunklen Theme-Variablen: die "--accent-light"-Variable kippt im
     Dark-Mode auf ein dunkles Navyblau, wodurch die (ebenfalls dunklen)
     Initialen-Buchstaben kaum noch lesbar waren. --accent bleibt in
     beiden Themes gleich kraeftig, daher hier bewusst fest verdrahtet. */
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: .02em;
  flex-shrink: 0;
}

/* ─── Ring / Gauge ─────────────────────────────────────── */
.ring-wrap {
  position: relative;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: rgba(255,255,255,0.16); stroke-width: 14; }
.ring-progress {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-dashoffset .9s cubic-bezier(.22,1,.36,1), stroke .4s ease;
  filter: drop-shadow(0 0 10px rgba(125,211,252,0.55));
}
.ring-progress.is-complete { filter: drop-shadow(0 0 14px rgba(74,222,128,0.65)); }
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
}
.ring-pct { font-size: 40px; font-weight: 750; line-height: 1; letter-spacing: -.02em; }
.ring-sub { font-size: 13px; color: rgba(255,255,255,0.78); margin-top: 6px; font-weight: 500; }
.ring-label { font-size: 12px; color: rgba(255,255,255,0.55); margin-top: 2px; text-transform: uppercase; letter-spacing: .06em; }
.ring-saldo {
  margin-top: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -.005em;
}
.ring-saldo.pos { background: rgba(74,222,128,0.18); color: #86efac; }
.ring-saldo.neg { background: rgba(248,113,113,0.20); color: #fca5a5; }

/* ─── App shell (Mitarbeiter) ──────────────────────────── */
.app-header {
  background: var(--header-gradient);
  padding: 22px 20px 90px; /* Fallback fuer Browser ohne env()-Unterstuetzung */
  /* iPhone: apple-mobile-web-app-status-bar-style ist "black-translucent",
     d.h. der Inhalt liegt UNTER der Statusleiste (Uhr/WLAN-Symbol). Ohne
     safe-area-Abstand landet der Avatar-Button oben rechts genau dort und
     laesst sich im Hochformat nicht antippen. +26px zusaetzlicher Puffer,
     damit der Button spuerbar unter der Statusleiste liegt statt nur knapp
     darunter. */
  padding-top: calc(env(safe-area-inset-top, 0px) + 48px);
  position: relative;
  overflow: hidden;
}
.app-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 50% at 85% 0%, rgba(255,255,255,0.12), transparent 60%);
  pointer-events: none;
}
.app-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  position: relative;
  z-index: 1;
}
.app-header-top .greet { font-size: 15px; font-weight: 600; opacity: .92; }
.app-header-top .avatar { width: 40px; height: 40px; font-size: 14px; cursor: pointer; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  backdrop-filter: blur(6px);
}
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,0.25); }
.status-pill.off .dot { background: rgba(255,255,255,0.5); box-shadow: none; }
.status-pill.pause { background: rgba(250,178,25,0.22); }
.status-pill.pause .dot { background: var(--warning); box-shadow: 0 0 0 3px rgba(250,178,25,0.25); }

.sheet {
  background: var(--surface-1);
  border-radius: 28px 28px 0 0;
  margin-top: -64px;
  position: relative;
  z-index: 2;
  padding: 24px 18px 100px;
  min-height: 50vh;
}
.sheet-handle {
  width: 40px; height: 5px; border-radius: 3px;
  background: var(--border-strong);
  margin: 0 auto 18px;
}

.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-tile {
  padding: 16px;
  border-radius: var(--radius-md);
}
.stat-tile .label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-tile .value { font-size: 22px; font-weight: 750; margin-top: 4px; letter-spacing: -.01em; }
.stat-tile.pos .value { color: var(--good); }
.stat-tile.neg .value { color: var(--critical); }

.stempel-btn {
  width: 100%;
  padding: 20px;
  border-radius: var(--radius-lg);
  font-size: 17px;
  margin-top: 6px;
}

.pause-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-lg);
  font-size: 14.5px;
  margin-top: 10px;
}
.pause-btn.is-active {
  background: var(--warning-bg);
  color: #8a5c07;
  border-color: rgba(250,178,25,0.4);
}

.report-self-btn { margin-top: 24px; font-size: 13.5px; padding: 12px; }

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 10px;
}
.app-footer .admin-link {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
  text-decoration: none;
}
.app-footer .admin-link:hover { color: var(--accent); }
.app-footer .app-version {
  font-size: 11px;
  color: var(--muted);
  opacity: .6;
}
.app-footer .admin-link::after { content: '·'; margin-left: 10px; color: var(--border-strong); }

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
}
.history-item:last-child { border-bottom: none; }
.history-item .day { font-weight: 650; font-size: 14px; }
.history-item .range { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.history-item .pause-range { font-size: 11.5px; color: var(--warning); opacity: .9; margin-top: 2px; }
.history-item .dur { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.badge-warn {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--warning);
  background: var(--warning-bg);
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
}

.section-title {
  font-size: 13px;
  font-weight: 750;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 22px 2px 10px;
}

/* ─── Bottom nav ───────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  gap: 4px;
  z-index: 10;
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 650;
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn.active { color: var(--accent); }

/* ─── Login (Mitarbeiter) ──────────────────────────────── */
.login-screen {
  min-height: 100vh;
  background: var(--header-gradient);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  color: #fff;
}
.login-logo { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
.login-sub { font-size: 13.5px; color: rgba(255,255,255,0.72); margin-bottom: 28px; }
.login-notice {
  width: 100%; max-width: 320px;
  background: rgba(250,178,25,0.16);
  border: 1px solid rgba(250,178,25,0.4);
  color: #ffe9b0;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 16px;
  text-align: center;
}

.login-user-form {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.login-screen .field-dark { margin-bottom: 6px; }
.login-screen .field-dark label { color: rgba(255,255,255,0.78); }
.login-screen .field-dark input {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.20);
  color: #fff;
}
.login-screen .field-dark input::placeholder { color: rgba(255,255,255,0.42); }
.login-screen .field-dark input:focus {
  outline: 2px solid rgba(255,255,255,0.6);
  outline-offset: 1px;
  background: rgba(255,255,255,0.15);
}
.login-user-form .btn-primary { margin-top: 10px; }
.login-user-form .pin-error { min-height: 16px; margin: 0; }

.pin-panel {
  width: 100%; max-width: 320px;
  background: var(--surface-1);
  color: var(--text-primary);
  border-radius: 24px 24px 0 0;
  position: fixed;
  left: 50%; bottom: 0; transform: translate(-50%, 0);
  padding: 22px 24px calc(24px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  z-index: 60;
}
/* Abgedunkelter Hintergrund hinter dem PIN-Panel, wenn es (wie beim
   Self-Service-PIN-aendern) ueber echtem App-Inhalt liegt statt wie beim
   Login ueber einer ohnehin leeren Seite. */
.pin-panel-backdrop {
  position: fixed; inset: 0;
  background: rgba(11,11,11,0.45);
  z-index: 55;
}
.pin-panel .who { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 18px 0; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); }
.pin-dot.filled { background: var(--accent); border-color: var(--accent); }
.pin-error { color: var(--critical); font-size: 13px; text-align: center; min-height: 18px; font-weight: 600; }
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 6px;
}
.keypad button {
  padding: 16px 0;
  font-size: 20px;
  font-weight: 650;
  border-radius: var(--radius-md);
  border: none;
  background: var(--page);
  color: var(--text-primary);
  cursor: pointer;
}
.keypad button:active { background: var(--border-strong); }
.keypad button.wide { font-size: 13px; color: var(--muted); }

/* ─── Info-Hinweis (z.B. Stunden-Verfall) ─────────────────── */
.info-note {
  background: var(--warning-bg);
  color: var(--text-primary);
  border: 1px solid rgba(250,178,25,0.35);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.5;
}
.info-note strong { color: var(--warning); }

/* ─── Auto-Logout-Hinweis (Admin-Dashboard) ────────────────── */
.alert-card {
  background: var(--critical-bg);
  border: 1px solid rgba(208,59,59,0.35);
  margin-bottom: 22px;
  padding: 20px;
}
.alert-title { font-weight: 800; color: var(--critical); font-size: 15px; }
.alert-sub { font-size: 13px; color: var(--text-primary); opacity: .85; margin-top: 4px; line-height: 1.45; }
.alert-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 0; border-top: 1px solid rgba(208,59,59,0.2);
  margin-top: 8px;
}
.alert-row .ar-name { font-weight: 700; }
.alert-row .ar-detail { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ─── "Aktuell im Dienst" (Admin-Dashboard) ────────────────── */
.dienst-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.dienst-row:last-child { border-bottom: none; }
.dienst-row .dr-name { font-weight: 650; }
.dienst-row .dr-detail { font-size: 12.5px; color: var(--muted); }

/* ─── Offene Urlaubsanträge (Admin-Dashboard) ──────────────── */
.urlaub-req-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border);
}
.urlaub-req-row:last-child { border-bottom: none; }
.urlaub-req-row .ur-name { font-weight: 700; }
.urlaub-req-row .ur-detail { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.urlaub-req-row .ur-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ─── Urlaub – eigene Antraege (App + Admin-Verlauf) ───────── */
.urlaub-saldo-card { padding: 20px; margin-bottom: 18px; text-align: center; }
.urlaub-saldo-card .value { font-size: 34px; font-weight: 800; color: var(--accent); line-height: 1.1; }
.urlaub-saldo-card .label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.urlaub-antrag-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border);
}
.urlaub-antrag-row:last-child { border-bottom: none; }
.urlaub-antrag-row .ua-range { font-weight: 700; font-size: 13.5px; }
.urlaub-antrag-row .ua-detail { font-size: 12px; color: var(--muted); margin-top: 2px; }
.urlaub-antrag-row .ua-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ─── iOS "Zum Home-Bildschirm"-Hinweis ────────────────────
   Apple loest auf Safari (anders als Chrome/Android) nie automatisch einen
   Installations-Banner aus - das geht nur manuell ueber "Teilen" → "Zum
   Home-Bildschirm". Dieser Banner erklaert das einmalig, bis er weggeklickt
   wird (merkt sich das per localStorage). */
.ios-install-hint {
  position: fixed;
  left: 50%; bottom: calc(78px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 380px;
  background: var(--surface-1);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 45;
  font-size: 13px;
  line-height: 1.45;
}
.ios-install-hint .ios-install-icon { font-size: 18px; line-height: 1; margin-top: 1px; }
.ios-install-hint .ios-install-text { flex: 1; }
.ios-install-hint .ios-install-close {
  background: none; border: none; color: var(--muted);
  font-size: 15px; line-height: 1; cursor: pointer; padding: 2px 4px;
}

/* ─── Verlauf-Modal ────────────────────────────────────── */
.verlauf-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.verlauf-row:last-child { border-bottom: none; }
.verlauf-row .vr-monat { font-weight: 700; }
.verlauf-row .vr-detail { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.verlauf-row .vr-saldo { text-align: right; white-space: nowrap; }
.verlauf-row.reset { background: var(--warning-bg); border-radius: var(--radius-sm); padding: 10px 10px; margin: 2px 0; }
.verlauf-row.reset .vr-monat::after { content: " · verfallen zum 1.2."; color: var(--warning); font-weight: 600; }

/* ─── Zeiteintraege (Admin: hinzufuegen/bearbeiten/loeschen) ─ */
.eintrag-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.eintrag-row:last-child { border-bottom: none; }
.eintrag-row .er-tag { font-weight: 700; }
.eintrag-row .er-detail { color: var(--muted); font-size: 12px; margin-top: 2px; }
.eintrag-row .er-actions { display: flex; gap: 6px; flex-shrink: 0; }
.eintrag-row .icon-btn { width: 28px; height: 28px; }
.eintrag-row .icon-btn svg { width: 14px; height: 14px; }
.tag.warn { background: var(--warning-bg); color: var(--warning); }

/* ─── Modal / confirm ──────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(11,11,11,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 24px;
}
/* Bestaetigungs-Dialoge (Loeschen/Aktivieren) koennen auch UEBER einem
   bereits offenen Modal (z.B. Verlauf/Zeiteintrag) geoeffnet werden - sie
   muessen deshalb immer zuoberst liegen, unabhaengig von ihrer Position im
   DOM (sonst "intercepted"-Klicks, weil das spaeter im DOM stehende Modal
   sonst optisch darueber liegt). */
#deleteModal, #toggleModal {
  z-index: 70;
}
.modal-card {
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.modal-card h3 { font-size: 17px; margin-bottom: 8px; }
.modal-card p { color: var(--text-secondary); font-size: 14.5px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

.summary-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--good-bg); color: var(--good);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.summary-icon svg { width: 30px; height: 30px; }
.summary-hours { font-size: 34px; font-weight: 800; margin: 4px 0 2px; letter-spacing: -.02em; }

/* ─── Admin ────────────────────────────────────────────── */
.cred-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--page); border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 8px;
}
.cred-label { font-size: 12.5px; color: var(--text-secondary); font-weight: 650; }
.cred-value { font-size: 16px; font-weight: 800; color: var(--accent); letter-spacing: .02em; font-family: var(--font); }

.admin-body { background: var(--page); min-height: 100vh; }
.admin-shell { max-width: 1080px; margin: 0 auto; padding: 28px 24px 60px; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.admin-title { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.admin-title span { color: var(--accent); }

.admin-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--header-gradient);
  padding: 20px;
}
.admin-login-card {
  background: var(--surface-2); border-radius: var(--radius-lg);
  padding: 34px 30px; width: 100%; max-width: 360px; box-shadow: var(--shadow-lg);
}
.admin-login-card h2 { font-size: 19px; margin-bottom: 4px; }
.admin-login-card .sub { color: var(--text-secondary); font-size: 13.5px; margin-bottom: 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 650; color: var(--text-secondary); margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  padding: 12px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-1);
  color: var(--text-primary);
  font-size: 14.5px;
  font-family: var(--font);
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.error-text { color: var(--critical); font-size: 13px; font-weight: 600; min-height: 18px; }

.kpi-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 26px; }
.kpi-tile { padding: 18px 18px; }
.kpi-tile .label { font-size: 12px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.kpi-tile .value { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -.01em; }

.table-card { overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--border);
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--page); }
.cell-name { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.cell-name .avatar { width: 32px; height: 32px; font-size: 12px; }
.pos { color: var(--good); font-weight: 700; }
.neg { color: var(--critical); font-weight: 700; }
.mini-track { width: 90px; height: 6px; border-radius: 4px; background: var(--accent-light); overflow: hidden; }
.mini-fill { height: 100%; background: var(--accent); border-radius: 4px; }
.mini-fill.complete { background: var(--good); }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px;
}
.tag.good { background: var(--good-bg); color: var(--good); }
.tag.muted { background: var(--border); color: var(--muted); }
.tag.bad { background: var(--critical-bg); color: var(--critical); }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--text-secondary);
}
.icon-btn:hover { background: var(--page); }
.icon-btn svg { width: 16px; height: 16px; }

.panel-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; margin-top: 26px; }
@media (max-width: 860px) { .panel-grid { grid-template-columns: 1fr; } .kpi-row { grid-template-columns: repeat(2, 1fr); } }

.panel { padding: 20px; }
.panel h3 { font-size: 15.5px; margin-bottom: 4px; }
.panel .sub { color: var(--text-secondary); font-size: 13px; margin-bottom: 16px; }

.seg {
  display: flex; background: var(--page); border-radius: var(--radius-sm); padding: 3px; gap: 3px;
}
.seg button {
  flex: 1; padding: 9px 0; border: none; background: none; border-radius: 8px;
  font-size: 13px; font-weight: 650; color: var(--muted); cursor: pointer;
}
.seg button.active { background: var(--surface-2); color: var(--text-primary); box-shadow: var(--shadow-sm); }

.report-list { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; max-height: 260px; overflow-y: auto; }
.report-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 4px; border-bottom: 1px solid var(--border);
}
.report-row:last-child { border-bottom: none; }
.report-row .meta { font-size: 12.5px; color: var(--muted); }
.report-row .name { font-size: 13.5px; font-weight: 650; }

.toast {
  position: fixed; bottom: calc(84px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  background: var(--text-primary); color: var(--surface-1);
  padding: 12px 20px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-lg); z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 14px; }

/* ─── Splash / Boot-Screen ─────────────────────────────── */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface-1);
  transition: opacity .45s ease, visibility .45s ease;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-logo {
  width: 100%;
  height: auto;
  display: block;
}
.splash-firma {
  margin-top: 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  animation: splashFade .6s ease .25s forwards;
}
@keyframes splashPop {
  0% { opacity: 0; transform: scale(.8); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes splashFade {
  to { opacity: 1; }
}

/* ─── Brand-Badge / Brand-Icon (Alb Catering) ─────────────
   Logo immer auf weißem, abgerundetem Untergrund - unabhängig vom
   Farbschema (hell/dunkel/farbiger Header) bleibt das Emblem
   so garantiert gut lesbar. */
.brand-badge {
  background: #ffffff;
  border-radius: 24%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(13,43,82,0.14);
  flex-shrink: 0;
}
.brand-badge-lg {
  width: 148px;
  height: 148px;
  padding: 20px;
  border-radius: 32px;
  animation: splashPop .7s cubic-bezier(.22,1,.36,1);
}
.brand-badge-sm {
  width: 38px;
  height: 38px;
  padding: 6px;
  border-radius: 11px;
  box-shadow: 0 2px 10px rgba(13,43,82,0.12);
}
.brand-icon { height: 100%; width: auto; display: block; }
.login-logo-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 4px; }
.admin-title-row { display: flex; align-items: center; gap: 10px; }

/* Mobile responsiveness for the app screens */
@media (min-width: 480px) {
  .app-header, .sheet { max-width: 480px; margin-left: auto; margin-right: auto; }
  .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); border-radius: 20px 20px 0 0; }
}
