/* ============================================
   Clean & Umzug Profis — Design System
   (Tenant-Branding: Name + Farbe sind hier zentral. Wird später durch SaaS-Brand ersetzt.)
   ============================================ */

:root {
  /* === TENANT BRAND === */
  --brand-primary: #E11D2A;        /* Clean & Umzug Profis Rot */
  --brand-primary-hover: #B91C1C;
  --brand-primary-soft: rgba(225, 29, 42, 0.08);
  --brand-primary-glow: rgba(225, 29, 42, 0.35);

  /* Colors */
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --surface-2: #F7F6F5;
  --border: #EDEBE9;
  --border-strong: #E0DDDB;

  --text: #0C0A09;
  --text-muted: #57534E;
  --text-subtle: #78716C;

  --primary: #0F172A;
  --primary-hover: #1E293B;

  /* Accent = Brand color */
  --accent: var(--brand-primary);
  --accent-hover: var(--brand-primary-hover);
  --accent-soft: var(--brand-primary-soft);

  --success: #16A34A;
  --success-soft: #F0FDF4;
  --warning: #D97706;
  --warning-soft: #FFFBEB;
  --danger: #DC2626;
  --danger-soft: #FEF2F2;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radius — etwas weicher für ruhigeres Bild */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  /* Shadows — weicher & diffuser, weniger harte Kanten */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.07), 0 2px 8px rgba(0, 0, 0, 0.04);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --sidebar-w: 260px;
  --header-h: 64px;
}

/* ============================================
   Dark Theme
   ============================================ */

[data-theme="dark"] {
  --bg: #0A0A0B;
  --surface: #131316;
  --surface-2: #1A1A1E;
  --border: #222227;
  --border-strong: #2E2E35;

  --text: #F4F4F5;
  --text-muted: #A1A1AA;
  --text-subtle: #71717A;

  --primary: #F4F4F5;
  --primary-hover: #E4E4E7;

  --accent: #FB7185;
  --accent-hover: #FCA5A5;
  --accent-soft: rgba(251, 113, 133, 0.14);

  --success: #34D399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --warning: #FBBF24;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --danger: #F87171;
  --danger-soft: rgba(248, 113, 113, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

[data-theme="dark"] .btn-primary {
  background: var(--accent);
  color: #0A0A0B;
}

[data-theme="dark"] .btn-primary:hover {
  background: var(--accent-hover);
}

[data-theme="dark"] .btn-accent {
  background: var(--accent);
  color: #0A0A0B;
}

[data-theme="dark"] .kpi-meta .trend-up { color: var(--success); }
[data-theme="dark"] .kpi-meta .trend-down { color: var(--danger); }

[data-theme="dark"] .brand-mark {
  background: linear-gradient(135deg, #1E293B 0%, #60A5FA 100%);
}

[data-theme="dark"] .objekt-cover { opacity: 0.85; }

[data-theme="dark"] .schedule-event {
  background: rgba(96, 165, 250, 0.15);
  border-left-color: var(--accent);
}
[data-theme="dark"] .schedule-event.green {
  background: rgba(52, 211, 153, 0.15);
  border-left-color: var(--success);
}
[data-theme="dark"] .schedule-event.amber {
  background: rgba(251, 191, 36, 0.15);
  border-left-color: var(--warning);
}
[data-theme="dark"] .schedule-event-name { color: var(--text); }

[data-theme="dark"] .report-photo {
  background: linear-gradient(135deg, #27272A, #52525B);
}

[data-theme="dark"] .login-visual {
  background: linear-gradient(135deg, #0A0A0B 0%, #1E40AF 60%, #60A5FA 100%);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.18s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-title { font-size: 16px; font-weight: 600; }

.modal-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  animation: toastIn 0.2s ease-out;
  pointer-events: auto;
}

.toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--success-soft);
  color: var(--success);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Loading spinner inline */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Theme toggle button */
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ============================================
   Service Types (Reinigungsarten)
   ============================================ */

:root {
  --svc-unterhalt: #2563EB;
  --svc-unterhalt-soft: #EFF6FF;
  --svc-end: #8B5CF6;
  --svc-end-soft: #F5F3FF;
  --svc-fenster: #06B6D4;
  --svc-fenster-soft: #ECFEFF;
  --svc-bau: #F59E0B;
  --svc-bau-soft: #FFFBEB;
  --svc-fassade: #10B981;
  --svc-fassade-soft: #ECFDF5;
}

[data-theme="dark"] {
  --svc-unterhalt-soft: rgba(37,99,235,0.15);
  --svc-end-soft: rgba(139,92,246,0.15);
  --svc-fenster-soft: rgba(6,182,212,0.15);
  --svc-bau-soft: rgba(245,158,11,0.15);
  --svc-fassade-soft: rgba(16,185,129,0.15);
}

.svc-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.svc-unterhalt { background: var(--svc-unterhalt-soft); color: var(--svc-unterhalt); }
.svc-end { background: var(--svc-end-soft); color: var(--svc-end); }
.svc-fenster { background: var(--svc-fenster-soft); color: var(--svc-fenster); }
.svc-bau { background: var(--svc-bau-soft); color: var(--svc-bau); }
.svc-fassade { background: var(--svc-fassade-soft); color: var(--svc-fassade); }

/* Service type selector cards */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.svc-card {
  position: relative;
  padding: 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.18s;
  background: var(--surface);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.svc-card::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--svc-color);
  opacity: 0;
  filter: blur(30px);
  transition: opacity 0.25s;
}

.svc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--svc-color); }
.svc-card:hover::before { opacity: 0.18; }

.svc-card.selected {
  border-color: var(--svc-color);
  background: linear-gradient(135deg, var(--svc-color-soft), var(--surface) 80%);
}

.svc-card.selected::before { opacity: 0.25; }

.svc-card.selected .svc-icon {
  background: var(--svc-color);
  color: white;
}

.svc-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--svc-color-soft);
  color: var(--svc-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s;
  position: relative;
  z-index: 1;
}

.svc-card-title { font-weight: 600; font-size: 14px; position: relative; z-index: 1; }
.svc-card-desc { font-size: 12px; color: var(--text-subtle); position: relative; z-index: 1; }

/* Option chips inside wizard */
.opt-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.opt-chip {
  padding: 8px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.opt-chip:hover { border-color: var(--accent); }
.opt-chip.on {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
[data-theme="dark"] .opt-chip.on { color: #0A0A0B; }

/* Wizard steps */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.wstep {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-subtle);
  font-weight: 500;
}

.wstep-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
  color: var(--text-subtle);
}

.wstep.active { color: var(--text); }
.wstep.active .wstep-num {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
[data-theme="dark"] .wstep.active .wstep-num { color: #0A0A0B; }

.wstep.done .wstep-num {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.wstep-sep {
  flex: 1;
  height: 1.5px;
  background: var(--border);
  border-radius: 1px;
  max-width: 40px;
}

.wizard-page { display: none; }
.wizard-page.active { display: flex; flex-direction: column; gap: var(--space-4); }

/* Time calc box */
.calc-box {
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
}

.calc-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
[data-theme="dark"] .calc-icon { color: #0A0A0B; }

.calc-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.calc-val { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin-top: 2px; }
.calc-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Hero card on dashboard (more pop) */
.hero-card {
  position: relative;
  background: linear-gradient(135deg, #0F172A 0%, #2563EB 50%, #8B5CF6 100%);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  color: white;
  overflow: hidden;
  margin-bottom: var(--space-6);
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.15), transparent 60%);
  pointer-events: none;
}

.hero-card::after {
  content: '';
  position: absolute;
  bottom: -50%;
  left: 20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139,92,246,0.4), transparent 70%);
  pointer-events: none;
}

.hero-content { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.hero-eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.7; margin-bottom: 6px; }
.hero-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
.hero-sub { font-size: 14px; opacity: 0.85; max-width: 480px; line-height: 1.5; }
.hero-actions { display: flex; gap: 8px; flex-shrink: 0; }
.hero-btn {
  padding: 10px 16px;
  background: white;
  color: #0F172A;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
}
.hero-btn-ghost {
  padding: 10px 16px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
}

/* Pulsing live dot */
.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  position: relative;
  display: inline-block;
}
.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--success);
  opacity: 0.4;
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(2); opacity: 0; }
}

/* Brand mark animated gradient */
.brand-mark {
  background: linear-gradient(135deg, #1A0A0A 0%, var(--brand-primary) 55%, #FF6B6B 100%);
  background-size: 200% 200%;
  animation: gradShift 6s ease infinite;
}
@keyframes gradShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Bigger feel for KPI */
.kpi {
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-primary), #FF8A8A);
  opacity: 0;
  transition: opacity 0.2s;
}
.kpi:hover::before { opacity: 1; }
.kpi:hover { border-color: var(--border-strong); }

/* ============================================
   SIGNATURE: Mesh gradient background
   ============================================ */

body {
  background:
    radial-gradient(at 0% 0%, rgba(225, 29, 42, 0.07) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(255, 138, 138, 0.06) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(254, 226, 226, 0.5) 0px, transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

[data-theme="dark"] body {
  background:
    radial-gradient(at 0% 0%, rgba(225, 29, 42, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(251, 113, 133, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(190, 18, 60, 0.06) 0px, transparent 50%),
    var(--bg);
  background-attachment: fixed;
}

/* Glass effect for topbar */
.topbar {
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* ============================================
   SIGNATURE: Custom brand mark
   ============================================ */

.brand-mark-svg {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2A0808 0%, var(--brand-primary) 55%, #FF8A8A 100%);
  background-size: 200% 200%;
  animation: gradShift 8s ease infinite;
  box-shadow:
    0 4px 14px var(--brand-primary-glow),
    inset 0 1px 0 rgba(255,255,255,0.2);
}

.brand-mark-svg::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 60%);
  pointer-events: none;
}

.brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text), var(--text-muted));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============================================
   Bento-style dashboard
   ============================================ */

.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(120px, auto);
  gap: 14px;
}

.bento-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.18s;
}

.bento-cell:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.bento-cell.span-2 { grid-column: span 2; }
.bento-cell.span-3 { grid-column: span 3; }
.bento-cell.span-4 { grid-column: span 4; }
.bento-cell.span-6 { grid-column: span 6; }
.bento-cell.row-2 { grid-row: span 2; }

@media (max-width: 1100px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento-cell.span-2, .bento-cell.span-3, .bento-cell.span-4, .bento-cell.span-6 { grid-column: span 2; }
}

/* Price card / settings */
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  transition: all 0.15s;
}

.price-card:hover {
  border-color: var(--svc-color);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.price-card-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--svc-color-soft), transparent);
  display: flex;
  align-items: center;
  gap: 12px;
}

.price-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--svc-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.price-card-title { font-weight: 600; font-size: 15px; }
.price-card-sub { font-size: 12px; color: var(--text-subtle); }

.price-card-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.price-row {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 12px;
  align-items: center;
}

.price-row label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.price-input-wrap {
  position: relative;
}

.price-input {
  width: 100%;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.price-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.price-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-subtle);
  pointer-events: none;
  font-weight: 500;
}

/* Price summary box in wizard */
.price-summary {
  margin-top: 4px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #0F172A, #1E40AF);
  color: white;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.price-summary::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(139,92,246,0.4), transparent 60%);
  pointer-events: none;
}

[data-theme="dark"] .price-summary {
  background: linear-gradient(135deg, #1C1C20, #2563EB);
}

.price-row-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  margin-bottom: 4px;
  opacity: 0.85;
  position: relative;
}

.price-row-summary.total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.15);
  opacity: 1;
  font-size: 14px;
}

.price-row-summary.total strong {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.price-override-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  background: none;
  font-weight: 500;
}

.price-override-toggle:hover { background: var(--surface-2); color: var(--text); }

.price-override-input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Mini route visual on dashboard */
.routemap {
  width: 100%;
  height: 100%;
  min-height: 180px;
  position: relative;
}

.routemap svg { width: 100%; height: 100%; display: block; }

.route-dot {
  fill: var(--accent);
  animation: routePulse 2s ease-in-out infinite;
}
@keyframes routePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4); }
}

/* Marquee number animation */
@keyframes countup {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.kpi-value { animation: countup 0.6s ease-out; }

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }

/* ============================================
   Layout
   ============================================ */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #0F172A 0%, #2563EB 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
}

.brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-subtle);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  overflow-y: auto;
}

.nav-section {
  margin-bottom: var(--space-6);
}

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  font-weight: 600;
  padding: 0 var(--space-3);
  margin-bottom: var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.12s ease;
  margin-bottom: 2px;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary);
  color: white;
}

.nav-item.active .nav-icon { opacity: 1; }

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
}

.nav-item.active .nav-badge {
  background: rgba(255,255,255,0.15);
  color: white;
}

.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s;
}

.user-card:hover { background: var(--surface-2); }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; }
.user-role { font-size: 12px; color: var(--text-subtle); }

/* ============================================
   Main content
   ============================================ */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  width: 280px;
  transition: all 0.12s;
}

.search:focus-within {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 13px;
}

.search input::placeholder { color: var(--text-subtle); }

.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-subtle);
}

.content {
  padding: var(--space-8);
  max-width: 1400px;
  width: 100%;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13.5px;
  transition: all 0.12s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover { background: var(--surface-2); }

.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }

/* ============================================
   Page header
   ============================================ */

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  gap: var(--space-6);
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}

.page-subtitle {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ============================================
   Cards
   ============================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-subtle);
  margin-top: 2px;
}

/* ============================================
   KPI cards
   ============================================ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-subtle);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
}

.kpi-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.kpi-meta {
  margin-top: var(--space-3);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.trend-up { color: var(--success); font-weight: 600; }
.trend-down { color: var(--danger); font-weight: 600; }

/* ============================================
   Tables
   ============================================ */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ---- Nachkalkulation ---- */
.nk-month {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
}
.nk-ist-input {
  width: 70px;
  padding: 5px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  text-align: right;
}
.nk-ist-input:focus { outline: none; border-color: var(--accent); }
.nk-ist-input.filled { border-color: var(--success); }
.nk-pos { color: var(--danger); font-weight: 600; }   /* länger gebraucht = schlecht */
.nk-neg { color: var(--success); font-weight: 600; }  /* schneller fertig = gut */

/* ---- Live-Verfügbarkeit im Auftrags-Dialog ---- */
.wiz-avail { margin: 4px 0 2px; }
.wiz-avail:empty { display: none; }
.wiz-avail-box {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
}
.wiz-avail-box.ok   { border-color: var(--success); background: var(--success-soft); }
.wiz-avail-box.warn { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.wiz-avail-box.bad  { border-color: var(--danger);  background: color-mix(in srgb, var(--danger) 10%, transparent); }
.wiz-avail-head { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.wiz-avail-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.wiz-slot-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wiz-slot-chip {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
}
.wiz-slot-chip:hover { border-color: var(--accent); color: var(--accent); }

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  padding: var(--space-3) var(--space-5);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

td {
  padding: var(--space-4) var(--space-5);
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

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

/* ============================================
   Badges / chips
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--accent-soft); color: var(--accent); }
.badge-muted { background: var(--surface-2); color: var(--text-muted); }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

/* ============================================
   Object grid (Objektverwaltung)
   ============================================ */

.objekt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.objekt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.15s;
  cursor: pointer;
}

.objekt-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.objekt-cover {
  height: 100px;
  background: linear-gradient(135deg, #1E293B 0%, #2563EB 100%);
  position: relative;
}

.objekt-cover.green { background: linear-gradient(135deg, #064E3B 0%, #16A34A 100%); }
.objekt-cover.purple { background: linear-gradient(135deg, #4C1D95 0%, #7C3AED 100%); }
.objekt-cover.amber { background: linear-gradient(135deg, #78350F 0%, #D97706 100%); }
.objekt-cover.rose { background: linear-gradient(135deg, #881337 0%, #E11D48 100%); }

.objekt-cover-label {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.objekt-body { padding: var(--space-4); }
.objekt-name { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.objekt-addr { font-size: 12.5px; color: var(--text-subtle); margin-bottom: var(--space-3); }

.objekt-meta {
  display: flex;
  gap: var(--space-4);
  font-size: 12px;
  color: var(--text-muted);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.objekt-meta span { display: flex; align-items: center; gap: 4px; }

/* ============================================
   Schedule / Plan
   ============================================ */

.schedule {
  display: grid;
  grid-template-columns: 80px repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.schedule-cell {
  background: var(--surface);
  padding: var(--space-3);
  min-height: 56px;
  font-size: 12px;
}

.schedule-header {
  background: var(--surface-2);
  font-weight: 600;
  text-align: center;
  padding: var(--space-3);
  font-size: 12px;
}

.schedule-hour {
  background: var(--surface-2);
  text-align: right;
  padding-right: var(--space-3);
  color: var(--text-subtle);
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 11px;
  padding-top: var(--space-3);
}

.schedule-event {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 6px 8px;
  border-radius: 4px;
  margin-bottom: 2px;
  font-size: 11.5px;
  cursor: pointer;
}

.schedule-event.green {
  background: var(--success-soft);
  border-color: var(--success);
}

.schedule-event.amber {
  background: var(--warning-soft);
  border-color: var(--warning);
}

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

/* ============================================
   Employee list
   ============================================ */

.emp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

.emp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  cursor: pointer;
  transition: all 0.15s;
}

.emp-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.emp-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.emp-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  font-size: 15px;
  flex-shrink: 0;
}

.emp-name { font-weight: 600; font-size: 14px; }
.emp-role { font-size: 12px; color: var(--text-subtle); }

.emp-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.emp-stat-val { font-weight: 600; font-size: 16px; }
.emp-stat-label { font-size: 11px; color: var(--text-subtle); text-transform: uppercase; letter-spacing: 0.04em; }

.emp-driver {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  width: fit-content;
}
.emp-driver.is-driver {
  background: var(--success-soft);
  color: var(--success);
}
.emp-driver.is-passenger {
  background: var(--bg-subtle, #F3F4F6);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.tdrive, .tneeds {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.tdrive {
  background: var(--success-soft);
  color: var(--success);
}
.tneeds {
  background: var(--warning-soft, #FEF3C7);
  color: var(--warning);
}

/* ============================================
   Job Editor — Customer Card / Paymethod / Phone Log
   ============================================ */

.je-customer-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-2, var(--surface));
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-primary);
  border-radius: var(--radius-md, 10px);
  margin-bottom: 16px;
}
.je-cc-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  background: var(--bg-subtle, #F3F4F6);
  color: var(--text);
  border: 1px solid var(--border);
}
.je-cc-body { flex: 1 1 auto; min-width: 0; }
.je-cc-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.je-cc-warn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--warning-soft, #FEF3C7);
  color: var(--warning);
}
.je-cc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}
.je-cc-meta a { color: var(--text-muted); text-decoration: none; border-bottom: 1px dashed var(--border); }
.je-cc-meta a:hover { color: var(--brand-primary); border-color: var(--brand-primary); }
.je-cc-note {
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text);
}

.btn-sm {
  font-size: 12px !important;
  padding: 6px 10px !important;
  height: auto !important;
}

/* Zahlart-Switch */
.paymethod-switch {
  display: inline-flex;
  gap: 0;
  background: var(--bg-subtle, #F3F4F6);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.paymethod-switch button {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}
.paymethod-switch button:hover {
  color: var(--text);
}
.paymethod-switch button.is-active {
  background: var(--surface);
  color: var(--brand-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 0 0 1px var(--brand-primary-soft, rgba(225,29,42,0.2));
}

/* Telefon-Protokoll im Job-Editor */
.je-phone-log {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--surface-2, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
}
.je-phone-log:empty { display: none; }
.je-phone-head {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.je-phone-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  border-left: 3px solid transparent;
}
.je-phone-row + .je-phone-row { margin-top: 4px; }
.je-phone-row.is-followup {
  border-left-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 5%, transparent);
}
.je-phone-when {
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.je-phone-text {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.je-phone-fup {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--warning-soft, #FEF3C7);
  color: var(--warning);
  white-space: nowrap;
}

/* ============================================
   Anruf-Liste (Kunde-Detail + Anrufprotokoll-View)
   ============================================ */

.call-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 16px;
  margin: 10px 0 8px;
  padding: 10px 12px;
  background: var(--surface-2, var(--bg-subtle, #FAFAF9));
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
}
.call-rows > div { min-width: 0; }
.call-rows .call-lbl {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 2px;
}
.call-rows strong { color: var(--text); font-weight: 600; }

.call-summary {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.45;
  padding: 2px 0 0;
}

[data-theme="dark"] .call-rows {
  background: rgba(255,255,255,0.03);
}
.call-badge-ok {
  background: var(--success-soft);
  color: var(--success);
}
.call-badge-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.call-badge-btn:hover { opacity: 0.8; }

.anruf-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.anruf-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius-md, 10px);
  padding: 14px 16px;
  color: var(--text);
}
.anruf-item.is-followup {
  border-left-color: var(--warning);
}
.anruf-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.anruf-when {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}
.anruf-kunde-link,
.anruf-kunde-loose {
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  text-decoration: none;
}
.anruf-kunde-link {
  background: var(--brand-primary-soft, rgba(225,29,42,0.1));
  color: var(--brand-primary);
}
.anruf-kunde-link:hover { background: var(--brand-primary); color: #fff; }
.anruf-kunde-loose {
  background: var(--bg-subtle, #F3F4F6);
  color: var(--text-muted);
}
.anruf-filter .btn.is-active,
.anruf-filter button.is-active {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}
.anruf-filter button {
  font-size: 13px;
}

/* ============================================
   Employee Status Cards (Routenplaner Top-Bar)
   ============================================ */

.emp-status-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  min-width: 0;
}
.emp-status-card:hover {
  border-color: var(--border-strong, var(--border));
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.emp-status-card.is-busy {
  border-color: var(--brand-primary-soft, rgba(225, 29, 42, 0.25));
  background: linear-gradient(180deg, var(--brand-primary-soft, rgba(225,29,42,0.05)) 0%, var(--surface) 60%);
}
.emp-status-card.is-scheduled {
  border-color: var(--info-soft, rgba(59, 130, 246, 0.25));
}
.emp-status-card.is-free {
  opacity: 0.92;
}

.emp-status-avatar {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle, #F3F4F6);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  /* Team-Farbe als 2px-Ring (border-color via inline style vom JS) */
  border: 2px solid var(--border);
}
[data-theme="dark"] .emp-status-avatar {
  background: rgba(255,255,255,0.06);
}

.emp-status-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.emp-status-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
}

.emp-status-total {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle, #F3F4F6);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.emp-status-drive,
.emp-status-passenger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.emp-status-drive {
  background: var(--success-soft);
  color: var(--success);
}
.emp-status-passenger {
  background: var(--warning-soft, #FEF3C7);
  color: var(--warning);
}

.emp-status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.esi-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 6px;
  line-height: 1.3;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Status-Tags: nur ein Akzent pro Status, keine Animation, ruhige Farben */
.esi-tag.is-now {
  background: var(--brand-primary);
  color: #fff;
  font-weight: 600;
}
.esi-tag.is-busy {
  background: var(--bg-subtle, #F3F4F6);
  color: var(--text);
  border: 1px solid var(--border);
}
.esi-tag.is-free {
  background: var(--success-soft);
  color: var(--success);
  font-weight: 600;
}
.esi-tag.is-free-from {
  background: var(--bg-subtle, #F3F4F6);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

[data-theme="dark"] .emp-status-total {
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
}
[data-theme="dark"] .esi-tag.is-busy,
[data-theme="dark"] .esi-tag.is-free-from {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-color: var(--border);
}

/* ============================================
   Reports / Photo grid
   ============================================ */

.report-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-4);
  align-items: center;
}

.report-photos {
  display: flex;
  gap: 6px;
}

.report-photo {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  background: linear-gradient(135deg, #E2E8F0, #94A3B8);
  position: relative;
  overflow: hidden;
}

.report-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.4) 50%, transparent 60%);
}

/* ============================================
   Empty hidden views
   ============================================ */

.view { display: none; }
.view.active { display: block; }

/* ============================================
   Mobile cleaner view
   ============================================ */

.mobile-shell {
  max-width: 420px;
  margin: 0 auto;
  background: var(--surface);
  min-height: 100vh;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.mobile-header {
  padding: var(--space-5) var(--space-5) var(--space-4);
  background: var(--primary);
  color: white;
}

.mobile-greeting { font-size: 13px; opacity: 0.7; margin-bottom: 2px; }
.mobile-name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }

.mobile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.mobile-stat-val { font-size: 18px; font-weight: 700; }
.mobile-stat-label { font-size: 11px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.05em; }

.mobile-route {
  padding: var(--space-5);
}

.mobile-route-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
}

.stop {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.stop:last-child { border-bottom: none; }

.stop-time {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.stop-duration {
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 2px;
}

.stop-body { min-width: 0; }
.stop-name { font-weight: 600; font-size: 14px; }
.stop-addr { font-size: 12.5px; color: var(--text-muted); margin: 2px 0 var(--space-2); }

.stop-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.stop-actions .btn {
  padding: 6px 10px;
  font-size: 12px;
}

.stop.done .stop-name { color: var(--text-subtle); text-decoration: line-through; }
.stop.done::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 22px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.stop.active {
  margin: 0 calc(var(--space-5) * -1);
  padding-left: var(--space-5);
  padding-right: var(--space-5);
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-bottom: 1px solid var(--border);
}

/* ============================================
   Login
   ============================================ */

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.login-form-col {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
}

.login-box { width: 100%; max-width: 380px; }
.login-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: var(--space-2); }
.login-sub { color: var(--text-muted); margin-bottom: var(--space-8); }

.login-form { display: flex; flex-direction: column; gap: var(--space-4); }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.field input,
.field select,
.field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: all 0.12s;
  width: 100%;
  box-sizing: border-box;
}

.field textarea {
  resize: vertical;
  min-height: 64px;
  line-height: 1.4;
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2378716C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

[data-theme="dark"] .field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A1A1AA' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}

/* Native option-Liste folgt dem System — Browser entscheiden. Wir setzen wenigstens den Hintergrund konsistent: */
.field select option {
  background: var(--surface);
  color: var(--text);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-subtle);
}

.login-visual {
  background: linear-gradient(135deg, #0F172A 0%, #1E40AF 60%, #2563EB 100%);
  color: white;
  padding: var(--space-12);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-visual::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.25), transparent 70%);
  pointer-events: none;
}

.login-quote {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  max-width: 420px;
  position: relative;
}

.login-quote-author {
  margin-top: var(--space-4);
  font-size: 14px;
  font-weight: 500;
  opacity: 0.75;
}

.login-feature-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
}

.login-feature {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: 14px;
}

.login-feature-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ============================================
   Section grids
   ============================================ */

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }

/* ============================================
   Activity list (Dashboard)
   ============================================ */

.activity {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
}

.activity-icon.success { background: var(--success-soft); color: var(--success); }
.activity-icon.warning { background: var(--warning-soft); color: var(--warning); }
.activity-icon.info { background: var(--accent-soft); color: var(--accent); }

.activity-body { flex: 1; min-width: 0; }
.activity-title { font-size: 13.5px; font-weight: 500; }
.activity-meta { font-size: 12px; color: var(--text-subtle); margin-top: 2px; }

/* ============================================
   Aufgaben-Modul
   ============================================ */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.task-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease;
}
.task-item:hover {
  border-color: var(--border-strong);
}
.task-item.is-done {
  opacity: 0.55;
}
.task-item.is-done .task-title {
  text-decoration: line-through;
}
.task-item.is-overdue {
  border-left: 3px solid var(--danger);
}
.task-check {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 2px;
}
.task-check input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--brand-primary);
}
.task-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  min-width: 0;
}
.task-row1 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.task-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.task-prio {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.task-prio-dringend {
  background: rgba(225, 29, 42, 0.12);
  color: var(--danger, #e11d2a);
  border: 1px solid rgba(225, 29, 42, 0.3);
}
.task-prio-normal {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.task-prio-niedrig {
  background: var(--bg);
  color: var(--text-subtle);
  border: 1px solid var(--border);
  opacity: 0.8;
}
.task-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}
.task-row2 {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.task-assignee {
  display: flex;
  align-items: center;
  gap: 6px;
}
.task-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-primary-soft, rgba(225, 29, 42, 0.12));
  color: var(--brand-primary, #e11d2a);
  font-size: 10.5px;
  font-weight: 600;
}
.task-due.is-overdue {
  color: var(--danger);
  font-weight: 600;
}
.task-link {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
}
.task-prio-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.task-prio-picker button {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.task-prio-picker button:hover {
  border-color: var(--border-strong);
}
.task-prio-picker button.is-active {
  background: var(--brand-primary, #e11d2a);
  color: white;
  border-color: var(--brand-primary, #e11d2a);
}

/* Task-Kontakt-Schnellaktionen */
.task-contact-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.task-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.task-contact-btn:hover {
  background: var(--accent-soft, #FEF2F2);
  color: var(--accent, #E11D2A);
  border-color: var(--accent, #E11D2A);
}

/* Dashboard Aktivitäts-Feed */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.act-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}
.act-body { flex: 1; min-width: 0; }
.act-text { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-meta { font-size: 11.5px; color: var(--text-subtle); margin-top: 1px; }

/* Anruf-Aktionen */
.anruf-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ============================================
   Tages-Crew Karte + Modal
   ============================================ */
.daycrew-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.daycrew-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.daycrew-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.daycrew-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.daycrew-teams {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.daycrew-team {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-soft, var(--bg));
}
.daycrew-team.is-empty {
  opacity: 0.55;
}
.daycrew-team-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.daycrew-team-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.daycrew-team-count {
  font-weight: 400;
  color: var(--text-muted);
}
.daycrew-team-empty {
  font-size: 11.5px;
  font-style: italic;
  color: var(--text-subtle);
}
.daycrew-team-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
  margin-top: 4px;
}
.daycrew-chip {
  display: inline-block;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.daycrew-chip.is-absent {
  opacity: 0.6;
  text-decoration: line-through;
}
.daycrew-absent {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.daycrew-absent-label {
  font-weight: 600;
}

/* Tages-Crew-Modal Picker */
.daycrew-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 60vh;
  overflow-y: auto;
}
.daycrew-row {
  display: grid;
  grid-template-columns: 110px 1fr 220px;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.daycrew-row.is-absent {
  opacity: 0.55;
  background: var(--bg);
}
.daycrew-presence {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}
.daycrew-presence input { cursor: pointer; }
.daycrew-row-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  min-width: 0;
}
.daycrew-row-icon { font-size: 14px; }
.daycrew-row-role {
  font-size: 11.5px;
  color: var(--text-subtle);
}
.daycrew-row-team {
  display: flex;
  align-items: center;
  gap: 6px;
}
.daycrew-row-team select {
  flex: 1;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 12.5px;
}
.daycrew-row-team select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 700px) {
  .daycrew-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .daycrew-teams { grid-template-columns: 1fr; }
}

/* ============================================
   Responsive
   ============================================ */

/* Hamburger + Drawer-Overlay — auf Desktop ausgeblendet */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle:hover { background: var(--surface-2); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }

  /* Sidebar wird zum Slide-in-Drawer */
  .nav-toggle { display: inline-flex; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 84vw;
    max-width: 320px;
    height: 100vh;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  }
  .app-shell.nav-open .sidebar { transform: translateX(0); }

  .sidebar-overlay { display: block; }
  .app-shell.nav-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
  }

  /* Topbar kompakter, Aktionen verschlanken */
  .content { padding: var(--space-5) var(--space-4); }
  .topbar { padding: 0 var(--space-4); gap: var(--space-2); }
  .topbar-actions { gap: var(--space-2); }
  .search { display: none; }
  .user-switcher .user-meta { display: none; }
  .user-chip { padding: 4px; }

  /* Tabellen horizontal scrollbar statt abgeschnitten */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap table { min-width: 600px; }

  /* Modals fast vollbreit, mehr Höhe */
  .modal-backdrop { padding: 12px; align-items: flex-end; }
  .modal { max-width: 100%; border-radius: var(--radius-lg); }
  .modal-body { max-height: 70vh; }

  /* Page-Header stapeln, Aktions-Buttons umbrechen */
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
  }
  .page-header > div:last-child {
    flex-wrap: wrap;
  }
  .page-title { font-size: 22px; }

  /* Status-/Toolbar-Leisten umbrechen statt überlaufen */
  .plan-status-card { flex-wrap: wrap; }
  .plan-status-card > button { margin-left: 0 !important; }

  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
}

/* Sehr kleine Screens: voluminöse Buttons reduzieren */
@media (max-width: 480px) {
  .topbar .btn-accent {
    padding: 8px 10px;
    font-size: 0;
  }
  .topbar .btn-accent::before {
    content: "+";
    font-size: 18px;
    font-weight: 600;
  }
}

/* ============================================================
   SKIN „RUHIG"  (data-skin="calm" am <html>)
   Ziel: weniger Farben & weniger Kästchen. Reine Token-Über-
   steuerung — wirkt überall (auch in Inline-Styles, da diese
   var(--…) nutzen), baut kein Layout um, jederzeit per Umschalter
   im Header zurückschaltbar. Standard bleibt unverändert.
   ============================================================ */
[data-skin="calm"] {
  /* Hintergründe: eine ruhige Fläche statt vieler Töne */
  --bg: #FBFBFA;
  --surface: #FFFFFF;
  --surface-2: #FAFAF9;

  /* Rahmen fast unsichtbar — Trennung über Weißraum statt Boxen */
  --border: #F1F0EE;
  --border-strong: #E8E6E4;

  /* Farbige „Soft"-Flächen neutralisieren = nimmt den meisten Farblärm raus.
     Badges/KPIs/aktive Felder werden ruhig-grau statt rot/grün/gelb. */
  --accent-soft: #F4F4F3;
  --brand-primary-soft: #F4F4F3;
  --success-soft: #F5F6F5;
  --warning-soft: #F7F6F3;
  --danger-soft:  #F7F5F5;

  /* Status nur noch als dezenter Text/Punkt, gedämpfte Töne */
  --success: #4B7B5A;
  --warning: #94762F;
  --danger:  #A8524A;

  /* Schatten fast weg → flacher, ruhiger */
  --shadow-sm: 0 1px 1px rgba(0,0,0,0.02);
  --shadow:    0 1px 2px rgba(0,0,0,0.03);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.05);
}

/* Ruhig + Dark kombiniert */
[data-skin="calm"][data-theme="dark"] {
  --border: #1E1E22;
  --border-strong: #28282E;
  --accent-soft:  rgba(255,255,255,0.06);
  --brand-primary-soft: rgba(255,255,255,0.06);
  --success-soft: rgba(255,255,255,0.04);
  --warning-soft: rgba(255,255,255,0.04);
  --danger-soft:  rgba(255,255,255,0.04);
}

/* Ein paar gezielte Beruhigungen, die Tokens allein nicht abdecken.
   html[data-skin] erhöht die Spezifität, schlägt also Inline-.class-Regeln. */
html[data-skin="calm"] .card,
html[data-skin="calm"] .kpi-card,
html[data-skin="calm"] .panel {
  box-shadow: none;
}
/* farbige Status-Streifen am linken Rand entschärfen */
html[data-skin="calm"] .schedule-event {
  border-left-color: var(--border-strong);
}

/* Die lauten Verläufe beruhigen — das ist der größte Farblärm.
   Hero: vom Regenbogen (navy→blau→lila) auf EIN ruhiges Dunkel. */
html[data-skin="calm"] .hero-card {
  background: #1B2230;
}
[data-skin="calm"][data-theme="dark"] .hero-card {
  background: #16161A;
}
/* Karten mit fest verdrahtetem Inline-Verlauf (z. B. Routen-Karte,
   leere Zustände) → ruhige Fläche. Trifft NICHT die Avatare (.card-Scope). */
html[data-skin="calm"] .card[style*="gradient"] {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
}
/* Zähler-Badges in der Navigation: rote Zahl → ruhig & dezent */
html[data-skin="calm"] .nav-badge {
  background: var(--surface-2);
  color: var(--text-muted);
}
