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

:root {
  --ui-zoom:       1;    /* wird von appApplyUiZoom() gesetzt — Viewport-Einheiten muessen dadurch geteilt werden */
  --primary:       #35506f;
  --primary-dark:  #24384f;
  --primary-light: #4a6d94;
  --primary-pale:  #eef2f7;
  --text:          #1a2a3a;
  --text-muted:    #6b7f95;
  --border:        #e2e8f0;
  --bg:            #f8fafc;
  --white:         #ffffff;
  --danger:        #e74c3c;
  --success:       #27ae60;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 2px 12px rgba(0,0,0,.07);
  --nav-h:         100px;
}

/* ── Windows-Schrift: Segoe UI mit gezaehmten Gewichten ──────────────────────
   Auf dem Mac greift -apple-system (SF Pro), dort passen alle Gewichte.
   Segoe UI hat kein 800er-Gewicht: Chrome nimmt dann "Segoe UI Black" (900),
   dadurch wirken Zahlen und Titel gedrungen. Diese Zuordnung bildet 700–900
   auf das normale Fett ab, 600 auf Semibold, 500 auf Regular. */
@font-face {
  font-family: 'Schichtwerk UI';
  font-weight: 300 350;
  src: local('Segoe UI Light'), local('Segoe UI');
}
@font-face {
  font-family: 'Schichtwerk UI';
  font-weight: 400 599;
  src: local('Segoe UI');
}
@font-face {
  font-family: 'Schichtwerk UI';
  font-weight: 600 699;
  src: local('Segoe UI Semibold'), local('Segoe UI');
}
@font-face {
  font-family: 'Schichtwerk UI';
  font-weight: 700 900;
  src: local('Segoe UI Bold'), local('Segoe UI');
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Schichtwerk UI', 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  height: calc(100dvh / var(--ui-zoom));
  overflow: hidden;
}

/* ── Utilities ─────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Splash-Screen ────────────────────────────────────── */
#screen-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a2d44;
  transition: opacity .5s ease, visibility .5s ease;
}
#screen-splash.splash-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  animation: splashFadeIn .6s ease both;
}

.splash-logo {
  width: 80px;
  height: auto;
  margin-bottom: 24px;
}

.splash-name {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.5px;
}

.splash-sub {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.splash-dots {
  display: flex;
  gap: 8px;
  margin-top: 36px;
}
.splash-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  animation: splashDot 1.2s ease-in-out infinite;
}
.splash-dots span:nth-child(2) { animation-delay: .15s; }
.splash-dots span:nth-child(3) { animation-delay: .3s; }

@keyframes splashDot {
  0%, 60%, 100% { opacity: .35; transform: scale(1); }
  30% { opacity: 1; transform: scale(1.3); }
}

@keyframes splashFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Login-Screen ──────────────────────────────────────── */
#screen-login {
  min-height: calc(100dvh / var(--ui-zoom));
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a2a3a 0%, #2c4460 25%, #35506f 50%, #2a3f57 75%, #1e3048 100%);
  position: relative;
  overflow: hidden;
}

#screen-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 900px 600px at 20% 20%, rgba(53,80,111,.4) 0%, transparent 70%),
    radial-gradient(ellipse 700px 500px at 80% 80%, rgba(26,42,58,.6) 0%, transparent 70%),
    radial-gradient(circle 400px at 60% 30%, rgba(255,255,255,.03) 0%, transparent 60%);
  pointer-events: none;
}

/* Animated background shapes */
.login-bg-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: loginShapeFloat 20s ease-in-out infinite;
}

.login-shape--1 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(53,80,111,.15) 0%, transparent 70%);
  top: -80px; left: -60px;
  animation-delay: 0s;
  animation-duration: 22s;
}
.login-shape--2 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(96,165,250,.08) 0%, transparent 70%);
  top: 30%; right: -40px;
  animation-delay: -4s;
  animation-duration: 18s;
}
.login-shape--3 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(255,255,255,.04) 0%, transparent 70%);
  bottom: -60px; left: 20%;
  animation-delay: -8s;
  animation-duration: 25s;
}
.login-shape--4 {
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(53,80,111,.12) 0%, transparent 70%);
  top: 60%; right: 15%;
  animation-delay: -12s;
  animation-duration: 20s;
}
.login-shape--5 {
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(96,165,250,.06) 0%, transparent 70%);
  top: 15%; left: 35%;
  animation-delay: -6s;
  animation-duration: 24s;
}

@keyframes loginShapeFloat {
  0%   { opacity: 0; transform: translate(0, 0) scale(1); }
  20%  { opacity: 1; }
  50%  { transform: translate(30px, -20px) scale(1.1); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-20px, 30px) scale(0.95); }
}

/* Login wrapper for vertical layout */
.login-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 400px;
  padding: 0 20px;
  animation: loginFadeIn .6s ease-out both;
}

@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Branding above the card */
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.login-brand-icon {
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.login-brand-text {
  display: flex;
  flex-direction: column;
}

.login-brand-name {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.5px;
  line-height: 1.1;
}

.login-brand-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.login-card {
  background: var(--white);
  border-radius: 18px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25), 0 4px 12px rgba(0,0,0,.08);
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255,255,255,.6);
  border-top: 1px solid rgba(255,255,255,.8);
}

.login-logo {
  margin-bottom: 28px;
}

.login-logo h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.3px;
}

.login-logo p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-field {
  margin-bottom: 18px;
}

.login-field label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.login-card input[type="email"],
.login-card input[type="password"] {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  color: var(--text);
  background: var(--white);
}

.login-card input[type="email"]:focus,
.login-card input[type="password"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(53,80,111,.08);
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 20px;
  -webkit-user-select: none;
  user-select: none;
}
.login-remember input[type="checkbox"] {
  display: none;
}
.login-remember .check-box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.login-remember .check-box svg {
  width: 12px;
  height: 12px;
  opacity: 0;
  transition: opacity .15s;
  color: #fff;
}
.login-remember input:checked + .check-box {
  background: var(--primary);
  border-color: var(--primary);
}
.login-remember input:checked + .check-box svg {
  opacity: 1;
}

.login-card .btn-primary {
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  border-radius: 12px;
}

.login-forgot {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  margin-top: 16px;
  opacity: .7;
  transition: opacity .15s;
}
.login-forgot:hover { opacity: 1; }

.login-success {
  font-size: 13px;
  color: #166534;
  background: #dcfce7;
  border-radius: 10px;
  padding: 12px 16px;
  text-align: center;
  margin-top: 12px;
}

#login-error,
#reset-pw-error,
#verify-error {
  background: #fef2f2;
  color: var(--danger);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 18px;
}

/* ── Rechtliche Zustimmung ──────────────────────────── */
#screen-legal {
  min-height: calc(100dvh / var(--ui-zoom));
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a2a3a 0%, #2c4460 25%, #35506f 50%, #2a3f57 75%, #1e3048 100%);
  position: relative;
  overflow: hidden;
  z-index: 100;
}
#screen-legal::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 900px 600px at 20% 20%, rgba(53,80,111,.4) 0%, transparent 70%),
    radial-gradient(ellipse 700px 500px at 80% 80%, rgba(26,42,58,.6) 0%, transparent 70%),
    radial-gradient(circle 400px at 60% 30%, rgba(255,255,255,.03) 0%, transparent 60%);
  pointer-events: none;
}
.legal-card {
  max-width: 480px;
}
.legal-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}
.legal-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.legal-item input[type="checkbox"] {
  display: none;
}
.legal-item .check-box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: background .15s, border-color .15s;
}
.legal-item .check-box svg {
  width: 12px;
  height: 12px;
  opacity: 0;
  transition: opacity .15s;
  color: #fff;
}
.legal-item input:checked + .check-box {
  background: var(--primary);
  border-color: var(--primary);
}
.legal-item input:checked + .check-box svg {
  opacity: 1;
}
.legal-item a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-item a:hover {
  color: var(--primary-light);
}
#legal-accept-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* ── Verifizierungs-Code-Eingabe ──────────────────────────── */
#screen-verify {
  min-height: calc(100dvh / var(--ui-zoom));
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a2a3a 0%, #2c4460 25%, #35506f 50%, #2a3f57 75%, #1e3048 100%);
  position: relative;
  overflow: hidden;
  z-index: 100;
}
#screen-verify::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 900px 600px at 20% 20%, rgba(53,80,111,.4) 0%, transparent 70%),
    radial-gradient(ellipse 700px 500px at 80% 80%, rgba(26,42,58,.6) 0%, transparent 70%),
    radial-gradient(circle 400px at 60% 30%, rgba(255,255,255,.03) 0%, transparent 60%);
  pointer-events: none;
}
.verify-code-inputs {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}
.verify-digit {
  width: 48px;
  height: 56px;
  border: 2px solid var(--border);
  border-radius: 12px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .15s;
  caret-color: var(--primary);
}
.verify-digit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-pale);
}
.verify-code-sep {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 2px;
}

/* ── Passwort-Reset-Screen ────────────────────────────── */
#screen-reset-pw {
  min-height: calc(100dvh / var(--ui-zoom));
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a2a3a 0%, #2c4460 25%, #35506f 50%, #2a3f57 75%, #1e3048 100%);
  position: relative;
  overflow: hidden;
}
#screen-reset-pw::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 900px 600px at 20% 20%, rgba(53,80,111,.4) 0%, transparent 70%),
    radial-gradient(ellipse 700px 500px at 80% 80%, rgba(26,42,58,.6) 0%, transparent 70%),
    radial-gradient(circle 400px at 60% 30%, rgba(255,255,255,.03) 0%, transparent 60%);
  pointer-events: none;
}
#screen-reset-pw .login-card {
  position: relative;
  z-index: 1;
  animation: loginFadeIn .6s ease-out both;
}

/* ── App-Shell ─────────────────────────────────────────── */
#screen-app {
  height: calc(100dvh / var(--ui-zoom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ────────────────────────────────────────────── */
.app-header {
  display: none;
}

.app-header-brand {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

#app-admin-name {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Tab-Inhalt ────────────────────────────────────────── */
.app-content {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: linear-gradient(160deg, #eef3f7 0%, #dce5ed 100%);
}

.tab-pane {
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  z-index: 1;
}

/* Tab-Panes: visibility statt display:none für flüssiges Umschalten */
#tab-dashboard.hidden,
#tab-kalender.hidden,
#tab-planung.hidden,
#tab-team.hidden,
#tab-nachrichten.hidden,
#tab-einstellungen.hidden {
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: 0 !important;
}
#tab-dashboard.hidden    { display: block !important; }
#tab-kalender.hidden     { display: flex !important; }
#tab-planung.hidden      { display: block !important; }
#tab-team.hidden         { display: flex !important; }
#tab-nachrichten.hidden  { display: flex !important; }
#tab-einstellungen.hidden { display: flex !important; }

.tab-pane h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
}

/* ── Bottom Navigation ─────────────────────────────────── */
.app-nav {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(1080px, calc(calc(100vw / var(--ui-zoom)) - 40px));
  height: auto;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: 0 14px 36px rgba(24,39,75,.14);
  border-radius: 28px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  z-index: 200;
}

.app-nav-btn {
  border: none;
  background: none;
  border-radius: 22px;
  padding: 11px 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: .18s ease;
  position: relative;
}

.app-nav-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-nav-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(53,80,111,.22);
}

.app-nav-btn.active svg {
  stroke-width: 2;
}

.app-nav-badge {
  position: absolute;
  top: 4px;
  right: 8px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* ── Upgrade Hint ─────────────────────────────────────── */
.upgrade-hint {
  text-align: center;
  padding: 40px 20px;
}
.upgrade-hint-icon { font-size: 32px; margin-bottom: 12px; }
.upgrade-hint-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.upgrade-hint-text { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.upgrade-hint-btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 14px;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn-primary {
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}

.btn-primary:hover { background: var(--primary-light); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-secondary {
  background: var(--white);
  color: var(--primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s;
}

.btn-secondary:hover { border-color: var(--primary); }

.btn-danger {
  background: var(--danger);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  opacity: .9;
  transition: opacity .15s;
}
.btn-danger:hover { opacity: 1; }

.btn-danger-outline {
  background: none;
  color: var(--danger);
  border: 1.5px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-danger-outline:hover {
  background: var(--danger);
  color: var(--white);
}

.btn-success {
  background: var(--success);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  opacity: .9;
  transition: opacity .15s;
}
.btn-success:hover { opacity: 1; }

.btn-sm {
  padding: 7px 14px;
  font-size: 12px;
}

/* ── Karte ─────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

/* ── Ladeindikator ─────────────────────────────────────── */
.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 13px;
}

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

/* ── Planung ───────────────────────────────────────────── */
.plan-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,.06);
}

/* Toolbar */
.plan-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 10px;
  flex-shrink: 0;
}

.plan-week-nav {
  display: grid;
  grid-template-columns: 36px minmax(180px, 1fr) 36px;
  width: 280px;
  height: 36px;
  padding: 3px;
  background: var(--primary-pale);
  border-radius: 999px;
  align-items: stretch;
  gap: 0;
}
.plan-week-nav .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  color: var(--primary);
  font-size: 17px;
  line-height: 1;
  transition: background .14s, color .14s, box-shadow .14s;
  width: auto;
  height: auto;
  padding: 0;
}
.plan-week-nav .btn-icon:hover {
  background: var(--white);
  box-shadow: 0 1px 4px rgba(53,80,111,.12);
}

#plan-week-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s;
  white-space: nowrap;
  background: var(--white);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(53,80,111,.10);
  padding: 0 12px;
  color: var(--primary);
  letter-spacing: -.2px;
}
#plan-week-label:hover { background: var(--primary-pale); }

.plan-today-btn { display: none; }

.btn-icon {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s;
}
.btn-icon:hover { border-color: var(--primary); color: var(--primary); }

/* Area filters */
.plan-area-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: center;
}
.plan-area-filters:empty { display: none; }

.plan-filter-btn {
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
}
.plan-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}
.plan-filter-btn:hover:not(.active) {
  border-color: var(--primary);
  color: var(--primary);
}

/* Toolbar actions */
.plan-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.btn-icon-text {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  transition: border-color .15s, color .15s;
}
.btn-icon-text:hover { border-color: var(--primary); color: var(--primary); }
.btn-icon-text svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plan-publish-status { display: none; }

/* Kombinierter Publish-Button mit Status */
#plan-publish-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s, transform .15s;
  position: relative;
}
#plan-publish-btn:hover { opacity: .85; transform: translateY(-1px); }
#plan-publish-btn[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--text);
  color: var(--white);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  pointer-events: none;
  z-index: 50;
  animation: pubTooltipIn .15s ease;
}
@keyframes pubTooltipIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
#plan-publish-btn .plan-pub-dot { display: none; }
#plan-publish-btn .plan-pub-label { display: none; }
#plan-publish-btn .plan-pub-status { display: none; }

/* Entwurf — blau ausgefüllt */
#plan-publish-btn.pub-draft {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Veröffentlicht — weiß mit blauem Rand */
#plan-publish-btn.pub-published {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
}

/* Änderungen offen — blau ausgefüllt */
#plan-publish-btn.pub-changes {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Main layout */
.plan-main {
  display: flex;
  flex: 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
}

/* Sidebar */
.plan-sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.plan-sidebar-head {
  padding: 14px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.plan-search {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
.plan-search:focus { border-color: var(--primary); }

.plan-swap-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
  width: 100%;
}
.plan-swap-btn:hover, .plan-swap-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-pale);
}
.plan-swap-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.plan-sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Worker cards in sidebar */
.plan-worker-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: grab;
  font-size: 13px;
  font-weight: 600;
  transition: border-color .15s, box-shadow .15s;
  user-select: none;
}
.plan-worker-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-worker-card-top span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Verfuegbarkeits-Vorschau (1 Zelle pro Tag) */
.plan-avail-preview {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.plan-avail-cell {
  background: var(--border);
  border-radius: 3px;
  text-align: center;
  font-size: 8px;
  font-weight: 700;
  line-height: 16px;
  color: var(--text-muted);
}
.plan-avail-cell.avail-yes {
  background: #d1fae5;
  color: #065f46;
}
.plan-avail-cell.avail-mix {
  background: #fef3c7;
  color: #92400e;
}
.plan-avail-cell.avail-no {
  background: #fee2e2;
  color: #991b1b;
}
.plan-worker-card:hover { border-color: var(--primary); }
.plan-worker-card:active { cursor: grabbing; }
.plan-worker-card.dragging { opacity: .4; }
.plan-worker-card--selected {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent);
}

.plan-worker-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-pale);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Swap request cards */
.plan-swap-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: var(--white);
  font-size: 12px;
}
.plan-swap-card-name { font-weight: 700; margin-bottom: 4px; }
.plan-swap-card-info { color: var(--text-muted); margin-bottom: 8px; line-height: 1.5; }
.plan-swap-card-actions { display: flex; gap: 6px; }
.plan-swap-card-actions button { flex: 1; padding: 5px; font-size: 11px; font-weight: 700; border-radius: 6px; border: none; cursor: pointer; }
.plan-swap-approve { background: #dcfce7; color: #166534; }
.plan-swap-reject  { background: #fee2e2; color: #991b1b; }

/* Grid */
.plan-grid-wrap {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--bg);
  position: relative;
}

.plan-grid-inner {
  display: flex;
  flex-direction: column;
  min-width: max-content;
}

/* Day headers */
.plan-day-headers {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.plan-gutter-header {
  width: 48px;
  flex-shrink: 0;
}

.plan-day-header {
  flex: 1;
  min-width: 100px;
  padding: 14px 6px 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  border-left: 1px solid var(--border);
  position: relative;
}
.plan-day-clear {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, color .15s;
}
.plan-day-header:hover .plan-day-clear { opacity: 1; }
.plan-day-clear:hover { color: var(--danger); }
.plan-day-clear svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.plan-day-header.today { color: var(--primary); }
.plan-day-header .day-name { font-size: 11px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.plan-day-header .day-date { font-size: 14px; font-weight: 800; }
.plan-day-header--active {
  background: color-mix(in srgb, var(--primary) 12%, var(--white)) !important;
  box-shadow: inset 0 3px 0 var(--primary) !important;
}
.plan-day-header--active .day-name {
  color: var(--primary) !important;
}
.plan-day-header--active .day-date {
  color: var(--primary) !important;
}
.plan-day-header--active.today .day-date {
  background: var(--primary) !important;
  color: var(--white) !important;
}

/* Verfuegbarkeits-Farben auf Day-Headers */
.plan-day-header.avail-day-yes { background: #f0fdf4; }
.plan-day-header.avail-day-yes .day-name { color: #059669; }
.plan-day-header.avail-day-no { background: #fef2f2; }
.plan-day-header.avail-day-no .day-name { color: #dc2626; }
.plan-day-header.avail-day-mix { background: #fffbeb; }
.plan-day-header.avail-day-mix .day-name { color: #d97706; }

/* Wetter im Day-Header */
.plan-day-weather {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-top: 3px;
  font-size: 11px;
  height: 22px;
  color: var(--text-muted);
}
.plan-weather-icon { display: inline-flex; align-items: center; color: var(--text-muted); }
.plan-weather-icon svg { display: block; }
.plan-weather-temp { font-weight: 700; font-size: 11px; color: var(--text-muted); }
.plan-weather-precip { font-size: 10px; color: var(--text-muted); opacity: .7; }

/* Wetter Detail-Popup */
.plan-weather-popup {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 12px 48px rgba(0,0,0,.18);
  z-index: 500;
  min-width: 260px;
  animation: kalFadeIn .12s ease;
}
/* Header */
.pwp-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.pwp-header-icon svg { display: block; }
.pwp-header-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.pwp-header-temps { display: flex; gap: 8px; margin-top: 2px; }
.pwp-hi { font-size: 18px; font-weight: 800; color: var(--text); }
.pwp-lo { font-size: 18px; font-weight: 800; color: var(--text-muted); }
/* Stats */
.pwp-stats {
  display: flex;
  gap: 2px;
  margin-bottom: 12px;
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 0;
}
.pwp-stat {
  flex: 1;
  text-align: center;
}
.pwp-stat-val { font-size: 14px; font-weight: 800; color: var(--text); }
.pwp-stat-lbl { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
/* Stündlich */
.pwp-hourly {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 4px 0;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.pwp-hour {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 32px;
  flex-shrink: 0;
}
.pwp-hour-time { font-size: 10px; color: var(--text-muted); font-weight: 600; }
.pwp-hour-icon svg { display: block; }
.pwp-hour-temp { font-size: 11px; font-weight: 700; color: var(--text); }
.pwp-hour-rain { font-size: 9px; color: #3b82f6; font-weight: 600; }

/* Verfügbarkeits-Indikator im Grid-Header */
.plan-avail-strip {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin-top: 5px;
}

.plan-avail-box {
  width: 18px;
  height: 8px;
  border-radius: 3px;
  flex-shrink: 0;
}

.plan-avail-box.avail-green { background: #22c55e; }
.plan-avail-box.avail-red   { background: #ef4444; }
.plan-avail-box.avail-empty { background: var(--border); opacity: .5; }
.plan-day-header.today .day-date {
  background: var(--primary);
  color: var(--white);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

/* Time body */
.plan-time-body {
  display: flex;
  position: relative;
}

.plan-time-gutter {
  width: 48px;
  flex-shrink: 0;
  position: relative;
  background: var(--white);
}

.plan-hour-label {
  position: absolute;
  right: 6px;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1;
  transform: translateY(-50%);
  pointer-events: none;
  letter-spacing: .3px;
}

/* Day columns */
.plan-day-col {
  flex: 1;
  min-width: 100px;
  border-left: 1px solid var(--border);
  position: relative;
  background: var(--white);
}
.plan-day-col.today { background: #f8faff; }


.plan-hour-row {
  height: var(--hour-h, 64px);
  position: relative;
}
.plan-hour-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  border-top: 1px solid var(--border);
}
.plan-hour-row:first-child::before { border-top: none; }
.plan-hour-row::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px dashed color-mix(in srgb, var(--border) 60%, transparent);
}

/* Shift blocks */
/* Verfügbarkeitsblöcke im Grid */
.plan-avail-block {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 8px;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  border: 1.5px solid transparent;
}
.plan-avail-block.avail-yes {
  background: rgba(16, 185, 129, .12);
  border-color: rgba(16, 185, 129, .3);
}
.plan-avail-block.avail-no {
  background: rgba(239, 68, 68, .1);
  border-color: rgba(239, 68, 68, .25);
}

.plan-avail-block-label {
  font-size: 10px;
  font-weight: 700;
  padding: 5px 8px;
  letter-spacing: .3px;
}
.plan-avail-block.avail-yes .plan-avail-block-label { color: #047857; }
.plan-avail-block.avail-no .plan-avail-block-label { color: #b91c1c; }

/* Abwesenheitsblock im Planungsgrid */
.plan-leave-block {
  position: relative;
  margin: 2px 4px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}
.plan-leave-block--approved {
  background: #fef3c7;
  color: #92400e;
  border-left: 3px solid #f59e0b;
}
.plan-leave-block--pending {
  background: #f3f4f6;
  color: #6b7280;
  border-left: 3px solid #9ca3af;
}

.plan-shift {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  z-index: 2;
  box-sizing: border-box;
  transition: opacity .15s, box-shadow .15s;
  z-index: 2;
  border: 1.5px solid transparent;
  line-height: 1.3;
}
.plan-shift:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); opacity: .9; }
.plan-shift--dimmed { opacity: .3; }
.plan-shift--highlight {
  box-shadow: 0 0 0 2px var(--primary), 0 2px 12px rgba(59,130,246,.35);
  animation: plan-shimmer 1.8s ease-in-out infinite;
}
@keyframes plan-shimmer {
  0%, 100% { box-shadow: 0 0 0 2px var(--primary), 0 2px 12px rgba(59,130,246,.25); }
  50%      { box-shadow: 0 0 0 2px var(--primary), 0 2px 20px rgba(59,130,246,.5); }
}
.plan-shift.dragging { opacity: .4; cursor: grabbing; }
.plan-dragging .plan-shift:not(.dragging) { pointer-events: none; }
.plan-dragging .plan-avail-block { pointer-events: none; }
.plan-dragging .plan-leave-block { pointer-events: none; }
.plan-shift.open-shift {
  border-style: dashed;
  background: transparent !important;
}
.plan-shift--tiny { padding: 0 6px; font-size: 10px; display: flex; align-items: center; }
.plan-shift-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-shift-time { font-size: 10px; opacity: .8; }
.plan-shift-area { font-size: 10px; opacity: .7; }
.plan-shift-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border: none;
  background: rgba(0,0,0,.2);
  color: inherit;
  border-radius: 50%;
  font-size: 13px;
  line-height: 18px;
  text-align: center;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
}
.plan-shift:hover .plan-shift-del { opacity: 1; }
.plan-shift-del:hover { background: rgba(0,0,0,.4); }

/* Drop ghost */
.plan-drop-ghost {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 6px;
  background: var(--primary-pale);
  border: 1.5px dashed var(--primary);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
  opacity: .7;
}

/* Kalender-Ereignisse im Planungsgrid */
.plan-cal-event {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 6px;
  border: 1.5px dashed var(--plan-cal-accent, #3b82f6);
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
  padding: 3px 5px;
  box-sizing: border-box;
}
.plan-cal-event--allday {
  position: relative;
  margin: 2px 4px;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1.5px dashed var(--plan-cal-accent, #3b82f6);
  pointer-events: none;
}
.plan-cal-event-title {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .2px;
}
.plan-cal-event-time {
  font-size: 9px;
  opacity: .8;
}
.plan-cal-event-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2px;
}
.btn-icon-text.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-icon-text.active:hover {
  background: #2c4460;
  border-color: #2c4460;
  color: #fff;
}
.plan-cal-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border-radius: 999px;
  pointer-events: none;
}
#plan-cal-toggle-btn {
  position: relative;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: var(--white);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 12px 40px rgba(0,0,0,.16);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 0;
}
.modal-header h3 { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -.3px; flex: 1; }

.modal-back {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  margin-right: 8px;
  flex-shrink: 0;
}
.modal-back:hover { background: var(--border); }

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.modal-close:hover { background: var(--border); }

.modal-card form { padding: 20px 24px 24px; }

.form-row { margin-bottom: 16px; }
.form-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-row input, .form-row select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  background: var(--bg);
  color: #475569;
}
.form-row input::placeholder { color: var(--text-muted); font-weight: 400; }
.form-row input:focus, .form-row select:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

/* Autocomplete Dropdown */
.eins-autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  z-index: 50;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 4px;
}
.eins-autocomplete-item {
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
}
.eins-autocomplete-item:first-child { border-radius: 10px 10px 0 0; }
.eins-autocomplete-item:last-child { border-radius: 0 0 10px 10px; }
.eins-autocomplete-item:only-child { border-radius: 10px; }
.eins-autocomplete-item:hover {
  background: var(--bg-subtle);
}
.eins-autocomplete-item + .eins-autocomplete-item {
  border-top: 1px solid var(--border);
}

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-2 label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-row-2 input { width: 100%; }

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--text) !important;
  font-weight: 600 !important;
}
.checkbox-label input[type=checkbox] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
  border-radius: 5px;
}

.optional { font-size: 10px; color: var(--text-muted); font-weight: 400; text-transform: lowercase; }

/* Shift Ende offen */
.shift-end-offen {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px dashed var(--primary);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, var(--white));
  text-align: center;
}

/* Apple-Style Switch */
.switch-label {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--text) !important;
  cursor: pointer;
}
.shift-area-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.apple-switch {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: none;
  background: var(--border);
  cursor: pointer;
  padding: 0;
  transition: background .25s;
  flex-shrink: 0;
}
.apple-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .25s;
}
.apple-switch.active {
  background: #34c759;
}
.apple-switch.active .apple-switch-knob {
  transform: translateX(18px);
}

.shift-repeat-options {
  margin-top: 8px;
}
.shift-repeat-options select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

.modal-footer {
  display: flex;
  align-items: center;
  padding: 16px 20px 20px;
}
.modal-footer-right { display: flex; gap: 10px; margin-left: auto; }

.modal-footer .btn-secondary,
.modal-footer .btn-primary {
  height: 40px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
}
.modal-footer .btn-danger {
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  margin: 0 auto 0 0;
}

/* Context menu */
.context-menu {
  position: fixed;
  z-index: 300;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 4px;
  min-width: 180px;
}
.context-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text);
  text-align: left;
}
.context-menu-item:hover { background: var(--primary-pale); color: var(--primary); }
.context-menu-item svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Tab pane override for planung */
#tab-planung.tab-pane {
  padding: 20px 24px;
  max-width: none;
  height: calc(calc(100dvh / var(--ui-zoom)) - var(--nav-h));
  overflow: hidden;
  background: linear-gradient(160deg, #eef3f7 0%, #dce5ed 100%);
  display: flex;
  flex-direction: column;
}

/* When planung tab is active, app-content must not scroll */
body.tab-planung-active .app-content {
}
body.tab-planung-active {
  background: #dce5ed;
}

/* ═══════════════════════════════════════════════════════════
   KALENDER
   ═══════════════════════════════════════════════════════════ */

/* Tab-Pane Override */
#tab-kalender.kal-pane {
  padding: 20px 24px;
  max-width: none;
  display: flex;
  flex-direction: column;
  height: calc(calc(100dvh / var(--ui-zoom)) - var(--nav-h));
  overflow: hidden;
  background: linear-gradient(160deg, #eef3f7 0%, #dce5ed 100%);
}

/* Großes weißes Panel */
.kal-panel {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.06);
}

/* ── Toolbar ─────────────────────────────────────────────── */
.kal-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-bottom: 10px;
}

.kal-toolbar-spacer { flex: 1; }

.kal-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-pale);
  border-radius: 999px;
  padding: 3px 14px 3px 10px;
  height: 36px;
  transition: background .14s, box-shadow .14s;
  position: relative;
}
.kal-search-wrap:focus-within {
  background: var(--white);
  box-shadow: 0 1px 6px rgba(53,80,111,.15);
}

/* Dropdown */
.kal-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.12);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kal-search-dropdown.hidden { display: none; }

.kal-search-dropdown-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  padding: 0 4px;
}
.kal-search-dropdown-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.kal-search-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: none;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s, color .12s, box-shadow .12s;
  background: var(--primary-pale);
  color: var(--primary);
}
.kal-search-chip:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(53,80,111,.18);
}
.kal-search-chip.active {
  background: var(--primary);
  color: #fff;
}
.kal-search-dropdown-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px;
}
.kal-search-icon {
  width: 15px;
  height: 15px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.kal-search {
  width: 140px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  outline: none;
}
.kal-search::placeholder {
  color: var(--text-muted);
  font-weight: 600;
}

/* Ansichts-Umschalter (Pill-Stil) */
.kal-view-switcher {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--primary-pale);
  border-radius: 999px;
  padding: 3px;
}

.kal-view-btn {
  height: 30px;
  padding: 0 13px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: background .14s, color .14s, box-shadow .14s;
  white-space: nowrap;
}
.kal-view-btn + .kal-view-btn { border-left: none; }
.kal-view-btn.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(53,80,111,.12);
}

/* Navigation (Pill-Stil) */
.kal-nav {
  display: grid;
  grid-template-columns: 36px minmax(180px, 1fr) 36px;
  width: 280px;
  height: 36px;
  padding: 3px;
  background: var(--primary-pale);
  border-radius: 999px;
  align-items: stretch;
  gap: 0;
}
.kal-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  color: var(--primary);
  font-size: 17px;
  line-height: 1;
  transition: background .14s, color .14s, box-shadow .14s;
}
.kal-nav-btn:hover {
  background: var(--white);
  box-shadow: 0 1px 4px rgba(53,80,111,.12);
}
#kal-nav-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  min-width: 140px;
  text-align: center;
  color: var(--primary);
  letter-spacing: -.2px;
  cursor: pointer;
  transition: background .12s;
  white-space: nowrap;
  background: var(--white);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(53,80,111,.10);
  padding: 0 12px;
}
#kal-nav-label:hover { background: var(--primary-pale); }

/* + Neuer Eintrag Button (Gradient-Pill) */
.kal-add-btn {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(53,80,111,.18);
  white-space: nowrap;
  transition: opacity .15s, transform .15s;
}
.kal-add-btn:hover {
  opacity: .88;
  transform: translateY(-1px);
}

/* Schichten-Toggle */
.kal-shifts-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .12s, color .12s;
}
.kal-shifts-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.kal-shifts-toggle input[type=checkbox] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* Typ-Filter */
.kal-type-filters,
.kal-area-filters {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.kal-body {
  flex: 1;
  overflow: hidden;
  position: relative;
  min-height: 0;
}

@keyframes kalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes kalFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.kal-fade-in  { }
.kal-fade-out { }

/* ══════════════════════════════════════════════════════════
   MONATSANSICHT
   ══════════════════════════════════════════════════════════ */

.kal-month {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* Wochentag-Kopf */
.kal-month-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.kal-month-head-cell {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
}

/* Wochen-Grid */
.kal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  flex: 1;
}

/* Tag-Zelle */
.kal-month-cell {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 10px rgba(0,0,0,.03);
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow .12s;
  min-height: 0;
}
.kal-month-cell:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }

.kal-month-cell.other-month {
  background: #f8fafb;
  opacity: .58;
}
.kal-month-cell.other-month .kal-cell-day { color: var(--text-muted); }

.kal-month-cell.today {
  border-color: var(--primary);
  border-width: 2px;
  box-shadow: 0 4px 16px rgba(53,80,111,.13);
}

.kal-month-cell.today .kal-cell-day-num {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 12px;
}

.kal-month-cell.today .kal-cell-day-badge {
  background: var(--primary);
  color: #fff;
  font-size: 9px;
}

.kal-cell-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.kal-cell-day-num {
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}
.kal-cell-day-badge {
  font-size: 9px;
  font-weight: 800;
  color: var(--primary-dark);
  background: var(--primary-pale);
  border-radius: 999px;
  padding: 3px 6px;
  white-space: nowrap;
}

/* Abwesenheits-Chip im Kalender */
.kal-leave-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kal-leave-chip--urlaub  { background: #fef3c7; color: #92400e; }
.kal-leave-chip--krank   { background: #fee2e2; color: #991b1b; }
.kal-leave-chip--sonstiges { background: #f3f4f6; color: #4b5563; }
.kal-leave-chip--pending { opacity: .6; }

/* Ereignis-Chips in Monatsansicht */
.kal-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 2px;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: opacity .1s;
  border: none;
  border-left: 3px solid var(--primary);
  background: var(--primary-pale);
  min-width: 0;
}
.kal-chip:hover { opacity: .8; }
.kal-chip-time {
  font-weight: 500;
  opacity: .8;
  flex-shrink: 0;
}
.kal-chip-title { overflow: hidden; text-overflow: ellipsis; }
.kal-chip-source { font-size: 8px; font-weight: 800; background: rgba(53,80,111,.15); color: var(--primary); border-radius: 3px; padding: 1px 4px; margin-left: auto; flex-shrink: 0; }

/* Terminal-Toggle im Modal */
.kal-terminal-toggle-row { margin-top: 8px; }
.kal-terminal-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.kal-terminal-toggle input { width: 18px; height: 18px; accent-color: var(--primary); }

/* "+X weitere" Link */
.kal-more-link {
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 3px;
  margin-top: 1px;
}
.kal-more-link:hover { background: var(--primary-pale); }

/* ══════════════════════════════════════════════════════════
   WOCHEN- und TAGESANSICHT
   ══════════════════════════════════════════════════════════ */

.kal-timeline {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.kal-timeline-head {
  display: flex;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-shrink: 0;
}

.kal-timeline-gutter-head {
  width: 52px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}

.kal-timeline-day-head {
  flex: 1;
  min-width: 120px;
  padding: 6px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  border-left: 1px solid var(--border);
}
.kal-timeline-day-head .day-name { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.kal-timeline-day-head .day-date { font-size: 16px; font-weight: 800; }
.kal-timeline-day-head.today { color: var(--primary); }
.kal-timeline-day-head.today .day-date {
  background: var(--primary);
  color: var(--white);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-size: 14px;
}

/* Body: der sichtbare Zeitraum füllt immer exakt die Höhe — Mausrad zoomt */
.kal-timeline-body {
  flex: 1;
  overflow: hidden;
  min-height: 0;
  overscroll-behavior: contain;
}
.kal-timeline-body-inner {
  display: flex;
  height: 100%;
}

/* Zeit-Gutter */
.kal-time-gutter {
  width: 52px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--white);
  position: sticky;
  left: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
}
.kal-hour-label {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  padding: 4px 6px 0;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

/* Tag-Spalten in Zeitachsen-Ansicht */
.kal-day-col {
  flex: 1;
  min-width: 120px;
  border-left: 1px solid var(--border);
  position: relative;
  background: var(--white);
  display: flex;
  flex-direction: column;
}
.kal-day-col.today { background: #fafbff; }

.kal-hour-row {
  flex: 1;
  min-height: 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background .1s;
}
.kal-hour-row:hover { background: var(--primary-pale); }
.kal-hour-row::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  border-bottom: 1px dashed rgba(0,0,0,.05);
  pointer-events: none;
}

/* Kalender-Ereignis-Blöcke in Zeitachse */
.kal-event-block {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: grab;
  overflow: hidden;
  z-index: 3;
  border: 1.5px solid transparent;
  line-height: 1.3;
  transition: opacity .12s, box-shadow .12s;
}
.kal-event-block:hover { box-shadow: 0 2px 8px rgba(0,0,0,.18); opacity: .9; }
.kal-event-block--tiny { padding: 0 5px; font-size: 10px; display: flex; align-items: center; }
.kal-event-block--tiny .kal-event-block-time { display: none; }
.kal-shift-block--tiny { padding: 0 5px; font-size: 9px; display: flex; align-items: center; }
.kal-shift-block--tiny .kal-shift-block-time { display: none; }
.kal-event-block-time { font-size: 10px; font-weight: 500; opacity: .8; }
.kal-event-block-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Now-Indicator */
.kal-now-indicator {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  z-index: 5;
  pointer-events: none;
}
.kal-now-indicator::before {
  content: '';
  position: absolute;
  left: -6px;
  top: -5px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid var(--primary);
}

/* Schicht-Blöcke in Zeitachse (halb-transparent, klar unterscheidbar) */
.kal-shift-block {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 600;
  overflow: hidden;
  z-index: 2;
  border: 1.5px dashed;
  opacity: .55;
  pointer-events: none;
  line-height: 1.3;
}
.kal-shift-block-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kal-shift-block-time { font-size: 9px; opacity: .8; }

/* ══════════════════════════════════════════════════════════
   TAGESÜBERSICHT DRAWER
   ══════════════════════════════════════════════════════════ */

.kal-day-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.25);
  z-index: 150;
}

.kal-day-drawer {
  position: fixed;
  right: 0;
  top: 52px;
  bottom: var(--nav-h);
  width: 340px;
  max-width: calc(95vw / var(--ui-zoom));
  background: var(--white);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 20px rgba(0,0,0,.1);
  z-index: 160;
  display: flex;
  flex-direction: column;
}

.kal-day-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  flex-shrink: 0;
}

.kal-day-drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kal-day-shifts-btn {
  font-size: 11px;
  padding: 5px 10px;
}
.kal-day-shifts-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.kal-day-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Ereignis-Karten im Drawer */
.kal-drawer-entry {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.kal-drawer-entry:hover {
  border-color: var(--primary-light);
  background: var(--primary-pale);
}
.kal-drawer-entry-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.kal-drawer-entry-time {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.kal-drawer-entry-type {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.kal-drawer-entry-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.kal-drawer-entry-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kal-drawer-entry-meta span { display: flex; align-items: center; gap: 3px; }
.kal-drawer-no-events {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 32px 0;
}

/* Schichten-Panel im Drawer */
.kal-day-shifts-panel {
  border-top: 1px solid var(--border);
  overflow-y: auto;
  padding: 10px 12px;
  max-height: 260px;
  flex-shrink: 0;
}
.kal-shifts-panel-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.kal-shifts-area-group {
  margin-bottom: 10px;
}
.kal-shifts-area-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}
.kal-shift-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
}
.kal-shift-row:last-child { border-bottom: none; }
.kal-shift-row-time { color: var(--text-muted); font-size: 11px; flex-shrink: 0; min-width: 90px; }
.kal-shift-row-name { font-weight: 600; color: var(--text); }

/* ══════════════════════════════════════════════════════════
   EREIGNIS-MODAL
   ══════════════════════════════════════════════════════════ */

/* Kalender Detail-Ansicht */
.kal-detail-card {
  max-width: 440px;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
}
.kal-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 0;
}
.kal-detail-type-badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid transparent;
}
.kal-detail-edit-btn {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: border-color .15s, color .15s;
}
.kal-detail-edit-btn:hover { border-color: var(--primary); color: var(--primary); }
.kal-detail-edit-btn svg { width: 16px; height: 16px; }
.kal-detail-header .modal-close { flex-shrink: 0; }
.kal-detail-body {
  padding: 20px;
}
.kal-detail-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text);
}
.kal-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-secondary, #64748b);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.kal-detail-row:last-child { border-bottom: none; }
.kal-detail-row-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--primary);
}
.kal-detail-row-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Kalender Drag & Drop */
.kal-dragging { opacity: .4; cursor: grabbing; }
.kal-event-block:active { cursor: grabbing; }
.kal-drop-ghost {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 6px;
  background: var(--primary-pale);
  border: 1.5px dashed var(--primary);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
  opacity: .7;
}

.kal-modal-card {
  max-width: 560px;
  max-height: calc(90dvh / var(--ui-zoom));
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
}
.kal-modal-card form {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
}

/* Header */
.kal-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 16px 10px;
}
.kal-modal-head-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--primary);
}
.kal-modal-close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s;
}
.kal-modal-close-btn:hover { background: var(--bg); }

/* Body */
.kal-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
  min-height: 0;
}

/* Titel-Input (groß, prominent, grauer Hintergrund) */
.kal-modal-title-input {
  width: 100%;
  padding: 16px 18px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  outline: none;
  margin-bottom: 14px;
  background: var(--bg);
  transition: border-color .15s;
}
.kal-modal-title-input::placeholder { color: var(--text-muted); font-weight: 600; }
.kal-modal-title-input:focus { border-color: var(--primary); }

/* Typ-Chips */
.kal-modal-type-chips {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  overflow-x: auto;
}
.kal-type-chip {
  padding: 7px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .14s, color .14s, border-color .14s;
  white-space: nowrap;
  flex-shrink: 0;
}
.kal-type-chip:hover { border-color: var(--primary); color: var(--primary); }
.kal-type-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Reservierung-Felder */
.kal-res-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.kal-res-field {
  flex: 1;
}
.kal-res-field label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 5px;
}
.kal-res-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  outline: none;
  background: var(--white);
  transition: border-color .15s;
}
.kal-res-field input:focus { border-color: var(--primary); }

/* WANN-Fieldset (grauer Hintergrund + Border) */
.kal-modal-when {
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  margin: 0 0 18px;
  background: var(--bg);
}
.kal-modal-when legend {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--primary);
  padding: 0 6px;
}
.kal-when-row {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}
.kal-when-row:first-of-type { margin-top: 6px; }
.kal-when-field {
  flex: 1;
}
.kal-when-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.kal-when-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  outline: none;
  transition: border-color .15s;
  background: var(--white);
  accent-color: var(--primary);
  color-scheme: light;
}
.kal-when-field input:focus { border-color: var(--primary); }
.kal-when-field input::-webkit-calendar-picker-indicator {
  filter: brightness(0) saturate(100%) invert(30%) sepia(20%) saturate(800%) hue-rotate(175deg);
}

/* Ganztägig */
.kal-when-allday {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 20px;
  flex-shrink: 0;
}
.kal-when-allday-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Toggle-Switch */
.kal-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.kal-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.kal-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background .2s;
}
.kal-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  transition: transform .2s;
}
.kal-toggle input:checked + .kal-toggle-track {
  background: var(--primary);
}
.kal-toggle input:checked + .kal-toggle-track::after {
  transform: translateX(20px);
}

/* Bereich + Details Labels */
.kal-modal-body .form-row label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.kal-modal-body .form-row .optional { display: none; }

/* Bereich Input */
.kal-modal-body .form-row input[type="text"] {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--white);
}
.kal-modal-body .form-row input[type="text"]:focus { border-color: var(--primary); }

/* Textarea */
.kal-modal-body .form-row textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color .15s;
  background: var(--bg);
  min-height: 80px;
  color: var(--text);
}
.kal-modal-body .form-row textarea:focus { border-color: var(--primary); }

/* Wiederholen-Card */
.kal-repeat-card {
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  margin-top: 18px;
  background: var(--bg);
}
.kal-repeat-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.kal-repeat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-pale);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.kal-repeat-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.kal-repeat-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.kal-repeat-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.kal-repeat-options {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.kal-repeat-row {
  display: flex;
  gap: 12px;
}
.kal-repeat-field {
  flex: 1;
}
.kal-repeat-field label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 4px;
}
.kal-repeat-field select,
.kal-repeat-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  outline: none;
  background: var(--white);
  transition: border-color .15s;
}
.kal-repeat-field select:focus,
.kal-repeat-field input:focus { border-color: var(--primary); }

/* Footer */
.kal-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  padding: 14px 16px 22px;
  gap: 10px;
}
.kal-modal-footer-left { display: flex; gap: 8px; margin-right: auto; }
.kal-modal-footer-right { display: flex; gap: 10px; align-items: center; }
.kal-modal-btn-cancel {
  padding: 11px 20px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  border-radius: 999px;
  transition: background .12s;
}
.kal-modal-btn-cancel:hover { background: var(--bg); }
.kal-modal-btn-save {
  padding: 11px 22px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(53,80,111,.18);
  transition: opacity .15s, transform .15s;
}
.kal-modal-btn-save:hover { opacity: .88; transform: translateY(-1px); }

/* ══════════════════════════════════════════════════════════
   EREIGNIS-TYP FARBEN
   ══════════════════════════════════════════════════════════ */

.kal-type-reservierung  { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.kal-type-veranstaltung { background: #dcfce7; color: #166534; border-color: #86efac; }
.kal-type-termin        { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.kal-type-intern        { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
.kal-type-sonstiges     { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }

/* When kalender tab is active, override app-content scroll */
body.tab-kalender-active .app-content {
}
body.tab-kalender-active {
  background: #dce5ed;
}

/* ═══════════════════════════════════════════════════════════
   TEAM
   ═══════════════════════════════════════════════════════════ */

/* Tab-Pane Override */
#tab-team.team-pane {
  padding: 20px 24px;
  max-width: none;
  display: flex;
  flex-direction: column;
  height: calc(calc(100dvh / var(--ui-zoom)) - var(--nav-h));
  overflow: hidden;
  background: linear-gradient(160deg, #eef3f7 0%, #dce5ed 100%);
}

body.tab-team-active .app-content {
}
body.tab-team-active {
  background: #dce5ed;
}

/* Großes weißes Panel */
.team-panel {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.06);
}

/* ── Toolbar ─────────────────────────────────────────────── */
.team-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 10px;
  background: transparent;
  border-bottom: none;
  flex-shrink: 0;
  flex-wrap: wrap;
  z-index: 10;
}

.team-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-pale);
  border-radius: 999px;
  padding: 3px 14px 3px 10px;
  height: 36px;
  transition: background .14s, box-shadow .14s;
  flex-shrink: 0;
}
.team-search-wrap:focus-within {
  background: var(--white);
  box-shadow: 0 1px 6px rgba(53,80,111,.15);
}

.team-search-icon {
  width: 15px;
  height: 15px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.team-search {
  width: 140px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  outline: none;
}
.team-search::placeholder {
  color: var(--text-muted);
  font-weight: 600;
}


.team-costs-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
  flex-shrink: 0;
}
.team-costs-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: var(--primary-pale);
}
.team-costs-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.team-archive-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  margin-bottom: 10px;
  background: var(--bg);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}
.team-archive-back-btn {
  padding: 5px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.team-archive-back-btn:hover {
  border-color: var(--primary);
  background: var(--primary-pale);
}

.team-archive-section {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}
.team-drawer-archive-btn {
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.team-drawer-archive-btn:hover {
  border-color: #f87171;
  color: #dc2626;
  background: #fef2f2;
}
.team-drawer-archive-btn--restore {
  border-color: #86efac;
  color: #16a34a;
  background: #f0fdf4;
}
.team-drawer-archive-btn--restore:hover {
  border-color: #4ade80;
  color: #15803d;
  background: #dcfce7;
}

.team-toolbar-right {
  margin-left: auto;
}

/* Add-Button */
.team-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(53,80,111,.18);
  white-space: nowrap;
  transition: opacity .15s, transform .15s;
}
.team-add-btn:hover {
  opacity: .88;
  transform: translateY(-1px);
}

/* Add-Modal */
.team-add-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 300;
}
.team-add-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  max-width: calc(92vw / var(--ui-zoom));
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.16);
  z-index: 310;
  overflow: hidden;
}
.team-add-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 14px;
}
.team-add-modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}
.team-add-live {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 20px 18px;
  padding: 14px 18px;
  background: var(--bg);
  border-radius: 14px;
}
.team-add-live-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  white-space: nowrap;
}
.team-add-live-info {
  flex: 1;
  min-width: 0;
}
.team-add-live-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.team-add-live-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-add-modal-body {
  padding: 0 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.team-add-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--white);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  text-align: left;
  width: 100%;
}
.team-add-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 2px 12px rgba(53,80,111,.08);
  background: var(--bg);
}
.team-add-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-pale) 0%, #d0dfef 100%);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.team-add-card-icon--requests {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #b45309;
}
.team-add-card-text {
  flex: 1;
  min-width: 0;
}
.team-add-card-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.team-add-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.team-add-card-arrow {
  font-size: 20px;
  color: var(--text-muted);
  opacity: .4;
  flex-shrink: 0;
  transition: opacity .15s;
}
.team-add-card:hover .team-add-card-arrow {
  opacity: .7;
}
.team-add-req-count {
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  line-height: 16px;
  min-width: 18px;
  text-align: center;
  margin-left: 6px;
}
.team-add-req-count:empty { display: none; }
.team-add-card--archive {
  margin-top: 4px;
  border-style: dashed;
  opacity: .75;
}
.team-add-card--archive:hover { opacity: 1; }
.team-add-archive-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 4px;
}

/* ── Mitarbeiterliste ────────────────────────────────────── */
.team-list {
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: none;
  width: 100%;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.team-worker-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.team-worker-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 2px 10px rgba(53,80,111,.08);
}

.team-card-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.team-card-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-pale) 0%, #d0dfef 100%);
  color: var(--primary);
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.team-card-status {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--white);
}
.team-card-status.status--seen {
  background: #22c55e;
}
.team-card-status.status--unseen {
  background: #f59e0b;
}
.team-card-status.status--no-plan {
  background: #d1d5db;
}
.team-card-info {
  min-width: 0;
}
.team-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-card-role {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.team-card-spacer {
  flex: 1;
}

.team-card-hours {
  text-align: right;
  flex-shrink: 0;
}

.team-card-hours-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.team-card-hours-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}
.team-card-hours-label {
  display: none;
}

.team-card-chevron {
  font-size: 18px;
  color: var(--text-muted);
  opacity: .3;
  flex-shrink: 0;
  line-height: 1;
  transition: opacity .15s;
}
.team-worker-card:hover .team-card-chevron {
  opacity: .6;
}

/* ── Drawer ──────────────────────────────────────────────── */
.team-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 300;
  animation: drawerFadeIn .15s ease-out both;
}

.team-drawer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 660px;
  max-width: calc(92vw / var(--ui-zoom));
  max-height: calc(calc(100dvh / var(--ui-zoom)) - 40px);
  height: auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.16);
  z-index: 310;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: drawerSlideIn .2s ease-out both;
}

@keyframes drawerFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes drawerSlideIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.97); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.team-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  flex-shrink: 0;
  gap: 12px;
}

.team-drawer-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.team-drawer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary-pale) 0%, #d0dfef 100%);
  color: var(--primary);
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.team-drawer-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-drawer-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.team-drawer-plan-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.plan-badge--seen {
  background: rgba(34, 197, 94, .12);
  color: #16a34a;
}
.plan-badge--unseen {
  background: rgba(245, 158, 11, .12);
  color: #d97706;
}
.plan-badge--no-plan {
  background: rgba(156, 163, 175, .12);
  color: #9ca3af;
}
.team-drawer-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Drawer Tabs */
.team-drawer-tabs {
  display: flex;
  gap: 6px;
  padding: 0 24px 14px;
  flex-shrink: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.team-drawer-tab {
  padding: 7px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.team-drawer-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.team-drawer-tab:hover:not(.active) {
  border-color: var(--primary-light);
  color: var(--text);
}

.team-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.team-drawer-body input,
.team-drawer-body select,
.team-drawer-body textarea {
  color: var(--primary);
  font-weight: 600;
}
.team-drawer-body input::placeholder,
.team-drawer-body textarea::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  opacity: .6;
}

/* ── Abrechnung Tab ──────────────────────────────────────── */

/* Stundenkonto-Karte */
.abr-account-card {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 14px;
  color: #fff;
}
.abr-account-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.abr-account-item { flex: 1; }
.abr-account-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  opacity: .7;
  margin-bottom: 4px;
}
.abr-account-value {
  font-size: 17px;
  font-weight: 800;
}
.abr-account-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,.15);
  border-radius: 10px;
  padding: 10px 14px;
}
.abr-account-open-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  opacity: .8;
}
.abr-account-open-value {
  font-size: 20px;
  font-weight: 800;
}

/* Monatskarte */
.abr-month-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}
.abr-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.abr-month-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.abr-month-arrow {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: border-color .15s, color .15s;
}
.abr-month-arrow:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.abr-month-summary {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.abr-month-stat {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}
.abr-month-stat-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.abr-month-stat-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-top: 2px;
}
.abr-target {
  padding: 12px 16px 0;
}
.abr-target-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.abr-target-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.abr-target-pct {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}
.abr-target-pct--full {
  color: #16a34a;
}
.abr-target-bar {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.abr-target-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: 99px;
  transition: width .4s ease;
}
.abr-target-fill--full {
  background: linear-gradient(90deg, #4ade80, #16a34a);
}
.abr-month-days {
  max-height: 180px;
  overflow-y: auto;
}

/* Section headings */
.team-section-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--primary);
  margin: 16px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Per-day breakdown */
.team-abr-day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 4px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.team-abr-day-row:last-child { border-bottom: none; }
.team-abr-day-label {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 80px;
}
.team-abr-day-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.team-abr-day-hours {
  font-size: 13px;
  color: var(--text-muted);
}
.team-abr-day-earned {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.team-abr-day-tips {
  font-size: 12px;
  color: var(--success);
  font-weight: 600;
}

/* Auszahlung-Karte */
.abr-payout-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-top: 14px;
  margin-bottom: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.abr-payout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.abr-payout-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.abr-payout-tabs {
  display: flex;
  background: var(--bg);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.abr-payout-tab {
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.abr-payout-tab:hover:not(.active) {
  color: var(--text);
}
.abr-payout-tab.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

/* Monat-Modus: Zusammenfassung */
.abr-payout-summary {
  background: var(--bg);
  border-radius: 12px;
  padding: 4px 0;
  margin-bottom: 14px;
}
.abr-payout-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
}
.abr-payout-summary-row:not(:last-child) {
  border-bottom: 1px solid var(--border);
}
.abr-payout-summary-label {
  font-size: 13px;
  color: var(--text-muted);
}
.abr-payout-summary-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.abr-payout-summary-total {
  background: var(--primary-pale);
  border-radius: 0 0 12px 12px;
}
.abr-payout-summary-total .abr-payout-summary-label {
  font-weight: 700;
  color: var(--primary);
}
.abr-payout-summary-total .abr-payout-summary-value {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
}

/* Manuell-Modus */
.abr-payout-manual-grid {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}
.abr-payout-manual-field {
  flex: 1;
}
.abr-payout-manual-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.abr-payout-manual-field input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--bg);
  outline: none;
  transition: border-color .15s, background .15s;
}
.abr-payout-manual-field input:focus {
  border-color: var(--primary);
  background: var(--white);
}
.abr-payout-manual-divider {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding-bottom: 12px;
  flex-shrink: 0;
}
.abr-pay-manual-preview {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
  min-height: 18px;
}

/* Notiz + Button */
.abr-payout-note {
  margin-bottom: 14px;
}
.abr-payout-note input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  background: var(--bg);
  outline: none;
  transition: border-color .15s, background .15s;
  color: var(--text);
}
.abr-payout-note input:focus {
  border-color: var(--primary);
  background: var(--white);
}
.abr-payout-note input::placeholder {
  color: var(--text-muted);
}
.abr-payout-submit {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(53,80,111,.18);
  transition: opacity .15s, transform .15s;
}
.abr-payout-submit:hover {
  opacity: .92;
  transform: translateY(-1px);
}

/* Payout history */
.team-payout-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.team-payout-entry {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.team-payout-entry-main {
  flex: 1;
  min-width: 0;
}
.team-payout-entry-top {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.team-payout-entry-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.team-payout-entry-delete {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.team-payout-entry-delete:hover { background: #fee2e2; color: var(--danger); }

/* ── Stammdaten Tab ──────────────────────────────────────── */
.team-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.team-form .form-row {
  margin-bottom: 0;
}
.team-form .form-row-2 {
  margin-bottom: 0;
  gap: 14px;
}

.team-form .form-row label,
.team-form .form-row-2 label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  margin-bottom: 6px;
}

.team-form .form-row input,
.team-form .form-row select,
.team-form .form-row-2 input,
.team-form .form-row-2 select {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: var(--bg);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.team-form .form-row input:focus,
.team-form .form-row select:focus,
.team-form .form-row-2 input:focus,
.team-form .form-row-2 select:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(53,80,111,.08);
}

.team-form .form-row textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color .15s, background .15s, box-shadow .15s;
  background: var(--bg);
}
.team-form .form-row textarea:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(53,80,111,.08);
}

.team-form-actions {
  margin-top: 0;
  display: flex;
  justify-content: flex-end;
}
.team-form-actions .btn-primary {
  border-radius: 10px;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 100%);
  box-shadow: 0 4px 12px rgba(53,80,111,.18);
}
.team-drawer .btn-secondary {
  border-radius: 10px;
  padding: 9px 18px;
}

/* Bereich-Chips in Stammdaten */
.team-areas-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.team-chip-toggle {
  padding: 7px 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.team-chip-toggle:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}
.team-chip-toggle--active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.team-chip-toggle--active:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}
.team-chip-empty {
  font-size: 13px;
  color: var(--text-muted);
}

/* Dokumente */
.team-doc-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
}

.team-doc-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  transition: border-color .15s;
}
.team-doc-entry:hover { border-color: var(--primary-light); }

.team-doc-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.team-doc-info {
  flex: 1;
  min-width: 0;
}

.team-doc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-doc-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.team-doc-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.team-doc-btn {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color .15s, color .15s;
}
.team-doc-btn:hover { border-color: var(--primary); color: var(--primary); }
.team-doc-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

.team-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Zeiten Tab ──────────────────────────────────────────── */
/* ── Badges (global) ─────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .3px;
}

.badge--warning { background: #fef3c7; color: #92400e; }
.badge--success { background: #d1fae5; color: #065f46; }
.badge--danger  { background: #fee2e2; color: #991b1b; }
.badge--muted   { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* Zeiten: Monatskarte */
.zt-month-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}
.zt-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.zt-month-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.zt-month-stats {
  display: flex;
  gap: 8px;
}
.zt-month-stat {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}
.zt-month-stat-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.zt-month-stat-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-top: 2px;
}

/* Zeiten: Aktionen */
.team-times-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.team-times-actions .btn-success,
.team-times-actions .btn-danger {
  border-radius: 10px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.team-times-actions .btn-success {
  background: linear-gradient(160deg, rgba(22,163,74,.15) 0%, rgba(74,222,128,.25) 100%);
  border: 2px solid #16a34a;
  color: #15803d;
  box-shadow: inset 0 1px 12px rgba(74,222,128,.3), 0 2px 8px rgba(22,163,74,.1);
}
.team-times-actions .btn-success:hover {
  background: linear-gradient(160deg, rgba(22,163,74,.25) 0%, rgba(74,222,128,.35) 100%);
}
.team-times-actions .btn-danger {
  background: linear-gradient(160deg, rgba(220,38,38,.15) 0%, rgba(248,113,113,.25) 100%);
  border: 2px solid #dc2626;
  color: #b91c1c;
  box-shadow: inset 0 1px 12px rgba(248,113,113,.3), 0 2px 8px rgba(220,38,38,.1);
  opacity: 1;
}
.team-times-actions .btn-danger:hover {
  background: linear-gradient(160deg, rgba(220,38,38,.25) 0%, rgba(248,113,113,.35) 100%);
}

/* Zeiten: Liste */
.team-times-list {
  display: flex;
  flex-direction: column;
}

.team-times-date-divider {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 14px 0 6px;
}
.team-times-date-divider:first-child {
  padding-top: 0;
}

.team-times-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  margin-bottom: 6px;
  transition: border-color .15s;
}
.team-times-entry:hover {
  border-color: var(--primary-light);
}

.team-times-entry--manual {
  border-left: 3px solid var(--primary);
}

.team-times-entry-left {
  flex: 1;
  min-width: 0;
}

.team-times-entry-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.team-times-entry-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  font-style: italic;
}

.team-times-tips {
  font-size: 11px;
  color: var(--success);
  font-weight: 600;
  margin-top: 3px;
}

.team-times-entry-right {
  text-align: right;
  flex-shrink: 0;
}

.team-times-entry-dur {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.team-times-entry-manual {
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  margin-top: 2px;
}

/* ── Notizen Tab ─────────────────────────────────────────── */
.team-notes-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-notes-hint {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.team-notes-textarea {
  width: 100%;
  min-height: 200px;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.6;
  outline: none;
  resize: vertical;
  transition: border-color .15s;
  background: var(--white);
  color: var(--text);
}
.team-notes-textarea:focus { border-color: var(--primary); }

.team-notes-actions {
  display: flex;
  justify-content: flex-end;
}

/* ── Kostenübersicht ─────────────────────────────────────── */
.team-costs { padding: 16px; flex: 1; overflow-y: auto; min-height: 0; }

/* Kompakter Header */
.costs-header-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.costs-header-center {
  flex: 1;
  text-align: center;
  min-width: 0;
}
.costs-header-month {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.costs-header-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 3px;
  flex-wrap: wrap;
}
.costs-header-dot { opacity: .4; }
.costs-header-total {
  color: var(--primary);
  font-weight: 800;
}

/* Filter-Leiste */
.costs-filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.costs-filter-tab {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.costs-filter-tab:hover:not(.active) {
  border-color: var(--primary-light);
  color: var(--text);
}
.costs-filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.costs-csv-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 7px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.costs-csv-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Worker-Karten */
.costs-worker-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.costs-worker-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  transition: border-color .15s, box-shadow .15s;
}
.costs-worker-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 2px 10px rgba(53,80,111,.06);
}
.costs-worker-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.costs-worker-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-pale) 0%, #d0dfef 100%);
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.costs-worker-info { flex: 1; min-width: 0; }
.costs-worker-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.costs-worker-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}
.costs-worker-total {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}
.costs-worker-details {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.costs-worker-detail {
  flex: 1;
  min-width: 80px;
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}
.costs-detail-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.costs-detail-value {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.costs-offen { color: var(--danger); }
.costs-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 40px 0;
}

/* ── Team-Chat ───────────────────────────────────────────── */
.team-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 400px;
}
.team-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.team-chat-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 40px 0;
}
.team-chat-date {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 0 4px;
}
.team-chat-bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  word-wrap: break-word;
}
.team-chat-bubble--mine {
  align-self: flex-end;
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}
.team-chat-bubble--theirs {
  align-self: flex-start;
  background: var(--surface, #f0f2f5);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.team-chat-text { white-space: pre-wrap; }
.team-chat-time {
  font-size: 10px;
  opacity: .6;
  margin-top: 2px;
  text-align: right;
}
.team-chat-input-wrap {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--white);
}
.team-chat-input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  outline: none;
}
.team-chat-input:focus { border-color: var(--primary); }
.team-chat-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.team-chat-send:hover { opacity: .9; }

/* ── Team-Abwesenheiten ──────────────────────────────────── */
.team-leave-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}
.team-leave-empty {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 24px 0;
}
.team-leave-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.team-leave-type {
  font-weight: 700;
  font-size: 13px;
}
.team-leave-dates {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.team-leave-note {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}
.team-leave-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.team-leave-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.team-leave-status--pending  { background: #fef9c3; color: #92400e; }
.team-leave-status--approved { background: #dcfce7; color: #166534; }
.team-leave-status--rejected { background: #fee2e2; color: #991b1b; }
.team-leave-actions {
  display: flex;
  gap: 6px;
}

/* ── Beitrittsanfragen-Modal ─────────────────────────────── */
.team-requests-card {
  max-width: 480px;
  max-height: calc(80dvh / var(--ui-zoom));
  display: flex;
  flex-direction: column;
}

.team-requests-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-request-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.team-request-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.team-request-email {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.team-request-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.team-request-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* ── Form messages ───────────────────────────────────────── */
.team-form-msg {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  margin: 0 20px 4px;
}
.team-form-msg.success { background: #dcfce7; color: #166534; }
.team-form-msg.error   { background: #fee2e2; color: #991b1b; }

/* Einladungslink */
.team-link-body {
  padding: 16px 20px;
}

.team-link-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.team-link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.team-link-url {
  flex: 1;
  font-size: 13px;
  font-family: monospace;
  color: var(--text);
  word-break: break-all;
}

.team-link-copy-btn {
  flex-shrink: 0;
}

.team-link-copied {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   EINSTELLUNGEN
   ═══════════════════════════════════════════════════════════ */

/* Tab-Pane Override */
#tab-einstellungen.eins-pane {
  padding: 20px 24px;
  max-width: none;
  display: flex;
  flex-direction: column;
  height: calc(calc(100dvh / var(--ui-zoom)) - var(--nav-h));
  overflow: hidden;
  background: linear-gradient(160deg, #eef3f7 0%, #dce5ed 100%);
}

body.tab-einstellungen-active .app-content {
}
body.tab-einstellungen-active {
  background: #dce5ed;
}

/* ── Übersicht ────────────────────────────────────────────── */
.eins-overview {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px 20px 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.06);
}

/* Suchleiste (Kalender-Stil) */
.eins-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-pale);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 0;
  transition: background .14s, box-shadow .14s;
  position: relative;
  flex-shrink: 0;
}

/* Scrollbarer Bereich */
.eins-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 0 40px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 16px, black calc(100% - 16px), transparent);
  mask-image: linear-gradient(to bottom, transparent, black 16px, black calc(100% - 16px), transparent);
}

.eins-search-wrap:focus-within {
  background: var(--white);
  box-shadow: 0 1px 6px rgba(53,80,111,.15);
}

.eins-search-icon {
  width: 15px;
  height: 15px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.eins-search {
  flex: 1;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  outline: none;
}

.eins-search::placeholder {
  color: var(--text-muted);
  font-weight: 600;
}

.eins-search-clear {
  border: none;
  background: var(--text-muted);
  color: var(--white);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.eins-search-results {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  margin-bottom: 16px;
  overflow: hidden;
}

.eins-search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}

.eins-search-result-item:last-child { border-bottom: none; }
.eins-search-result-item:hover { background: var(--primary-pale); }

.eins-search-result-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.eins-search-result-cat {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.eins-search-no-result {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Sektionierte Liste ──────────────────────────────────── */
.eins-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.eins-section-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--primary);
  padding: 0 4px;
  margin-bottom: 8px;
}

.eins-section-card {
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
}

.eins-cat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.eins-cat-card:last-child { border-bottom: none; }
.eins-cat-card:hover { background: var(--primary-pale); }

.eins-cat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.eins-cat-icon svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eins-cat-body {
  flex: 1;
  min-width: 0;
}

.eins-cat-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.eins-cat-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 1px;
}

.eins-cat-chevron {
  font-size: 20px;
  color: var(--text-muted);
  line-height: 1;
  flex-shrink: 0;
  opacity: .5;
}

/* ── Detail-Panel ─────────────────────────────────────────── */
.eins-detail {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,.06);
  overflow: hidden;
}

.eins-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 5;
}

.eins-back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background .12s;
  flex-shrink: 0;
}

.eins-back-btn:hover { background: var(--primary-pale); }

.eins-back-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eins-detail-header h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.eins-detail-body {
  padding: 24px;
  padding-bottom: 40px;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

/* ── Profil-Header (Konto) ────────────────────────────────── */
.eins-profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.eins-profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .5px;
}

.eins-profile-info {
  flex: 1;
  min-width: 0;
}

.eins-profile-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1px;
}

.eins-profile-email {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.eins-profile-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 2px 8px;
  border-radius: 8px;
  background: #dbeafe;
  color: #1e40af;
}

/* ── Business-Avatar Upload ──────────────────────────────── */
.eins-biz-avatar-wrap {
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

.eins-biz-avatar-wrap .eins-profile-avatar {
  overflow: hidden;
}

.eins-biz-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .3s ease;
}
.eins-biz-avatar-img.loaded {
  opacity: 1;
}

.eins-biz-avatar-edit {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

.eins-biz-avatar-edit svg {
  width: 11px;
  height: 11px;
}

/* ── Logout-Button ───────────────────────────────────────── */
.eins-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  border: 1.5px solid #fecaca;
  border-radius: 14px;
  background: #fef2f2;
  color: var(--danger);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
  margin-top: 12px;
}
.eins-logout-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.eins-logout-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  transform: translateY(-1px);
}

/* ── Settings-Gruppen (iOS-Stil) ──────────────────────────── */
.eins-group {
  margin-bottom: 28px;
}

.eins-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--primary);
  padding: 0 4px;
  margin-bottom: 6px;
}

.eins-group-hint {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 4px 0;
  line-height: 1.5;
}

.eins-list {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.eins-row {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  min-height: 54px;
}

.eins-row:last-child { border-bottom: none; }

.eins-row-label {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.eins-row-sublabel {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* Selectable rows (Nachrichten-Settings) */
.eins-row--selectable {
  cursor: pointer;
  transition: background .15s;
  border-radius: 10px;
  padding: 14px 16px;
}
.eins-row--selectable:hover {
  background: var(--primary-pale);
}
.eins-row--selectable .eins-row-check {
  display: none;
  flex-shrink: 0;
}
.eins-row--selected .eins-row-check {
  display: flex;
}
.eins-row--selected {
  background: var(--primary-pale);
}
.eins-row--selected .eins-row-label {
  font-weight: 700;
  color: var(--primary);
}

.eins-row-value {
  font-size: 14px;
  color: var(--text-muted);
  text-align: right;
}

.eins-row-chevron {
  font-size: 20px;
  color: var(--text-muted);
  margin-left: 4px;
}

.eins-row-btn {
  display: flex;
  align-items: center;
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  padding: 14px 18px;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  min-height: 54px;
  transition: background .12s;
}

.eins-row-btn:last-child { border-bottom: none; }
.eins-row-btn:hover { background: var(--primary-pale); }

.eins-row-btn .eins-row-label { pointer-events: none; color: var(--primary); }

.eins-row-btn.danger .eins-row-label { color: var(--danger); }

/* Support-Formular */
.eins-support-form {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.eins-support-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.eins-support-field input,
.eins-support-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}
.eins-support-field input:focus,
.eins-support-field textarea:focus { border-color: var(--primary); background: var(--white); }
.eins-support-msg {
  font-size: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}
.eins-support-msg.success { background: #dcfce7; color: #166534; }
.eins-support-msg.error { background: #fee2e2; color: #991b1b; }

/* Hilfe-Seite: Karten-Grid */
.eins-hilfe-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.eins-hilfe-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  text-align: center;
}
.eins-hilfe-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.eins-hilfe-card-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.eins-hilfe-card-icon svg {
  width: 22px; height: 22px;
  stroke: #fff;
}
.eins-hilfe-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.eins-hilfe-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Hilfe-Seite: Sections mit Header */
.eins-hilfe-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
}
.eins-hilfe-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 0;
}
.eins-hilfe-section-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.eins-hilfe-section-icon svg {
  width: 20px; height: 20px;
  stroke: #fff;
}
.eins-hilfe-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.eins-hilfe-section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Inline Formular innerhalb einer Gruppe */
.eins-inline-form {
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.eins-inline-form .form-row { margin-bottom: 16px; }
.eins-inline-form .form-row:last-of-type { margin-bottom: 0; }

.eins-inline-form .form-row input,
.eins-inline-form .form-row select,
.eins-inline-form .form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

.eins-inline-form .form-row input:focus,
.eins-inline-form .form-row select:focus,
.eins-inline-form .form-row textarea:focus { border-color: var(--primary); background: var(--white); }

.eins-inline-form .form-row input[readonly] {
  background: var(--bg);
  color: var(--text-muted);
  cursor: not-allowed;
}

.eins-inline-form .form-row label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.eins-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.eins-msg {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
}

.eins-msg.success { background: #dcfce7; color: #166534; }
.eins-msg.error   { background: #fee2e2; color: #991b1b; }
.eins-msg.info    { background: var(--primary-pale); color: var(--primary); }

/* ── Toggle-Schalter (reines CSS) ─────────────────────────── */
.eins-toggle-wrap {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.eins-toggle-wrap input[type=checkbox] {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.eins-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 13px;
  cursor: pointer;
  transition: background .2s;
}

.eins-toggle-wrap input:checked + .eins-toggle-track {
  background: var(--primary);
}

.eins-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .2s;
}

.eins-toggle-wrap input:checked + .eins-toggle-track::after {
  transform: translateX(20px);
}

/* ── Zahlen-Input mit Label ───────────────────────────────── */
.eins-number-row {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  min-height: 54px;
}

.eins-number-row:last-child { border-bottom: none; }

/* Schichtzeiten-Einstellungen */
.eins-shift-time-row {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  min-height: 54px;
}

.eins-shift-time-row:last-child { border-bottom: none; }

.eins-shift-time-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.eins-time-input {
  width: 100px;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--primary);
  background: var(--primary-pale, #eef2f7);
  text-align: center;
  outline: none;
  transition: box-shadow .15s;
  -webkit-appearance: none;
}

.eins-time-input:focus { box-shadow: 0 0 0 2px rgba(53,80,111,.18); }

.eins-time-sep {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 700;
}

/* Erinnerungen */
.eins-reminder-row {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.eins-reminder-row:last-child { border-bottom: none; }
.eins-reminder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.eins-reminder-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 10px;
}
.eins-reminder-config {
  display: flex;
  align-items: center;
  gap: 10px;
}
.eins-reminder-select {
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}
.eins-reminder-at {
  font-size: 14px;
  color: var(--text-muted);
}
.eins-reminder-time {
  width: 90px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  text-align: center;
}
.eins-reminder-number {
  width: 68px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  text-align: center;
}

.eins-number-label {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.eins-number-input {
  width: 76px;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  text-align: center;
  outline: none;
  transition: box-shadow .15s;
  background: var(--primary-pale, #eef2f7);
  color: var(--primary);
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

.eins-number-input:focus { box-shadow: 0 0 0 2px rgba(53,80,111,.18); }

/* ── Bereiche-Liste ───────────────────────────────────────── */
.eins-area-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.eins-area-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}

.eins-area-row:last-child { border-bottom: none; }

.eins-area-sort-btns {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.eins-area-sort-btn {
  width: 22px;
  height: 18px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s, color .1s;
}

.eins-area-sort-btn:hover { background: var(--primary-pale); color: var(--primary); }
.eins-area-sort-btn:disabled { opacity: .3; cursor: default; }
.eins-area-sort-btn:disabled:hover { background: none; color: var(--text-muted); }

.eins-area-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  border: 1.5px solid transparent;
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
  background: transparent;
  cursor: text;
  transition: border-color .15s, background .15s;
  font-family: inherit;
}

.eins-area-name:focus {
  border-color: var(--primary);
  background: var(--bg);
}

.eins-area-toggle {
  flex-shrink: 0;
}

.eins-area-del-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .12s, color .12s;
}

.eins-area-del-btn:hover { background: #fee2e2; color: var(--danger); }

.eins-area-add-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 18px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
}

.eins-area-add-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  background: var(--white);
  color: var(--text);
  transition: border-color .15s;
  font-family: inherit;
}

.eins-area-add-input:focus { border-color: var(--primary); background: var(--white); }

.eins-area-add-btn { padding: 10px 16px; font-size: 14px; flex-shrink: 0; }

/* ── Einladungslink-Box ───────────────────────────────────── */
.eins-invite-code-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.eins-invite-code {
  flex: 1;
  font-size: 14px;
  font-family: monospace;
  color: var(--text);
  word-break: break-all;
  font-weight: 600;
}

/* ── Admin-Zugänge ───────────────────────────────────────── */
.eins-admin-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.eins-admin-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color .15s, background .15s;
}
.eins-admin-remove:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, .1);
}

.eins-admin-add-form {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border);
}

.eins-admin-add-input {
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--primary-pale, #eef2f7);
  outline: none;
  transition: box-shadow .15s;
}
.eins-admin-add-input:focus {
  box-shadow: 0 0 0 2px rgba(53,80,111,.18);
}
.eins-admin-add-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.eins-admin-add-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Admin hinzufügen Button ──────── */
.eins-admin-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  margin: 14px 0 0;
  border-radius: 12px;
  background: var(--primary-pale, #eef2f7);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.eins-admin-add-btn:hover {
  background: rgba(53,80,111,.15);
}

/* ── Admin-Berechtigungs-Modal ──────── */
.eins-perm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(20,20,30,.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
}
.eins-perm-overlay.visible { opacity: 1; }
.eins-perm-overlay.visible .epm-modal {
  transform: scale(1);
  opacity: 1;
}

.epm-modal {
  background: var(--white);
  border-radius: 20px;
  width: 94%;
  max-width: 640px;
  max-height: calc(85vh / var(--ui-zoom));
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.05);
  transform: scale(.95);
  opacity: 0;
  transition: transform .25s cubic-bezier(.32,.72,0,1), opacity .2s;
}
.epm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.epm-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}
.epm-close {
  background: rgba(0,0,0,.06);
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.epm-close:hover { background: rgba(0,0,0,.1); }
.epm-save {
  background: var(--primary);
  border: none;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  padding: 8px 20px;
  border-radius: 10px;
  transition: opacity .15s;
}
.epm-save:hover { opacity: .9; }
.epm-save:disabled { opacity: .4; cursor: default; }

.epm-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px;
  flex: 1;
}

/* Profil-Header (Bearbeiten) */
.epm-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.epm-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.epm-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}
.epm-email {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Inputs (Hinzufügen) */
.epm-inputs {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.epm-input {
  flex: 1;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
}
.epm-input:focus { border-color: var(--primary); }

/* Section Label */
.epm-section-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 16px;
}

/* Perm Groups */
.epm-group {
  background: var(--bg, #f8f9fb);
  border-radius: 14px;
  padding: 4px 16px;
  margin-bottom: 12px;
}
.epm-group-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
  padding: 12px 0 4px;
}

/* Perm Row */
.epm-perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid rgba(0,0,0,.05);
}
.epm-perm-row:first-of-type { border-top: none; }
.epm-perm-label {
  font-size: 14px;
  color: var(--text);
}

/* Apple-style Toggle */
.epm-toggle {
  position: relative;
  display: inline-block;
  cursor: pointer;
  flex-shrink: 0;
}
.epm-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.epm-toggle-track {
  display: block;
  width: 46px;
  height: 28px;
  border-radius: 14px;
  background: #d1d5db;
  transition: background .25s;
  position: relative;
}
.epm-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.epm-toggle input:checked + .epm-toggle-track {
  background: #34c759;
}
.epm-toggle input:checked + .epm-toggle-track .epm-toggle-thumb {
  transform: translateX(18px);
}

/* Footer */
.epm-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Dark Mode */
html.dark .epm-modal { background: #1c1c1e; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
html.dark .epm-header { border-bottom-color: #333; }
html.dark .epm-close { background: rgba(255,255,255,.08); }
html.dark .epm-close:hover { background: rgba(255,255,255,.14); }
html.dark .epm-group { background: #262626; }
html.dark .epm-perm-row { border-top-color: rgba(255,255,255,.06); }
html.dark .epm-toggle-track { background: #3a3a3c; }
html.dark .epm-input { background: #2c2c2e; border-color: #3a3a3c; color: #fff; }
html.dark .epm-footer { border-top-color: #333; }
html.dark .epm-profile { border-bottom-color: #333; }
html.dark .epm-inputs { border-bottom-color: #333; }
html.dark .eins-admin-add-btn { background: #262626; color: #8ab4f8; }

/* ── Darstellung – Erscheinungsbild Auswahl ───────────────── */
.eins-appearance-group {
  display: flex;
  gap: 10px;
}

.eins-appearance-option {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 12px;
  cursor: pointer;
  background: var(--white);
  text-align: center;
  transition: border-color .15s;
}

.eins-appearance-option.active {
  border-color: var(--primary);
  background: var(--primary-pale);
}

.eins-appearance-preview {
  width: 48px;
  height: 34px;
  border-radius: 8px;
  margin: 0 auto 8px;
  border: 1.5px solid var(--border);
}

.eins-appearance-preview.light { background: #f8fafc; }
.eins-appearance-preview.dark  { background: #1a1f2e; }
.eins-appearance-preview.auto  {
  background: linear-gradient(135deg, #f8fafc 50%, #1a1f2e 50%);
}

.eins-appearance-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

/* ── Rollen-Karten ────────────────────────────────────────── */
.eins-role-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.eins-role-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.eins-role-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.eins-role-badge.admin  { background: #dbeafe; color: #1e40af; }
.eins-role-badge.worker { background: #dcfce7; color: #166534; }

.eins-role-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.eins-role-card-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.eins-role-card ul {
  margin: 10px 0 0 18px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 2;
}

/* ── Bestätigungs-Modal Body ──────────────────────────────── */
.eins-confirm-body {
  padding: 16px 20px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

.eins-confirm-body input {
  width: 100%;
  margin-top: 12px;
  padding: 9px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
  background: var(--white);
  color: var(--text);
  font-family: inherit;
}

.eins-confirm-body input:focus { border-color: var(--danger); }

/* ═══════════════════════════════════════════════════════════
   NACHRICHTEN (WhatsApp-Style)
   ═══════════════════════════════════════════════════════════ */

/* Tab-Pane Override */
#tab-nachrichten.msg-pane {
  padding: 20px 24px;
  max-width: none;
  display: flex;
  flex-direction: column;
  height: calc(calc(100dvh / var(--ui-zoom)) - var(--nav-h));
  overflow: hidden;
  background: linear-gradient(160deg, #eef3f7 0%, #dce5ed 100%);
}

body.tab-nachrichten-active .app-content {
}
body.tab-nachrichten-active {
  background: #dce5ed;
}

/* Weißes Panel */
.msg-panel {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.06);
}

/* Container: Split-Layout */
.msg-container {
  display: flex;
  height: 100%;
}

/* ── Konversationsliste (links) ──────────────────────────── */
.msg-list-panel {
  width: 360px;
  min-width: 360px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 24px 0 0 24px;
  overflow: hidden;
}

.msg-list-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Neue-Gruppe-Button */
.msg-new-group-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity .12s;
}
.msg-new-group-btn:hover { opacity: .85; }

.msg-list-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  flex-shrink: 0;
}

/* Suchleiste */
.msg-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-pale);
  border-radius: 999px;
  padding: 3px 14px 3px 10px;
  height: 36px;
  transition: background .14s, box-shadow .14s;
  flex: 1;
}
.msg-search-wrap:focus-within {
  background: var(--white);
  box-shadow: 0 1px 6px rgba(53,80,111,.15);
}
.msg-search-icon {
  width: 15px;
  height: 15px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.msg-search {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  outline: none;
}
.msg-search::placeholder {
  color: var(--text-muted);
  font-weight: 600;
}

/* Archiv-Header */
.msg-archive-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: var(--primary-pale);
}
.msg-archive-back {
  border: none;
  background: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
}
.msg-archive-back:hover { background: var(--white); }

/* Archiv-Link */
.msg-archive-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background .12s, color .12s;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.msg-archive-link:hover {
  background: var(--primary-pale);
  color: var(--primary);
}
.msg-archive-link svg {
  flex-shrink: 0;
}

.msg-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Konversations-Eintrag (Karten-Layout) */
.msg-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.msg-conv-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 16px;
  cursor: pointer;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  transition: border-color .15s, box-shadow .15s;
  position: relative;
}
.msg-conv-item:hover {
  border-color: var(--primary-light);
  box-shadow: 0 2px 10px rgba(53, 80, 111, .08);
}
.msg-conv-item--active {
  border-color: var(--primary);
  background: var(--primary-pale);
}
.msg-conv-item--unread {
  border-color: var(--primary-light);
}
.msg-conv-item--unread .msg-conv-name {
  font-weight: 700;
}
.msg-conv-item--unread .msg-conv-preview {
  color: var(--text);
  font-weight: 600;
}

/* Avatar */
.msg-conv-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-pale);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: .3px;
}

/* Body: Name + Preview gestapelt */
.msg-conv-body {
  flex: 1;
  min-width: 0;
}
.msg-conv-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.msg-conv-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-conv-time {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
  font-weight: 600;
}
.msg-conv-item--unread .msg-conv-time {
  color: var(--primary);
  font-weight: 700;
}
.msg-conv-row-bottom {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  min-width: 0;
}
.msg-conv-preview {
  flex: 1;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.msg-conv-no-msg {
  font-style: italic;
  opacity: .5;
}
.msg-mute-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: .5;
}
.msg-conv-badge {
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  flex-shrink: 0;
}

/* Pin-Icon */
.msg-pin-icon {
  color: var(--text-muted);
  opacity: .5;
  flex-shrink: 0;
  margin-right: 2px;
}

/* Gruppen-Avatar */
.msg-conv-avatar--group {
  border-radius: 12px;
}

/* Kontextmenü auf Konversations-Items */
.msg-conv-menu-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background .1s;
  flex-shrink: 0;
}
.msg-conv-menu-btn:hover { background: var(--primary-pale); color: var(--primary); }
.msg-conv-dropdown {
  position: absolute;
  top: 100%;
  right: 8px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  z-index: 50;
  min-width: 170px;
  overflow: hidden;
}
.msg-conv-dropdown-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  width: 100%;
  text-align: left;
}
.msg-conv-dropdown-option:hover { background: var(--primary-pale); }
.msg-conv-dropdown-option--danger { color: var(--danger); }

/* Gruppen-Modal */
.msg-modal--group { max-width: 560px; width: calc(95vw / var(--ui-zoom)); }
.msg-modal--group .msg-modal-body { padding: 0; }

.msg-gm-name-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 24px 20px;
}
.msg-gm-group-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--primary-pale);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.msg-gm-name-input {
  flex: 1;
  padding: 12px 0;
  border: none;
  border-bottom: 2px solid var(--border);
  font-size: 18px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  background: transparent;
  color: var(--text);
  transition: border-color .15s;
}
.msg-gm-name-input:focus { border-color: var(--primary); }
.msg-gm-name-input::placeholder { color: var(--text-muted); font-weight: 500; }

.msg-gm-selected {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 24px 14px;
}
.msg-gm-selected--visible { display: flex; }
.msg-gm-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 600;
}

.msg-gm-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 24px;
  padding: 10px 14px;
  background: var(--primary-pale);
  border-radius: 10px;
  color: var(--text-muted);
}
.msg-gm-search {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  color: var(--text);
}
.msg-gm-search::placeholder { color: var(--text-muted); }

.msg-gm-list {
  min-height: calc(40vh / var(--ui-zoom));
  max-height: calc(50vh / var(--ui-zoom));
  overflow-y: auto;
  margin-top: 10px;
}
.msg-gm-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  cursor: pointer;
  transition: background .1s;
}
.msg-gm-row:hover { background: var(--primary-pale); }
.msg-gm-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-pale);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.msg-gm-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.msg-gm-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .12s, border-color .12s;
}
.msg-gm-check input { display: none; }
.msg-gm-checkmark { display: none; }
.msg-gm-row--checked .msg-gm-check {
  background: var(--primary);
  border-color: var(--primary);
}
.msg-gm-row--checked .msg-gm-checkmark {
  display: block;
}

/* ── Chat-Panel (rechts) ─────────────────────────────────── */
.msg-chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  height: 100%;
  min-width: 0;
}
.msg-chat-panel--empty {
  display: flex;
  align-items: center;
  justify-content: center;
}
.msg-chat-placeholder {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
.msg-chat-placeholder p {
  margin-top: 16px;
}
.msg-chat-error {
  padding: 40px;
  text-align: center;
  color: var(--danger);
}

/* Chat-Header */
.msg-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.msg-chat-back {
  display: none;
  border: none;
  background: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
}
.msg-chat-back:hover { background: var(--primary-pale); }
.msg-chat-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-pale);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.msg-chat-header-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Drei-Punkte-Menü */
.msg-menu-wrap {
  margin-left: auto;
  position: relative;
}
.msg-menu-btn {
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s;
}
.msg-menu-btn:hover {
  background: var(--primary-pale);
  color: var(--text);
}
.msg-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  min-width: 170px;
  z-index: 100;
  overflow: hidden;
}
.msg-menu-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background .1s;
}
.msg-menu-option:hover {
  background: var(--primary-pale);
}
.msg-menu-option--danger {
  color: var(--danger);
}
.msg-menu-option--danger:hover {
  background: rgba(231, 76, 60, .08);
}

/* Melden/Blockieren Modal */
.msg-modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 400px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  overflow: hidden;
}
.msg-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 700;
}
.msg-modal-body {
  padding: 20px;
}
.msg-modal-text {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.msg-modal-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.msg-modal-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 14px;
  margin-bottom: 5px;
}
.msg-modal-select,
.msg-modal-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: var(--white);
  color: var(--text);
}
.msg-modal-select:focus,
.msg-modal-textarea:focus {
  border-color: var(--primary);
}
.msg-modal-textarea {
  resize: vertical;
}
.msg-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.msg-modal-danger-btn {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
}
.msg-modal-danger-btn:hover {
  opacity: .9;
}

/* Mute-Dauer-Optionen */
.msg-mute-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}
.msg-mute-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color .12s, background .12s;
  text-align: left;
}
.msg-mute-option:hover {
  border-color: var(--primary);
  background: var(--primary-pale);
}
.msg-mute-option svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Toast */
/* Globaler App-Toast */
.app-toast {
  position: fixed;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 24px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  max-width: calc(90vw / var(--ui-zoom));
  text-align: center;
}
.app-toast--visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.app-toast--info { background: var(--text); color: var(--white); }
.app-toast--success { background: var(--primary); color: var(--white); }
.app-toast--error { background: #991b1b; color: var(--white); }

/* Globales Bestätigungs-Modal */
.app-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity .2s;
}
.app-confirm--visible { opacity: 1; }
.app-confirm-box {
  background: var(--white);
  border-radius: 16px;
  padding: 28px 28px 20px;
  max-width: 380px;
  width: calc(90vw / var(--ui-zoom));
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.app-confirm-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 24px;
}
.app-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.app-confirm-cancel {
  height: 38px;
  padding: 0 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.app-confirm-cancel:hover { background: var(--bg); }
.app-confirm-ok {
  height: 38px;
  padding: 0 20px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.app-confirm-ok:hover { opacity: .9; }

/* ── Crop-Modal (Bildpositionierung) ─────────────────────── */
.crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease;
}
.crop-overlay--visible { opacity: 1; }
.crop-container {
  background: var(--white);
  border-radius: 18px;
  padding: 24px;
  width: 340px;
  max-width: calc(92vw / var(--ui-zoom));
  box-shadow: 0 12px 48px rgba(0,0,0,.3);
}
.crop-title {
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
  color: var(--text);
}
.crop-viewport {
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  cursor: grab;
  background: #111;
  border-radius: 12px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.crop-viewport:active { cursor: grabbing; }
.crop-img {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}
.crop-mask {
  position: absolute;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.5);
  border: 2px solid rgba(255,255,255,.5);
}
.crop-mask--circle { border-radius: 50%; }
.crop-mask--square { border-radius: 14px; }
.crop-zoom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 4px 20px;
}
.crop-zoom svg {
  flex-shrink: 0;
  opacity: .45;
}
.crop-zoom input[type=range] {
  flex: 1;
  height: 4px;
  accent-color: var(--primary);
}
.crop-actions {
  display: flex;
  gap: 10px;
}
.crop-actions button {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.crop-cancel-btn {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
}
.crop-cancel-btn:hover { background: var(--bg); }
.crop-confirm-btn {
  border: none;
  background: var(--primary);
  color: #fff;
}
.crop-confirm-btn:hover { opacity: .9; }

/* PDF-Vorschau-Modal */
.pdf-preview-box {
  background: var(--white);
  border-radius: 16px;
  width: calc(90vw / var(--ui-zoom));
  max-width: 900px;
  height: calc(85vh / var(--ui-zoom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.pdf-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.pdf-preview-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.pdf-preview-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pdf-preview-close:hover { background: var(--bg); }
.pdf-preview-frame {
  flex: 1;
  border: none;
  background: var(--bg);
}
.pdf-preview-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}
.pdf-preview-download {
  height: 38px;
  padding: 0 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}

/* Upload-Fortschritt */
.msg-upload-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 20px;
  background: var(--primary-pale);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.msg-upload-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.msg-upload-info svg { color: var(--primary); flex-shrink: 0; }
.msg-upload-progress {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.msg-upload-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  animation: msg-upload-anim 1.5s ease-in-out infinite;
  width: 40%;
}
@keyframes msg-upload-anim {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* Aktive Mute-Option */
.msg-mute-option--active {
  background: var(--primary-pale);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

.msg-toast {
  position: fixed;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text);
  color: var(--white);
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 9999;
  pointer-events: none;
}
.msg-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Nachrichten-Bereich */
.msg-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg-chat-empty {
  margin: auto;
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
}
.msg-chat-empty p:first-child {
  font-size: 15px;
  font-weight: 600;
}
.msg-chat-empty-sub {
  font-size: 13px;
  margin-top: 6px;
  opacity: .7;
}

/* Datumstrenner */
.msg-date-divider {
  text-align: center;
  padding: 12px 0 8px;
}
.msg-date-divider span {
  display: inline-block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

/* Sprechblasen */
.msg-bubble {
  max-width: 70%;
  padding: 8px 12px 6px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  position: relative;
}
.msg-bubble--mine {
  align-self: flex-end;
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}
.msg-bubble--theirs {
  align-self: flex-start;
  background: var(--white);
  color: var(--text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}
.msg-bubble-content {
  white-space: pre-wrap;
}
.msg-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 3px;
}
.msg-bubble-time {
  font-size: 10px;
  opacity: .65;
}
.msg-bubble-status {
  font-size: 10px;
  opacity: .65;
  letter-spacing: -2px;
}
.msg-bubble--mine .msg-bubble-status {
  color: rgba(255,255,255,.8);
}

/* Gelöschte Nachricht */
.msg-bubble--deleted { opacity: .6; }
.msg-deleted-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-style: italic;
  font-size: 13px;
}
.msg-bubble--mine .msg-deleted-text { color: rgba(255,255,255,.8); }

/* Reply-Quote in Blase */
.msg-reply-quote {
  background: rgba(0,0,0,.06);
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.3;
}
.msg-bubble--mine .msg-reply-quote { background: rgba(255,255,255,.15); border-left-color: rgba(255,255,255,.5); }
.msg-reply-sender { font-weight: 700; display: block; margin-bottom: 2px; }
.msg-reply-text {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: .8;
}

/* Datei-Anhang in Blase */
.msg-file-attachment { margin-bottom: 4px; }
.msg-file-image {
  max-width: 100%;
  max-height: 280px;
  border-radius: 10px;
  display: block;
  cursor: pointer;
}
.msg-file-doc {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,.06);
  border-radius: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: inherit;
}
.msg-bubble--mine .msg-file-doc { background: rgba(255,255,255,.15); }
.msg-file-info { min-width: 0; }
.msg-file-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-file-size {
  display: block;
  font-size: 11px;
  opacity: .7;
  margin-top: 1px;
}

/* Nachrichten-Aktionen (Antworten / Löschen) */
.msg-bubble-actions {
  position: absolute;
  top: 4px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity .15s;
}
.msg-bubble:hover .msg-bubble-actions { opacity: 1; }
.msg-bubble--mine .msg-bubble-actions { left: -56px; }
.msg-bubble--theirs .msg-bubble-actions { right: -56px; }
.msg-bubble-action {
  width: 26px;
  height: 26px;
  border: none;
  background: var(--white);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  transition: background .1s;
}
.msg-bubble-action:hover { background: var(--primary-pale); color: var(--primary); }
.msg-bubble-action--delete:hover { color: var(--danger); }

/* Highlight beim Scroll zu Reply */
.msg-bubble--highlight {
  animation: msg-highlight .8s ease;
}
@keyframes msg-highlight {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: 0 0 0 3px var(--primary-light); }
}

/* Reply-Bar über Input */
.msg-reply-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  background: var(--primary-pale);
  border-top: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  flex-shrink: 0;
}
.msg-reply-bar.hidden { display: none; }
.msg-reply-bar-content { flex: 1; min-width: 0; }
.msg-reply-bar-sender { font-size: 12px; font-weight: 700; color: var(--primary); display: block; }
.msg-reply-bar-text { font-size: 12px; color: var(--text-muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-reply-bar-close {
  width: 26px; height: 26px; border: none; background: transparent; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.msg-reply-bar-close:hover { background: rgba(0,0,0,.06); }

/* Datei-Anhang Button */
.msg-attach-btn {
  width: 40px; height: 40px; border: none; background: transparent; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-muted);
  flex-shrink: 0; transition: color .1s;
}
.msg-attach-btn:hover { color: var(--primary); }

/* Chat-Suchleiste */
.msg-chat-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.msg-chat-search-bar.hidden { display: none; }
.msg-chat-search-bar > svg { color: var(--text-muted); flex-shrink: 0; }
.msg-chat-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  color: var(--text);
}
.msg-chat-search-input::placeholder { color: var(--text-muted); }
.msg-chat-search-count {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.msg-chat-search-nav,
.msg-chat-search-close {
  width: 26px; height: 26px; border: none; background: transparent; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.msg-chat-search-nav:hover,
.msg-chat-search-close:hover { background: var(--primary-pale); color: var(--primary); }
.msg-bubble--search-hit { box-shadow: 0 0 0 2px var(--primary); }

/* Such-Button im Header */
.msg-search-chat-btn {
  width: 32px; height: 32px; border: none; background: transparent; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-muted);
  flex-shrink: 0;
}
.msg-search-chat-btn:hover { background: var(--primary-pale); color: var(--primary); }

/* Klickbarer Avatar/Name im Header */
.msg-chat-header-clickable { cursor: pointer; }
.msg-chat-header-clickable:hover { opacity: .7; }

/* Profil-Modal (read-only) */
.msg-modal--profile { max-width: 400px; width: calc(90vw / var(--ui-zoom)); }
.msg-profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 24px 20px;
  position: relative;
}
.msg-profile-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary-pale); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.msg-profile-name { font-size: 20px; font-weight: 700; color: var(--text); flex: 1; }
.msg-profile-header .msg-modal-close { position: absolute; top: 16px; right: 16px; }
.msg-profile-body { padding: 0 24px 24px; }
.msg-profile-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.msg-profile-field:last-child { border-bottom: none; }
.msg-profile-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.msg-profile-value { font-size: 14px; color: var(--text); font-weight: 600; text-align: right; }

/* Input-Leiste */
.msg-chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 20px;
  background: var(--white);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.msg-chat-input {
  flex: 1;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: none;
  max-height: 120px;
  line-height: 1.4;
  background: var(--white);
  color: var(--text);
}
.msg-chat-input:focus {
  border-color: var(--primary);
}
.msg-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity .12s;
}
.msg-chat-send:hover { opacity: .85; }

/* Blockiert-Leiste */
.msg-chat-blocked-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: rgba(231, 76, 60, .06);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-muted);
}
.msg-chat-blocked-bar svg {
  color: var(--danger);
  flex-shrink: 0;
}
.msg-unblock-btn {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  margin-left: 6px;
  transition: background .12s;
}
.msg-unblock-btn:hover {
  background: var(--primary-pale);
}

/* ── Responsive: Mobil ───────────────────────────────────── */
@media (max-width: 700px) {
  .msg-list-panel {
    width: 100%;
    min-width: 0;
    border-right: none;
  }
  .msg-chat-panel {
    display: none;
  }
  .msg-chat-panel--empty {
    display: none;
  }

  /* Wenn Chat offen: Liste verstecken, Chat zeigen */
  .msg-chat-open .msg-list-panel {
    display: none;
  }
  .msg-chat-open .msg-chat-panel {
    display: flex;
  }
  .msg-chat-open .msg-chat-back {
    display: block;
  }

  /* Zurück-Button auf Mobil immer zeigen */
  .msg-chat-back {
    display: block;
  }

  .msg-bubble {
    max-width: 85%;
  }
}

/* ── Dark Mode ────────────────────────────────────────────── */
html.dark {
  --bg:            #141414;
  --white:         #1e1e1e;
  --text:          #e4e4e4;
  --text-muted:    #9a9a9a;
  --border:        #2e2e2e;
  --primary:       #e4e4e4;
  --primary-light: #ffffff;
  --primary-pale:  rgba(255, 255, 255, .08);
  --danger:        #f87171;
  --success:       #34d399;
  --shadow:        0 2px 12px rgba(0,0,0,.3);
}

/* Inputs & Selects */
html.dark input,
html.dark select,
html.dark textarea {
  background: #262626;
  color: var(--text);
  border-color: var(--border);
}
html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #6a6a6a;
}
html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
  border-color: var(--primary);
}

/* Login / Verify / Reset-PW: immer helles Erscheinungsbild */
html.dark #screen-login,
html.dark #screen-verify,
html.dark #screen-reset-pw,
html.dark #screen-legal {
  --bg:            #f8fafc;
  --white:         #ffffff;
  --text:          #1a2a3a;
  --text-muted:    #6b7f95;
  --border:        #e2e8f0;
  --primary:       #35506f;
  --primary-light: #4a6d94;
  --primary-pale:  #eef2f7;
  --danger:        #e74c3c;
  --success:       #27ae60;
  --shadow:        0 2px 12px rgba(0,0,0,.07);
}
html.dark #screen-login input,
html.dark #screen-verify input,
html.dark #screen-reset-pw input,
html.dark #screen-legal input {
  background: #fff;
  color: #1a2a3a;
  border-color: #e2e8f0;
}
html.dark #screen-login input::placeholder,
html.dark #screen-verify input::placeholder,
html.dark #screen-reset-pw input::placeholder,
html.dark #screen-legal input::placeholder {
  color: #6b7f95;
}
html.dark #screen-login input:focus,
html.dark #screen-verify input:focus,
html.dark #screen-reset-pw input:focus,
html.dark #screen-legal input:focus {
  border-color: #35506f;
  box-shadow: 0 0 0 3px #eef2f7;
}

/* Planung Container */
html.dark #tab-planung.tab-pane      { background: linear-gradient(160deg, #141414 0%, #1a1a1a 100%); }
html.dark.tab-planung-active         { background: #141414; }

/* Modal overlays & drawers */
html.dark .modal-overlay     { background: rgba(0,0,0,.65); }
html.dark .plan-sidebar-overlay,
html.dark .kal-sidebar-overlay,
html.dark .team-overlay      { background: rgba(0,0,0,.5); }
html.dark .team-add-live     { background: #262626; border-color: var(--border); }
html.dark .team-add-card-icon,
html.dark .team-add-card-icon--requests { background: #fff; color: #1a1a1a; }
html.dark .team-add-card-icon svg { stroke: #1a1a1a; }
html.dark .team-card-avatar { background: #fff; color: #1a1a1a; }

/* Shadows on drawers */
html.dark .plan-sidebar,
html.dark .kal-sidebar,
html.dark .team-drawer       { box-shadow: -4px 0 24px rgba(0,0,0,.4); }

/* Planung Container + Grid */
html.dark .plan-container    { background: rgba(30, 30, 30, .92); border-color: #2e2e2e; box-shadow: 0 8px 32px rgba(0,0,0,.3); }
html.dark .plan-day-headers  { background: var(--white); }

/* Verfügbarkeit in Sidebar (Worker-Card) */
html.dark .plan-avail-cell.avail-yes { background: #e4e4e4; color: #141414; }
html.dark .plan-avail-cell.avail-mix { background: #6a6a6a; color: #e4e4e4; }
html.dark .plan-avail-cell.avail-no  { background: #333333; color: #8a8a8a; }

/* Verfügbarkeit im Grid */
html.dark .plan-avail-block.avail-yes { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .35); }
html.dark .plan-avail-block.avail-no  { background: rgba(255, 255, 255, .03); border-color: rgba(255, 255, 255, .12); }
html.dark .plan-avail-block.avail-yes .plan-avail-block-label { color: #e4e4e4; }
html.dark .plan-avail-block.avail-no .plan-avail-block-label  { color: #6a6a6a; }

/* Verfügbarkeit in Day-Headers */
html.dark .plan-avail-box.avail-green { background: #e4e4e4; }
html.dark .plan-avail-box.avail-red   { background: #333333; }

/* Today-Spalten */
html.dark .plan-day-col.today,
html.dark .kal-day-col.today { background: #262626; }

/* Publish-Status Badges */
html.dark #plan-publish-btn.pub-draft     { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: none; }
html.dark #plan-publish-btn.pub-published { background: transparent; border-color: var(--primary); color: var(--primary); box-shadow: none; }
html.dark #plan-publish-btn.pub-changes   { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: none; }

/* Swap-Buttons */
html.dark .plan-swap-approve { background: rgba(52, 211, 153, .15); color: #34d399; }
html.dark .plan-swap-reject  { background: rgba(248, 113, 113, .15); color: #f87171; }

/* Leave-Bloecke in Planung */
html.dark .plan-leave-block--approved { background: rgba(245, 158, 11, .15); color: #fbbf24; border-left-color: #f59e0b; }
html.dark .plan-leave-block--pending  { background: rgba(156, 163, 175, .15); color: #9ca3af; border-left-color: #6b7280; }

/* Kalender-Ereignisse im Plan (Dark) */
html.dark .btn-icon-text.active { background: var(--primary); color: #141414; border-color: var(--primary); }
html.dark .btn-icon-text.active:hover { background: #cccccc; border-color: #cccccc; color: #141414; }
html.dark .plan-cal-badge { background: #e4e4e4; color: #141414; }
html.dark .plan-cal-event,
html.dark .plan-cal-event--allday { color: rgba(255,255,255,.7) !important; }

/* Kalender Leave-Chips */
html.dark .kal-leave-chip--urlaub    { background: rgba(245, 158, 11, .15); color: #fbbf24; }
html.dark .kal-leave-chip--krank     { background: rgba(248, 113, 113, .15); color: #f87171; }
html.dark .kal-leave-chip--sonstiges { background: rgba(156, 163, 175, .15); color: #9ca3af; }

/* Kalender Ereignis-Typ Farben */
html.dark .kal-detail-row { border-bottom-color: rgba(255,255,255,.08); color: #9a9a9a; }
html.dark .kal-detail-edit-btn { background: #1e1e1e; border-color: #2e2e2e; color: #9a9a9a; }
html.dark .kal-type-reservierung  { background: rgba(255, 255, 255, .08); color: #cccccc; border-color: rgba(255, 255, 255, .15); }
html.dark .kal-type-veranstaltung { background: rgba(52, 211, 153, .15); color: #34d399; border-color: rgba(52, 211, 153, .3); }
html.dark .kal-type-termin        { background: rgba(245, 158, 11, .15); color: #fbbf24; border-color: rgba(245, 158, 11, .3); }
html.dark .kal-type-intern        { background: rgba(139, 92, 246, .15); color: #a78bfa; border-color: rgba(139, 92, 246, .3); }
html.dark .kal-type-sonstiges     { background: rgba(148, 163, 184, .15); color: #94a3b8; border-color: rgba(148, 163, 184, .3); }

/* Kalender Container + Panel */
html.dark #tab-kalender.kal-pane     { background: linear-gradient(160deg, #141414 0%, #1a1a1a 100%); }
html.dark .kal-panel                 { background: rgba(30, 30, 30, .92); border-color: #2e2e2e; box-shadow: 0 8px 32px rgba(0,0,0,.3); }

/* Kalender Monatsansicht */
html.dark .kal-month-cell            { background: #1e1e1e; border-color: #2e2e2e; box-shadow: none; }
html.dark .kal-month-cell:hover      { box-shadow: 0 4px 16px rgba(0,0,0,.3); }
html.dark .kal-month-cell.other-month { background: #1a1a1a; opacity: .5; }
html.dark .kal-month-cell.today      { border-color: var(--primary); box-shadow: 0 4px 16px rgba(255,255,255,.1); }
html.dark .kal-month-cell.today .kal-cell-day-num   { background: #ffffff; color: #141414; }
html.dark .kal-month-cell.today .kal-cell-day-badge { background: #ffffff; color: #141414; }
html.dark .kal-view-btn.active       { background: #262626; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
html.dark .kal-nav-btn:hover         { background: #262626; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
html.dark .kal-search-wrap:focus-within { background: #262626; box-shadow: 0 1px 6px rgba(0,0,0,.3); }
html.dark .kal-search-dropdown       { background: var(--white); border-color: var(--border); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
html.dark .kal-weekday-header        { color: #8a8a8a; }
html.dark .kal-add-btn               { background: #ffffff; color: #141414; box-shadow: 0 4px 12px rgba(0,0,0,.2); }

/* Team Badges */
html.dark .badge--warning { background: rgba(245, 158, 11, .15); color: #fbbf24; }
html.dark .badge--success { background: rgba(52, 211, 153, .15); color: #34d399; }
html.dark .badge--danger  { background: rgba(248, 113, 113, .15); color: #f87171; }

/* Team Leave-Status */
html.dark .team-leave-status--pending  { background: rgba(250, 204, 21, .15); color: #fbbf24; }
html.dark .team-leave-status--approved { background: rgba(52, 211, 153, .15); color: #34d399; }
html.dark .team-leave-status--rejected { background: rgba(248, 113, 113, .15); color: #f87171; }

/* Form Messages */
html.dark .team-form-msg.success,
html.dark .eins-msg.success { background: rgba(52, 211, 153, .15); color: #34d399; }
html.dark .team-form-msg.error,
html.dark .eins-msg.error   { background: rgba(248, 113, 113, .15); color: #f87171; }

/* Payout delete */
html.dark .team-payout-entry-delete:hover { background: rgba(248, 113, 113, .12); }

/* Rollen-Badges */
html.dark .eins-role-badge.admin  { background: rgba(255, 255, 255, .08); color: #cccccc; }
html.dark .eins-role-badge.worker { background: rgba(52, 211, 153, .15); color: #34d399; }

/* Einstellungen Toggle */
html.dark .eins-toggle-track { background: #4b5563; }
html.dark .eins-area-name    { color: var(--text); }
html.dark .eins-area-del-btn:hover { background: rgba(248, 113, 113, .12); }
html.dark .eins-logout-btn { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .25); }
html.dark .eins-logout-btn:hover { background: rgba(239, 68, 68, .18); border-color: rgba(239, 68, 68, .4); }

html.dark .app-content              { background: linear-gradient(160deg, #111111 0%, #191919 100%); }

/* Team Container */
html.dark #tab-team.team-pane       { background: linear-gradient(160deg, #141414 0%, #1a1a1a 100%); }
html.dark.tab-team-active           { background: #141414; }

/* Einstellungen Container */
html.dark #tab-einstellungen.eins-pane { background: linear-gradient(160deg, #141414 0%, #1a1a1a 100%); }
html.dark.tab-einstellungen-active     { background: #141414; }

/* Dashboard */
html.dark .dash-pane                { background: linear-gradient(160deg, #111111 0%, #191919 100%); }
html.dark .dash-greeting            { background: #ffffff; color: #141414; }
html.dark .dash-panel               { background: rgba(30, 30, 30, .92); box-shadow: 0 8px 32px rgba(0,0,0,.3); }
html.dark .dash-todo-check:hover    { background: rgba(52, 211, 153, .12); border-color: var(--primary); }
html.dark .dash-todo-badge--overdue { background: rgba(248, 113, 113, .12); color: var(--danger); border-color: rgba(248, 113, 113, .25); }
html.dark .dash-todo-badge--today   { background: rgba(245, 158, 11, .12); color: #fbbf24; border-color: rgba(245, 158, 11, .25); }
html.dark .dash-morgen-row--warn    { color: #fbbf24; }
html.dark .dash-heute-row--warn     { color: var(--danger); }

/* Nachrichten */
html.dark #tab-nachrichten.msg-pane {
  background: linear-gradient(160deg, #141414 0%, #1a1a1a 100%);
}
html.dark.tab-nachrichten-active {
  background: #141414;
}
html.dark .msg-panel {
  background: rgba(30, 30, 30, .92);
  box-shadow: -4px 0 24px rgba(0,0,0,.4);
}
html.dark .msg-bubble--theirs {
  background: #262626;
  border-color: var(--border);
}
html.dark .msg-date-divider span {
  background: #262626;
  border-color: var(--border);
}
html.dark .msg-conv-item {
  background: #262626;
  border-color: var(--border);
}
html.dark .msg-conv-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}
html.dark .msg-conv-item--active {
  background: rgba(255, 255, 255, .08);
  border-color: var(--primary);
}
html.dark .msg-menu-dropdown {
  background: #262626;
  border-color: var(--border);
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
html.dark .msg-menu-option:hover {
  background: rgba(255, 255, 255, .08);
}
html.dark .msg-conv-dropdown {
  background: #262626;
  border-color: var(--border);
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
html.dark .msg-conv-dropdown-option:hover {
  background: rgba(255, 255, 255, .08);
}
html.dark .msg-menu-option--danger:hover {
  background: rgba(248, 113, 113, .12);
}
html.dark .msg-reply-quote { background: rgba(255,255,255,.08); }
html.dark .msg-file-doc { background: rgba(255,255,255,.08); }
html.dark .msg-bubble-action { background: #262626; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
html.dark .msg-reply-bar { background: rgba(255, 255, 255, .06); }
html.dark .msg-reply-bar-close:hover { background: rgba(255,255,255,.08); }
html.dark .msg-modal {
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
html.dark .msg-archive-header {
  background: rgba(255, 255, 255, .06);
}
html.dark .msg-archive-back:hover {
  background: rgba(255, 255, 255, .08);
}
html.dark .msg-archive-link:hover {
  background: rgba(255, 255, 255, .06);
}
html.dark .msg-new-group-btn { background: #ffffff; color: #141414; }
html.dark .msg-conv-avatar,
html.dark .msg-chat-header-avatar,
html.dark .msg-gm-avatar,
html.dark .msg-profile-avatar { background: #fff; color: #1a1a1a; }
html.dark .msg-chat-send { background: #fff; color: #1a1a1a; }
html.dark .msg-chat-send svg { stroke: #1a1a1a; }
html.dark .msg-bubble--mine { background: #fff; color: #1a1a1a; }
html.dark .msg-bubble--mine .msg-bubble-status { color: rgba(0,0,0,.45); }
html.dark .msg-bubble--mine .msg-reply-quote { background: rgba(0,0,0,.06); border-left-color: rgba(0,0,0,.3); }
html.dark .msg-bubble--mine .msg-file-doc { background: rgba(0,0,0,.06); }
html.dark .msg-bubble--mine .msg-deleted-text { color: rgba(0,0,0,.5); }

/* Toggles + Switches */
html.dark .toggle-slider::before { background: #e4e4e4; }
html.dark .apple-switch.active   { background: #e4e4e4; }
html.dark .apple-switch.active .apple-switch-knob { background: #141414; }

/* Löschen-Button */
html.dark .btn-danger { background: #e4e4e4; color: #141414; }
html.dark .btn-danger:hover { background: #cccccc; }

/* Scrollbars */
html.dark ::-webkit-scrollbar-track { background: var(--bg); }
html.dark ::-webkit-scrollbar-thumb { background: #374151; border-radius: 4px; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #4b5563; }

/* Bottom Nav */
html.dark .app-nav {
  background: rgba(20, 20, 20, .88);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 -4px 32px rgba(0,0,0,.4);
}
html.dark .app-nav-btn       { color: #8a8a8a; }
html.dark .app-nav-btn:hover { color: #9a9a9a; background: rgba(255,255,255,.05); }
html.dark .app-nav-btn.active {
  background: var(--primary);
  color: #141414;
  box-shadow: 0 6px 18px rgba(255, 255, 255, .12);
}

/* Header */
html.dark .app-header {
  background: rgba(15, 25, 35, .92);
  border-bottom-color: var(--border);
}

/* Darstellung: Appearance-Karten */
html.dark .eins-appearance-option {
  background: #262626;
}
html.dark .eins-appearance-preview {
  border-color: #3a3a3a;
}
html.dark .eins-appearance-preview.light {
  background: #d1d5db;
}

/* Einstellungen: Panels */
html.dark .eins-overview     { background: rgba(30, 30, 30, .92); border-color: #2e2e2e; box-shadow: 0 8px 32px rgba(0,0,0,.3); }
html.dark .eins-detail       { background: rgba(30, 30, 30, .92); border-color: #2e2e2e; box-shadow: 0 8px 32px rgba(0,0,0,.3); }
html.dark .eins-detail-header { background: rgba(30, 30, 30, .92); border-bottom-color: #2e2e2e; }

/* Einstellungen: allgemein */
html.dark .eins-group       { border-color: var(--border); }
html.dark .eins-row          { border-bottom-color: rgba(255,255,255,.06); }
html.dark .eins-row-sublabel { color: #8a8a8a; }
html.dark .eins-cat-card     { background: #262626; border-color: var(--border); }
html.dark .eins-cat-card:hover { background: #2e2e2e; border-color: #404040; }
html.dark .eins-cat-icon     { background: #fff !important; }
html.dark .eins-cat-icon svg { stroke: #1a1a1a; }
html.dark .eins-hilfe-card   { background: #262626; border-color: var(--border); }
html.dark .eins-hilfe-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.3); }
html.dark .eins-hilfe-card-icon,
html.dark .eins-hilfe-section-icon { background: #e4e4e4 !important; }
html.dark .eins-hilfe-card-icon svg,
html.dark .eins-hilfe-section-icon svg { stroke: #141414; }
html.dark .eins-hilfe-section { background: #262626; border-color: var(--border); }
html.dark .eins-support-msg.success { background: #052e16; color: #86efac; }
html.dark .eins-support-msg.error { background: #450a0a; color: #fca5a5; }

/* Dashboard */
html.dark .dash-card {
  background: rgba(30, 30, 30, .85);
  border-color: var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
html.dark .dash-card-header  { border-bottom-color: rgba(255,255,255,.06); }
html.dark .dash-week {
  background: rgba(30, 30, 30, .85);
  border-color: var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
html.dark .dash-team-stat    { background: rgba(255, 255, 255, .06); }
html.dark .dash-team-stat--active { background: rgba(52, 211, 153, .12); }
html.dark .dash-team-stat--warn   { background: rgba(248, 113, 113, .1); }
html.dark .dash-week-day     { background: #262626; border: 1px solid #333333; }
html.dark .dash-week-day.today { background: #ffffff; color: #141414; box-shadow: 0 4px 14px rgba(255,255,255,.15); }
html.dark .dash-week-day.today .dash-week-name,
html.dark .dash-week-day.today .dash-week-num,
html.dark .dash-week-day.today .dash-week-tag,
html.dark .dash-week-day.today .dash-week-tag-more,
html.dark .dash-week-day.today .dash-week-shifts,
html.dark .dash-week-day.today .dash-week-open { color: #141414; }
html.dark .dash-week-day.today .dash-week-name { color: rgba(20, 20, 20, .6); }
html.dark .dash-week-day.today .dash-week-tag  { background: rgba(0, 0, 0, .12); }
html.dark .dash-week-day.today .dash-week-dot  { background: #141414; }
html.dark .dash-week-day.today .dash-week-dot--open { background: #d44; }
html.dark .dash-week-day:hover { box-shadow: 0 3px 10px rgba(0,0,0,.25); }
html.dark .dash-week-tag       { background: rgba(255, 255, 255, .12); color: #cccccc; }
html.dark .dash-heute-row    { border-bottom-color: rgba(255,255,255,.06); }
html.dark .dash-todo-check   { border-color: #3a3a3a; }
html.dark .dash-todo-row     { border-bottom-color: rgba(255,255,255,.06); }
html.dark .dash-todo-input   { color: var(--text); }
html.dark .dash-todo-input::placeholder { color: #8a8a8a; }
html.dark .dash-live-modal-overlay { background: rgba(0,0,0,.65); }
html.dark .dash-live-modal   { background: var(--white); border-color: var(--border); box-shadow: 0 16px 48px rgba(0,0,0,.5); }
html.dark .dash-live-stat    { background: rgba(255, 255, 255, .05); border-color: var(--border); }

/* Team Panel + Worker-Card */
html.dark .team-add-btn      { background: #ffffff; color: #141414; }
html.dark .team-panel        { background: rgba(30, 30, 30, .92); border-color: #2e2e2e; box-shadow: 0 8px 32px rgba(0,0,0,.3); }
html.dark .team-worker-card  { background: #262626; border-color: var(--border); }
html.dark .team-worker-card:hover { background: #2e2e2e; }
html.dark .team-toolbar      { background: #1e1e1e; border-color: var(--border); }

/* Onboarding Tour */
html.dark .onb-tooltip       { background: var(--white); border-color: var(--border); box-shadow: 0 8px 32px rgba(0,0,0,.5); }

/* ── Compact Mode ─────────────────────────────────────────── */
html.compact {
  font-size: 13px;
}

html.compact .eins-row,
html.compact .eins-row-btn,
html.compact .eins-number-row,
html.compact .eins-shift-time-row { padding: 10px 14px; min-height: 44px; }

html.compact .eins-cat-card { padding: 10px 14px; }
html.compact .eins-cat-icon { width: 34px; height: 34px; border-radius: 10px; }
html.compact .eins-cat-icon svg { width: 16px; height: 16px; }
html.compact .eins-cat-title { font-size: 13px; }
html.compact .eins-cat-desc { font-size: 11px; }

html.compact .team-worker-card { padding: 8px 14px; }
/* plan-hour-row/label Hoehe wird jetzt dynamisch per --hour-h gesetzt */

/* ══════════════════════════════════════════════════════════
   Dashboard
   ══════════════════════════════════════════════════════════ */

/* Pane: Kalender-Style Gradient */
.dash-pane {
  background: linear-gradient(160deg, #eef3f7 0%, #dce5ed 100%);
  height: calc(calc(100dvh / var(--ui-zoom)) - var(--nav-h));
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  max-width: none;
  overflow: hidden;
}

body.tab-dashboard-active { background: #dce5ed; }
body.tab-dashboard-active .app-content { }

/* Panel: weisses Container-Panel */
.dash-panel {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,.06);
  padding: 18px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────── */
.dash-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.dash-greeting {
  display: inline-flex;
  align-items: center;
  height: 36px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.2px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 0 18px;
  border-radius: 999px;
  white-space: nowrap;
}

.dash-date {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

/* ── Wochenuebersicht ──────────────────────────────────── */
.dash-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 14px;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.dash-week-day {
  background: var(--primary-pale, #eef2f7);
  border-radius: 14px;
  padding: 10px 6px 8px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform .12s, box-shadow .12s;
  min-height: 68px;
}

.dash-week-day:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,.08);
}

.dash-week-day.today {
  background: var(--primary);
  box-shadow: 0 4px 14px rgba(53,80,111,.25);
}

.dash-week-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.dash-week-day.today .dash-week-name {
  color: rgba(255,255,255,.8);
}

.dash-week-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.dash-week-day.today .dash-week-num {
  color: #fff;
  font-size: 20px;
}
.dash-week-day.today .dash-week-tag {
  background: rgba(255,255,255,.22);
  color: #fff;
}
.dash-week-day.today .dash-week-tag-more {
  color: rgba(255,255,255,.7);
}
.dash-week-day.today .dash-week-shifts {
  color: rgba(255,255,255,.75);
}
.dash-week-day.today .dash-week-dot {
  background: #fff;
}
.dash-week-day.today .dash-week-dot--open {
  background: #ffa0a0;
}
.dash-week-day.today .dash-week-open {
  color: #ffa0a0;
}

.dash-week-tags {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  margin-top: 2px;
}

.dash-week-tag {
  font-size: 8px;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.3;
  text-align: center;
  background: rgba(53, 80, 111, .12);
  color: var(--primary);
}
.dash-week-tag-more {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

.dash-week-shifts {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: auto;
}

.dash-week-shifts-label { line-height: 1; }

.dash-week-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}
.dash-week-dot--open { background: var(--danger); }

.dash-week-open {
  color: var(--danger);
  font-weight: 700;
}

.dash-divider {
  height: 0;
  margin: 0 0 16px;
}

/* ── Live Badge ────────────────────────────────────────── */
.dash-live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
}

.dash-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: dash-pulse 2s ease-in-out infinite;
}

@keyframes dash-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,.4); }
  50% { opacity: .7; box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}

/* ── Content-Grid ──────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: minmax(260px, 1fr);
  gap: 16px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px;
  margin: -4px;
}

.dash-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.dash-card .dash-card-body {
  flex: 1;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Wetter im Dashboard */

/* Hero-Zeile: Icon + Temp + Info */
.dash-wetter-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  margin-bottom: 12px;
}
.dash-wetter-hero-icon {
  line-height: 1;
  flex-shrink: 0;
}
.dash-wetter-hero-icon svg { display: block; }
.dash-wetter-hero-temp {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  flex-shrink: 0;
}
.dash-wetter-hero-info {
  min-width: 0;
}
.dash-wetter-hero-desc {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.dash-wetter-hero-range {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Stündliche Vorhersage */
.dash-wetter-forecast {
  display: flex;
  gap: 0;
}
.dash-wetter-fc {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 12px;
  transition: background .15s;
}
.dash-wetter-fc--now {
  background: var(--primary-pale, #eef2f7);
}
.dash-wetter-fc--now .dash-wetter-fc-temp {
  color: var(--primary);
  font-weight: 800;
}
.dash-wetter-fc-time {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.dash-wetter-fc--now .dash-wetter-fc-time {
  color: var(--primary);
  font-weight: 700;
}
.dash-wetter-fc-icon {
  line-height: 1;
}
.dash-wetter-fc-icon svg { display: block; }
.dash-wetter-fc-temp {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.dash-wetter-fc-rain {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: center;
}


/* Termin-Sektionen */
.dash-termine-section {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
  padding: 8px 0 4px;
}
.dash-termine-section:first-child {
  padding-top: 0;
}

/* ── Karten ─────────────────────────────────────────────── */
/* ── Karten-Header ──────────────────────────────────────── */
.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.dash-card-body {
  padding: 16px 20px 20px;
}

.dash-card-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .3px;
  color: var(--primary);
}

/* ── Leere Zustaende ─────────────────────────────────────── */
.dash-empty-note {
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0 6px;
}

/* ── Team Stats ─────────────────────────────────────────── */
.dash-team-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  flex: 1;
}

/* Mitarbeiter-Karte: Kacheln fuellen die Karte, Aktionszeilen nehmen nur ihren Platz */
#dash-card-team .dash-card-body { overflow-y: auto; }
#dash-card-team .dash-heute-list {
  flex: 0 0 auto;
  margin-top: 10px;
  overflow: visible;
  -webkit-mask-image: none;
  mask-image: none;
}
#dash-card-team .dash-heute-row { padding: 7px 0; font-size: 12px; }

/* Schlanke Scrollbars fuer die Dashboard-Scrollbereiche (Windows zeigt sonst breite Systemleisten) */
.dash-grid,
#dash-card-team .dash-card-body { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,.18) transparent; }
.dash-grid::-webkit-scrollbar,
#dash-card-team .dash-card-body::-webkit-scrollbar { width: 6px; }
.dash-grid::-webkit-scrollbar-track,
#dash-card-team .dash-card-body::-webkit-scrollbar-track { background: transparent; }
.dash-grid::-webkit-scrollbar-thumb,
#dash-card-team .dash-card-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 3px; }

.dash-team-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 6px;
  background: var(--primary-pale, #eef2f7);
  border-radius: 14px;
  min-height: 80px;
  overflow: hidden;
}

/* Zustands-Farben — nur grün/rot für echte Zustände */
.dash-team-stat--active {
  background: rgba(39, 174, 96, .10);
}
.dash-team-stat--active .dash-team-stat-num {
  color: var(--success);
}
.dash-team-stat--done .dash-team-stat-num {
  color: var(--primary);
}
.dash-team-stat--warn {
  background: rgba(231, 76, 60, .08);
}
.dash-team-stat--warn .dash-team-stat-num {
  color: var(--danger, #e74c3c);
}

.dash-team-stat-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.dash-team-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.dash-team-stat-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dash-team-stat--clickable {
  cursor: pointer;
  transition: box-shadow .14s, transform .14s;
}
.dash-team-stat--clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(0,0,0,.1);
}

/* ── Live Detail Modal ─────────────────────────────────── */
.dash-live-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease;
}
.dash-live-modal-overlay.visible { opacity: 1; }

.dash-live-modal {
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,.2);
  width: 720px;
  max-width: calc(94vw / var(--ui-zoom));
  max-height: calc(85vh / var(--ui-zoom));
  display: flex;
  flex-direction: column;
  transform: translateY(12px) scale(.97);
  transition: transform .25s ease;
}
.dash-live-modal-overlay.visible .dash-live-modal { transform: translateY(0) scale(1); }

.dlm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--border);
}

.dlm-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.dlm-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

.dash-live-modal-close {
  background: var(--primary-pale);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s;
}
.dash-live-modal-close:hover { background: var(--border); }

.dlm-body {
  padding: 22px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Stats-Leiste */
.dlm-stats {
  display: flex;
  gap: 8px;
}

.dlm-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  background: var(--primary-pale, #eef2f7);
  border-radius: 12px;
}

.dlm-stat-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.dlm-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* Sektionen */
.dlm-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 10px;
}
.dlm-section-label svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dlm-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 0;
}

/* Kalendereinträge im Modal */
.dlm-cal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dlm-cal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--primary-pale, #eef2f7);
  border-radius: 10px;
}
.dlm-cal-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--border);
  color: var(--text-muted);
  flex-shrink: 0;
}
.dlm-cal-tag--reservierung {
  background: rgba(53, 80, 111, .12);
  color: var(--primary);
}
.dlm-cal-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dlm-cal-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Anträge-Liste im Modal */
.dlm-req-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dlm-req-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--primary-pale, #eef2f7);
  border-radius: 12px;
  transition: background .12s;
}
.dlm-req-row:hover {
  background: var(--border);
}
.dlm-req-info {
  flex: 1;
  min-width: 0;
}
.dlm-req-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.dlm-req-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 1px;
}
.dlm-req-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  padding: 4px 10px;
  border-radius: 6px;
  flex-shrink: 0;
}
.dlm-req-tag--leave {
  background: rgba(231, 76, 60, .1);
  color: var(--danger, #e74c3c);
}
.dlm-req-tag--swap {
  background: rgba(53, 80, 111, .1);
  color: var(--primary);
}
.dlm-req-tag--join {
  background: rgba(39, 174, 96, .1);
  color: var(--success);
}
.dlm-req-tag--avail-done {
  background: rgba(34, 197, 94, .1);
  color: #16a34a;
}
.dlm-req-tag--avail-missing {
  background: rgba(245, 158, 11, .1);
  color: #d97706;
}

/* Eröffnung */
.dlm-opening {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--primary-pale, #eef2f7);
  border-radius: 14px;
}

.dlm-opening-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dlm-opening-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.dlm-opening-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Nachricht-Button */
.dlm-msg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s, transform .12s;
  flex-shrink: 0;
}
.dlm-msg-btn:hover { background: var(--primary-dark); transform: scale(1.03); }
.dlm-msg-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dlm-msg-btn--sm {
  padding: 5px 8px;
  background: transparent;
  color: var(--text-muted);
}
.dlm-msg-btn--sm:hover { background: var(--primary-pale); color: var(--primary); transform: none; }

/* Live-Liste */
.dlm-live-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dlm-live-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(39, 174, 96, .06);
  border-radius: 12px;
}

.dlm-live-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.dlm-live-meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 1px;
}

.dlm-live-info { flex: 1; min-width: 0; }

.dlm-live-pulse {
  display: flex;
  align-items: center;
}

/* Tages-Timeline */
.dlm-timeline {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.dlm-tl-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--primary-pale, #eef2f7);
}

.dlm-tl-label-spacer {
  width: 70px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}

.dlm-tl-hours {
  flex: 1;
  position: relative;
  height: 28px;
  min-width: 0;
}

.dlm-tl-hour {
  position: absolute;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  border-left: 1px solid rgba(0,0,0,.08);
}
.dlm-tl-hour span {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  padding-left: 4px;
  white-space: nowrap;
}

/* Now-Marker */
.dlm-tl-now {
  position: absolute;
  top: 0;
  bottom: -200px;
  z-index: 5;
  pointer-events: none;
}
.dlm-tl-now-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  position: absolute;
  top: -1px;
  left: -4px;
}
.dlm-tl-now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--primary);
}

/* Zeilen */
.dlm-tl-body {
  display: flex;
  flex-direction: column;
}

.dlm-tl-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  min-height: 40px;
}
.dlm-tl-row:last-child { border-bottom: none; }

.dlm-tl-label {
  width: 70px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  border-right: 1px solid var(--border);
  background: rgba(255,255,255,.5);
}

.dlm-tl-track {
  flex: 1;
  position: relative;
  min-height: 40px;
}

/* Schicht-Block */
.dlm-tl-block {
  position: absolute;
  top: 5px;
  bottom: 5px;
  border-radius: 6px;
  background: rgba(53, 80, 111, .2);
  border: 1px solid rgba(53, 80, 111, .3);
  display: flex;
  align-items: center;
  padding: 0 8px;
  overflow: hidden;
  min-width: 2px;
}

.dlm-tl-block-text {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dlm-tl-block--live {
  background: rgba(39, 174, 96, .18);
  border-color: rgba(39, 174, 96, .35);
}
.dlm-tl-block--live .dlm-tl-block-text { color: var(--success); }

.dlm-tl-block--open {
  background: rgba(231, 76, 60, .15);
  border-color: rgba(231, 76, 60, .3);
}
.dlm-tl-block--open .dlm-tl-block-text { color: var(--danger); }

.dlm-tl-block--past {
  background: rgba(53, 80, 111, .08);
  border-color: rgba(53, 80, 111, .12);
}
.dlm-tl-block--past .dlm-tl-block-text { color: var(--text-muted); }

/* ── Wer arbeitet gerade ───────────────────────────────── */
.dash-worker-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.dash-worker-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-worker-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -.5px;
}

.dash-worker-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dash-worker-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.dash-worker-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.dash-next-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-next-hint svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.dash-next-hint--warn {
  color: var(--danger);
  font-weight: 600;
}

/* ── Heute-Karte ───────────────────────────────────────── */
.dash-heute-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black calc(100% - 16px), transparent);
  mask-image: linear-gradient(to bottom, black 0%, black calc(100% - 16px), transparent);
}

.dash-heute-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.dash-heute-row:last-child {
  border-bottom: none;
}

.dash-heute-row[data-tab] {
  cursor: pointer;
  transition: color .12s;
}

.dash-heute-row[data-tab]:hover {
  color: var(--primary);
}

.dash-heute-row--warn {
  color: var(--danger);
}

.dash-heute-row--ok {
  color: var(--success);
}

.dash-heute-ok-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

.dash-heute-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  min-width: 38px;
}

.dash-heute-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.dash-heute-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-heute-type {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
}

.dash-heute-arrow {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 16px;
  flex-shrink: 0;
}

/* ── Morgen ─────────────────────────────────────────────── */
.dash-morgen-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-morgen-row {
  font-size: 13px;
  color: var(--text);
  padding: 2px 0;
}

.dash-morgen-row--warn {
  color: #b45309;
  font-weight: 600;
}

/* ── Todos (Apple Reminders Style) ──────────────────────── */
.dash-todo-count {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.dash-todo-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black calc(100% - 16px), transparent);
  mask-image: linear-gradient(to bottom, black 0%, black calc(100% - 16px), transparent);
}

.dash-todo-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  cursor: pointer;
}

.dash-todo-row--done {
  opacity: 0;
  transform: scale(.96);
}

.dash-todo-row--high .dash-todo-check {
  border-color: var(--danger);
}

.dash-todo-check {
  width: 22px;
  height: 22px;
  border: 2px solid #c7ced6;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .15s, background .15s;
  margin-top: 1px;
}

.dash-todo-check--high {
  border-color: var(--danger);
}

.dash-todo-check:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.dash-todo-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dash-todo-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
}

.dash-todo-meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.dash-todo-meta--overdue {
  color: var(--danger);
}

.dash-todo-meta--today {
  color: var(--text-secondary);
}

/* Todo Items */
.dash-todo-item { border-bottom: 1px solid var(--border); }
.dash-todo-item:last-child { border-bottom: none; }

/* ── Todo Detail Modal ─────────────────────────────────── */
.dash-todo-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  backdrop-filter: blur(4px);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
}
.dash-todo-modal-overlay.visible { opacity: 1; }

.dash-todo-modal {
  background: var(--white);
  border-radius: 20px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  transform: scale(.95);
  transition: transform .2s;
}
.dash-todo-modal-overlay.visible .dash-todo-modal { transform: scale(1); }

.dash-todo-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
}

.dash-todo-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.dash-todo-modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dash-todo-modal-close:hover { background: var(--border); }

.dash-todo-modal-body {
  padding: 0 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dash-todo-modal-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.dash-todo-modal-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #475569;
  background: var(--white);
  outline: none;
  transition: border-color .15s;
}
.dash-todo-modal-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.dash-todo-modal-prio {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.dtm-prio {
  flex: 1;
  border: none;
  background: var(--white);
  padding: 9px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .12s, color .12s;
  text-align: center;
}

.dtm-prio + .dtm-prio { border-left: 1.5px solid var(--border); }

.dtm-prio.active {
  background: var(--primary);
  color: #fff;
}

.dtm-prio[data-val="high"].active {
  background: var(--danger);
}

.dash-todo-modal-footer {
  display: flex;
  align-items: center;
  padding: 0 22px 18px;
}

.dtm-delete {
  border: none;
  background: none;
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.dtm-delete:hover { opacity: .7; }

.dtm-save {
  margin-left: auto;
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 9px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.dtm-save:hover { opacity: .9; }

.dash-todo-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-todo-add-inline {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity .12s;
}
.dash-todo-add-inline:hover { opacity: .8; }

.dash-todo-input--hidden {
  display: none !important;
}

.dash-todo-add-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 400;
  line-height: 0;
  flex-shrink: 0;
  padding-bottom: 1px;
}

.dash-todo-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--primary-pale, #eef2f7);
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(53,80,111,.08);
  transition: box-shadow .15s;
}
.dash-todo-input:focus {
  box-shadow: 0 0 0 2px rgba(53,80,111,.18);
}

.dash-todo-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 720px) {
  .dash-pane {
    padding: 12px;
  }

  .dash-panel {
    padding: 16px;
    border-radius: 18px;
  }

  .dash-header {
    padding: 18px 20px;
  }

  .dash-greeting {
    font-size: 18px;
  }

  .dash-week {
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }

  .dash-week-day {
    padding: 6px 4px;
    border-radius: 12px;
    min-height: 64px;
  }

  .dash-week-num {
    font-size: 15px;
  }

  .dash-week-shifts {
    font-size: 9px;
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════
   ONBOARDING
   ═══════════════════════════════════════════════════════════ */

#screen-onboarding {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--white);
}

.ob-page {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

/* ── Welcome ── */
.ob-welcome-inner {
  max-width: 440px;
  width: 100%;
  padding: 48px 32px;
  text-align: center;
}

.ob-welcome-wave {
  font-size: 56px;
  margin-bottom: 20px;
  animation: ob-wave-anim .6s ease-in-out;
}
@keyframes ob-wave-anim {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(20deg); }
  50% { transform: rotate(-10deg); }
  75% { transform: rotate(15deg); }
}

.ob-brand {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.5px;
  margin-bottom: 40px;
}

.ob-brand-sm {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.4px;
}

.ob-welcome-title {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -.5px;
}

.ob-welcome-sub {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 36px;
}
.ob-welcome-sub strong {
  color: var(--primary);
  font-weight: 700;
}

.ob-welcome-btn {
  width: 100%;
  max-width: 280px;
  padding: 16px;
  font-size: 16px;
}

.ob-welcome-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 14px;
  opacity: .7;
}

/* ── Setup Wizard ── */
.ob-setup-inner {
  max-width: 520px;
  width: 100%;
  padding: 32px 32px 24px;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh / var(--ui-zoom));
}

.ob-setup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}

.ob-progress-wrap {
  flex: 1;
}

.ob-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.ob-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width .35s ease;
}

.ob-progress-label {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

/* ── Step ── */
.ob-step {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ob-step-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.ob-step-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -.4px;
}

.ob-step-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.ob-step-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}

.ob-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Logo Upload im Onboarding */
.ob-logo-upload {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ob-logo-upload:hover {
  border-color: var(--primary);
  background: var(--primary-pale, #eef2f7);
}
.ob-logo-preview {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: var(--primary-pale, #eef2f7);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.ob-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ob-logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ob-logo-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}
.ob-logo-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Toggles ── */
.ob-toggles {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 16px;
}

.ob-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  gap: 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  transition: background .15s;
}
.ob-toggle-row:last-child { border-bottom: none; }
.ob-toggle-row:hover { background: var(--bg); }

.ob-toggle-primary {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.ob-toggle-info { flex: 1; }
.ob-toggle-label { font-size: 14px; font-weight: 600; color: var(--text); }
.ob-toggle-desc  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Bereiche Step ── */
.ob-areas-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.ob-area-chip {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.ob-area-chip:hover { border-color: var(--primary); color: var(--primary); }
.ob-area-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.ob-areas-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.ob-area-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.ob-area-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.ob-area-remove:hover { color: var(--danger); }

.ob-area-add-row {
  display: flex;
  gap: 8px;
}

.ob-area-input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--white);
}
.ob-area-input:focus { outline: none; border-color: var(--primary); }

/* ── Einladen Step ── */
.ob-invite-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
}

.ob-invite-tab {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.ob-invite-tab.active {
  background: var(--white);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.ob-invite-panel { display: flex; flex-direction: column; gap: 0; }

.ob-inv-msg {
  font-size: 12px;
  padding: 8px 0;
}
.ob-inv-msg.success { color: var(--success); }
.ob-inv-msg.error   { color: var(--danger);  }

.ob-inv-list { margin-top: 12px; }
.ob-inv-list-title { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.ob-inv-list-item  { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.ob-inv-list-item span { color: var(--text-muted); }

.ob-link-box {
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: monospace;
  word-break: break-all;
  margin-bottom: 10px;
}

.ob-link-copied { font-size: 12px; color: var(--success); margin-top: 6px; }

/* ── Setup Footer ── */
.ob-setup-footer {
  display: flex;
  justify-content: space-between;
  padding-top: 24px;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

/* ── Summary ── */
.ob-summary-inner {
  max-width: 480px;
  width: 100%;
  padding: 48px 32px;
  text-align: center;
}

.ob-check-icon {
  width: 64px;
  height: 64px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.ob-summary-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 28px;
  letter-spacing: -.4px;
}

.ob-summary-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-align: left;
  margin-bottom: 28px;
}

.ob-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.ob-summary-item:last-child { border-bottom: none; }

.ob-summary-item-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 100px;
}

.ob-summary-item-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

.ob-summary-btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  margin-bottom: 10px;
}

.ob-skip-tour-btn {
  width: 100%;
  padding: 11px;
}

/* ── Tour ── */
body.ob-tour-active .tab-pane { overflow: hidden; }

.ob-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 10003;
  pointer-events: none;
}

.ob-tour-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: auto;
}
.ob-tour-backdrop.visible { opacity: 1; }

/* ── Übersichts-Karte (zentriert) ── */
.ob-tour-card {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  max-width: calc(calc(100vw / var(--ui-zoom)) - 32px);
  max-height: calc(calc(100dvh / var(--ui-zoom)) - 32px);
  overflow-y: auto;
  background: var(--white);
  border-radius: 20px;
  padding: 36px 32px 28px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  pointer-events: auto;
  z-index: 10002;
  animation: ob-card-in .3s ease;
}
@keyframes ob-card-in {
  from { opacity: 0; transform: translate(-50%, -48%) scale(.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.ob-tour-card.hidden { display: none; }
.ob-tour-card-badge {
  font-size: 12px; font-weight: 700; color: var(--primary);
  background: var(--primary-pale); display: inline-block;
  padding: 4px 12px; border-radius: 999px; margin-bottom: 20px;
}
.ob-tour-card-icon { font-size: 48px; margin-bottom: 16px; }
.ob-tour-card-title {
  font-size: 24px; font-weight: 800; color: var(--text);
  margin-bottom: 12px; letter-spacing: -.3px;
}
.ob-tour-card-text {
  font-size: 15px; color: var(--text-muted); line-height: 1.65; margin-bottom: 28px;
}
.ob-tour-card-actions { display: flex; gap: 10px; justify-content: center; }
.ob-tour-detail-btn {
  height: 44px; padding: 0 20px; border: 1.5px solid var(--border);
  border-radius: 12px; background: var(--white); color: var(--text);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.ob-tour-detail-btn:hover { border-color: var(--primary); color: var(--primary); }
.ob-tour-next-btn {
  height: 44px; padding: 0 24px; border-radius: 12px;
  font-size: 14px; font-weight: 600; min-width: 100px;
}
.ob-tour-skip-link {
  display: block; margin: 16px auto 0; background: none; border: none;
  font-size: 13px; color: var(--text-muted); cursor: pointer; padding: 0;
  opacity: .7; transition: opacity .15s;
}
.ob-tour-skip-link:hover { opacity: 1; }

/* ── Detail-Spotlight ── */
.ob-tour-highlight {
  background: transparent;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.52);
  z-index: 10001;
}

/* ── Detail-Tooltip (positioniert) ── */
.ob-tour-tooltip {
  position: fixed;
  width: 320px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  pointer-events: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.22);
  z-index: 10002;
  transition: top .25s ease, left .25s ease;
}
.ob-tour-tooltip.hidden { display: none; }

.ob-tour-step-badge {
  font-size: 11px; font-weight: 700; color: var(--primary);
  background: var(--primary-pale); display: inline-block;
  padding: 3px 10px; border-radius: 12px; margin-bottom: 10px;
}
.ob-tour-title { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.ob-tour-text { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin-bottom: 16px; }
.ob-tour-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ob-tour-skip { background: none; border: none; font-size: 13px; color: var(--text-muted); cursor: pointer; padding: 0; }
.ob-tour-skip:hover { color: var(--text); }
.ob-tour-next { min-width: 90px; }

/* ── Tour: Einstiegskarte (Zusammenspiel der Apps + Wochenablauf) ── */
.ob-tour-card--wide { width: 600px; }
.ob-tour-card-kicker {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); margin-bottom: 6px;
}
.ob-tour-card-kicker.hidden { display: none; }
.ob-tour-card-visual { margin: 0 0 24px; }
.ob-tour-card-visual.hidden { display: none; }
.ob-tour-apps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px;
}
.ob-tour-app {
  border: 1.5px solid var(--border); border-radius: 14px; padding: 12px 10px;
  text-align: center; background: var(--bg);
}
.ob-tour-app--you { border-color: var(--primary); background: var(--primary-pale); }
.ob-tour-app-who {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-muted);
}
.ob-tour-app-name { font-size: 14px; font-weight: 800; color: var(--text); margin: 4px 0 2px; }
.ob-tour-app-what { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.ob-tour-cycle {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px;
}
.ob-tour-cycle-step {
  display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  color: var(--text); background: var(--primary-pale); border-radius: 999px; padding: 5px 11px 5px 5px;
}
.ob-tour-cycle-num {
  width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: #fff;
  font-size: 11px; display: flex; align-items: center; justify-content: center;
}
.ob-tour-cycle-arrow { color: var(--text-muted); font-size: 16px; line-height: 1; }

/* ── Tour: Hinweis auf Beispieldaten ── */
.ob-tour-demo {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 10002; pointer-events: none; white-space: nowrap;
  font-size: 12px; font-weight: 700; color: #fff; background: var(--primary);
  padding: 6px 14px; border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.ob-tour-demo.hidden { display: none; }

/* KI-Button waehrend Setup/Zusammenfassung ausblenden (in der Tour ist er ein eigener Schritt) */
#screen-onboarding:not(.hidden) ~ .ai-fab { display: none; }

/* ── Setup: Schichtzeiten, Abrechnung, Einladungshinweis ── */
.ob-form-section {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-muted); margin: 18px 0 8px; padding-left: 2px;
}
.ob-shift-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.ob-shift-row:last-of-type { border-bottom: none; }
.ob-shift-label { font-size: 14px; font-weight: 600; color: var(--text); min-width: 110px; }
.ob-shift-times { display: flex; align-items: center; gap: 8px; }
.ob-shift-times input[type="time"] {
  padding: 9px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; font-family: inherit; background: var(--bg);
  color: var(--text); outline: none; width: 110px;
}
.ob-shift-times input[type="time"]:focus { border-color: var(--primary); }
.ob-shift-sep { color: var(--text-muted); font-size: 16px; }
.ob-link-hint {
  margin-top: 14px; font-size: 13px; color: var(--text-muted); line-height: 1.55; text-align: left;
}
.ob-link-hint strong { color: var(--text); }
.ob-link-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; color: var(--primary); }

/* ── Responsive ── */
@media (max-width: 540px) {
  .ob-setup-inner, .ob-welcome-inner, .ob-summary-inner {
    padding: 24px 20px 20px;
  }
  .ob-welcome-title { font-size: 28px; }
  .ob-tour-tooltip  { width: calc(calc(100vw / var(--ui-zoom)) - 24px); left: 12px !important; }
  .ob-tour-card { padding: 28px 20px 22px; }
  .ob-tour-card-title { font-size: 20px; }
  .ob-tour-apps { grid-template-columns: 1fr; gap: 8px; }
  .ob-tour-app { padding: 10px; }
  .ob-tour-demo { font-size: 10px; padding: 4px 10px; }
  .ob-shift-label { min-width: 90px; font-size: 13px; }
  .ob-shift-times input[type="time"] { width: 95px; font-size: 13px; padding: 7px 8px; }
}

/* ═══════════════════════════════════════════════════════════
   Checklisten — Einstellungen
   ═══════════════════════════════════════════════════════════ */
.eins-checklist-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.eins-checklist-empty {
  padding: 18px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
.eins-checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
  transition: background .15s;
}
.eins-checklist-item:hover {
  background: var(--bg-hover, rgba(0,0,0,.03));
}
.eins-checklist-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 22px;
}
.eins-checklist-text {
  flex: 1;
  font-size: 15px;
  color: var(--text);
}
.eins-checklist-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s;
}
.eins-checklist-item:hover .eins-checklist-actions {
  opacity: 1;
}
.eins-checklist-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.eins-checklist-btn:hover {
  background: rgba(0,0,0,.06);
  color: var(--text);
}
.eins-checklist-btn:disabled {
  opacity: .25;
  pointer-events: none;
}
.eins-checklist-btn svg {
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.eins-cl-del:hover {
  color: var(--danger, #e74c3c);
}
.eins-checklist-add {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.eins-checklist-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: var(--white);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.eins-checklist-input:focus {
  border-color: var(--primary);
}
.eins-checklist-add-btn {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.eins-checklist-add-btn:hover {
  opacity: .85;
}

/* ═══════════════════════════════════════════════════════════
   Checklisten — Dashboard Chips
   ═══════════════════════════════════════════════════════════ */
.dash-team-stats--2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  gap: 10px;
}
.dash-team-stat--progress {
  background: rgba(245, 158, 11, .10);
}
.dash-team-stat--progress .dash-team-stat-num {
  color: #f59e0b;
}

/* ═══════════════════════════════════════════════════════════
   Checklisten — Detail-Modal
   ═══════════════════════════════════════════════════════════ */
.dash-cl-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease;
}
.dash-cl-overlay.visible { opacity: 1; }

.dash-cl-modal {
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,.2);
  width: 480px;
  max-width: calc(94vw / var(--ui-zoom));
  max-height: calc(85vh / var(--ui-zoom));
  display: flex;
  flex-direction: column;
  transform: translateY(12px) scale(.97);
  transition: transform .25s ease;
}
.dash-cl-overlay.visible .dash-cl-modal { transform: translateY(0) scale(1); }

.dash-cl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.dash-cl-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}
.dash-cl-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}
.dash-cl-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.dash-cl-close:hover { color: var(--text); }

.dash-cl-body {
  padding: 16px 24px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-cl-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background .15s;
}
.dash-cl-item:hover { background: rgba(0,0,0,.02); }
.dash-cl-item-check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.dash-cl-item--done .dash-cl-item-check {
  background: var(--success, #27ae60);
  border-color: var(--success, #27ae60);
  color: #fff;
}
.dash-cl-item--done .dash-cl-item-check svg {
  stroke: #fff;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dash-cl-item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash-cl-item-text {
  font-size: 15px;
  color: var(--text);
}
.dash-cl-item--done .dash-cl-item-text {
  text-decoration: line-through;
  opacity: .55;
}
.dash-cl-item-meta {
  font-size: 12px;
  color: var(--success, #27ae60);
  font-weight: 600;
}
.dash-cl-empty {
  text-align: center;
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* Dark Mode */
html.dark .dash-cl-overlay { background: rgba(0,0,0,.65); }
html.dark .dash-cl-modal { background: var(--white); border-color: var(--border); box-shadow: 0 16px 48px rgba(0,0,0,.5); }
html.dark .dash-team-stat--progress { background: rgba(245, 158, 11, .12); }
html.dark .eins-checklist-item { background: rgba(255,255,255,.04); }
html.dark .eins-checklist-item:hover { background: rgba(255,255,255,.08); }
html.dark .eins-checklist-btn:hover { background: rgba(255,255,255,.1); }
html.dark .eins-checklist-input { background: var(--white); border-color: var(--border); }

/* ═══════════════════════════════════════════════════════════════
   Google Bewertungen – Einstellungen
   ═══════════════════════════════════════════════════════════════ */

/* Suche */
.eins-google-search-row {
  display: flex;
  gap: 8px;
}
.eins-google-search-row input { flex: 1; }
.eins-google-search-row .btn { flex-shrink: 0; white-space: nowrap; }

/* Suchergebnisse */
.eins-google-candidates {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.eins-google-candidate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.eins-google-candidate:last-child { border-bottom: none; }
.eins-google-candidate:hover { background: var(--primary-pale); }
.eins-google-candidate-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.eins-google-candidate-addr {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}
.eins-google-candidate-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.eins-google-candidate-count {
  font-weight: 400;
  color: var(--text-muted);
}
.eins-google-candidate-select {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}
.eins-google-no-result {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* Verbundener Header */
.eins-google-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.eins-google-header-info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.eins-google-header-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #4285f4;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.eins-google-header-icon svg { width: 20px; height: 20px; }
.eins-google-header-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.eins-google-header-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Bewertungs-Übersicht */
.eins-google-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.eins-google-summary-rating {
  font-size: 42px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.eins-google-summary-stars {
  display: flex;
  align-items: center;
  gap: 2px;
}
.eins-google-summary-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Sterne */
.eins-star {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.eins-star--full { fill: #facc15; }
.eins-star--empty { fill: #d1d5db; }
.eins-google-candidate-rating .eins-star { width: 14px; height: 14px; }
.eins-google-review-stars .eins-star { width: 15px; height: 15px; }

/* Einzelne Rezensionen */
.eins-google-review-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.eins-google-review {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.eins-google-review:last-child { border-bottom: none; }
.eins-google-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.eins-google-review-author {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.eins-google-review-time {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.eins-google-review-stars {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 8px;
}
.eins-google-review-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
}

/* Dark Mode */
html.dark .eins-google-candidate:hover { background: rgba(255,255,255,.06); }
html.dark .eins-star--empty { fill: #4b5563; }

/* ═══════════════════════════════════════════════════════════════
   Team – Betrieb-Karte
   ═══════════════════════════════════════════════════════════════ */

.team-betrieb-card {
  border-bottom: 2px solid var(--primary) !important;
  margin-bottom: 4px;
}
.team-betrieb-avatar {
  background: linear-gradient(135deg, #4285f4, #1a73e8) !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.team-betrieb-avatar svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
}
.team-betrieb-avatar--logo {
  background: var(--bg) !important;
  overflow: hidden;
}
.team-betrieb-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.team-betrieb-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.team-betrieb-rating .eins-star { width: 14px; height: 14px; }
.team-betrieb-rating-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-left: 2px;
}
.team-betrieb-rating-loading {
  font-size: 12px;
  color: var(--text-muted);
}

/* Betrieb-Drawer Inhalt */
.team-betrieb-section {
  margin-bottom: 24px;
}
.team-betrieb-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--primary);
  margin-bottom: 10px;
}
.team-betrieb-info-list {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.team-betrieb-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.team-betrieb-info-row:last-child { border-bottom: none; }
.team-betrieb-info-label {
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.team-betrieb-info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}
.team-betrieb-no-reviews {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.team-betrieb-settings-link {
  text-align: center;
  padding-top: 8px;
}

/* ── KI-Assistent ────────────────────────────────────────────────────────── */

.ai-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, background .2s;
}
.ai-fab:hover { background: var(--primary-dark); transform: scale(1.08); }
.ai-fab svg { width: 28px; height: 28px; }
.ai-fab-close { display: none; }
.ai-fab--open .ai-fab-icon { display: none; }
.ai-fab--open .ai-fab-close { display: block; }

.ai-panel {
  --ai-w: 440px;
  --ai-h: 640px;
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: min(var(--ai-w), calc(calc(100vw / var(--ui-zoom)) - 48px));
  height: min(var(--ai-h), calc(calc(100vh / var(--ui-zoom)) - 116px));
  min-width: 320px;
  min-height: 320px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  z-index: 9997;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(16px) scale(.96);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.ai-panel--open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.ai-panel--resizing { transition: none; user-select: none; }

/* Grosse Ansicht: Seitenleiste rechts ueber volle Hoehe */
.ai-panel--large {
  top: 16px;
  bottom: 16px;
  right: 16px;
  width: clamp(520px, calc(50vw / var(--ui-zoom)), 900px);
  max-width: calc(calc(100vw / var(--ui-zoom)) - 32px);
  height: auto;
  min-height: 0;
  z-index: 10001;
}
.ai-panel--large .ai-resize { display: none; }
.ai-panel--large .ai-msg { max-width: 75%; }
.ai-fab--hidden { display: none; }

/* Resize-Griff: linke Kante, obere Kante, Ecke oben links */
.ai-resize {
  position: absolute;
  z-index: 2;
  touch-action: none;
}
.ai-resize--l { top: 12px; bottom: 12px; left: -4px; width: 10px; cursor: ew-resize; }
.ai-resize--t { left: 12px; right: 12px; top: -4px; height: 10px; cursor: ns-resize; }
.ai-resize--tl { top: -4px; left: -4px; width: 18px; height: 18px; cursor: nwse-resize; }
.ai-resize--tl::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-left: 2px solid rgba(255,255,255,.6);
  border-top: 2px solid rgba(255,255,255,.6);
  border-radius: 2px 0 0 0;
}

.ai-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--primary);
  color: #fff;
}
.ai-panel-title {
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-panel-dot {
  display: none;
}
.ai-panel-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ai-panel-expand,
.ai-panel-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  opacity: .8;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 22px;
}
.ai-panel-expand svg { width: 16px; height: 16px; }
.ai-panel-expand .ai-ico-shrink { display: none; }
.ai-panel--large .ai-panel-expand .ai-ico-grow { display: none; }
.ai-panel--large .ai-panel-expand .ai-ico-shrink { display: block; }
.ai-panel-expand:hover,
.ai-panel-close:hover { opacity: 1; background: rgba(255,255,255,.12); }

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.ai-msg ul {
  margin: 4px 0 2px;
  padding-left: 18px;
}
.ai-msg li { margin: 2px 0; }
.ai-msg p { margin: 0 0 6px; }
.ai-msg p:last-child { margin-bottom: 0; }

.ai-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}
.ai-msg--user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-msg--assistant {
  align-self: flex-start;
  background: var(--primary-pale);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.ai-typing {
  display: flex;
  gap: 5px;
  padding: 8px 16px;
}
.ai-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: .4;
  animation: aiBounce .6s infinite alternate;
}
.ai-typing span:nth-child(2) { animation-delay: .15s; }
.ai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes aiBounce {
  to { opacity: 1; transform: translateY(-4px); }
}

.ai-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
}
.ai-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 14px;
  outline: none;
  background: var(--white);
  color: var(--text);
}
.ai-input:focus { border-color: var(--primary); }
.ai-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ai-send:hover { background: var(--primary-dark); }
.ai-send svg { width: 18px; height: 18px; }

@media (max-width: 480px) {
  .ai-panel,
  .ai-panel--large {
    top: auto;
    right: 8px;
    left: 8px;
    bottom: 80px;
    width: auto;
    max-width: none;
    height: calc(70vh / var(--ui-zoom));
    min-width: 0;
  }
  .ai-resize,
  .ai-panel-expand { display: none; }
  .ai-fab { bottom: 16px; right: 16px; }
}

/* ── Betrieb-Hinweise (Chat-Tab) ────────────────────────────── */

.msg-hints-card {
  margin: 0 0 6px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.msg-hints-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.msg-hints-header:hover {
  background: var(--primary-pale);
}
.msg-hints-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.msg-hints-icon {
  color: var(--primary);
  flex-shrink: 0;
}
.msg-hints-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.msg-hints-badge {
  font-size: 11px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.msg-hints-chevron {
  color: var(--text-muted);
  transition: transform .2s;
  flex-shrink: 0;
}
.msg-hints-chevron--open {
  transform: rotate(180deg);
}
.msg-hints-body {
  border-top: 1px solid var(--border);
  padding: 6px 0;
  max-height: 320px;
  overflow-y: auto;
}
.msg-hints-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 16px;
  transition: background .1s;
}
.msg-hints-item:hover {
  background: var(--bg);
}
.msg-hints-item--done {
  opacity: .5;
}
.msg-hints-check-label {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
  margin-top: 2px;
}
.msg-hints-check-label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.msg-hints-checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.msg-hints-check-label input:checked + .msg-hints-checkmark {
  background: var(--primary);
  border-color: var(--primary);
}
.msg-hints-check-label input:checked + .msg-hints-checkmark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -1px;
}
.msg-hints-item-body {
  flex: 1;
  min-width: 0;
}
.msg-hints-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.msg-hints-prio {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 6px;
  white-space: nowrap;
}
.msg-hints-cat {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.msg-hints-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}
.msg-hints-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.msg-hints-item--done .msg-hints-item-title {
  text-decoration: line-through;
}
.msg-hints-item-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
  line-height: 1.35;
}
.msg-hints-item-note {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
  line-height: 1.35;
}

/* Dark Mode */
html.dark .msg-hints-card {
  background: var(--card-bg, #1e293b);
  border-color: var(--border);
}
html.dark .msg-hints-header:hover {
  background: rgba(255,255,255,.05);
}
html.dark .msg-hints-item:hover {
  background: rgba(255,255,255,.03);
}
html.dark .msg-hints-checkmark {
  border-color: var(--border);
}
