/*
 * ═══════════════════════════════════════════════════════════════════════════
 *  Fast Reonic V1.2 – Zentrale Stylesheet V1.5
 *  4 Themes: Light · Dark (echtes Schwarz) · Blue (Navy) · Green (Forest)
 *  4 Layouts: Zentriert · Links · Rechts · Volle Breite
 *
 *  Abschnitte:
 *    1.  CSS Custom Properties  (4 Theme-Variablen)
 *    2.  Basis & Animationen
 *    3.  Login-Modal
 *    4.  Startseite           (page-home – immer dunkel, theme-adaptiv)
 *    5.  Workspace – Glass    (light-mode Glassmorphism + Karten)
 *    6.  Workspace – Filter   (Autocomplete)
 *    7.  Workspace – ToDo-System
 *    8.  Workspace – Popdowns
 *    9.  Workspace – Angebots-Tabelle
 *   10.  Workspace – Dark-Varianten  (dark / blue / green Tailwind-Overrides)
 *   11.  Workspace – Layout-Optionen (center / left / right / full)
 *   12.  Karten-Ansicht        (page-map)
 *   13.  Setup-Seite           (page-setup)
 * ═══════════════════════════════════════════════════════════════════════════
 */


/* ═══════════════════════════════════════════════════════════════════════════
   1. CSS CUSTOM PROPERTIES  (Light-Theme als Default)
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  /* ── Markenfarben ──────────────────────────────────────────────────────── */
  --brand-primary:       #2563eb;
  --brand-primary-hover: #1d4ed8;
  --brand-primary-light: #93c5fd;
  --brand-primary-bg:    rgba(59, 130, 246, 0.15);

  /* ── Light – Seiten-Hintergrund ─────────────────────────────────────────── */
  --surface-bg: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 25%, #f0f9ff 65%, #faf5ff 100%);

  /* ── Light – Oberflächen ────────────────────────────────────────────────── */
  --surface-card:        rgba(255, 255, 255, 0.82);
  --surface-card-solid:  #ffffff;
  --surface-raised:      rgba(248, 250, 252, 0.88);
  --surface-subtle:      rgba(250, 250, 250, 0.70);
  --surface-border:      rgba(209, 213, 219, 0.80);
  --surface-border-soft: rgba(229, 231, 235, 0.60);

  /* ── Light – Glass-Werte (spezifisch) ──────────────────────────────────── */
  --glass-bg:           rgba(255, 255, 255, 0.72);
  --glass-bg-strong:    rgba(255, 255, 255, 0.88);
  --glass-border:       rgba(255, 255, 255, 0.60);
  --glass-shadow:       0 8px 32px rgba(99, 102, 241, 0.08), 0 2px 8px rgba(0,0,0,0.05);
  --glass-shadow-hover: 0 16px 48px rgba(99, 102, 241, 0.14), 0 4px 16px rgba(0,0,0,0.08);

  /* Per-Komponenten-Glass (ermöglicht theme-spezifische Tönungen) */
  --glass-header-bg:    rgba(255, 255, 255, 0.88);
  --glass-filterbar-bg: rgba(255, 255, 255, 0.82);
  --glass-card-bg:      rgba(255, 255, 255, 0.82);
  --glass-card-border:  rgba(255, 255, 255, 0.58);
  --glass-card-hover-bg:    rgba(255, 255, 255, 0.92);
  --glass-card-hover-border: rgba(99, 102, 241, 0.22);
  --glass-popdown-bg:   rgba(255, 255, 255, 0.92);

  /* ── Light – Textfarben ─────────────────────────────────────────────────── */
  --text-primary:   #111827;
  --text-secondary: #374151;
  --text-muted:     #6b7280;
  --text-subtle:    #9ca3af;

  /* ── Feedback-Farben ────────────────────────────────────────────────────── */
  --color-error:    #ef4444;
  --color-error-bg: #fee2e2;
  --color-success:  #22c55e;

  /* ── Karten-Markierung: NUR Glow-Rand (kein Hintergrund!) ──────────────── */
  --color-highlight-border: #22c55e;
  --color-highlight-ring:   rgba(34, 197, 94, 0.22);
  --color-highlight-glow:   rgba(34, 197, 94, 0.18);

  /* ── Dunkler Hintergrund (page-home, immer dunkel) ─────────────────────── */
  --dark-bg:      linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  --dark-surface: rgba(255, 255, 255, 0.07);
  --dark-border:  rgba(255, 255, 255, 0.12);
  --dark-text:    #f1f5f9;
  --dark-muted:   rgba(203, 213, 225, 0.80);

  /* ── Radien ─────────────────────────────────────────────────────────────── */
  --radius-sm: 6px;  --radius-md: 8px;   --radius-lg: 12px;
  --radius-xl: 16px; --radius-2xl: 20px; --radius-3xl: 28px;
  --radius-full: 9999px;

  /* ── Transitionen ───────────────────────────────────────────────────────── */
  --transition-fast:   0.15s ease;
  --transition-base:   0.22s ease;
  --transition-slow:   0.35s ease;
  --transition-theme:  0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ── Schatten ───────────────────────────────────────────────────────────── */
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.07);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.09);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.12);
  --shadow-xl:  0 24px 64px rgba(0,0,0,0.25);
  --shadow-2xl: 0 32px 80px rgba(0,0,0,0.35);

  /* ── z-Index ────────────────────────────────────────────────────────────── */
  --z-filterbar: 9; --z-dropdown: 1000;
  --z-status-pop: 600; --z-todo-pop: 601; --z-login: 9999;
}


/* ── DARK THEME (echtes Schwarz / Anthrazit – keine blauen Töne) ─────────── */
[data-theme="dark"] {
  --surface-bg:          linear-gradient(160deg, #0a0a0a 0%, #161616 100%);
  --surface-card:        rgba(255, 255, 255, 0.055);
  --surface-card-solid:  #1c1c1c;
  --surface-raised:      rgba(255, 255, 255, 0.035);
  --surface-subtle:      rgba(255, 255, 255, 0.025);
  --surface-border:      rgba(255, 255, 255, 0.10);
  --surface-border-soft: rgba(255, 255, 255, 0.06);

  --glass-bg:           rgba(255, 255, 255, 0.055);
  --glass-bg-strong:    rgba(255, 255, 255, 0.09);
  --glass-border:       rgba(255, 255, 255, 0.12);
  --glass-shadow:       0 8px 32px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.06);
  --glass-shadow-hover: 0 16px 48px rgba(0,0,0,0.70), inset 0 1px 0 rgba(255,255,255,0.09);

  --glass-header-bg:         rgba(8, 8, 8, 0.92);
  --glass-filterbar-bg:      rgba(10, 10, 10, 0.87);
  --glass-card-bg:           rgba(255, 255, 255, 0.055);
  --glass-card-border:       rgba(255, 255, 255, 0.10);
  --glass-card-hover-bg:     rgba(255, 255, 255, 0.09);
  --glass-card-hover-border: rgba(255, 255, 255, 0.20);
  --glass-popdown-bg:        rgba(18, 18, 18, 0.97);

  --text-primary:   #f0f0f0;
  --text-secondary: #cccccc;
  --text-muted:     #888888;
  --text-subtle:    #555555;

  --color-highlight-border: #22c55e;
  --color-highlight-ring:   rgba(34, 197, 94, 0.38);
  --color-highlight-glow:   rgba(34, 197, 94, 0.58);

  --dark-bg:      linear-gradient(160deg, #080808 0%, #141414 100%);
  --dark-surface: rgba(255, 255, 255, 0.06);
  --dark-border:  rgba(255, 255, 255, 0.10);
  --dark-text:    #f0f0f0;
  --dark-muted:   rgba(200, 200, 200, 0.75);

  --shadow-sm:  0 1px 4px rgba(0,0,0,0.40);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.50);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.60);
  --shadow-xl:  0 24px 64px rgba(0,0,0,0.70);
  --shadow-2xl: 0 32px 80px rgba(0,0,0,0.80);
}


/* ── BLUE THEME (tiefes Navy, basiert auf altem Dark-Theme) ─────────────── */
[data-theme="blue"] {
  --surface-bg:          linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  --surface-card:        rgba(255, 255, 255, 0.07);
  --surface-card-solid:  #0f1f3d;
  --surface-raised:      rgba(255, 255, 255, 0.045);
  --surface-subtle:      rgba(255, 255, 255, 0.028);
  --surface-border:      rgba(147, 197, 253, 0.22);
  --surface-border-soft: rgba(147, 197, 253, 0.11);

  --glass-bg:           rgba(255, 255, 255, 0.07);
  --glass-bg-strong:    rgba(255, 255, 255, 0.11);
  --glass-border:       rgba(147, 197, 253, 0.24);
  --glass-shadow:       0 8px 32px rgba(0,0,30,0.50), inset 0 1px 0 rgba(147,197,253,0.10);
  --glass-shadow-hover: 0 16px 48px rgba(0,0,50,0.65), inset 0 1px 0 rgba(147,197,253,0.15);

  --glass-header-bg:         rgba(7, 14, 38, 0.90);
  --glass-filterbar-bg:      rgba(7, 14, 38, 0.84);
  --glass-card-bg:           rgba(255, 255, 255, 0.07);
  --glass-card-border:       rgba(147, 197, 253, 0.18);
  --glass-card-hover-bg:     rgba(255, 255, 255, 0.11);
  --glass-card-hover-border: rgba(147, 197, 253, 0.38);
  --glass-popdown-bg:        rgba(8, 18, 52, 0.97);

  --text-primary:   #f0f9ff;
  --text-secondary: #e0f2fe;
  --text-muted:     #93c5fd;
  --text-subtle:    #4a6fa5;

  --brand-primary:       #60a5fa;
  --brand-primary-hover: #3b82f6;
  --brand-primary-light: #bfdbfe;
  --brand-primary-bg:    rgba(96, 165, 250, 0.18);

  --color-highlight-border: #60a5fa;
  --color-highlight-ring:   rgba(96, 165, 250, 0.38);
  --color-highlight-glow:   rgba(96, 165, 250, 0.55);

  --dark-bg:      linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  --dark-surface: rgba(255, 255, 255, 0.08);
  --dark-border:  rgba(147, 197, 253, 0.22);
  --dark-text:    #f0f9ff;
  --dark-muted:   rgba(147, 197, 253, 0.80);

  --shadow-sm:  0 1px 4px rgba(0,0,20,0.40);
  --shadow-md:  0 4px 12px rgba(0,0,20,0.50);
  --shadow-lg:  0 8px 24px rgba(0,0,30,0.55);
  --shadow-xl:  0 24px 64px rgba(0,0,40,0.65);
  --shadow-2xl: 0 32px 80px rgba(0,0,40,0.75);
}


/* ── GREEN THEME (dunkles Waldgrün / Forest) ─────────────────────────────── */
[data-theme="green"] {
  --surface-bg:          linear-gradient(135deg, #052e16 0%, #14532d 50%, #052e16 100%);
  --surface-card:        rgba(255, 255, 255, 0.07);
  --surface-card-solid:  #0a2015;
  --surface-raised:      rgba(255, 255, 255, 0.04);
  --surface-subtle:      rgba(255, 255, 255, 0.025);
  --surface-border:      rgba(52, 211, 153, 0.22);
  --surface-border-soft: rgba(52, 211, 153, 0.11);

  --glass-bg:           rgba(255, 255, 255, 0.065);
  --glass-bg-strong:    rgba(255, 255, 255, 0.10);
  --glass-border:       rgba(52, 211, 153, 0.26);
  --glass-shadow:       0 8px 32px rgba(0,20,8,0.50), inset 0 1px 0 rgba(52,211,153,0.10);
  --glass-shadow-hover: 0 16px 48px rgba(0,30,12,0.65), inset 0 1px 0 rgba(52,211,153,0.16);

  --glass-header-bg:         rgba(3, 13, 8, 0.92);
  --glass-filterbar-bg:      rgba(3, 13, 8, 0.86);
  --glass-card-bg:           rgba(255, 255, 255, 0.065);
  --glass-card-border:       rgba(52, 211, 153, 0.20);
  --glass-card-hover-bg:     rgba(255, 255, 255, 0.10);
  --glass-card-hover-border: rgba(52, 211, 153, 0.42);
  --glass-popdown-bg:        rgba(4, 18, 10, 0.97);

  --text-primary:   #ecfdf5;
  --text-secondary: #d1fae5;
  --text-muted:     #6ee7b7;
  --text-subtle:    #2d6b4e;

  --brand-primary:       #10b981;
  --brand-primary-hover: #059669;
  --brand-primary-light: #6ee7b7;
  --brand-primary-bg:    rgba(16, 185, 129, 0.18);

  --color-highlight-border: #34d399;
  --color-highlight-ring:   rgba(52, 211, 153, 0.38);
  --color-highlight-glow:   rgba(52, 211, 153, 0.58);

  --dark-bg:      linear-gradient(135deg, #052e16 0%, #14532d 50%, #052e16 100%);
  --dark-surface: rgba(255, 255, 255, 0.07);
  --dark-border:  rgba(52, 211, 153, 0.22);
  --dark-text:    #ecfdf5;
  --dark-muted:   rgba(110, 231, 183, 0.80);

  --shadow-sm:  0 1px 4px rgba(0,15,5,0.40);
  --shadow-md:  0 4px 12px rgba(0,15,5,0.50);
  --shadow-lg:  0 8px 24px rgba(0,20,8,0.55);
  --shadow-xl:  0 24px 64px rgba(0,25,10,0.65);
  --shadow-2xl: 0 32px 80px rgba(0,25,10,0.75);
}


/* ═══════════════════════════════════════════════════════════════════════════
   2. BASIS & ANIMATIONEN
   ═══════════════════════════════════════════════════════════════════════════ */

/* Globale Theme-Transition – alle Oberflächen wechseln sanft */
*,
*::before,
*::after {
  box-sizing: border-box;
  transition:
    background-color var(--transition-theme),
    border-color     var(--transition-theme),
    color            var(--transition-theme),
    box-shadow       var(--transition-slow),
    opacity          var(--transition-slow);
}

/* Elemente, bei denen Transitions stören */
.spinner, input, textarea, select { transition: unset; }
button { transition: unset; }

/* Accordion-Pfeile (eigene Transition beibehalten) */
.notes-chevron, .offers-chevron { transition: transform var(--transition-slow) !important; }
.notes-chevron.open, .offers-chevron.open { transform: rotate(180deg); }

/* ── HTML-Hintergrund: verhindert weiße Linie an Status-Bar (PWA/viewport-fit:cover) ── */
html                        { background: #f1f5f9; }
html[data-theme="dark"]     { background: #0f0f0f; }
html[data-theme="blue"]     { background: #0a0f1e; }
html[data-theme="green"]    { background: #0a120a; }

/* Animationen */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { animation: spin 0.7s linear infinite; }

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  60%      { transform: translateX(8px); }
  80%      { transform: translateX(-4px); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

pre { white-space: pre-wrap; word-break: break-all; }


/* ═══════════════════════════════════════════════════════════════════════════
   3. LOGIN-MODAL  (index.html + arbeitsplatz.html)
   ═══════════════════════════════════════════════════════════════════════════ */

#pinOverlay {
  position: fixed; inset: 0;
  background: rgba(10, 10, 10, 0.88);
  display: flex; align-items: center; justify-content: center;
  z-index: var(--z-login);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  animation: fadeIn 0.25s ease;
}
#pinOverlay.hidden { display: none; }

#pinCard {
  background: var(--surface-card-solid);
  border-radius: var(--radius-2xl);
  padding: 40px 36px;
  width: 360px;
  box-shadow: var(--shadow-2xl);
  text-align: center;
  border: 1px solid var(--surface-border);
  animation: scaleIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: background-color var(--transition-theme), border-color var(--transition-theme) !important;
}

/* Dark / Blue / Green: dunkle Login-Karte */
[data-theme="dark"] #pinCard,
[data-theme="blue"] #pinCard,
[data-theme="green"] #pinCard {
  background: var(--surface-card-solid);
  border-color: var(--glass-border);
  box-shadow: var(--shadow-2xl), inset 0 1px 0 var(--glass-border);
}
[data-theme="dark"] #pinCard h2,
[data-theme="blue"] #pinCard h2,
[data-theme="green"] #pinCard h2 { color: var(--text-primary) !important; }
[data-theme="dark"] #pinCard p,
[data-theme="blue"] #pinCard p,
[data-theme="green"] #pinCard p { color: var(--text-muted) !important; }
[data-theme="dark"] #pinCard strong,
[data-theme="blue"] #pinCard strong,
[data-theme="green"] #pinCard strong { color: var(--text-secondary) !important; }

.login-input {
  width: 100%;
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  font-size: 1rem;
  text-align: center;
  margin: 14px 0 6px;
  outline: none;
  background: var(--surface-card-solid);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.3s ease !important;
  box-sizing: border-box;
}
.login-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-bg);
}
.login-input.shake {
  animation: pinShake 0.38s;
  border-color: var(--color-error);
}
[data-theme="dark"] .login-input,
[data-theme="blue"] .login-input,
[data-theme="green"] .login-input {
  background: rgba(255,255,255,0.07);
  border-color: var(--glass-border);
  color: var(--text-primary);
}

#pinInput, #otpInput {
  font-size: 1.5rem; letter-spacing: 0.5em;
  font-family: monospace; -webkit-text-security: disc;
}
#otpInput { -webkit-text-security: none; }

.login-error {
  color: var(--color-error); font-size: 0.78rem;
  min-height: 18px; margin-bottom: 10px;
}
.login-btn-primary {
  flex: 1; padding: 12px;
  background: var(--brand-primary); color: #fff;
  border: none; border-radius: var(--radius-lg);
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease !important;
  box-shadow: 0 4px 14px var(--brand-primary-bg);
}
.login-btn-primary:hover:not(:disabled) {
  background: var(--brand-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.45);
}
.login-btn-primary:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.login-btn-primary:disabled { background: var(--brand-primary-light); cursor: not-allowed; }

.login-btn-back {
  flex: 0 0 auto; padding: 12px 14px;
  background: var(--surface-card-solid); color: var(--text-secondary);
  border: 2px solid var(--surface-border); border-radius: var(--radius-lg);
  font-size: 0.9rem; cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease !important;
}
.login-btn-back:hover { border-color: #9ca3af; background: #f9fafb; }
[data-theme="dark"] .login-btn-back,
[data-theme="blue"] .login-btn-back,
[data-theme="green"] .login-btn-back {
  background: rgba(255,255,255,0.07); border-color: var(--glass-border); color: var(--text-muted);
}
[data-theme="dark"] .login-btn-back:hover,
[data-theme="blue"] .login-btn-back:hover,
[data-theme="green"] .login-btn-back:hover { background: rgba(255,255,255,0.12); }

.login-btn-row { display: flex; gap: 8px; }
#otpHint { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 2px; line-height: 1.4; }
#pinError { color: var(--color-error); font-size: 0.78rem; min-height: 18px; margin-bottom: 12px; }


/* ═══════════════════════════════════════════════════════════════════════════
   4. STARTSEITE  (body.page-home – theme-adaptiv: hell bei Light, dunkel sonst)
   ═══════════════════════════════════════════════════════════════════════════ */

body.page-home {
  background: var(--surface-bg);   /* adaptiv: lavender/dark/navy/forest je Theme */
  background-attachment: fixed;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Sterne-Hintergrund: standardmäßig versteckt (Light), nur für dunkle Themes */
body.page-home::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 15%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 55%, rgba(255,255,255,0.30) 0%, transparent 100%),
    radial-gradient(1px 1px at 10% 75%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 85%, rgba(255,255,255,0.28) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 10%, rgba(255,255,255,0.22) 0%, transparent 100%),
    radial-gradient(1px 1px at 35% 50%, rgba(255,255,255,0.18) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 70% 70%, rgba(255,255,255,0.24) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 40%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 45%, rgba(255,255,255,0.16) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.5s ease !important;
}
[data-theme="dark"] body.page-home::before,
[data-theme="blue"] body.page-home::before,
[data-theme="green"] body.page-home::before { opacity: 1; }

/* ── Kacheln ─────────────────────────────────────────────────────────────── */
.tile {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-2xl);
  padding: 36px 28px;
  cursor: pointer;
  position: relative; overflow: hidden;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  text-decoration: none;
  display: flex; flex-direction: column; align-items: flex-start;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), border-color 0.3s ease, box-shadow 0.3s ease !important;
}
.tile::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.09) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.3s ease !important;
}
.tile:hover { transform: translateY(-6px); border-color: rgba(255,255,255,0.32); box-shadow: 0 24px 56px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.12); }
.tile:hover::before   { opacity: 1; }
.tile:active          { transform: translateY(-2px) scale(0.98); }
.tile.active          { background: rgba(255,255,255,0.13); }
.tile.soon            { opacity: 0.60; cursor: default; }
.tile.soon:hover      { transform: none; box-shadow: none; border-color: var(--dark-border); }
.tile.soon:hover::before { opacity: 0; }
.tile-waiting         { opacity: 0.35 !important; pointer-events: none !important; filter: grayscale(0.65); cursor: not-allowed; transition: opacity 0.3s, filter 0.3s; }
.tile-waiting:hover   { transform: none !important; box-shadow: none !important; }
.tile-waiting:hover::before { opacity: 0 !important; }
/* tile-locked: Kachel sichtbar aber gesperrt (keine Berechtigung) – wird NICHT vom Cache-Loader entfernt */
.tile-locked          { opacity: 0.35 !important; pointer-events: none !important; filter: grayscale(0.65) !important; cursor: not-allowed; transition: opacity 0.3s, filter 0.3s; }
.tile-locked:hover    { transform: none !important; box-shadow: none !important; }
.tile-locked:hover::before { opacity: 0 !important; }

/* 3×3 Kacheln (index.html) – Mobile: Quadratisch + scrollbar */
.tile-grid-sq .tile {
  aspect-ratio: 1 / 1;
  padding: 28px 24px;
  justify-content: flex-start;
}

/* ── Desktop (≥640px): Grid passt ohne Scrollbalken ins Fenster ─────── */
@media (min-width: 640px) {
  /* Hauptseite exakt auf Viewport-Höhe begrenzen */
  body.page-home #mainPage {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }
  /* Content-Wrapper: flex-Shrink erlauben */
  body.page-home #tileContentWrap {
    min-height: 0;
  }
  /* Tile-Grid: Höhe via Viewport berechnet, max 790px. -180px lässt oben Header
     + unten Footer (User-Name) + eine Zeile Luft. */
  body.page-home .tile-grid-sq {
    height: min(calc(100vh - 180px), 790px);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
  }
  /* API-Ladebalken ist seit V4.7 inline im Footer → keine Höhen-Kompensation nötig */
  /* Kacheln: kein festes Seitenverhältnis – füllen ihre Grid-Zeile */
  body.page-home .tile-grid-sq .tile {
    aspect-ratio: unset;
    min-height: 0;
    padding: 14px 18px;
    justify-content: flex-start;
  }
  /* Footer auf Desktop kompakter */
  body.page-home #homeFooter {
    padding-bottom: 6px;
    padding-top: 2px;
  }
}

/* ── Kompaktmodus für niedrige Bildschirme (Laptops ≤800px Höhe) ─────── */
@media (min-width: 640px) and (max-height: 800px) {
  body.page-home .tile-icon {
    width: 40px; height: 40px; border-radius: 10px; margin-bottom: 10px;
  }
  body.page-home .tile-icon svg { width: 20px !important; height: 20px !important; }
  body.page-home .tile-title { font-size: 1rem !important; margin-bottom: 4px; }
  body.page-home .tile-desc  { font-size: 0.78rem !important; line-height: 1.4; }
}

.tile-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1) !important;
}
.tile:hover .tile-icon { transform: scale(1.08); }
.tile.soon:hover .tile-icon { transform: none; }

.tile-title { font-size: 1.25rem; font-weight: 700; color: var(--dark-text); margin-bottom: 8px; letter-spacing: -0.01em; }
.tile-desc  { font-size: 0.85rem; color: var(--dark-muted); line-height: 1.55; }

.tile-badge {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.11); color: rgba(203,213,225,0.70);
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.15);
}
.tile-badge.active-badge { background: rgba(var(--brand-primary-rgb,37,99,235),0.28); color: var(--brand-primary-light); border-color: rgba(37,99,235,0.45); }

/* Brand-Header */
.main-header { padding: 14px 40px 0; display: flex; align-items: center; justify-content: space-between; }
.brand       { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  width: 40px; height: 40px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-hover));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800; color: #fff;
  box-shadow: 0 4px 16px var(--brand-primary-bg);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s ease !important;
}
.brand-icon:hover { transform: scale(1.07); box-shadow: 0 6px 22px rgba(37,99,235,0.5); }
.brand-name { font-size: 1.1rem; font-weight: 700; color: var(--dark-text); }
.brand-sub  { font-size: 0.72rem; color: rgba(148,163,184,0.80); margin-top: 1px; }

.logout-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex-shrink: 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 0;
  color: rgba(200,215,230,0.80);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease;
}
.logout-btn svg { transition: filter 0.25s ease, transform 0.22s ease; }
.logout-btn:hover { transform: scale(1.06); }
.logout-btn:active { transform: scale(0.95); }
.logout-btn:hover svg {
  filter: drop-shadow(0 0 7px rgba(255,255,255,0.68))
          drop-shadow(0 0 22px rgba(147,197,253,0.58));
}
.logout-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(15,23,42,0.95);
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 7px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 9999;
  border: 1px solid rgba(99,102,241,0.40);
  box-shadow: 0 4px 16px rgba(0,0,0,0.40);
  letter-spacing: 0.01em;
}
.logout-btn:hover::after { opacity: 1; }

/* Vollbild-Button – identischer Stil wie logout-btn */
.fullscreen-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex-shrink: 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 0;
  color: rgba(200,215,230,0.80);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease;
}
.fullscreen-btn svg { transition: filter 0.25s ease, transform 0.22s ease; }
.fullscreen-btn:hover  { transform: scale(1.06); }
.fullscreen-btn:active { transform: scale(0.95); }
.fullscreen-btn:hover svg {
  filter: drop-shadow(0 0 7px rgba(255,255,255,0.68))
          drop-shadow(0 0 22px rgba(147,197,253,0.58));
}
.fullscreen-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(15,23,42,0.95);
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 7px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 9999;
  border: 1px solid rgba(99,102,241,0.40);
  box-shadow: 0 4px 16px rgba(0,0,0,0.40);
  letter-spacing: 0.01em;
}
.fullscreen-btn:hover::after { opacity: 1; }

/* ── LIGHT-THEME: page-home Overrides (helle Glasskacheln, dunkle Texte) ── */
[data-theme="light"] body.page-home {
  background: var(--surface-bg);  /* Lavender-Gradient */
}

/* Kacheln: glas-weiß statt transparent-dunkel */
[data-theme="light"] body.page-home .tile {
  background: var(--glass-bg-strong);
  border-color: rgba(99, 102, 241, 0.14);
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.07), 0 2px 8px rgba(0,0,0,0.04);
}
[data-theme="light"] body.page-home .tile:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.38);
  box-shadow: 0 18px 50px rgba(99, 102, 241, 0.13), 0 4px 16px rgba(0,0,0,0.07);
}
[data-theme="light"] body.page-home .tile.active {
  background: rgba(255, 255, 255, 0.92);
}
[data-theme="light"] body.page-home .tile.soon {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(209, 213, 219, 0.60);
}
[data-theme="light"] body.page-home .tile.soon:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(209, 213, 219, 0.60);
}

/* Texte: dunkel statt hell – !important nötig wegen hardcodierter inline-style="color:..." */
[data-theme="light"] body.page-home .tile-title { color: var(--text-primary) !important; }
[data-theme="light"] body.page-home .tile-desc  { color: var(--text-muted)   !important; }
[data-theme="light"] body.page-home .brand-name { color: var(--text-primary); }
[data-theme="light"] body.page-home .brand-sub  { color: var(--text-muted); }

/* Hero-Überschriften (Tailwind text-white / text-slate-400) */
[data-theme="light"] body.page-home .text-white    { color: var(--text-primary)   !important; }
[data-theme="light"] body.page-home .text-slate-400 { color: var(--text-muted)    !important; }

/* Badge */
[data-theme="light"] body.page-home .tile-badge {
  background: rgba(99, 102, 241, 0.08);
  color: var(--text-muted);
  border-color: rgba(99, 102, 241, 0.18);
}
[data-theme="light"] body.page-home .tile-badge.active-badge {
  background: rgba(37, 99, 235, 0.12);
  color: var(--brand-primary);
  border-color: rgba(37, 99, 235, 0.28);
}

/* Logout-Button */
[data-theme="light"] body.page-home .logout-btn { color: var(--text-muted); }
[data-theme="light"] body.page-home .logout-btn:hover svg {
  filter: drop-shadow(0 0 5px rgba(37,99,235,0.62))
          drop-shadow(0 0 18px rgba(99,102,241,0.42));
}

/* Vollbild-Button: helles Theme */
[data-theme="light"] body.page-home .fullscreen-btn {
  color: var(--text-muted);
}
[data-theme="light"] body.page-home .fullscreen-btn:hover {
  color: var(--brand-primary);
  transform: scale(1.06);
}

/* SVG-Icons: dunkle Striche für helles Theme
   Überschreibt hardcodierte Presentation-Attribute wie stroke="rgba(203,213,225,0.95)"
   (CSS stroke-Property hat höhere Priorität als SVG-Attribute) */
[data-theme="light"] body.page-home .tile-icon svg {
  stroke: rgba(30, 41, 59, 0.78) !important;  /* Slate-900 – sichtbar auf allen Hintergründen */
}

/* Icon-Hintergrund: kräftigere Farben im hellen Theme
   saturate(2.0) → sattere Farbgebung, brightness(0.78) → dunkler → Kontrast zu weißen Tiles */
[data-theme="light"] body.page-home .tile-icon {
  filter: saturate(2.0) brightness(0.78);
}

/* Demnächst-Kacheln: etwas weniger ausgeblendet für bessere Lesbarkeit */
[data-theme="light"] body.page-home .tile.soon {
  opacity: 0.80;
}


/* ═══════════════════════════════════════════════════════════════════════════
   5. WORKSPACE – BODY & GLASSMORPHISM  (body.page-arbeitsplatz)
   ═══════════════════════════════════════════════════════════════════════════ */

body.page-arbeitsplatz {
  background: var(--surface-bg) !important;
  background-attachment: fixed !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
}

/* ── Tab-Reiter (gleicher Stil wie kommunikation.html, global nutzbar) ──── */
.km-rtab {
  flex: 1 1 0; min-width: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.60) 0%, rgba(218,228,248,0.75) 100%);
  border: 1px solid rgba(175,195,225,0.55);
  border-radius: 8px;
  padding: 8px 6px; font-size: 0.8rem; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer; font-family: inherit; transition: all 0.17s;
  white-space: nowrap; text-align: center;
  box-shadow: 0 1px 0 rgba(255,255,255,0.85) inset, 0 -1px 0 rgba(0,0,0,0.06) inset, 0 1px 3px rgba(0,0,0,0.1);
}
[data-theme="dark"] .km-rtab,
[data-theme="blue"] .km-rtab,
[data-theme="green"] .km-rtab {
  background: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.05) 100%);
  border-color: rgba(255,255,255,0.12); color: rgba(255,255,255,0.55);
  box-shadow: 0 1px 0 rgba(255,255,255,0.10) inset, 0 -1px 0 rgba(0,0,0,0.28) inset, 0 1px 3px rgba(0,0,0,0.32);
}
.km-rtab:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.82) 0%, rgba(205,222,252,0.9) 100%);
  color: var(--brand-primary); border-color: rgba(37,99,235,0.32);
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.92) inset, 0 -1px 0 rgba(0,0,0,0.06) inset, 0 3px 9px rgba(37,99,235,0.15);
}
[data-theme="dark"] .km-rtab:hover,
[data-theme="blue"] .km-rtab:hover,
[data-theme="green"] .km-rtab:hover {
  background: linear-gradient(180deg, rgba(99,130,235,0.22) 0%, rgba(37,99,235,0.13) 100%);
  border-color: rgba(99,130,235,0.38);
  box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset, 0 -1px 0 rgba(0,0,0,0.32) inset, 0 3px 9px rgba(37,99,235,0.22);
}
.km-rtab.active {
  background: linear-gradient(180deg, #5b9eff 0%, #2563eb 48%, #1a4ecf 100%);
  color: #fff; border-color: #1648b8; font-weight: 700; transform: translateY(0);
  box-shadow: 0 1px 0 rgba(255,255,255,0.30) inset, 0 -1px 0 rgba(0,0,0,0.22) inset, 0 3px 12px rgba(37,99,235,0.50), 0 1px 3px rgba(0,0,0,0.18);
}
.km-rtab.active:hover {
  filter: brightness(1.08);
  box-shadow: 0 1px 0 rgba(255,255,255,0.30) inset, 0 -1px 0 rgba(0,0,0,0.22) inset, 0 5px 18px rgba(37,99,235,0.60), 0 1px 3px rgba(0,0,0,0.18);
}

/* ── 2-Spalten Vollbild-Layout ─────────────────────────────────────────── */
#apMain {
  display: flex;
  flex-direction: row;
  height: calc(100vh - 66px);
  overflow: hidden;
  width: 100%;
}
#apLeftPanel {
  width: 50%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--glass-card-border, rgba(209,213,219,0.55));
  overflow: hidden;
  background: var(--surface-bg);
}
#apRightPanel {
  width: 50%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#apCardsArea {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
#paginationBar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 16px;
  border-top: 2px solid rgba(37,99,235,0.18);
  background: linear-gradient(180deg, rgba(241,245,249,0.98) 0%, rgba(226,232,240,0.98) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
[data-theme="dark"]  #paginationBar,
[data-theme="blue"]  #paginationBar,
[data-theme="green"] #paginationBar {
  background: linear-gradient(180deg, rgba(40,40,40,0.97) 0%, rgba(28,28,28,0.97) 100%);
  border-top-color: rgba(255,255,255,0.08);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.35);
}
#paginationBar.hidden { display: none; }

.ap-page-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px; border-radius: 8px; border: none;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff; cursor: pointer; font-size: 0.82rem; font-weight: 600;
  box-shadow: 0 2px 8px rgba(37,99,235,0.35);
  transition: box-shadow 0.18s, transform 0.15s, background 0.18s;
  white-space: nowrap;
}
.ap-page-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8, #0284c7);
  box-shadow: 0 4px 14px rgba(37,99,235,0.55);
  transform: translateY(-1px);
}
.ap-page-btn:active:not(:disabled) { transform: translateY(0); }
.ap-page-btn:disabled { opacity: 0.35; cursor: default; transform: none; box-shadow: none; }
#apTabBar {
  display: flex;
  gap: 5px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--glass-card-border, rgba(209,213,219,0.55));
  flex-shrink: 0;
  background: var(--glass-header-bg, rgba(255,255,255,0.85));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
#apTabContent {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
}

/* ── Mobile (Touchgerät): linke Spalte ausblenden – auch inline in arbeitsplatz.html ── */
@media (pointer: coarse) {
  #apLeftPanel  { display: none; }
  #apRightPanel { width: 100%; }
}

/* Glass-Header (light) */
body.page-arbeitsplatz header {
  background: var(--glass-header-bg) !important;
  backdrop-filter: blur(22px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(200%) !important;
  border-bottom: 1px solid rgba(255,255,255,0.65) !important;
  box-shadow: 0 1px 0 rgba(99,102,241,0.06), 0 4px 16px rgba(0,0,0,0.04) !important;
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease !important;
}

/* Glass-Filter-Leiste (light) */
body.page-arbeitsplatz #filterBar {
  background: var(--glass-filterbar-bg) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  border-bottom-color: rgba(209,213,219,0.55) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04) !important;
}

#filterBar { top: 0; overflow-x: auto; overflow-y: hidden; }
#filterBar::-webkit-scrollbar { height: 3px; }
#filterBar::-webkit-scrollbar-track { background: transparent; }
#filterBar::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.25); border-radius: 2px; }
#filterBar::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.5); }

/* Glass-Karte (light): NUR bei Nicht-Highlighted */
body.page-arbeitsplatz .card-article {
  background: var(--glass-card-bg) !important;
  border-color: var(--glass-card-border) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  box-shadow: var(--glass-shadow) !important;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease !important;
}

body.page-arbeitsplatz .card-article:hover:not(.card-highlighted) {
  transform: translateY(-3px) !important;
  background: var(--glass-card-hover-bg) !important;
  border-color: var(--glass-card-hover-border) !important;
  box-shadow: var(--glass-shadow-hover) !important;
}

/* ── KARTEN-MARKIERUNG: nur Glow-Rand, kein Hintergrundwechsel ─────────── */
/* Legacy – wird nicht mehr durch die neue Auswahl-Logik genutzt */
body.page-arbeitsplatz .card-article.card-highlighted {
  /* background BLEIBT unverändert (kein bg-change!) */
  border-color: var(--color-highlight-border) !important;
  box-shadow:
    0 0 0 1.5px var(--color-highlight-border),
    0 0 0 5px   var(--color-highlight-ring),
    0 0 28px    var(--color-highlight-glow) !important;
}

body.page-arbeitsplatz .card-article.card-highlighted:hover {
  transform: translateY(-3px) !important;
  border-color: var(--color-highlight-border) !important;
  box-shadow:
    0 0 0 1.5px var(--color-highlight-border),
    0 0 0 5px   var(--color-highlight-ring),
    0 0 36px    var(--color-highlight-glow) !important;
}

/* Cache-Indikator */
#cacheInfo { line-height: 1.2; flex-direction: column; align-items: flex-end; }


/* ═══════════════════════════════════════════════════════════════════════════
   6. WORKSPACE – FILTER & AUTOCOMPLETE
   ═══════════════════════════════════════════════════════════════════════════ */

#searchSuggestions {
  position: fixed;
  background: var(--glass-popdown-bg);
  border: 1px solid var(--surface-border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 260px; overflow-y: auto;
  z-index: var(--z-dropdown);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
#searchSuggestions li {
  padding: 8px 12px; cursor: pointer;
  font-size: 0.875rem; color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px;
  transition: background 0.12s ease, color 0.12s ease !important;
}
#searchSuggestions li:hover,
#searchSuggestions li.active { background: rgba(239,246,255,0.85); color: var(--brand-primary-hover); }
#searchSuggestions li mark { background: #bfdbfe; color: var(--brand-primary-hover); border-radius: 2px; padding: 0 1px; font-weight: 600; }


/* ═══════════════════════════════════════════════════════════════════════════
   7. WORKSPACE – TODO-SYSTEM
   ═══════════════════════════════════════════════════════════════════════════ */

.card-article {
  transition: background-color var(--transition-base), border-color var(--transition-base) !important;
}

.todo-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.72rem; padding: 2px 9px;
  border-radius: var(--radius-full);
  border: 1px dashed var(--text-subtle);
  color: var(--text-subtle);
  background: none; cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease, transform 0.15s ease !important;
  line-height: 1.6; vertical-align: middle;
}
.todo-btn:hover { border-color: var(--text-muted); color: var(--text-muted); transform: scale(1.04); }
.todo-btn.is-set { border-style: solid; padding-right: 24px; box-shadow: var(--shadow-sm); }
.todo-btn.is-set:hover { filter: brightness(0.90); transform: scale(1.02); }

.td-icon  { font-size: 0.82rem; line-height: 1; }
.td-label { font-weight: 700; letter-spacing: 0.02em; }
.td-ts    { font-weight: 400; font-size: 0.64rem; opacity: 0.82; margin-left: 2px; }

.todo-cancel {
  display: none; position: absolute; right: 7px; top: 50%;
  transform: translateY(-50%); font-size: 0.7rem; font-weight: 700;
  line-height: 1; pointer-events: none;
}
.todo-btn.is-set:hover .todo-cancel { display: block; }
.todo-saving-msg { font-size: 0.7rem; color: var(--text-subtle); font-style: italic; }


/* ═══════════════════════════════════════════════════════════════════════════
   8. WORKSPACE – POPDOWNS (position:fixed wegen overflow:hidden in Karten!)
   ═══════════════════════════════════════════════════════════════════════════ */

#statusPopdown,
#todoPopdown {
  position: fixed;
  background: var(--glass-popdown-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 4px 0;
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
}

#statusPopdown { z-index: var(--z-status-pop); min-width: 200px; max-height: 300px; overflow-y: auto; }
#statusPopdown .sp-group {
  padding: 6px 12px 2px;
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-subtle);
}
#statusPopdown .sp-item {
  display: block; width: 100%; text-align: left;
  padding: 5px 16px; font-size: 0.8125rem; color: var(--text-secondary);
  background: none; border: none; cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease !important;
}
#statusPopdown .sp-item:hover  { background: rgba(239,246,255,0.85); color: var(--brand-primary-hover); }
#statusPopdown .sp-item.active { font-weight: 600; color: var(--brand-primary-hover); }

#todoPopdown { z-index: var(--z-todo-pop); min-width: 140px; }
#todoPopdown .td-item {
  display: block; width: 100%; text-align: left;
  padding: 6px 16px; font-size: 0.8125rem; color: var(--text-secondary);
  background: none; border: none; cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease !important;
}
#todoPopdown .td-item:hover { background: rgba(239,246,255,0.85); color: var(--brand-primary-hover); }


/* ═══════════════════════════════════════════════════════════════════════════
   9. WORKSPACE – ANGEBOTS-TABELLE
   ═══════════════════════════════════════════════════════════════════════════ */

.offer-option { border: 1px solid var(--surface-border); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 12px; }
.offer-option:last-child { margin-bottom: 0; }

.offer-option-header {
  background: var(--surface-raised); padding: 10px 14px;
  font-weight: 600; font-size: 0.8rem; color: var(--text-secondary);
  border-bottom: 1px solid var(--surface-border);
  display: flex; justify-content: space-between; align-items: center;
}
.offer-section-title {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); padding: 8px 14px 4px;
  background: var(--surface-subtle); border-bottom: 1px solid var(--surface-border-soft);
}
.offer-component-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 8px; padding: 6px 14px;
  border-bottom: 1px solid var(--surface-border-soft);
  font-size: 0.8rem; align-items: start;
}
.offer-component-row:last-child { border-bottom: none; }
.offer-component-name  { color: var(--text-primary); font-weight: 500; }
.offer-component-meta  { color: var(--text-subtle); font-size: 0.72rem; margin-top: 1px; }
.offer-component-price { text-align: right; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.offer-component-qty   { color: var(--text-muted); font-size: 0.72rem; }

.offer-totals { border-top: 2px solid var(--surface-border); padding: 8px 14px; background: var(--surface-raised); }
.offer-total-row { display: flex; justify-content: space-between; font-size: 0.8rem; padding: 2px 0; color: var(--text-secondary); }
.offer-total-row.discount { color: #dc2626; }
.offer-total-row.grand { font-weight: 700; font-size: 0.875rem; color: var(--text-primary); border-top: 1px solid var(--surface-border); margin-top: 4px; padding-top: 6px; }
.offer-empty { color: var(--text-subtle); font-style: italic; font-size: 0.8rem; padding: 12px 14px; }


/* ═══════════════════════════════════════════════════════════════════════════
   10. WORKSPACE – DARK-VARIANTEN  (dark · blue · green)
   Überschreibt Tailwind-Klassen für alle dunklen Themes.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Body ──────────────────────────────────────────────────────────────────── */
[data-theme="dark"] body.page-arbeitsplatz,
[data-theme="blue"] body.page-arbeitsplatz,
[data-theme="green"] body.page-arbeitsplatz {
  background: var(--surface-bg) !important;
  color: var(--text-primary);
}

/* ── Glass-Header ────────────────────────────────────────────────────────── */
/* Mobile: Header solid + FilterBar schwarz (eliminiert Backdrop-Filter-Artefakt am Logo) */
@media (pointer: coarse) {
  [data-theme="dark"]  body.page-arbeitsplatz header,
  [data-theme="blue"]  body.page-arbeitsplatz header,
  [data-theme="green"] body.page-arbeitsplatz header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #1a1a1a !important;
    border-bottom: 1px solid #2a2a2a !important;
    box-shadow: none !important;
  }
  [data-theme="dark"]  body.page-arbeitsplatz .fr-logo-link,
  [data-theme="blue"]  body.page-arbeitsplatz .fr-logo-link,
  [data-theme="green"] body.page-arbeitsplatz .fr-logo-link {
    background: transparent !important;
  }
  [data-theme="dark"]  body.page-arbeitsplatz #filterBar,
  [data-theme="blue"]  body.page-arbeitsplatz #filterBar,
  [data-theme="green"] body.page-arbeitsplatz #filterBar {
    background: #000 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 1px solid #1a1a1a !important;
    box-shadow: none !important;
  }
}

[data-theme="dark"] body.page-arbeitsplatz header,
[data-theme="blue"] body.page-arbeitsplatz header,
[data-theme="green"] body.page-arbeitsplatz header {
  background: var(--glass-header-bg) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border-bottom: 1px solid var(--glass-border) !important;
  box-shadow: 0 1px 0 var(--glass-border), 0 4px 20px rgba(0,0,0,0.35) !important;
}

/* ── Glass-Filter-Leiste ─────────────────────────────────────────────────── */
[data-theme="dark"] body.page-arbeitsplatz #filterBar,
[data-theme="blue"] body.page-arbeitsplatz #filterBar,
[data-theme="green"] body.page-arbeitsplatz #filterBar {
  background: var(--glass-filterbar-bg) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom-color: var(--glass-border) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35) !important;
}

/* ── Glass-Karten ────────────────────────────────────────────────────────── */
[data-theme="dark"] body.page-arbeitsplatz .card-article,
[data-theme="blue"] body.page-arbeitsplatz .card-article,
[data-theme="green"] body.page-arbeitsplatz .card-article {
  background: var(--glass-card-bg) !important;
  border-color: var(--glass-card-border) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.30), inset 0 1px 0 rgba(255,255,255,0.07) !important;
}

[data-theme="dark"] body.page-arbeitsplatz .card-article:hover:not(.card-highlighted) {
  background: var(--glass-card-hover-bg) !important;
  border-color: var(--glass-card-hover-border) !important;
  box-shadow: 0 14px 44px rgba(0,0,0,0.50), inset 0 1px 0 rgba(255,255,255,0.10) !important;
}
[data-theme="blue"] body.page-arbeitsplatz .card-article:hover:not(.card-highlighted) {
  background: var(--glass-card-hover-bg) !important;
  border-color: var(--glass-card-hover-border) !important;
  box-shadow: 0 14px 44px rgba(0,0,30,0.55), inset 0 1px 0 rgba(147,197,253,0.12) !important;
}
[data-theme="green"] body.page-arbeitsplatz .card-article:hover:not(.card-highlighted) {
  background: var(--glass-card-hover-bg) !important;
  border-color: var(--glass-card-hover-border) !important;
  box-shadow: 0 14px 44px rgba(0,20,8,0.55), inset 0 1px 0 rgba(52,211,153,0.12) !important;
}

/* ── Karten-Markierung (Dark-Varianten): deutlich stärkerer Glow ─────────── */
[data-theme="dark"] body.page-arbeitsplatz .card-article.card-highlighted,
[data-theme="blue"] body.page-arbeitsplatz .card-article.card-highlighted,
[data-theme="green"] body.page-arbeitsplatz .card-article.card-highlighted {
  border-color: var(--color-highlight-border) !important;
  box-shadow:
    0 0 0 2px   var(--color-highlight-border),
    0 0 0 7px   var(--color-highlight-ring),
    0 0 44px    var(--color-highlight-glow) !important;
}
[data-theme="dark"] body.page-arbeitsplatz .card-article.card-highlighted:hover,
[data-theme="blue"] body.page-arbeitsplatz .card-article.card-highlighted:hover,
[data-theme="green"] body.page-arbeitsplatz .card-article.card-highlighted:hover {
  transform: translateY(-3px) !important;
  box-shadow:
    0 0 0 2px   var(--color-highlight-border),
    0 0 0 7px   var(--color-highlight-ring),
    0 0 56px    var(--color-highlight-glow) !important;
}

/* ── Textfarben (Tailwind-Override) ──────────────────────────────────────── */
[data-theme="dark"] body.page-arbeitsplatz .text-gray-900,
[data-theme="blue"] body.page-arbeitsplatz .text-gray-900,
[data-theme="green"] body.page-arbeitsplatz .text-gray-900 { color: var(--text-primary) !important; }

[data-theme="dark"] body.page-arbeitsplatz .text-gray-800,
[data-theme="blue"] body.page-arbeitsplatz .text-gray-800,
[data-theme="green"] body.page-arbeitsplatz .text-gray-800 { color: var(--text-primary) !important; }

[data-theme="dark"] body.page-arbeitsplatz .text-gray-700,
[data-theme="blue"] body.page-arbeitsplatz .text-gray-700,
[data-theme="green"] body.page-arbeitsplatz .text-gray-700 { color: var(--text-secondary) !important; }

[data-theme="dark"] body.page-arbeitsplatz .text-gray-600,
[data-theme="blue"] body.page-arbeitsplatz .text-gray-600,
[data-theme="green"] body.page-arbeitsplatz .text-gray-600 { color: var(--text-muted) !important; }

[data-theme="dark"] body.page-arbeitsplatz .text-gray-500,
[data-theme="blue"] body.page-arbeitsplatz .text-gray-500,
[data-theme="green"] body.page-arbeitsplatz .text-gray-500 { color: var(--text-muted) !important; }

[data-theme="dark"] body.page-arbeitsplatz .text-gray-400,
[data-theme="blue"] body.page-arbeitsplatz .text-gray-400,
[data-theme="green"] body.page-arbeitsplatz .text-gray-400 { color: var(--text-subtle) !important; }

/* ── Hintergründe ────────────────────────────────────────────────────────── */
[data-theme="dark"] body.page-arbeitsplatz .bg-white,
[data-theme="blue"] body.page-arbeitsplatz .bg-white,
[data-theme="green"] body.page-arbeitsplatz .bg-white    { background-color: rgba(255,255,255,0.07) !important; }

[data-theme="dark"] body.page-arbeitsplatz .bg-gray-50,
[data-theme="blue"] body.page-arbeitsplatz .bg-gray-50,
[data-theme="green"] body.page-arbeitsplatz .bg-gray-50  { background-color: rgba(255,255,255,0.04) !important; }

[data-theme="dark"] body.page-arbeitsplatz .bg-gray-100,
[data-theme="blue"] body.page-arbeitsplatz .bg-gray-100,
[data-theme="green"] body.page-arbeitsplatz .bg-gray-100 { background-color: rgba(255,255,255,0.08) !important; }

[data-theme="dark"] body.page-arbeitsplatz .hover\:bg-gray-50:hover,
[data-theme="blue"] body.page-arbeitsplatz .hover\:bg-gray-50:hover,
[data-theme="green"] body.page-arbeitsplatz .hover\:bg-gray-50:hover { background-color: rgba(255,255,255,0.07) !important; }

/* ── Rahmen ──────────────────────────────────────────────────────────────── */
[data-theme="dark"] body.page-arbeitsplatz .border-gray-100,
[data-theme="blue"] body.page-arbeitsplatz .border-gray-100,
[data-theme="green"] body.page-arbeitsplatz .border-gray-100 { border-color: var(--surface-border-soft) !important; }

[data-theme="dark"] body.page-arbeitsplatz .border-gray-200,
[data-theme="blue"] body.page-arbeitsplatz .border-gray-200,
[data-theme="green"] body.page-arbeitsplatz .border-gray-200 { border-color: var(--surface-border) !important; }

[data-theme="dark"] body.page-arbeitsplatz .border-gray-300,
[data-theme="blue"] body.page-arbeitsplatz .border-gray-300,
[data-theme="green"] body.page-arbeitsplatz .border-gray-300 { border-color: rgba(255,255,255,0.20) !important; }

[data-theme="dark"] body.page-arbeitsplatz .border-b,
[data-theme="blue"] body.page-arbeitsplatz .border-b,
[data-theme="green"] body.page-arbeitsplatz .border-b { border-bottom-color: var(--surface-border-soft) !important; }

[data-theme="dark"] body.page-arbeitsplatz .border-t,
[data-theme="blue"] body.page-arbeitsplatz .border-t,
[data-theme="green"] body.page-arbeitsplatz .border-t { border-top-color: var(--surface-border-soft) !important; }

/* ── Status-Badge ────────────────────────────────────────────────────────── */
[data-theme="dark"] body.page-arbeitsplatz .bg-blue-100,
[data-theme="blue"] body.page-arbeitsplatz .bg-blue-100,
[data-theme="green"] body.page-arbeitsplatz .bg-blue-100  { background-color: rgba(37,99,235,0.22) !important; }

[data-theme="dark"] body.page-arbeitsplatz .text-blue-700,
[data-theme="blue"] body.page-arbeitsplatz .text-blue-700 { color: #93c5fd !important; }
[data-theme="green"] body.page-arbeitsplatz .text-blue-700 { color: #6ee7b7 !important; }

/* ── Eingabefelder ───────────────────────────────────────────────────────── */
[data-theme="dark"] body.page-arbeitsplatz input[type="text"],
[data-theme="dark"] body.page-arbeitsplatz input[type="number"],
[data-theme="dark"] body.page-arbeitsplatz select,
[data-theme="dark"] body.page-arbeitsplatz textarea,
[data-theme="blue"] body.page-arbeitsplatz input[type="text"],
[data-theme="blue"] body.page-arbeitsplatz input[type="number"],
[data-theme="blue"] body.page-arbeitsplatz select,
[data-theme="blue"] body.page-arbeitsplatz textarea,
[data-theme="green"] body.page-arbeitsplatz input[type="text"],
[data-theme="green"] body.page-arbeitsplatz input[type="number"],
[data-theme="green"] body.page-arbeitsplatz select,
[data-theme="green"] body.page-arbeitsplatz textarea {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--surface-border) !important;
  color: var(--text-primary) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}
[data-theme="dark"] body.page-arbeitsplatz input:focus,
[data-theme="dark"] body.page-arbeitsplatz select:focus,
[data-theme="dark"] body.page-arbeitsplatz textarea:focus,
[data-theme="blue"] body.page-arbeitsplatz input:focus,
[data-theme="blue"] body.page-arbeitsplatz select:focus,
[data-theme="blue"] body.page-arbeitsplatz textarea:focus,
[data-theme="green"] body.page-arbeitsplatz input:focus,
[data-theme="green"] body.page-arbeitsplatz select:focus,
[data-theme="green"] body.page-arbeitsplatz textarea:focus {
  border-color: var(--brand-primary) !important;
  box-shadow: 0 0 0 3px var(--brand-primary-bg) !important;
  background: rgba(255,255,255,0.11) !important;
}
[data-theme="dark"] body.page-arbeitsplatz input::placeholder,
[data-theme="dark"] body.page-arbeitsplatz textarea::placeholder,
[data-theme="blue"] body.page-arbeitsplatz input::placeholder,
[data-theme="blue"] body.page-arbeitsplatz textarea::placeholder,
[data-theme="green"] body.page-arbeitsplatz input::placeholder,
[data-theme="green"] body.page-arbeitsplatz textarea::placeholder { color: rgba(180,180,180,0.35) !important; }

[data-theme="dark"] body.page-arbeitsplatz select option,
[data-theme="blue"] body.page-arbeitsplatz select option,
[data-theme="green"] body.page-arbeitsplatz select option { background: var(--surface-card-solid); color: var(--text-primary); }

/* ── Warn-/Fehlerboxen ───────────────────────────────────────────────────── */
[data-theme="dark"] body.page-arbeitsplatz .bg-yellow-50,
[data-theme="blue"] body.page-arbeitsplatz .bg-yellow-50,
[data-theme="green"] body.page-arbeitsplatz .bg-yellow-50 { background-color: rgba(245,158,11,0.13) !important; }

[data-theme="dark"] body.page-arbeitsplatz .bg-red-50,
[data-theme="blue"] body.page-arbeitsplatz .bg-red-50,
[data-theme="green"] body.page-arbeitsplatz .bg-red-50 { background-color: rgba(239,68,68,0.13) !important; }

[data-theme="dark"] body.page-arbeitsplatz .text-yellow-800,
[data-theme="blue"] body.page-arbeitsplatz .text-yellow-800,
[data-theme="green"] body.page-arbeitsplatz .text-yellow-800 { color: #fcd34d !important; }

[data-theme="dark"] body.page-arbeitsplatz .text-red-800,
[data-theme="blue"] body.page-arbeitsplatz .text-red-800,
[data-theme="green"] body.page-arbeitsplatz .text-red-800 { color: #fca5a5 !important; }

[data-theme="dark"] body.page-arbeitsplatz .border-yellow-300,
[data-theme="blue"] body.page-arbeitsplatz .border-yellow-300,
[data-theme="green"] body.page-arbeitsplatz .border-yellow-300 { border-color: rgba(245,158,11,0.40) !important; }

[data-theme="dark"] body.page-arbeitsplatz .border-red-300,
[data-theme="blue"] body.page-arbeitsplatz .border-red-300,
[data-theme="green"] body.page-arbeitsplatz .border-red-300 { border-color: rgba(239,68,68,0.40) !important; }

/* ── Home-Button im dunklen Theme ────────────────────────────────────────── */
[data-theme="dark"] body.page-arbeitsplatz header a[href="index.html"],
[data-theme="blue"] body.page-arbeitsplatz header a[href="index.html"],
[data-theme="green"] body.page-arbeitsplatz header a[href="index.html"] {
  background: rgba(255,255,255,0.09) !important;
  border-color: var(--glass-border) !important;
  color: var(--text-muted) !important;
}
[data-theme="dark"] body.page-arbeitsplatz header a[href="index.html"]:hover,
[data-theme="blue"] body.page-arbeitsplatz header a[href="index.html"]:hover,
[data-theme="green"] body.page-arbeitsplatz header a[href="index.html"]:hover {
  background: var(--brand-primary-bg) !important;
  border-color: var(--brand-primary) !important;
  color: var(--brand-primary-light) !important;
}

/* ── Autocomplete (Dark) ─────────────────────────────────────────────────── */
[data-theme="dark"] #searchSuggestions,
[data-theme="blue"] #searchSuggestions,
[data-theme="green"] #searchSuggestions {
  background: var(--glass-popdown-bg);
  border-color: var(--glass-border);
}
[data-theme="dark"] #searchSuggestions li,
[data-theme="blue"] #searchSuggestions li,
[data-theme="green"] #searchSuggestions li { color: var(--text-secondary); }
[data-theme="dark"] #searchSuggestions li:hover,
[data-theme="blue"] #searchSuggestions li:hover,
[data-theme="green"] #searchSuggestions li:hover { background: var(--brand-primary-bg); color: var(--brand-primary-light); }
[data-theme="dark"] #searchSuggestions li mark,
[data-theme="blue"] #searchSuggestions li mark,
[data-theme="green"] #searchSuggestions li mark { background: var(--brand-primary-bg); color: var(--brand-primary-light); }

/* ── Popdowns (Dark) ─────────────────────────────────────────────────────── */
[data-theme="dark"] #statusPopdown,
[data-theme="dark"] #todoPopdown,
[data-theme="blue"] #statusPopdown,
[data-theme="blue"] #todoPopdown,
[data-theme="green"] #statusPopdown,
[data-theme="green"] #todoPopdown {
  background: var(--glass-popdown-bg);
  border-color: var(--glass-border);
  box-shadow: var(--shadow-xl);
}
[data-theme="dark"] #statusPopdown .sp-group,
[data-theme="blue"] #statusPopdown .sp-group,
[data-theme="green"] #statusPopdown .sp-group { color: var(--text-subtle); }

[data-theme="dark"] #statusPopdown .sp-item,
[data-theme="blue"] #statusPopdown .sp-item,
[data-theme="green"] #statusPopdown .sp-item { color: var(--text-secondary); }
[data-theme="dark"] #statusPopdown .sp-item:hover,
[data-theme="blue"] #statusPopdown .sp-item:hover,
[data-theme="green"] #statusPopdown .sp-item:hover { background: var(--brand-primary-bg); color: var(--brand-primary-light); }

[data-theme="dark"] #todoPopdown .td-item,
[data-theme="blue"] #todoPopdown .td-item,
[data-theme="green"] #todoPopdown .td-item { color: var(--text-secondary); }
[data-theme="dark"] #todoPopdown .td-item:hover,
[data-theme="blue"] #todoPopdown .td-item:hover,
[data-theme="green"] #todoPopdown .td-item:hover { background: var(--brand-primary-bg); color: var(--brand-primary-light); }

/* ── Angebots-Tabelle (Dark) ─────────────────────────────────────────────── */
[data-theme="dark"] .offer-option,
[data-theme="blue"] .offer-option,
[data-theme="green"] .offer-option { border-color: var(--surface-border); }

[data-theme="dark"] .offer-option-header,
[data-theme="blue"] .offer-option-header,
[data-theme="green"] .offer-option-header { background: var(--surface-raised); border-bottom-color: var(--surface-border); }

[data-theme="dark"] .offer-section-title,
[data-theme="blue"] .offer-section-title,
[data-theme="green"] .offer-section-title { background: var(--surface-subtle); border-bottom-color: var(--surface-border-soft); }

[data-theme="dark"] .offer-totals,
[data-theme="blue"] .offer-totals,
[data-theme="green"] .offer-totals { background: var(--surface-raised); border-top-color: var(--surface-border); }

[data-theme="dark"] .offer-total-row.grand,
[data-theme="blue"] .offer-total-row.grand,
[data-theme="green"] .offer-total-row.grand { border-top-color: var(--surface-border); }

[data-theme="dark"] .offer-total-row.discount,
[data-theme="blue"] .offer-total-row.discount,
[data-theme="green"] .offer-total-row.discount { color: #f87171; }


/* ═══════════════════════════════════════════════════════════════════════════
   11. WORKSPACE – LAYOUT-OPTIONEN  (data-layout auf <html>)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Standard (center): max-w-5xl mx-auto / .setup-container margin:0 auto bleibt wie definiert */

/* Startseite: Links */
[data-layout="left"] body.page-home #tileContentWrap  { justify-content: flex-start; padding-left: 28px; }
/* Startseite: Rechts */
[data-layout="right"] body.page-home #tileContentWrap { justify-content: flex-end;   padding-right: 28px; }
/* Startseite: Volle Breite */
[data-layout="full"] body.page-home #tileContentWrap  { padding-left: 16px; padding-right: 16px; }
[data-layout="full"] body.page-home .tile-grid-sq     { max-width: 100% !important; }

/* Links: Inhalt linksbündig mit Abstand */
[data-layout="left"] body.page-arbeitsplatz .max-w-5xl,
[data-layout="left"] body.page-setup .setup-container,
[data-layout="left"] body.page-dashboard .setup-container {
  margin-left: 28px !important;
  margin-right: auto !important;
}

/* Rechts: Inhalt rechtsbündig mit Abstand */
[data-layout="right"] body.page-arbeitsplatz .max-w-5xl,
[data-layout="right"] body.page-setup .setup-container,
[data-layout="right"] body.page-dashboard .setup-container {
  margin-left: auto !important;
  margin-right: 28px !important;
}

/* Volle Breite: max-width aufheben */
[data-layout="full"] body.page-arbeitsplatz .max-w-5xl,
[data-layout="full"] body.page-setup .setup-container,
[data-layout="full"] body.page-dashboard .setup-container {
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Volle Breite: Karten-Grid mehrspaltiger für breite Screens */
[data-layout="full"] body.page-arbeitsplatz #resultsGrid {
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)) !important;
}

/* Links: setup-header + setup-hero folgen dem Container */
[data-layout="left"] body.page-setup .setup-header,
[data-layout="left"] body.page-setup .setup-hero {
  max-width: 860px;
  margin-left: 28px !important;
  margin-right: auto !important;
  text-align: left;
}
[data-layout="left"] body.page-dashboard .setup-header,
[data-layout="left"] body.page-dashboard .setup-hero {
  max-width: 1100px;
  margin-left: 28px !important;
  margin-right: auto !important;
  text-align: left;
}

/* Rechts: setup-header + setup-hero folgen dem Container */
[data-layout="right"] body.page-setup .setup-header,
[data-layout="right"] body.page-setup .setup-hero {
  max-width: 860px;
  margin-left: auto !important;
  margin-right: 28px !important;
  text-align: left;
}
[data-layout="right"] body.page-dashboard .setup-header,
[data-layout="right"] body.page-dashboard .setup-hero {
  max-width: 1100px;
  margin-left: auto !important;
  margin-right: 28px !important;
  text-align: left;
}

/* Volle Breite: hero-Text linksbündig */
[data-layout="full"] body.page-setup .setup-hero,
[data-layout="full"] body.page-dashboard .setup-hero {
  text-align: left;
}

/* Links/Rechts/Voll: p-Zentrierung aufheben */
[data-layout="left"]  body.page-setup .setup-hero p,
[data-layout="right"] body.page-setup .setup-hero p,
[data-layout="full"]  body.page-setup .setup-hero p,
[data-layout="left"]  body.page-dashboard .setup-hero p,
[data-layout="right"] body.page-dashboard .setup-hero p,
[data-layout="full"]  body.page-dashboard .setup-hero p {
  margin-left: 0;
  margin-right: 0;
}


/* ═══════════════════════════════════════════════════════════════════════════
   12. KARTEN-ANSICHT  (body.page-map)
   ═══════════════════════════════════════════════════════════════════════════ */

body.page-map {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #0d0d0d;
}
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 40px; z-index: 9999;
  background: rgba(8,8,8,0.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: flex-start;
  gap: 8px; padding: 0 12px;
}
#topbar .addr   { color: #f0f0f0; font-size: 13px; font-weight: 600; }
#topbar .sep    { color: #444; }
#topbar .coords { color: #666; font-size: 11px; font-variant-numeric: tabular-nums; }
#grid {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  width: 100vw; height: calc(100vh - 40px); margin-top: 40px; gap: 2px; background: #0d0d0d;
}
.pane    { position: relative; overflow: hidden; }
.map-el  { width: 100%; height: 100%; }
.pane-label {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 1000;
  background: rgba(0,0,0,0.70); color: #fff; font-size: 11px; font-weight: 600;
  letter-spacing: 0.03em; padding: 4px 13px; border-radius: 20px;
  pointer-events: none; white-space: nowrap; backdrop-filter: blur(4px);
}
.overlay-btns { position: absolute; bottom: 34px; right: 8px; z-index: 1000; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.overlay-btn {
  background: rgba(0,0,0,0.75); color: #fff; font-size: 11px; font-weight: 600;
  padding: 6px 12px; border-radius: var(--radius-md); text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px; backdrop-filter: blur(4px);
  transition: background 0.15s ease !important; border: 1px solid rgba(255,255,255,0.15); white-space: nowrap;
}
.overlay-btn:hover { background: rgba(0,0,0,0.95); }
#wms-switcher { position: absolute; bottom: 34px; left: 8px; z-index: 1000; }
#wms-select {
  font-size: 10px; font-weight: 600; background: rgba(0,0,0,0.72); color: #fff;
  border: 1px solid rgba(255,255,255,0.15); border-radius: 7px;
  padding: 4px 8px; cursor: pointer; backdrop-filter: blur(4px); appearance: none; outline: none;
}
#wms-select option { background: #222; color: #fff; }
#ortho-error {
  display: none; position: absolute; bottom: 58px; left: 50%; transform: translateX(-50%); z-index: 1000;
  background: rgba(180,40,40,0.90); color: #fff; font-size: 10px; font-weight: 600;
  padding: 4px 12px; border-radius: 7px; white-space: nowrap; pointer-events: none;
}
.leaflet-control-attribution { font-size: 9px !important; }
.leaflet-container:focus      { outline: none; }
.leaflet-control-zoom         { margin-top: 36px !important; }


/* ═══════════════════════════════════════════════════════════════════════════
   13. SETUP-SEITE  (body.page-setup)
   ═══════════════════════════════════════════════════════════════════════════ */

body.page-setup {
  background: var(--surface-bg);
  background-attachment: fixed;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Sterne-Hintergrund für dunkle Themes (gleiche Technik wie page-home) */
body.page-setup::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 25% 20%, rgba(255,255,255,0.28) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 12%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 82% 52%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 12% 78%, rgba(255,255,255,0.18) 0%, transparent 100%),
    radial-gradient(1px 1px at 48% 88%, rgba(255,255,255,0.22) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 72% 65%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 38% 48%, rgba(255,255,255,0.16) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.5s ease !important;
}
[data-theme="dark"] body.page-setup::before,
[data-theme="blue"] body.page-setup::before,
[data-theme="green"] body.page-setup::before { opacity: 1; }

/* ── Auth-Spinner ────────────────────────────────────────────────────────── */
.setup-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80vh; gap: 16px; }
.setup-loading-spinner { width: 44px; height: 44px; border: 3px solid var(--surface-border); border-top-color: var(--brand-primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
.setup-loading-text { font-size: 0.875rem; color: var(--text-muted); }
[data-theme="dark"] .setup-loading-text,
[data-theme="blue"] .setup-loading-text,
[data-theme="green"] .setup-loading-text { color: var(--dark-muted); }

/* ── Setup-Header ────────────────────────────────────────────────────────── */
.setup-header { padding: 14px 40px 0; display: flex; align-items: center; justify-content: space-between; }

/* ── Setup-Hero ──────────────────────────────────────────────────────────── */
.setup-hero { text-align: center; padding: 36px 24px 24px; animation: fadeInUp 0.5s ease both; }
.setup-hero h1 { font-size: 2.25rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.025em; margin-bottom: 10px; }
.setup-hero p  { font-size: 1.05rem; color: var(--text-muted); max-width: 480px; margin: 0 auto; line-height: 1.6; }
[data-theme="dark"] .setup-hero h1,
[data-theme="blue"] .setup-hero h1,
[data-theme="green"] .setup-hero h1 { color: var(--dark-text); }
[data-theme="dark"] .setup-hero p,
[data-theme="blue"] .setup-hero p,
[data-theme="green"] .setup-hero p  { color: var(--dark-muted); }

/* ── Haupt-Container ─────────────────────────────────────────────────────── */
.setup-container { max-width: 860px; margin: 0 auto; padding: 0 24px 60px; display: flex; flex-direction: column; gap: 20px; }

/* ── Abschnitt (Glassmorphism-Karte) ─────────────────────────────────────── */
.setup-section {
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  padding: 28px 32px;
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow: var(--glass-shadow);
  animation: fadeInUp 0.5s ease both;
  transition: box-shadow 0.3s ease !important;
}
.setup-section:hover { box-shadow: var(--glass-shadow-hover); }

/* Aktionsbutton-Sektion bricht bewusst aus dem 860px-Container heraus */
#actSection {
  width: min(1300px, calc(100vw - 60px));
  margin-left: calc((min(1300px, calc(100vw - 60px)) - 100%) / -2);
  overflow-x: auto;
}

.setup-section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.setup-section-icon   { width: 38px; height: 38px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.setup-section-title  { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
[data-theme="dark"] .setup-section-title,
[data-theme="blue"] .setup-section-title,
[data-theme="green"] .setup-section-title { color: var(--dark-text); }

.setup-section-desc { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 22px; line-height: 1.55; padding-left: 50px; }
[data-theme="dark"] .setup-section-desc,
[data-theme="blue"] .setup-section-desc,
[data-theme="green"] .setup-section-desc { color: var(--dark-muted); }

/* Gestaffelte Animationen */
.setup-section:nth-child(1) { animation-delay: 0.04s; }
.setup-section:nth-child(2) { animation-delay: 0.10s; }
.setup-section:nth-child(3) { animation-delay: 0.16s; }
.setup-section:nth-child(4) { animation-delay: 0.22s; }

/* ── Theme-Grid (2×2) ────────────────────────────────────────────────────── */
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 540px) { .theme-grid { grid-template-columns: 1fr; } }

/* ── Desktop/Mobile-Geräte-Blöcke im Erscheinungsbild ───────────────────── */
.setup-device-block { margin-bottom: 24px; }
.setup-device-block:last-child { margin-bottom: 0; }
.setup-device-label {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 10px; padding-left: 2px;
}
[data-theme="dark"] .setup-device-label { color: var(--dark-muted); }

/* ── Layout-Grid (4 Kacheln nebeneinander) ───────────────────────────────── */
.layout-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 600px) { .layout-grid { grid-template-columns: 1fr 1fr; } }

/* ── Wahl-Kachel (gemeinsam für Themes + Layouts) ────────────────────────── */
.theme-card,
.layout-card {
  border-radius: var(--radius-xl);
  border: 2px solid var(--surface-border);
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.25s ease,
    box-shadow 0.25s ease !important;
  user-select: none;
}
.theme-card:hover,
.layout-card:hover {
  transform: translateY(-5px) scale(1.015);
  border-color: var(--brand-primary);
  box-shadow: 0 14px 44px var(--brand-primary-bg);
}
.theme-card:active,
.layout-card:active { transform: translateY(-1px) scale(0.99); }

.theme-card.selected,
.layout-card.selected {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-bg), 0 10px 36px var(--brand-primary-bg);
}
[data-theme="dark"] .theme-card, [data-theme="dark"] .layout-card,
[data-theme="blue"] .theme-card,  [data-theme="blue"] .layout-card,
[data-theme="green"] .theme-card, [data-theme="green"] .layout-card { border-color: var(--glass-border); }

/* ── Theme-Preview-Bereich ───────────────────────────────────────────────── */
.theme-preview {
  height: 140px; position: relative; overflow: hidden; padding: 12px;
  display: flex; flex-direction: column; gap: 7px;
}

/* Light-Preview */
.theme-preview-light { background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 40%, #f0f9ff 100%); }
.theme-preview-light .tp-bar {
  height: 19px; background: rgba(255,255,255,0.92); border-radius: 7px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10); display: flex; align-items: center; padding: 0 9px; gap: 5px;
}
.theme-preview-light .tp-bar-line { height: 3px; border-radius: 3px; background: #c7d2fe; flex: 1; }
.theme-preview-light .tp-card {
  flex: 1; background: rgba(255,255,255,0.82); border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: 0 4px 14px rgba(99,102,241,0.10), inset 0 1px 0 rgba(255,255,255,0.95);
  padding: 7px 9px; display: flex; flex-direction: column; gap: 4px;
}

/* Dark-Preview (true dark) */
.theme-preview-dark { background: linear-gradient(160deg, #0a0a0a 0%, #1a1a1a 100%); }
.theme-preview-dark .tp-bar {
  height: 19px; background: rgba(255,255,255,0.08); border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.11); display: flex; align-items: center; padding: 0 9px; gap: 5px;
}
.theme-preview-dark .tp-bar-line { height: 3px; border-radius: 3px; background: rgba(255,255,255,0.14); flex: 1; }
.theme-preview-dark .tp-card {
  flex: 1; background: rgba(255,255,255,0.055); border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 4px 16px rgba(0,0,0,0.40), inset 0 1px 0 rgba(255,255,255,0.06);
  padding: 7px 9px; display: flex; flex-direction: column; gap: 4px;
}

/* Blue-Preview (navy) */
.theme-preview-blue { background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%); }
.theme-preview-blue .tp-bar {
  height: 19px; background: rgba(255,255,255,0.09); border-radius: 7px;
  border: 1px solid rgba(147,197,253,0.24); display: flex; align-items: center; padding: 0 9px; gap: 5px;
}
.theme-preview-blue .tp-bar-line { height: 3px; border-radius: 3px; background: rgba(147,197,253,0.25); flex: 1; }
.theme-preview-blue .tp-card {
  flex: 1; background: rgba(255,255,255,0.07); border-radius: 9px;
  border: 1px solid rgba(147,197,253,0.18);
  box-shadow: 0 4px 16px rgba(0,0,30,0.40), inset 0 1px 0 rgba(147,197,253,0.08);
  padding: 7px 9px; display: flex; flex-direction: column; gap: 4px;
}

/* Green-Preview (forest) */
.theme-preview-green { background: linear-gradient(135deg, #052e16 0%, #14532d 60%, #052e16 100%); }
.theme-preview-green .tp-bar {
  height: 19px; background: rgba(255,255,255,0.08); border-radius: 7px;
  border: 1px solid rgba(52,211,153,0.26); display: flex; align-items: center; padding: 0 9px; gap: 5px;
}
.theme-preview-green .tp-bar-line { height: 3px; border-radius: 3px; background: rgba(52,211,153,0.25); flex: 1; }
.theme-preview-green .tp-card {
  flex: 1; background: rgba(255,255,255,0.065); border-radius: 9px;
  border: 1px solid rgba(52,211,153,0.20);
  box-shadow: 0 4px 16px rgba(0,20,8,0.40), inset 0 1px 0 rgba(52,211,153,0.08);
  padding: 7px 9px; display: flex; flex-direction: column; gap: 4px;
}

/* Gemeinsame Preview-Linien und Dots */
.tp-bar-dot { width: 7px; height: 7px; border-radius: 50%; }
.tp-bar-dot.red   { background: #ef4444; }
.tp-bar-dot.amber { background: #f59e0b; }
.tp-bar-dot.green { background: #22c55e; }

.tp-line { height: 4px; border-radius: 3px; }
.tp-line.l  { background: rgba(255,255,255,0.70); width: 68%; }
.tp-line.m  { width: 45%; }
.tp-line.s  { width: 30%; }
.tp-line.xs { width: 20%; height: 3px; }
/* Light: darker lines for contrast */
.theme-preview-light .tp-line.l  { background: #c7d2fe; }
.theme-preview-light .tp-line.m  { background: #a5b4fc; width: 45%; }
.theme-preview-light .tp-line.s  { background: #ddd6fe; width: 30%; }
/* Dark/Blue/Green: light lines */
.theme-preview-dark  .tp-line.l  { background: rgba(255,255,255,0.20); }
.theme-preview-dark  .tp-line.m  { background: rgba(255,255,255,0.13); width: 45%; }
.theme-preview-dark  .tp-line.s  { background: rgba(255,255,255,0.10); width: 30%; }
.theme-preview-blue  .tp-line.l  { background: rgba(147,197,253,0.35); }
.theme-preview-blue  .tp-line.m  { background: rgba(96,165,250,0.25);  width: 45%; }
.theme-preview-blue  .tp-line.s  { background: rgba(147,197,253,0.18); width: 30%; }
.theme-preview-green .tp-line.l  { background: rgba(52,211,153,0.35); }
.theme-preview-green .tp-line.m  { background: rgba(16,185,129,0.25);  width: 45%; }
.theme-preview-green .tp-line.s  { background: rgba(52,211,153,0.18); width: 30%; }

/* ── Layout-Preview-Bereich ──────────────────────────────────────────────── */
.layout-preview {
  height: 80px; position: relative; overflow: hidden; padding: 10px 8px;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--surface-border);
  display: flex; align-items: center; justify-content: center;
}
[data-theme="dark"] .layout-preview,
[data-theme="blue"] .layout-preview,
[data-theme="green"] .layout-preview {
  background: var(--surface-raised);
  border-bottom-color: var(--surface-border);
}
.layout-diagram {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; gap: 4px; padding: 4px; justify-content: center;
}
.layout-bar {
  height: 7px; border-radius: 4px;
  background: var(--brand-primary);
  opacity: 0.55;
}
/* Center */
.layout-preview-center .layout-bar { width: 60%; margin: 0 auto; }
/* Left */
.layout-preview-left .layout-bar { width: 60%; margin-left: 4px; margin-right: auto; }
/* Right */
.layout-preview-right .layout-bar { width: 60%; margin-left: auto; margin-right: 4px; }
/* Full */
.layout-preview-full .layout-bar { width: 95%; margin: 0 auto; }
/* Varied widths for realism */
.layout-bar:nth-child(1) { opacity: 0.65; }
.layout-bar:nth-child(2) { opacity: 0.40; }
.layout-bar:nth-child(3) { opacity: 0.50; width: 50%; }

/* Keep right-align for right layout bars */
.layout-preview-right .layout-bar:nth-child(3) { width: 50%; margin-left: auto; margin-right: 4px; }
/* Full layout bars */
.layout-preview-full .layout-bar:nth-child(3) { width: 80%; }

/* ── Kachel-Footer ───────────────────────────────────────────────────────── */
.theme-card-footer,
.layout-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--surface-border);
  background: var(--surface-card-solid);
  transition: background var(--transition-theme), border-color var(--transition-theme) !important;
}
[data-theme="dark"] .theme-card-footer,
[data-theme="dark"] .layout-card-footer,
[data-theme="blue"] .theme-card-footer,
[data-theme="blue"] .layout-card-footer,
[data-theme="green"] .theme-card-footer,
[data-theme="green"] .layout-card-footer {
  background: var(--surface-raised);
  border-top-color: var(--glass-border);
}
.theme-card-name, .layout-card-name {
  font-size: 0.9rem; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 6px;
}
[data-theme="dark"] .theme-card-name, [data-theme="dark"] .layout-card-name,
[data-theme="blue"] .theme-card-name,  [data-theme="blue"] .layout-card-name,
[data-theme="green"] .theme-card-name, [data-theme="green"] .layout-card-name { color: var(--dark-text); }

.theme-card-sub { font-size: 0.75rem; font-weight: 400; color: var(--text-muted); }
[data-theme="dark"] .theme-card-sub,
[data-theme="blue"] .theme-card-sub,
[data-theme="green"] .theme-card-sub { color: var(--dark-muted); }

/* Checkmark-Häkchen */
.card-check {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand-primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.80rem; font-weight: 800;
  opacity: 0; transform: scale(0.4) rotate(-90deg);
  transition: opacity 0.3s ease, transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  box-shadow: 0 4px 12px var(--brand-primary-bg);
  flex-shrink: 0;
}
.theme-card.selected .card-check,
.layout-card.selected .card-check { opacity: 1; transform: scale(1) rotate(0deg); }

/* ── Toast-Benachrichtigung ───────────────────────────────────────────────── */
.setup-toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(12, 12, 12, 0.92); color: #f0f0f0;
  padding: 12px 26px; border-radius: var(--radius-full);
  font-size: 0.875rem; font-weight: 500;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  z-index: 9000; opacity: 0; pointer-events: none; white-space: nowrap;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease !important;
}
.setup-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── System-Info Zeilen ──────────────────────────────────────────────────── */
.setup-version-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--surface-border); font-size: 0.875rem; }
.setup-version-row:last-child { border-bottom: none; padding-bottom: 0; }
.setup-version-label { color: var(--text-muted); }
.setup-version-value { color: var(--text-primary); font-weight: 600; }
[data-theme="dark"] .setup-version-label,
[data-theme="blue"] .setup-version-label,
[data-theme="green"] .setup-version-label { color: var(--dark-muted); }
[data-theme="dark"] .setup-version-value,
[data-theme="blue"] .setup-version-value,
[data-theme="green"] .setup-version-value { color: var(--dark-text); }
[data-theme="dark"] .setup-version-row,
[data-theme="blue"] .setup-version-row,
[data-theme="green"] .setup-version-row { border-bottom-color: var(--glass-border); }

/* ── Filter-Konfiguration (einstellungen.html) ───────────────────────────────────── */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
@media (max-width: 540px) { .filter-grid { grid-template-columns: 1fr 1fr; } }

.filter-card {
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 11px 13px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
  display: flex;
  align-items: center;
  gap: 9px;
  user-select: none;
}
.filter-card:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}
.filter-card.active {
  border-color: #22c55e;
  background: rgba(34,197,94,0.12);
}
.filter-card .fc-icon { font-size: 1.1rem; flex-shrink: 0; line-height: 1; }
.filter-card .fc-label {
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--dark-text);
  flex: 1;
  line-height: 1.2;
}
.filter-card .fc-toggle {
  width: 19px; height: 19px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  border: 1.5px solid rgba(255,255,255,0.20);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; color: transparent; flex-shrink: 0;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.filter-card.active .fc-toggle {
  background: #22c55e; border-color: #16a34a; color: #fff;
}

/* Light-Theme für Filter-Cards */
[data-theme="light"] body.page-setup .filter-card {
  background: rgba(255,255,255,0.80);
  border-color: rgba(99,102,241,0.14);
}
[data-theme="light"] body.page-setup .filter-card:hover {
  background: rgba(255,255,255,0.97);
  border-color: rgba(99,102,241,0.28);
}
[data-theme="light"] body.page-setup .filter-card.active {
  border-color: #22c55e;
  background: rgba(34,197,94,0.07);
}
[data-theme="light"] body.page-setup .filter-card .fc-label { color: var(--text-primary); }
[data-theme="light"] body.page-setup .filter-card .fc-toggle {
  background: #e5e7eb; border-color: #d1d5db;
}
[data-theme="light"] body.page-setup .filter-card.active .fc-toggle {
  background: #22c55e; border-color: #16a34a; color: #fff;
}

/* ── Suchfeld-Konfiguration ──────────────────────────────────────────────── */
.search-fields-box {
  padding: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
}
.search-fields-box.sf-hidden { display: none; }
.search-fields-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--dark-muted);
  margin-bottom: 11px;
}
.search-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 7px;
}
.sf-label {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  font-size: 0.82rem; font-weight: 500;
  color: var(--dark-text); user-select: none;
}
.sf-label:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.18); }
.sf-label input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: #22c55e; cursor: pointer; flex-shrink: 0;
}

/* Light-Theme für Suchfeld-Box */
[data-theme="light"] body.page-setup .search-fields-box {
  background: rgba(241,245,249,0.85);
  border-color: rgba(99,102,241,0.12);
}
[data-theme="light"] body.page-setup .search-fields-title { color: var(--text-muted); }
[data-theme="light"] body.page-setup .sf-label {
  background: #fff; border-color: rgba(99,102,241,0.12); color: var(--text-primary);
}
[data-theme="light"] body.page-setup .sf-label:hover {
  background: rgba(99,102,241,0.05); border-color: rgba(99,102,241,0.22);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Sektion 14 – Schriftart & Schriftgröße
   Globale Schrift-/Größen-Regeln + Font-Kacheln für einstellungen.html
═══════════════════════════════════════════════════════════════════════════ */

/* ── Globale Schriftart (fest: Inter) ─────────────────────────────────────── */
body,
input,
select,
textarea,
button,
.font-sans {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: "ss01","cv11";
}

/* ── Schriftgrößen (rem-Basis auf html setzen → alle Tailwind-rem-Klassen skalieren) */
html[data-fontsize="small"]  { font-size: 13px; }
html[data-fontsize="medium"] { font-size: 16px; }
html[data-fontsize="large"]  { font-size: 20px; }

/* ── Unterabschnitt-Beschriftung ────────────────────────────────────────── */
.setup-sub-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 0 0 12px 2px;
}
.setup-sub-label + * { /* entfernt Extra-Abstand zwischen Label und Grid */ }

/* ── Font-Kacheln Grids ─────────────────────────────────────────────────── */
.font-grid,
.font-size-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 520px) {
  .font-grid, .font-size-grid { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
}

/* ── Font-Kachel (card) – gleiche Basis wie .theme-card / .layout-card ───── */
.font-card {
  border-radius: var(--radius-xl);
  border: 2px solid var(--surface-border);
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease !important;
  user-select: none;
}
.font-card:hover {
  transform: translateY(-5px) scale(1.015);
  border-color: var(--brand-primary);
  box-shadow: 0 14px 44px var(--brand-primary-bg);
}
.font-card:active { transform: translateY(-1px) scale(0.99); }
.font-card.selected {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-bg), 0 10px 36px var(--brand-primary-bg);
}
[data-theme="dark"]  .font-card,
[data-theme="blue"]  .font-card,
[data-theme="green"] .font-card { border-color: var(--glass-border); }

/* ── Kachel-Footer ───────────────────────────────────────────────────────── */
.font-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--surface-border);
  background: var(--surface-card-solid);
  transition: background var(--transition-theme), border-color var(--transition-theme) !important;
}
[data-theme="dark"]  .font-card-footer,
[data-theme="blue"]  .font-card-footer,
[data-theme="green"] .font-card-footer {
  background: var(--surface-raised);
  border-top-color: var(--glass-border);
}
.font-card-name {
  font-size: 0.85rem; font-weight: 700; color: var(--text-primary);
  transition: color var(--transition-theme);
}
[data-theme="dark"]  .font-card-name,
[data-theme="blue"]  .font-card-name,
[data-theme="green"] .font-card-name { color: var(--dark-text); }

/* ── Schriftart-Vorschau ─────────────────────────────────────────────────── */
.font-preview-area {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 90px;
  background: var(--glass-card-bg);
  transition: background var(--transition-theme);
}
/* Jede Vorschau nutzt IMMER ihre eigene Schrift – unabhängig von data-font */
.font-preview-text {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text-primary);
  transition: color var(--transition-theme);
}
.font-preview-text.is-standard      { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif !important; }
.font-preview-text.is-inter         { font-family: 'Inter', system-ui, sans-serif !important; }
.font-preview-text.is-onest         { font-family: 'Onest', system-ui, sans-serif !important; }
.font-preview-text.is-albertsans    { font-family: 'Albert Sans', system-ui, sans-serif !important; }
.font-preview-text.is-figtree       { font-family: 'Figtree', system-ui, sans-serif !important; }
.font-preview-text.is-hankengrotesk { font-family: 'Hanken Grotesk', system-ui, sans-serif !important; }
[data-theme="dark"]  .font-preview-text,
[data-theme="blue"]  .font-preview-text,
[data-theme="green"] .font-preview-text { color: var(--dark-text); }

.font-preview-sub {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
  font-family: system-ui, sans-serif !important;
  letter-spacing: 0.04em;
  transition: color var(--transition-theme);
}

/* ── Schriftgröße-Vorschau ───────────────────────────────────────────────── */
.size-preview-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 90px;
  background: var(--glass-card-bg);
  gap: 4px;
  transition: background var(--transition-theme);
}
/* Vorschau-Texte in px (nicht rem!) damit sie unabhängig von data-fontsize sind */
.size-preview-text {
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  font-family: system-ui, sans-serif !important;
  transition: color var(--transition-theme);
}
.size-preview-text.is-small  { font-size: 14px; }
.size-preview-text.is-medium { font-size: 22px; }
.size-preview-text.is-large  { font-size: 32px; }
[data-theme="dark"]  .size-preview-text,
[data-theme="blue"]  .size-preview-text,
[data-theme="green"] .size-preview-text { color: var(--dark-text); }

.size-preview-sub {
  font-size: 10px;
  color: var(--text-muted);
  font-family: system-ui, sans-serif !important;
  letter-spacing: 0.04em;
  transition: color var(--transition-theme);
}


/* ═══════════════════════════════════════════════════════════════════════════
   Sektion 15 – Status-Filter Multi-Select Popdown
═══════════════════════════════════════════════════════════════════════════ */

/* ── Status-Filter Button (Filter-Leiste arbeitsplatz.html) ─────────────────── */
#statusFilterBtn {
  background: var(--glass-card-bg);
  border-color: var(--surface-border);
  color: var(--text-primary);
  transition: background var(--transition-theme), border-color var(--transition-theme), color var(--transition-theme);
}
#statusFilterBtn:hover { border-color: var(--brand-primary); }
[data-theme="dark"]  #statusFilterBtn,
[data-theme="blue"]  #statusFilterBtn,
[data-theme="green"] #statusFilterBtn {
  background: var(--surface-raised); border-color: var(--glass-border); color: var(--dark-text);
}
#statusFilterBtn.has-selection { border-color: var(--brand-primary); color: var(--brand-primary); }

/* ── Popdown-Container ───────────────────────────────────────────────────── */
#statusFilterPopdown {
  background: var(--glass-card-bg);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  transition: background var(--transition-theme), border-color var(--transition-theme);
  backdrop-filter: blur(12px);
}
[data-theme="dark"]  #statusFilterPopdown,
[data-theme="blue"]  #statusFilterPopdown,
[data-theme="green"] #statusFilterPopdown {
  border-color: var(--glass-border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}

/* ── Popdown-Kopfbereich (Aktions-Buttons) ───────────────────────────────── */
.sfp-header {
  display: flex; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid var(--surface-border);
  background: var(--surface-card-solid);
  position: sticky; top: 0; z-index: 1;
  transition: background var(--transition-theme), border-color var(--transition-theme);
}
[data-theme="dark"]  .sfp-header,
[data-theme="blue"]  .sfp-header,
[data-theme="green"] .sfp-header { background: var(--surface-raised); border-color: var(--glass-border); }
.sfp-action-btn {
  font-size: 0.72rem; font-weight: 600; padding: 3px 10px;
  border-radius: 6px; border: 1px solid var(--brand-primary);
  background: transparent; color: var(--brand-primary); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sfp-action-btn:hover { background: var(--brand-primary-bg); }
[data-theme="dark"]  .sfp-action-btn,
[data-theme="blue"]  .sfp-action-btn,
[data-theme="green"] .sfp-action-btn { color: #93c5fd; border-color: #93c5fd; }

/* ── Board-Überschrift im Popdown ────────────────────────────────────────── */
.sfp-board-header {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  padding: 8px 12px 2px; margin-top: 2px;
  transition: color var(--transition-theme);
}

/* ── Einzelnes Status-Element ────────────────────────────────────────────── */
.sfp-item-label {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  width: 100%; padding: 5px 12px; transition: background 0.12s;
}
.sfp-item-label:hover { background: var(--brand-primary-bg); }
.sfp-item-cb { width: 14px; height: 14px; accent-color: var(--brand-primary); cursor: pointer; flex-shrink: 0; }
.sfp-item-text {
  font-size: 0.82rem; color: var(--text-primary); transition: color var(--transition-theme); line-height: 1.3;
}
[data-theme="dark"]  .sfp-item-text,
[data-theme="blue"]  .sfp-item-text,
[data-theme="green"] .sfp-item-text { color: var(--dark-text); }

/* ── Status-Sichtbarkeits-Chips (einstellungen.html) ─────────────────────────────── */
.sv-board-section { margin-bottom: 14px; }
.sv-board-header {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  padding: 10px 0 6px; margin-bottom: 2px;
  border-top: 1px solid var(--surface-border);
  transition: color var(--transition-theme), border-color var(--transition-theme);
}
.sv-board-section:first-child .sv-board-header { border-top: none; padding-top: 0; }
[data-theme="dark"]  .sv-board-header,
[data-theme="blue"]  .sv-board-header,
[data-theme="green"] .sv-board-header { border-color: var(--glass-border); }
.sv-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.sv-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 11px 3px 7px; border-radius: 999px;
  font-size: 0.73rem; font-weight: 500; line-height: 1;
  border: 1px solid var(--surface-border);
  background: transparent; color: var(--text-muted);
  cursor: pointer; user-select: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sv-chip::before {
  content: '✓'; font-size: 0.65rem; font-weight: 700;
  opacity: 0; transition: opacity 0.12s; width: 0; overflow: hidden;
}
.sv-chip.active {
  background: rgba(37,99,235,0.10); color: #2563eb; border-color: #2563eb;
}
.sv-chip.active::before { opacity: 1; width: auto; margin-right: 2px; }
.sv-chip:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
[data-theme="dark"]  .sv-chip.active,
[data-theme="blue"]  .sv-chip.active  { background: rgba(96,165,250,0.15); color: #93c5fd; border-color: #93c5fd; }
[data-theme="green"] .sv-chip.active  { background: rgba(52,211,153,0.15); color: #6ee7b7; border-color: #6ee7b7; }
[data-theme="dark"]  .sv-chip:hover,
[data-theme="blue"]  .sv-chip:hover   { color: #93c5fd; border-color: #93c5fd; }
[data-theme="green"] .sv-chip:hover   { color: #6ee7b7; border-color: #6ee7b7; }

/* ── Aufklappbarer Status-Reihenfolge-Header ── */
.so-collapse-header { display:flex; align-items:center; justify-content:space-between; cursor:pointer; padding:2px 0; }
.so-collapse-header:hover { opacity:0.72; }
.so-collapse-title  { margin:0 !important; }
.so-chevron         { font-size:0.7rem; color:var(--text-muted); user-select:none; flex-shrink:0; transition:color 0.15s; }
.so-collapse-header:hover .so-chevron { color:var(--brand-primary); }

/* ── Status-Reihenfolge-Editor (einstellungen.html, Drag & Drop) ── */
.so-board-wrap  { margin-bottom:14px; border:1px solid var(--surface-border); border-radius:9px; overflow:hidden; }
.so-board-title { padding:6px 12px; font-size:0.7rem; font-weight:700; text-transform:uppercase; letter-spacing:0.07em; color:var(--text-muted); background:rgba(0,0,0,0.04); border-bottom:1px solid var(--surface-border); }
[data-theme="dark"]  .so-board-title,
[data-theme="blue"]  .so-board-title,
[data-theme="green"] .so-board-title { background:rgba(255,255,255,0.05); }
.so-status-list { list-style:none; padding:5px; margin:0; display:flex; flex-direction:column; gap:3px; }
.so-item { display:flex; align-items:center; gap:8px; padding:5px 8px; border-radius:6px; background:var(--glass-card-bg); border:1px solid var(--surface-border); cursor:grab; user-select:none; font-size:0.8rem; color:var(--text-primary); transition:background 0.12s, border-color 0.12s; }
.so-item:active  { cursor:grabbing; }
.so-item.so-dragging { opacity:0.3; }
.so-item.so-over    { border-color:var(--brand-primary); background:rgba(37,99,235,0.08); }
[data-theme="dark"]  .so-item.so-over,
[data-theme="blue"]  .so-item.so-over  { background:rgba(96,165,250,0.1); border-color:#93c5fd; }
[data-theme="green"] .so-item.so-over  { background:rgba(52,211,153,0.1); border-color:#6ee7b7; }
.so-handle { color:var(--text-muted); font-size:1.1rem; line-height:1; flex-shrink:0; }
.so-name   { flex:1; }


/* ═══════════════════════════════════════════════════════════════════════════
   15. LOGO + HOME-BUTTON  (alle Seiten)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Logo-Bild (theme-sensitiv) ──────────────────────────────────────────── */
.fr-logo       { height: 54px; width: auto; display: block; flex-shrink: 0; user-select: none; }
.fr-logo-dark  { display: none; }

/* Dunkle Themes → weiße Logo-Version einblenden */
[data-theme="dark"]  .fr-logo-light,
[data-theme="blue"]  .fr-logo-light,
[data-theme="green"] .fr-logo-light { display: none; }

[data-theme="dark"]  .fr-logo-dark,
[data-theme="blue"]  .fr-logo-dark,
[data-theme="green"] .fr-logo-dark  { display: block; }

/* map.html: Topbar ist immer dunkel → immer weiße Logo-Version */
body.page-map .fr-logo-light { display: none !important; }
body.page-map .fr-logo-dark  { display: block !important; }

/* map.html: kompaktere Logo-Höhe passend zum 40px-Topbar */
body.page-map .fr-logo { height: 22px; }

/* index.html: Logo deutlich größer als auf anderen Seiten */
body.page-home .fr-logo { height: 85px; }

/* ── Logo als klickbarer Homescreen-Link (ersetzt Home-Button) ──────────── */
.fr-logo-link {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  border-radius: 10px;
  padding: 5px 8px;
  margin: -5px -8px;
  position: relative;
  text-decoration: none !important;
  overflow: visible;
  background: transparent;
}

/* Logo-Bilder sanft animieren */
.fr-logo-link .fr-logo {
  transition: filter 0.25s ease, transform 0.22s ease;
}
.fr-logo-link:hover .fr-logo {
  transform: scale(1.04);
}

/* Glow – Light Theme: schwarzes Logo → blauer Schein */
.fr-logo-link:hover .fr-logo-light {
  filter: drop-shadow(0 0 5px rgba(37,99,235,0.62))
          drop-shadow(0 0 18px rgba(99,102,241,0.42));
}

/* Glow – Dunkle/Blaue/Grüne Themes + map.html: weißes Logo → weiß-blauer Schein */
[data-theme="dark"]  .fr-logo-link:hover .fr-logo-dark,
[data-theme="blue"]  .fr-logo-link:hover .fr-logo-dark,
[data-theme="green"] .fr-logo-link:hover .fr-logo-dark,
body.page-map        .fr-logo-link:hover .fr-logo-dark {
  filter: drop-shadow(0 0 7px rgba(255,255,255,0.68))
          drop-shadow(0 0 22px rgba(147,197,253,0.58));
}

/* Tooltip: erscheint unterhalb des Logos bei Hover */
.fr-logo-link::after {
  content: "🏠  Zur Startseite";
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: rgba(15,23,42,0.95);
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 7px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 9999;
  border: 1px solid rgba(99,102,241,0.40);
  box-shadow: 0 4px 16px rgba(0,0,0,0.40);
  letter-spacing: 0.01em;
}
.fr-logo-link:hover::after {
  opacity: 1;
}


/* ═══════════════════════════════════════════════════════════════════════════
   16. DASHBOARD-SEITE  (body.page-dashboard)
   ═══════════════════════════════════════════════════════════════════════════ */

body.page-dashboard {
  background: var(--surface-bg);
  background-attachment: fixed;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Sterne-Hintergrund für dunkle Themes (gleiche Technik wie page-setup) */
body.page-dashboard::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 25% 20%, rgba(255,255,255,0.28) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 12%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 82% 52%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 12% 78%, rgba(255,255,255,0.18) 0%, transparent 100%),
    radial-gradient(1px 1px at 48% 88%, rgba(255,255,255,0.22) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 72% 65%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 38% 48%, rgba(255,255,255,0.16) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.5s ease !important;
}
[data-theme="dark"] body.page-dashboard::before,
[data-theme="blue"] body.page-dashboard::before,
[data-theme="green"] body.page-dashboard::before { opacity: 1; }


/* ═══════════════════════════════════════════════════════════════════════════
   17. KUNDENKOMMUNIKATION  (body.page-kommunikation)
   ═══════════════════════════════════════════════════════════════════════════ */

body.page-kommunikation {
  background: var(--surface-bg);
  background-attachment: fixed;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
body.page-kommunikation::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 25% 20%, rgba(255,255,255,0.28) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 12%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 82% 52%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 12% 78%, rgba(255,255,255,0.18) 0%, transparent 100%),
    radial-gradient(1px 1px at 48% 88%, rgba(255,255,255,0.22) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 72% 65%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 38% 48%, rgba(255,255,255,0.16) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.5s ease !important;
}
[data-theme="dark"] body.page-kommunikation::before,
[data-theme="blue"] body.page-kommunikation::before,
[data-theme="green"] body.page-kommunikation::before { opacity: 1; }


/* ═══════════════════════════════════════════════════════════════════════════
   18. TERMINPLANER  (body.page-terminplaner)
   ═══════════════════════════════════════════════════════════════════════════ */

body.page-terminplaner {
  background: var(--surface-bg);
  background-attachment: fixed;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
body.page-terminplaner::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 25% 20%, rgba(255,255,255,0.28) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 12%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 82% 52%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 12% 78%, rgba(255,255,255,0.18) 0%, transparent 100%),
    radial-gradient(1px 1px at 48% 88%, rgba(255,255,255,0.22) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 72% 65%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 38% 48%, rgba(255,255,255,0.16) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.5s ease !important;
}
[data-theme="dark"] body.page-terminplaner::before,
[data-theme="blue"] body.page-terminplaner::before,
[data-theme="green"] body.page-terminplaner::before { opacity: 1; }


/* ═══════════════════════════════════════════════════════════════════════════
   19. PROJEKTPLANER  (body.page-projektplaner)
   ═══════════════════════════════════════════════════════════════════════════ */

body.page-projektplaner {
  background: var(--surface-bg);
  background-attachment: fixed;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
body.page-projektplaner::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 25% 20%, rgba(255,255,255,0.28) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 12%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 82% 52%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 12% 78%, rgba(255,255,255,0.18) 0%, transparent 100%),
    radial-gradient(1px 1px at 48% 88%, rgba(255,255,255,0.22) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 72% 65%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 38% 48%, rgba(255,255,255,0.16) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.5s ease !important;
}
[data-theme="dark"] body.page-projektplaner::before,
[data-theme="blue"] body.page-projektplaner::before,
[data-theme="green"] body.page-projektplaner::before { opacity: 1; }


/* ═══════════════════════════════════════════════════════════════════════════
   19b. TICKETSYSTEM + PLATZHALTER  (body.page-ticketsystem, body.page-platzhalter)
   ═══════════════════════════════════════════════════════════════════════════ */

body.page-ticketsystem,
body.page-platzhalter {
  background: var(--surface-bg);
  background-attachment: fixed;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
body.page-ticketsystem::before,
body.page-platzhalter::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 25% 20%, rgba(255,255,255,0.28) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 12%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 82% 52%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 12% 78%, rgba(255,255,255,0.18) 0%, transparent 100%),
    radial-gradient(1px 1px at 48% 88%, rgba(255,255,255,0.22) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 72% 65%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 38% 48%, rgba(255,255,255,0.16) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.5s ease !important;
}
[data-theme="dark"] body.page-ticketsystem::before,
[data-theme="blue"] body.page-ticketsystem::before,
[data-theme="green"] body.page-ticketsystem::before,
[data-theme="dark"] body.page-platzhalter::before,
[data-theme="blue"] body.page-platzhalter::before,
[data-theme="green"] body.page-platzhalter::before { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   19c. PLATZHALTER 2  (body.page-platzhalter2)
   ═══════════════════════════════════════════════════════════════════════════ */

body.page-platzhalter2 {
  background: var(--surface-bg);
  background-attachment: fixed;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
body.page-platzhalter2::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,0.55) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0;
  transition: opacity 0.5s ease !important;
}
[data-theme="dark"] body.page-platzhalter2::before,
[data-theme="blue"] body.page-platzhalter2::before,
[data-theme="green"] body.page-platzhalter2::before { opacity: 1; }


/* ═══════════════════════════════════════════════════════════════════════════
   20. DASHBOARD  (body.page-dashboard) – KPI, Charts, Karte
   ═══════════════════════════════════════════════════════════════════════════ */

/* Zeitraum-Filter */
.db-time-bar { display:flex; gap:6px; flex-wrap:wrap; justify-content:center; margin-bottom:24px; }
.db-time-btn {
  padding:6px 16px; border-radius:8px; font-size:0.8rem; font-weight:600; cursor:pointer;
  border:1px solid var(--surface-border); background:var(--glass-bg,rgba(255,255,255,0.08));
  color:var(--text-muted); transition:all 0.2s;
}
.db-time-btn:hover { border-color:var(--brand-primary); color:var(--brand-primary); }
.db-time-btn.active { background:var(--brand-primary); color:#fff; border-color:var(--brand-primary); }

/* Individueller Zeitraum-Picker */
.db-custom-range {
  display:none; justify-content:center; align-items:center; gap:10px;
  flex-wrap:wrap; margin-bottom:20px;
}
.db-custom-label { font-size:0.8rem; font-weight:600; color:var(--text-muted); }
.db-custom-select {
  padding:5px 10px; border-radius:6px; font-size:0.8rem; cursor:pointer;
  border:1px solid var(--surface-border);
  background:var(--glass-card-bg,rgba(255,255,255,0.82));
  color:var(--text-primary);
}
.db-custom-select option {
  background:var(--surface-card-solid,#fff);
  color:var(--text-primary);
}
.db-custom-apply {
  padding:5px 14px; border-radius:6px; border:none;
  background:var(--brand-primary); color:#fff;
  font-size:0.8rem; font-weight:600; cursor:pointer;
}
.db-custom-apply:hover { opacity:0.85; }

/* Mitarbeiter-Picker (Umsatz-Chart) */
.db-emp-picker { display:inline-block; }
.db-emp-btn {
  padding:5px 12px; border-radius:6px; font-size:0.78rem; font-weight:600; cursor:pointer;
  border:1px solid var(--surface-border); background:var(--glass-card-bg,rgba(255,255,255,0.82));
  color:var(--text-primary); transition:all 0.2s; white-space:nowrap;
}
.db-emp-btn:hover { border-color:var(--brand-primary); color:var(--brand-primary); }
.db-emp-popdown {
  position:fixed; z-index:9999; padding:8px 0; border-radius:10px;
  background:var(--surface-card-solid,#fff); border:1px solid var(--surface-border);
  box-shadow:0 8px 24px rgba(0,0,0,0.18); max-height:280px; overflow-y:auto;
  scrollbar-width:thin;
}
.db-emp-item {
  display:flex; align-items:center; gap:8px; padding:6px 14px; cursor:pointer;
  font-size:0.82rem; color:var(--text-primary); transition:background 0.12s;
}
.db-emp-item:hover { background:rgba(100,100,100,0.1); }
.db-emp-item.disabled { opacity:0.38; cursor:not-allowed; }
.db-emp-item input[type="checkbox"] {
  accent-color:var(--brand-primary,#2563eb); width:15px; height:15px; cursor:pointer; flex-shrink:0;
}
.db-emp-item.disabled input[type="checkbox"] { cursor:not-allowed; }

/* KPI-Karten */
.db-kpi-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:14px; margin-bottom:24px; }
@media (max-width:900px) { .db-kpi-grid { grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); } }
.db-kpi-card {
  padding:20px; border-radius:14px; text-align:center;
  background:var(--glass-card-bg,rgba(255,255,255,0.82)); border:1px solid var(--surface-border,rgba(0,0,0,0.08));
  backdrop-filter:blur(12px); transition:transform 0.2s;
}
.db-kpi-card:hover { transform:translateY(-2px); }
.db-kpi-value { font-size:1.8rem; font-weight:800; color:var(--text-primary); line-height:1.2; }
.db-kpi-label { font-size:0.78rem; color:var(--text-muted); margin-top:4px; font-weight:500; display:inline-flex; align-items:center; gap:4px; justify-content:center; }
.db-kpi-info { font-size:0.7rem; cursor:help; opacity:0.5; transition:opacity 0.15s; }
.db-kpi-info:hover { opacity:1; }
.db-kpi-trend { font-size:0.72rem; font-weight:600; margin-top:6px; }
.db-kpi-trend.up   { color:#22c55e; }
.db-kpi-trend.down { color:#ef4444; }
.db-kpi-trend.neutral { color:var(--text-muted); }

/* Multi-Mitarbeiter KPI-Werte */
.db-kpi-emp-values { display:flex; flex-direction:column; gap:2px; align-items:center; }
.db-kpi-emp-row { display:flex; align-items:center; gap:6px; justify-content:center; }
.db-kpi-value-sm { font-size:1.2rem; font-weight:800; color:var(--text-primary); line-height:1.3; }
.db-emp-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; display:inline-block; }

/* Mitarbeiter-Filter-Bar (global, über KPIs) */
.db-emp-filter-bar {
  display:flex; align-items:center; gap:12px; margin-bottom:16px; flex-wrap:wrap;
}
.db-emp-legend { display:flex; gap:12px; flex-wrap:wrap; }
.db-emp-legend-item { display:flex; align-items:center; gap:5px; font-size:0.8rem; font-weight:600; color:var(--text-primary); }

/* Grid-Layout */
.db-grid { display:grid; gap:20px; margin-bottom:20px; min-width:0; }
.db-grid > * { min-width:0; }
.db-grid-2 { grid-template-columns:1fr 1fr; }
.db-grid-1 { grid-template-columns:1fr; }
@media(max-width:860px) { .db-grid-2 { grid-template-columns:1fr; } }

/* Karten */
.db-card {
  padding:24px; border-radius:14px; overflow:hidden;
  background:var(--glass-card-bg,rgba(255,255,255,0.82)); border:1px solid var(--surface-border,rgba(0,0,0,0.08));
  backdrop-filter:blur(12px);
}
.db-card-title { font-size:0.95rem; font-weight:700; color:var(--text-primary); margin-bottom:16px; display:flex; align-items:center; gap:8px; }
.db-card-title svg { opacity:0.6; flex-shrink:0; }

/* Chart-Container */
.db-chart-wrap { position:relative; width:100%; }
.db-chart-wrap.h300 { height:300px; }
.db-chart-wrap.h260 { height:260px; }
.db-chart-wrap.h220 { height:220px; }

/* Scrollbarer Chart-Container (Umsatz-Entwicklung) */
.db-chart-scroll { overflow-x:auto; overflow-y:hidden; max-width:100%; scrollbar-width:thin; scrollbar-color:var(--brand-primary,#2563eb) transparent; }
.db-chart-scroll::-webkit-scrollbar { height:6px; }
.db-chart-scroll::-webkit-scrollbar-track { background:transparent; }
.db-chart-scroll::-webkit-scrollbar-thumb { background:var(--brand-primary,#2563eb); border-radius:3px; opacity:0.5; }
.db-chart-scroll-inner { position:relative; min-width:100%; }
.db-chart-scroll-inner.h300 { height:300px; }

/* Mitarbeiter-Ranking */
.db-rank-row { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--surface-border-soft,rgba(0,0,0,0.05)); }
.db-rank-row:last-child { border-bottom:none; }
.db-rank-pos { width:28px; height:28px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:0.75rem; font-weight:700; flex-shrink:0; background:var(--surface-border,#e5e7eb); color:var(--text-primary); }
.db-rank-pos.gold { background:#fbbf24; color:#78350f; }
.db-rank-pos.silver { background:#d1d5db; color:#374151; }
.db-rank-pos.bronze { background:#f97316; color:#fff; }
.db-rank-name { flex:1; font-size:0.85rem; font-weight:600; color:var(--text-primary); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.db-rank-stats { display:flex; gap:12px; font-size:0.75rem; color:var(--text-muted); flex-shrink:0; }
.db-rank-bar-wrap { flex:1; min-width:80px; max-width:160px; height:8px; border-radius:4px; background:var(--surface-border-soft,rgba(0,0,0,0.06)); overflow:hidden; }
.db-rank-bar { height:100%; border-radius:4px; transition:width 1s ease; }

/* Aktivitäts-Heatmap */
.db-hm-cell { width:18px; height:18px; border-radius:3px; background:var(--surface-border-soft,rgba(0,0,0,0.06)); position:relative; cursor:default; transition:transform 0.12s; }
.db-hm-cell:hover { transform:scale(1.5); z-index:2; box-shadow:0 0 6px rgba(0,0,0,0.2); }

/* Toggle-Buttons */
.db-toggle { display:inline-flex; border:1px solid var(--surface-border); border-radius:6px; overflow:hidden; font-size:0.7rem; }
.db-toggle button { padding:3px 10px; border:none; background:transparent; color:var(--text-muted); cursor:pointer; font-weight:600; }
.db-toggle button.active { background:var(--brand-primary); color:#fff; }

/* Karte */
.db-map-wrap { height:450px; border-radius:12px; overflow:hidden; border:1px solid var(--surface-border); }
.db-map-info { font-size:0.78rem; color:var(--text-muted); margin-top:8px; }

/* Ladeleiste */
.db-loading-bar { height:3px; background:var(--surface-border); border-radius:2px; overflow:hidden; margin-top:8px; }
.db-loading-fill { height:100%; background:var(--brand-primary); transition:width 0.3s; border-radius:2px; }

/* Leerer Zustand */
.db-empty { text-align:center; padding:40px 20px; color:var(--text-muted); font-size:0.9rem; }


/* ═══════════════════════════════════════════════════════════════════════════
   23. MAP-OVERLAY (schwebendes Fenster für Dachansicht in arbeitsplatz.html)
   ═══════════════════════════════════════════════════════════════════════════ */

#mapOverlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.62);
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
/* backdrop-filter BEWUSST WEGGELASSEN – verursacht in Chrome/iframe Rendering-Bugs */
#mapOverlayDialog {
  position: relative;
  width: min(96vw, 1600px);
  height: 93vh;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.12);
  z-index: 100000;
}
[data-theme="dark"] #mapOverlayDialog,
[data-theme="blue"] #mapOverlayDialog,
[data-theme="green"] #mapOverlayDialog {
  background: #1e2535;
  border-color: rgba(255,255,255,0.1);
}
#mapOverlayHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--glass-card-bg, rgba(255,255,255,0.9));
  border-bottom: 1px solid rgba(0,0,0,0.08);
  flex-shrink: 0;
  gap: 8px;
  min-height: 44px;
}
#mapOverlayTitle {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
#mapOverlayClose {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #6b7280);
  transition: background 0.15s, color 0.15s;
}
#mapOverlayClose:hover {
  background: rgba(239,68,68,0.12);
  color: #ef4444;
}
#mapOverlayClose svg { display: block; }
#mapOverlayFrame {
  flex: 1;
  width: 100%;
  border: none;
  display: block;
}
[data-theme="dark"] #mapOverlayHeader,
[data-theme="blue"] #mapOverlayHeader,
[data-theme="green"] #mapOverlayHeader {
  border-bottom-color: rgba(255,255,255,0.08);
}

/* ═══════════════════════════════════════════════════════════════════════════
   21. PWA FULLSCREEN-MODUS  (display-mode: fullscreen)
   Wenn die App als PWA mit display:fullscreen läuft, ist der Status-Balken
   bereits vom OS ausgeblendet → Vollbild-Button wird nicht mehr benötigt.
   ═══════════════════════════════════════════════════════════════════════════ */

@media (display-mode: fullscreen) {
  #btnFullscreen { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   22. SAFE AREA – Edge-to-Edge für PWA (viewport-fit=cover)
   Ohne diese Regel würde der Header-Inhalt unter dem transparenten
   Status-Balken verschwinden. env(safe-area-inset-top) = Höhe des
   Status-Balkens (ca. 24–48px je nach Gerät).
   ═══════════════════════════════════════════════════════════════════════════ */

@supports (padding: env(safe-area-inset-top)) {
  .setup-header,
  .main-header {
    padding-top: max(14px, calc(env(safe-area-inset-top) + 4px));
  }
  #topbar {
    padding-top: max(0px, env(safe-area-inset-top));
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   NOTIZ KI-OPTIMIERUNG – Zweipanel-Ansicht (arbeitsplatz.html)
   ═══════════════════════════════════════════════════════════════════════════ */

.note-ki-panels {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px;
}
.note-ki-panel { display: flex; flex-direction: column; gap: 4px; }
.note-ki-panel-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted, #6b7280);
}
.note-ki-orig-text,
.note-ki-sugg-text {
  width: 100%; min-height: 120px; padding: 8px 10px;
  font-size: 0.82rem; line-height: 1.55; border-radius: 8px;
  border: 1px solid var(--glass-border, #e5e7eb);
  background: var(--glass-card-bg, #f9fafb);
  color: var(--text-primary, #111827);
  font-family: inherit; resize: vertical; box-sizing: border-box;
  transition: border-color 0.15s;
}
.note-ki-orig-text {
  background: rgba(0,0,0,0.03); color: var(--text-secondary, #374151); cursor: default;
}
[data-theme="dark"] .note-ki-orig-text,
[data-theme="blue"] .note-ki-orig-text,
[data-theme="green"] .note-ki-orig-text { background: rgba(255,255,255,0.04); }
.note-ki-sugg-text:focus {
  outline: none; border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

/* Ghost-Button für "Verwerfen" */
.note-action-btn-ghost {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 13px; font-size: 0.76rem; font-weight: 600;
  border-radius: 8px; border: 1px solid var(--glass-border, #e5e7eb);
  background: transparent; color: var(--text-secondary, #374151);
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
  white-space: nowrap; line-height: 1.4;
}
.note-action-btn-ghost:hover:not(:disabled) {
  background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.4); color: #dc2626;
}
.note-action-btn-ghost:disabled { opacity: 0.45; cursor: default; }

/* ═══════════════════════════════════════════════════════════════════════════
   NOTIZ SPRACHEINGABE (arbeitsplatz.html)
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes nrPulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.82); }
}

.note-action-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; font-size: 0.72rem; font-weight: 600;
  border-radius: 8px; border: none; cursor: pointer;
  white-space: nowrap; line-height: 1.4; position: relative;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,0.35), 0 0 0 0 rgba(14,165,233,0);
  transition: box-shadow 0.2s, transform 0.15s, background 0.2s;
}
.note-action-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8, #0284c7);
  box-shadow: 0 4px 16px rgba(37,99,235,0.55), 0 0 18px rgba(14,165,233,0.3);
  transform: translateY(-1px);
}
.note-action-btn:active:not(:disabled) { transform: translateY(0); box-shadow: 0 2px 8px rgba(37,99,235,0.35); }
.note-action-btn:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: none; }

/* Farbvarianten für Notiz-Buttons */
.note-action-btn-purple {
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  box-shadow: 0 2px 8px rgba(99,102,241,0.35), 0 0 0 0 rgba(99,102,241,0) !important;
}
.note-action-btn-purple:hover:not(:disabled) {
  background: linear-gradient(135deg, #4f46e5, #3730a3) !important;
  box-shadow: 0 4px 16px rgba(99,102,241,0.55), 0 0 18px rgba(99,102,241,0.3) !important;
}
.note-action-btn-teal {
  background: linear-gradient(135deg, #0d9488, #0891b2) !important;
  box-shadow: 0 2px 8px rgba(13,148,136,0.35), 0 0 0 0 rgba(8,145,178,0) !important;
}
.note-action-btn-teal:hover:not(:disabled) {
  background: linear-gradient(135deg, #0f766e, #0e7490) !important;
  box-shadow: 0 4px 16px rgba(13,148,136,0.55), 0 0 18px rgba(8,145,178,0.3) !important;
}
.note-action-btn-green {
  background: linear-gradient(135deg, #16a34a, #059669) !important;
  box-shadow: 0 2px 8px rgba(22,163,74,0.35), 0 0 0 0 rgba(5,150,105,0) !important;
}
.note-action-btn-green:hover:not(:disabled) {
  background: linear-gradient(135deg, #15803d, #047857) !important;
  box-shadow: 0 4px 16px rgba(22,163,74,0.55), 0 0 18px rgba(5,150,105,0.3) !important;
}

@media (pointer: coarse) {
  .note-action-btn,
  .note-action-btn-ghost {
    flex: 1;
    justify-content: center;
    padding: 9px 4px !important;
    font-size: .75rem !important;
    min-height: 44px;
  }
}

/* Recording-Zustand: Rot-Gradient */
.note-voice-btn.recording {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  box-shadow: 0 4px 14px rgba(239,68,68,0.5), 0 0 18px rgba(220,38,38,0.25) !important;
  color: #fff !important;
}

.note-rec-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444; animation: nrPulse 1s ease-in-out infinite; flex-shrink: 0;
}
.note-rec-timer {
  font-size: 0.72rem; font-weight: 600; font-family: ui-monospace, monospace;
  color: #dc2626; min-width: 2.5em; letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   23. PHONE CLICK-TO-CALL (arbeitsplatz.html)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Telefonnummer als klickbarer tel:-Link */
a.ws-phone-link {
  color: var(--brand-primary);
  text-decoration: none;
  white-space: nowrap;
}
a.ws-phone-link:hover {
  text-decoration: underline;
}

/* Copy-Icon-Button neben der Nummer */
.ws-phone-copy {
  display: inline-flex;
  align-items: center;
  padding: 2px 3px;
  border-radius: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0.45;
  transition: opacity 0.15s, background 0.15s;
  vertical-align: middle;
  margin-left: 3px;
  line-height: 1;
}
.ws-phone-copy:hover {
  opacity: 1;
  background: rgba(0,0,0,0.07);
}
[data-theme="dark"]  .ws-phone-copy:hover,
[data-theme="blue"]  .ws-phone-copy:hover,
[data-theme="green"] .ws-phone-copy:hover {
  background: rgba(255,255,255,0.1);
}

/* Toast-Meldung "Nummer kopiert" */
#wsPhoneToast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: #1f2937;
  color: #fff;
  padding: 8px 20px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
}
#wsPhoneToast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════════════
   24. MINI-DIALER OVERLAY (arbeitsplatz.html)
   ═══════════════════════════════════════════════════════════════════════════ */

#wsDialerPanel {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 272px;
  border-radius: 18px;
  background: var(--glass-card-bg);
  backdrop-filter: blur(20px);
  border: 1.5px solid var(--glass-border);
  box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.1);
  z-index: 8000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: dialerSlideIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes dialerSlideIn {
  from { opacity:0; transform: translateY(18px) scale(0.95); }
  to   { opacity:1; transform: translateY(0)   scale(1); }
}

/* Header-Leiste */
.ws-dialer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px 10px;
  background: linear-gradient(120deg, #1d4ed8, #3b82f6);
  color: #fff;
}
.ws-dialer-header-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex: 1;
}
.ws-dialer-close {
  background: rgba(255,255,255,0.18);
  border: none;
  border-radius: 50%;
  width: 22px; height: 22px;
  cursor: pointer;
  color: #fff;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  line-height: 1;
}
.ws-dialer-close:hover { background: rgba(255,255,255,0.32); }

/* Kontakt-Info */
.ws-dialer-contact {
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--glass-border);
  text-align: center;
}
.ws-dialer-contact-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.ws-dialer-contact-num {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Status-Zeile */
.ws-dialer-status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-height: 36px;
}
.ws-dialer-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.3s;
}
.ws-dialer-dot.green  { background: #22c55e; }
.ws-dialer-dot.red    { background: #ef4444; }
.ws-dialer-dot.amber  { background: #f59e0b; }
.ws-dialer-dot.grey   { background: #9ca3af; }
.ws-dialer-dot.pulse  {
  background: #3b82f6;
  animation: dialerDotPulse 1s ease-in-out infinite;
}
@keyframes dialerDotPulse {
  0%,100% { opacity:1; transform:scale(1);    }
  50%      { opacity:.5; transform:scale(1.4); }
}
#wsDialerStatusText {
  flex: 1;
  font-variant-numeric: tabular-nums;
}

/* Aktions-Buttons */
.ws-dialer-actions {
  display: flex;
  gap: 10px;
  padding: 10px 18px 16px;
}
.ws-dialer-btn {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 11px 0;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: filter 0.15s, transform 0.1s;
}
.ws-dialer-btn:active { transform: scale(0.97); }
.ws-dialer-btn:hover  { filter: brightness(1.08); }
.ws-dialer-btn.call {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
}
.ws-dialer-btn.end {
  background: linear-gradient(135deg, #b91c1c, #ef4444);
  color: #fff;
}
.ws-dialer-btn.fallback {
  background: var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.78rem;
}

/* Offline-Hinweis */
.ws-dialer-hint {
  padding: 0 18px 14px;
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.55;
  border-top: 1px solid var(--glass-border);
  padding-top: 10px;
}
.ws-dialer-hint a {
  color: var(--brand-primary);
  text-decoration: underline;
  cursor: pointer;
}

/* Server-URL Eingabe (Settings-Zeile) */
.ws-dialer-url-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.ws-dialer-url-input {
  flex: 1;
  background: rgba(0,0,0,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  outline: none;
}
[data-theme="dark"]  .ws-dialer-url-input,
[data-theme="blue"]  .ws-dialer-url-input,
[data-theme="green"] .ws-dialer-url-input {
  background: rgba(255,255,255,0.06);
}
.ws-dialer-url-save {
  background: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

/* ── Dialer: QR-Bereich & neue Elemente (V2) ─────────────────────────────── */

/* Panel etwas breiter für QR */
#wsDialerPanel { width: 300px; }

/* QR-Code Sektion */
.ws-dialer-qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--glass-border);
}
.ws-dialer-qr {
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  display: inline-block;
  line-height: 0;
  box-shadow: 0 1px 6px rgba(0,0,0,0.10);
}
/* canvas/img erzeugt von qrcode.js */
.ws-dialer-qr canvas,
.ws-dialer-qr img {
  display: block;
  border-radius: 4px;
}
.ws-dialer-qr-label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
  max-width: 210px;
}
.ws-dialer-qr-label svg { flex-shrink: 0; margin-top: 1px; opacity: 0.7; }

/* Server-Sektion (unter QR) */
.ws-dialer-server-section {
  padding: 10px 0 4px;
}

/* Trennlinie "oder Direkt-Anruf" */
.ws-dialer-sep {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px 8px;
}
.ws-dialer-sep-line {
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}
.ws-dialer-sep-text {
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

/* "Einrichten"-Link */
.ws-dialer-setup-row {
  padding: 2px 18px 8px;
}
.ws-dialer-setup-link {
  font-size: 0.75rem;
  color: var(--brand-primary);
  cursor: pointer;
  text-decoration: underline;
}

/* Info-Box mit Einrichtungsanleitung */
.ws-dialer-info-box {
  margin: 0 18px 12px;
  background: rgba(0,0,0,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
[data-theme="dark"]  .ws-dialer-info-box,
[data-theme="blue"]  .ws-dialer-info-box,
[data-theme="green"] .ws-dialer-info-box {
  background: rgba(255,255,255,0.05);
}
.ws-dialer-info-box a {
  color: var(--brand-primary);
  text-decoration: underline;
}
.ws-dialer-info-box code {
  background: rgba(0,0,0,0.07);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.7rem;
  font-family: monospace;
}
[data-theme="dark"]  .ws-dialer-info-box code,
[data-theme="blue"]  .ws-dialer-info-box code,
[data-theme="green"] .ws-dialer-info-box code {
  background: rgba(255,255,255,0.1);
}

/* Aktions-Buttons kompakter */
.ws-dialer-actions { padding: 0 18px 8px; }

/* tel: Zeile (3. Option im Dialer) */
.ws-dialer-tel-row {
  text-align: center;
  padding: 4px 18px 14px;
  border-top: 1px solid var(--glass-border);
  margin-top: 4px;
}
.ws-dialer-tel-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.73rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.ws-dialer-tel-link:hover {
  color: var(--brand-primary);
}

/* Aktions-Buttons zentriert */
.ws-dialer-actions {
  display: flex;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TERMINE TAB – Kalenderansicht (arbeitsplatz.html)
   ═══════════════════════════════════════════════════════════════════════════ */

#apTermineWrap { display:flex; flex-direction:column; flex:1; overflow:hidden; }

#apWeekNav {
  display: flex; gap: 5px; padding: 8px 10px; flex-shrink: 0;
  flex-wrap: wrap; align-items: center;
  border-bottom: 1px solid var(--glass-card-border, rgba(209,213,219,0.45));
  background: var(--glass-filterbar-bg, rgba(248,250,252,0.9));
}
.ap-week-btn {
  padding: 5px 11px; font-size: 0.76rem; font-weight: 600; border-radius: 7px;
  border: 1px solid var(--glass-border, #e5e7eb);
  background: var(--glass-card-bg, #f9fafb); color: var(--text-secondary, #374151);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.ap-week-btn:hover { background: rgba(37,99,235,0.07); border-color: rgba(37,99,235,0.3); color: var(--brand-primary); }
.ap-week-btn.active {
  background: linear-gradient(135deg,#2563eb,#0ea5e9); color:#fff; border-color:#2563eb;
  box-shadow: 0 2px 8px rgba(37,99,235,0.35);
}
#apWeekSel {
  padding: 5px 8px; font-size: 0.76rem; border-radius: 7px;
  border: 1px solid var(--glass-border, #e5e7eb);
  background: var(--glass-card-bg, #f9fafb); color: var(--text-secondary);
  cursor: pointer; font-family: inherit;
}
.ap-cal-status { font-size: 0.75rem; color: var(--text-muted); margin-left: 4px; }

#apCalGrid {
  flex: 1; overflow-y: auto; padding: 8px 8px 10px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 0.62fr 0.52fr;
  gap: 5px;
  align-content: start;
}
[data-theme="dark"] #apCalGrid,
[data-theme="blue"] #apCalGrid,
[data-theme="green"] #apCalGrid { background: transparent; }

.ap-cal-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.ap-cal-col-hdr {
  font-size: 0.72rem; font-weight: 700; text-align: center;
  padding: 5px 3px; border-radius: 7px;
  background: var(--glass-card-bg, rgba(255,255,255,0.7));
  border: 1px solid var(--glass-card-border, rgba(209,213,219,0.5));
  color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ap-cal-col-hdr.today {
  background: linear-gradient(135deg,#2563eb,#0ea5e9); color: #fff; border-color: #2563eb;
}

.ap-cal-event {
  border-radius: 7px; padding: 5px 6px; font-size: 0.72rem;
  border: 1px solid transparent; line-height: 1.35; min-width: 0; overflow: hidden;
}
.ap-cal-event.vot {
  background: linear-gradient(135deg,rgba(37,99,235,0.12),rgba(14,165,233,0.08));
  border-color: rgba(37,99,235,0.25); color: var(--text-primary);
  cursor: pointer; transition: box-shadow 0.15s, transform 0.12s;
}
.ap-cal-event.vot:hover {
  box-shadow: 0 3px 10px rgba(37,99,235,0.25); transform: translateY(-1px);
}
.ap-cal-event.vot.selected {
  background: linear-gradient(135deg,rgba(37,99,235,0.25),rgba(14,165,233,0.18));
  border-color: rgba(37,99,235,0.55);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.3);
}
.ap-cal-event.priv {
  background: rgba(107,114,128,0.07); border-color: rgba(107,114,128,0.18);
  color: var(--text-muted);
}
.ap-cal-allday.vot {
  background: rgba(37,99,235,0.08); border-color: rgba(37,99,235,0.2);
  border-left: 3px solid #2563eb;
}
.ap-cal-allday.priv {
  background: rgba(107,114,128,0.05); border-left: 3px solid rgba(107,114,128,0.3);
}
.ap-cal-ev-title {
  font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 3px;
}
.ap-cal-ev-time { font-size: 0.68rem; opacity: 0.75; margin-top: 1px; }
.ap-cal-priv-badge {
  font-size: 0.6rem; font-weight: 700; padding: 0 4px; border-radius: 3px;
  background: rgba(107,114,128,0.15); color: var(--text-muted); flex-shrink: 0;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.ap-cal-empty { min-height: 30px; }

/* ═══════════════════════════════════════════════════════════════════════════
   EMAIL EINGANG TAB (arbeitsplatz.html)
   ═══════════════════════════════════════════════════════════════════════════ */

#apMailWrap { display:flex; flex-direction:column; flex:1; overflow:hidden; }
#apMailFilterBar {
  display:flex; gap:5px; padding:8px 10px; flex-shrink:0; flex-wrap:wrap;
  border-bottom:1px solid var(--glass-card-border,rgba(209,213,219,0.45));
  background:var(--glass-filterbar-bg,rgba(248,250,252,0.9));
  align-items:center;
}
.ap-mail-filter-btn {
  padding:5px 10px; font-size:0.75rem; font-weight:600; border-radius:7px;
  border:1px solid var(--glass-border,#e5e7eb);
  background:var(--glass-card-bg,#f9fafb); color:var(--text-secondary,#374151);
  cursor:pointer; transition:all 0.15s; white-space:nowrap;
}
.ap-mail-filter-btn:hover { background:rgba(37,99,235,0.07); border-color:rgba(37,99,235,0.3); color:var(--brand-primary); }
.ap-mail-filter-btn.active {
  background:linear-gradient(135deg,#2563eb,#0ea5e9); color:#fff; border-color:#2563eb;
  box-shadow:0 2px 8px rgba(37,99,235,0.35);
}
#apMailLayout {
  flex:1; display:grid; grid-template-columns:220px 260px 1fr; overflow:hidden;
}
.ap-mail-col {
  display:flex; flex-direction:column; overflow:hidden;
  border-right:1px solid var(--glass-card-border,rgba(209,213,219,0.45));
}
.ap-mail-col:last-child { border-right:none; }
.ap-mail-col-hdr {
  font-size:0.72rem; font-weight:700; text-transform:uppercase; letter-spacing:0.05em;
  color:var(--text-muted,#6b7280); padding:7px 10px 5px; flex-shrink:0;
  border-bottom:1px solid var(--glass-card-border,rgba(209,213,219,0.45));
  background:var(--glass-header-bg,rgba(248,250,252,0.8));
}
.ap-mail-col-body { flex:1; overflow-y:auto; }
.ap-mail-status { font-size:0.78rem; color:var(--text-muted); padding:12px 10px; }
.ap-mail-cust-item {
  padding:8px 10px; cursor:pointer; border-bottom:1px solid var(--glass-card-border,rgba(209,213,219,0.3));
  transition:background 0.12s;
}
.ap-mail-cust-item:hover { background:rgba(37,99,235,0.06); }
.ap-mail-cust-item.active { background:rgba(37,99,235,0.1); border-left:3px solid #2563eb; }
.ap-mail-cust-name { font-size:0.82rem; font-weight:600; color:var(--text-primary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ap-mail-cust-sub  { font-size:0.72rem; color:var(--text-muted); margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ap-mail-cust-date { font-size:0.68rem; color:var(--text-muted); float:right; }
.ap-mail-unread-dot { display:inline-block; width:7px; height:7px; border-radius:50%; background:#2563eb; margin-right:4px; flex-shrink:0; }
.ap-mail-dir-badge {
  display:inline-flex; align-items:center; justify-content:center;
  width:16px; height:16px; border-radius:50%; font-size:0.65rem; font-weight:700;
  flex-shrink:0; margin-right:3px;
}
.ap-mail-dir-badge.sent     { background:rgba(16,185,129,0.15); color:#059669; }
.ap-mail-dir-badge.received { background:rgba(37,99,235,0.15);  color:#2563eb; }
.ap-mail-msg-item {
  padding:8px 10px; cursor:pointer; border-bottom:1px solid var(--glass-card-border,rgba(209,213,219,0.3));
  transition:background 0.12s;
}
.ap-mail-msg-item:hover   { background:rgba(37,99,235,0.06); }
.ap-mail-msg-item.active  { background:rgba(37,99,235,0.1); border-left:3px solid #2563eb; }
.ap-mail-msg-subj { font-size:0.8rem; font-weight:600; color:var(--text-primary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ap-mail-msg-subj.unread  { color:#2563eb; }
.ap-mail-msg-meta { font-size:0.7rem; color:var(--text-muted); margin-top:2px; display:flex; gap:6px; }
.ap-mail-body-wrap { flex:1; overflow:hidden; display:flex; flex-direction:column; padding:10px; }
.ap-mail-body-hdr  { font-size:0.78rem; color:var(--text-secondary); margin-bottom:6px; flex-shrink:0; }
.ap-mail-body-hdr strong { color:var(--text-primary); }
.ap-mail-body-content { flex:1; overflow:hidden; border-radius:8px; border:1px solid var(--glass-card-border,rgba(209,213,219,0.45)); background:#fff; }
.ap-mail-body-content iframe { width:100%; height:100%; border:none; }
.ap-mail-body-plain { width:100%; height:100%; overflow-y:auto; padding:10px; font-size:0.8rem; line-height:1.6; color:var(--text-primary); white-space:pre-wrap; word-break:break-word; background:#fff; border-radius:8px; box-sizing:border-box; }
[data-theme="dark"]  .ap-mail-body-content, [data-theme="dark"]  .ap-mail-body-plain,
[data-theme="blue"]  .ap-mail-body-content, [data-theme="blue"]  .ap-mail-body-plain,
[data-theme="green"] .ap-mail-body-content, [data-theme="green"] .ap-mail-body-plain { background:var(--glass-card-bg); }
.ap-mail-placeholder { display:flex; align-items:center; justify-content:center; height:100%; color:var(--text-muted); font-size:0.82rem; opacity:0.5; }

/* ═══════════════════════════════════════════════════════════════════════════
   KANBAN TAB (arbeitsplatz.html)
   ═══════════════════════════════════════════════════════════════════════════ */

#apKbWrap  { display:flex; flex-direction:column; flex:1; overflow:hidden; }
#apKbBoard {
  display:flex; flex-direction:row; gap:10px;
  padding:12px 12px 0 12px; flex:1; overflow-x:auto; overflow-y:hidden;
  align-items:flex-start;
  scrollbar-width:auto;
  scrollbar-color: rgba(37,99,235,0.6) rgba(0,0,0,0.08);
}
#apKbBoard::-webkit-scrollbar         { height:14px; }
#apKbBoard::-webkit-scrollbar-track   { background:rgba(0,0,0,0.08); border-radius:7px; }
#apKbBoard::-webkit-scrollbar-thumb   { background:rgba(37,99,235,0.55); border-radius:7px; border:3px solid transparent; background-clip:content-box; min-width:40px; }
#apKbBoard::-webkit-scrollbar-thumb:hover { background:rgba(37,99,235,0.85); border:3px solid transparent; background-clip:content-box; }
#apKbBoard::-webkit-scrollbar-corner  { background:transparent; }

.ap-kb-col {
  width: 220px; flex-shrink:0;
  display:flex; flex-direction:column; max-height:100%;
  background:var(--glass-card-bg,rgba(255,255,255,0.75));
  border:1px solid var(--glass-card-border,rgba(209,213,219,0.55));
  border-radius:10px; overflow:hidden;
  box-shadow:0 1px 4px rgba(0,0,0,0.06);
}
.ap-kb-col-hdr {
  display:flex; align-items:center; gap:5px; padding:8px 10px;
  background:var(--glass-header-bg,rgba(248,250,252,0.9));
  border-bottom:1px solid var(--glass-card-border,rgba(209,213,219,0.45));
  flex-shrink:0; cursor:grab; user-select:none;
}
.ap-kb-col-hdr:active { cursor:grabbing; }
.ap-kb-col-drag-handle { color:var(--text-muted); font-size:.85rem; flex-shrink:0; cursor:grab; }
.ap-kb-col.ap-kb-drag-col-over  { outline:2px dashed #2563eb; outline-offset:-2px; background:rgba(37,99,235,0.04); }
.ap-kb-col.ap-kb-drag-card-over { outline:2px dashed #10b981; outline-offset:-2px; background:rgba(16,185,129,0.04); }
.ap-kb-col-title {
  flex:1; font-size:0.76rem; font-weight:700; color:var(--text-primary);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.ap-kb-col-count {
  font-size:0.68rem; font-weight:700; background:rgba(37,99,235,0.12);
  color:#2563eb; border-radius:10px; padding:1px 6px; flex-shrink:0;
}
.ap-kb-col-remove {
  background:none; border:none; cursor:pointer; color:var(--text-muted);
  font-size:1rem; line-height:1; padding:0 2px; flex-shrink:0; transition:color 0.12s;
}
.ap-kb-col-remove:hover { color:#ef4444; }
.ap-kb-col-body { flex:1; overflow-y:auto; padding:6px; display:flex; flex-direction:column; gap:5px; }
.ap-kb-col-body::-webkit-scrollbar        { width:3px; }
.ap-kb-col-body::-webkit-scrollbar-track  { background:transparent; }
.ap-kb-col-body::-webkit-scrollbar-thumb  { background:rgba(99,102,241,0.2); border-radius:2px; border:none; }
.ap-kb-col-body { scrollbar-width:thin; scrollbar-color:rgba(99,102,241,0.2) transparent; }

.ap-kb-card {
  background:var(--glass-card-bg,#fff); border:1px solid var(--glass-card-border,rgba(209,213,219,0.5));
  border-radius:7px; padding:7px 9px; cursor:grab; transition:all 0.14s;
  box-shadow:0 1px 3px rgba(0,0,0,0.05);
}
.ap-kb-card:active { cursor:grabbing; }
.ap-kb-card:hover { border-color:rgba(37,99,235,0.4); box-shadow:0 2px 8px rgba(37,99,235,0.15); transform:translateY(-1px); }
.ap-kb-card.selected { border-color:#2563eb; box-shadow:0 0 0 2px rgba(37,99,235,0.25); background:rgba(37,99,235,0.04); }
.ap-kb-card-name    { font-size:0.8rem; font-weight:600; color:var(--text-primary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ap-kb-card-contact { font-size:0.7rem; color:var(--text-muted); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ap-kb-empty { font-size:0.72rem; color:var(--text-muted); text-align:center; padding:12px 6px; opacity:0.6; }
.ap-kb-loading { font-size:0.82rem; color:var(--text-muted); padding:20px; }

.ap-kb-add-col {
  flex-shrink:0; display:flex; align-items:flex-start; padding-top:4px;
}
.ap-kb-add-btn {
  width:40px; height:40px; border-radius:50%; border:2px dashed var(--glass-border,rgba(209,213,219,0.7));
  background:transparent; color:var(--text-muted); font-size:1.4rem; font-weight:300;
  cursor:pointer; transition:all 0.15s; display:flex; align-items:center; justify-content:center; line-height:1;
}
.ap-kb-add-btn:hover { border-color:#2563eb; color:#2563eb; background:rgba(37,99,235,0.06); transform:scale(1.08); }

/* Bereits genutzte Status-Einträge im Add-Popdown ausgegraut */
.sfp-item-used { opacity:0.35; cursor:default !important; }
.sfp-item-used:hover { background:transparent !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   AUSWAHL-MANAGER (arbeitsplatz.html)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Auswahl-Popdown: immer opak, keine Transparenz */
#apSelPopdown                { background: #ffffff; }
[data-theme="dark"]  #apSelPopdown { background: #1e2130; border-color: rgba(255,255,255,0.12); }
[data-theme="blue"]  #apSelPopdown { background: #0e1628; border-color: rgba(147,197,253,0.2); }
[data-theme="green"] #apSelPopdown { background: #0e1a0e; border-color: rgba(52,211,153,0.2); }

.card-hl-general  { box-shadow: 0 0 0 2px #6b7280, 0 0 12px rgba(107,114,128,0.4) !important; }
.card-hl-massmail { box-shadow: 0 0 0 2px #8b5cf6, 0 0 14px rgba(139,92,246,0.45) !important; }
.card-hl-terminplan { box-shadow: 0 0 0 2px #10b981, 0 0 14px rgba(16,185,129,0.45) !important; }
.card-hl-telefon  { box-shadow: 0 0 0 2px #0ea5e9, 0 0 14px rgba(14,165,233,0.45) !important; }

/* Mehrere Kategorien gleichzeitig: erste Farbe dominiert (alle sichtbar durch kombinierte Schatten) */
.card-hl-general.card-hl-massmail   { box-shadow: 0 0 0 2px #8b5cf6, 0 0 0 4px #6b7280, 0 0 14px rgba(139,92,246,0.35) !important; }
.card-hl-general.card-hl-terminplan { box-shadow: 0 0 0 2px #10b981, 0 0 0 4px #6b7280, 0 0 14px rgba(16,185,129,0.35) !important; }
.card-hl-general.card-hl-telefon    { box-shadow: 0 0 0 2px #0ea5e9, 0 0 0 4px #6b7280, 0 0 14px rgba(14,165,233,0.35) !important; }
