/* ===================================================================
   FBA Command Center — Dashboard CSS v6.0
   Design: Steve (CDO) — Inspired by Wise.com Design System
   Palette: Dark=#121511, Light=#FFFFFF, Accent=#9FE870 bright-green
   Typography: Inter, system-ui fallback
   Philosophy: Clean-first, generous radius, bright-green accent,
               no glow/glassmorphism, trust through clarity
   v6: Wise.com palette, large radius (16-30px), forest-green interactives,
       bright-green CTAs, clean shadows, no glass effects
   =================================================================== */

/* -- Design Tokens -------------------------------------------------- */
:root {
  /* Backgrounds — Apple-inspired Dark (deep, clean separation) */
  --q-bg: #000000;
  --q-surface: #1c1c1e;
  --q-surface2: #2c2c2e;
  --q-surface3: #3a3a3c;
  --q-surface-glass: rgba(28, 28, 30, 0.88);

  /* Borders — Apple uses subtle but visible borders */
  --q-border: rgba(255,255,255,0.1);
  --q-border-hover: rgba(255,255,255,0.2);
  --q-border-active: rgba(159,232,112,0.5);

  /* Text — Apple contrast hierarchy: white > gray > dark gray */
  --q-text: #f5f5f7;
  --q-text2: #a1a1a6;
  --q-text3: #8e8e93;

  /* Brand Colors — Wise Bright Green + Forest Green */
  --q-cyan: #9FE870;
  --q-cyan-dim: rgba(159,232,112,0.08);
  --q-cyan-glow: rgba(159,232,112,0.2);
  --q-emerald: #9FE870;
  --q-emerald-dim: rgba(159,232,112,0.08);
  --q-emerald-glow: rgba(159,232,112,0.2);
  --q-forest: #163300;

  /* Semantic Colors */
  --q-green: #9FE870;
  --q-green-dim: rgba(159,232,112,0.1);
  --q-red: #ef4444;
  --q-red-dim: rgba(239,68,68,0.1);
  --q-red-glow: rgba(239,68,68,0.2);
  --q-orange: #FFC091;
  --q-orange-dim: rgba(255,192,145,0.12);
  --q-yellow: #FFEB69;
  --q-yellow-dim: rgba(255,235,105,0.12);
  --q-purple: #a855f7;
  --q-purple-dim: rgba(168,85,247,0.1);
  --q-blue: #A0E1E1;
  --q-blue-dim: rgba(160,225,225,0.1);
  --q-gray: #6b7280;
  --q-gray-dim: rgba(107,114,128,0.1);

  /* Layout — Wise uses generous radius */
  --sidebar-w: 224px;
  --ticker-h: 34px;
  --footer-h: 48px;
  --radius: 16px;
  --radius-lg: 20px;
  --radius-xl: 30px;

  /* Shadows & Effects — Apple: subtle elevation, no glow */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-card: 0 2px 10px rgba(0,0,0,0.4);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.5);
  --shadow-glow-red: 0 0 12px rgba(239,68,68,0.12);
  --shadow-glow-emerald: 0 0 12px rgba(159,232,112,0.12);
  --glass-blur: blur(12px);
  --glass-saturate: saturate(1.2);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.2s;
  --duration-slow: 0.4s;
}

/* -- Light Mode Override — Wise Light -------------------------------- */
[data-theme="light"] {
  /* Backgrounds — Wise clean white */
  --q-bg: #F2F5F0;
  --q-surface: #ffffff;
  --q-surface2: #E8EDE5;
  --q-surface3: #D9E0D5;
  --q-surface-glass: rgba(255, 255, 255, 0.88);

  /* Borders — subtle green tint */
  --q-border: rgba(22,51,0,0.08);
  --q-border-hover: rgba(22,51,0,0.15);
  --q-border-active: rgba(22,51,0,0.35);

  /* Text — Wise content colors */
  --q-text: #0E0F0C;
  --q-text2: #454745;
  --q-text3: #525452;

  /* Brand — Forest Green for light mode (better contrast) */
  --q-cyan: #163300;
  --q-cyan-dim: rgba(22,51,0,0.06);
  --q-cyan-glow: rgba(22,51,0,0.12);
  --q-emerald: #163300;
  --q-emerald-dim: rgba(22,51,0,0.06);
  --q-emerald-glow: rgba(22,51,0,0.12);

  /* WCAG AA Kontrast-Fixes fuer Light-Theme */
  --q-orange: #b45309;
  --q-yellow: #92400e;
  --q-red: #b91c1c;
  --q-green: #166534;

  /* Dim-Farben */
  --q-green-dim: rgba(47,87,17,0.1);
  --q-red-dim: rgba(168,32,13,0.08);
  --q-red-glow: rgba(168,32,13,0.12);
  --q-orange-dim: rgba(255,192,145,0.2);
  --q-yellow-dim: rgba(237,200,67,0.15);
  --q-purple-dim: rgba(168,85,247,0.08);
  --q-blue-dim: rgba(160,225,225,0.15);
  --q-gray-dim: rgba(107,114,128,0.08);

  /* Shadows — Wise clean shadows */
  --shadow-sm: 0 1px 2px rgba(14,15,12,0.05);
  --shadow-card: 0 2px 8px rgba(14,15,12,0.06);
  --shadow-hover: 0 4px 16px rgba(14,15,12,0.1);
  --shadow-glow-red: 0 0 8px rgba(168,32,13,0.08);
  --shadow-glow-emerald: 0 0 8px rgba(22,51,0,0.08);
}

/* -- Theme: Midnight Blue (Refine-inspired) ------------------------- */
[data-theme="midnight"] {
  --q-bg: #0f1117;
  --q-surface: #161923;
  --q-surface2: #1e2130;
  --q-surface3: #282c3e;
  --q-surface-glass: rgba(22, 25, 35, 0.85);
  --q-border: rgba(99,102,241,0.08);
  --q-border-hover: rgba(99,102,241,0.18);
  --q-border-active: rgba(99,102,241,0.45);
  --q-text: #e2e8f0;
  --q-text2: #8892b0;
  --q-text3: #5a6178;
  --q-cyan: #6366f1;
  --q-cyan-dim: rgba(99,102,241,0.08);
  --q-cyan-glow: rgba(99,102,241,0.2);
  --q-emerald: #6366f1;
  --q-emerald-dim: rgba(99,102,241,0.08);
  --q-emerald-glow: rgba(99,102,241,0.2);
  --q-green: #22c55e;
  --q-blue: #6366f1;
  --q-blue-dim: rgba(99,102,241,0.12);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.4);
}

/* -- Theme: Sunset (warm tones) ------------------------------------- */
[data-theme="sunset"] {
  --q-bg: #1a1210;
  --q-surface: #231a16;
  --q-surface2: #2e2320;
  --q-surface3: #3a2e2a;
  --q-surface-glass: rgba(35, 26, 22, 0.85);
  --q-border: rgba(251,146,60,0.1);
  --q-border-hover: rgba(251,146,60,0.2);
  --q-border-active: rgba(251,146,60,0.4);
  --q-text: #f5e6d3;
  --q-text2: #a89080;
  --q-text3: #6e5a4e;
  --q-cyan: #fb923c;
  --q-cyan-dim: rgba(251,146,60,0.08);
  --q-cyan-glow: rgba(251,146,60,0.2);
  --q-emerald: #fb923c;
  --q-emerald-dim: rgba(251,146,60,0.08);
  --q-emerald-glow: rgba(251,146,60,0.2);
  --q-green: #4ade80;
  --q-orange: #fb923c;
  --q-orange-dim: rgba(251,146,60,0.12);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.3);
}

/* -- Theme: Nord (Arctic blue-gray) --------------------------------- */
[data-theme="nord"] {
  --q-bg: #2e3440;
  --q-surface: #3b4252;
  --q-surface2: #434c5e;
  --q-surface3: #4c566a;
  --q-surface-glass: rgba(59, 66, 82, 0.85);
  --q-border: rgba(136,192,208,0.1);
  --q-border-hover: rgba(136,192,208,0.2);
  --q-border-active: rgba(136,192,208,0.4);
  --q-text: #eceff4;
  --q-text2: #a3be8c;
  --q-text3: #7b8da0;
  --q-cyan: #88c0d0;
  --q-cyan-dim: rgba(136,192,208,0.08);
  --q-cyan-glow: rgba(136,192,208,0.2);
  --q-emerald: #88c0d0;
  --q-emerald-dim: rgba(136,192,208,0.08);
  --q-emerald-glow: rgba(136,192,208,0.2);
  --q-green: #a3be8c;
  --q-red: #bf616a;
  --q-orange: #d08770;
  --q-yellow: #ebcb8b;
  --q-purple: #b48ead;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.2);
}

/* -- Theme: Cyberpunk (Neon on dark) -------------------------------- */
[data-theme="cyberpunk"] {
  --q-bg: #0a0a12;
  --q-surface: #12121e;
  --q-surface2: #1a1a2e;
  --q-surface3: #24243e;
  --q-surface-glass: rgba(18, 18, 30, 0.85);
  --q-border: rgba(236,72,153,0.1);
  --q-border-hover: rgba(236,72,153,0.2);
  --q-border-active: rgba(236,72,153,0.5);
  --q-text: #f0e6ff;
  --q-text2: #9088a8;
  --q-text3: #5a5278;
  --q-cyan: #ec4899;
  --q-cyan-dim: rgba(236,72,153,0.08);
  --q-cyan-glow: rgba(236,72,153,0.3);
  --q-emerald: #06b6d4;
  --q-emerald-dim: rgba(6,182,212,0.08);
  --q-emerald-glow: rgba(6,182,212,0.3);
  --q-green: #06b6d4;
  --q-green-dim: rgba(6,182,212,0.1);
  --q-blue: #ec4899;
  --q-purple: #a855f7;
  --shadow-card: 0 2px 12px rgba(236,72,153,0.06);
  --shadow-hover: 0 8px 24px rgba(236,72,153,0.12);
  --shadow-glow-emerald: 0 0 20px rgba(6,182,212,0.15);
}

/* -- Theme Transition (targeted, not wildcard) ---------------------- */
body,
.sidebar,
.main,
.card,
.card-glass,
.ampel-zone,
.kpi-card,
.table-wrap,
.q-table thead th,
.q-table tbody tr,
.input,
select.input,
.marketplace-select,
.btn-secondary,
.btn-icon,
.tag,
.tab,
.ticker-bar,
.quick-actions-footer,
.qa-btn,
.toast,
.dash-header,
.reimburse-banner,
.bulk-bar,
.action-card,
.report-cat-card,
.settings-row,
.alert-bar,
.aging-bucket,
.swot-cell,
.pain-item,
.q-modal-overlay,
.q-modal,
.hamburger,
.back-link,
.nav-item,
.write-guard,
.health-indicator,
.badge,
.loading-wrap,
.empty-state,
.listing-thumb,
.listing-thumb-empty,
.img-main-wrap,
.carousel-main-wrap,
.carousel-arrow,
.carousel-dot,
.carousel-zoom-hint,
.img-thumb,
.range-selector,
.range-btn,
h1, h2, h3, h4,
.theme-toggle {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* -- Theme Toggle Button -------------------------------------------- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--q-border);
  background: var(--q-surface2);
  color: var(--q-text2);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.theme-toggle:hover {
  color: var(--q-emerald);
  border-color: var(--q-emerald);
  background: var(--q-emerald-dim);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}
.theme-toggle:hover svg {
  transform: rotate(20deg);
}

/* -- Theme Menu Dropdown -- */
.theme-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1000;
  min-width: 180px;
  background: var(--q-surface);
  border: 1px solid var(--q-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 6px;
  margin-top: 4px;
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--q-text);
  cursor: pointer;
  transition: background 0.15s;
}
.theme-option:hover {
  background: var(--q-surface2);
}
.theme-option.active {
  background: var(--q-emerald-dim);
  color: var(--q-emerald);
  font-weight: 600;
}

/* Light mode scrollbar */
[data-theme="light"] ::-webkit-scrollbar-thumb { background: var(--q-surface3); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: var(--q-text3); }

/* Light mode table row stripes */
[data-theme="light"] .q-table tbody tr:nth-child(even) { background: rgba(0,0,0,0.02); }
[data-theme="light"] .q-table tbody tr:hover { background: rgba(16,185,129,0.06); }

/* Light mode inline edit hover */
[data-theme="light"] td.iec:hover {
  background: rgba(16,185,129,0.08);
  outline-color: rgba(16,185,129,0.5);
}

/* Light mode sidebar overlay */
[data-theme="light"] .sidebar-overlay { background: rgba(0,0,0,0.35); }

/* Light mode toast shadow */
[data-theme="light"] .toast { box-shadow: 0 4px 20px rgba(0,0,0,0.15); }

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--q-bg);
  color: var(--q-text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

code, pre, .mono {
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', monospace;
  font-size: 0.875em;
}

a { color: inherit; text-decoration: none; }

/* -- Scrollbar ------------------------------------------------------ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--q-surface3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--q-text3); }

/* ===================================================================
   SIDEBAR
   =================================================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--q-surface);
  border-right: 1px solid var(--q-border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--duration) var(--ease);
}

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

.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { flex-shrink: 0; }
.brand-text { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }
.accent { color: var(--q-emerald); }

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--q-text2);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all var(--duration) var(--ease);
}
.sidebar-close:hover { color: var(--q-text); background: var(--q-surface2); }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-divider {
  margin: 6px 12px;
  border-top: 1px solid var(--q-border);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--q-text2);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  position: relative;
}
.nav-item:hover { color: var(--q-text); background: var(--q-surface2); }
.nav-item.active {
  color: var(--q-emerald);
  background: var(--q-emerald-dim);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--q-emerald);
  border-radius: 0 2px 2px 0;
}
.nav-item svg { flex-shrink: 0; opacity: 0.6; transition: opacity var(--duration); }
.nav-item:hover svg { opacity: 0.85; }
.nav-item.active svg { opacity: 1; stroke: var(--q-emerald); }

.nav-badge {
  margin-left: auto;
  background: var(--q-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--q-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.write-guard {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--q-orange);
  padding: 6px 10px;
  background: var(--q-orange-dim);
  border-radius: var(--radius);
  border: 1px solid rgba(245,158,11,0.3);
  cursor: help;
  position: relative;
}
.write-guard svg { width: 16px; height: 16px; }
.write-guard::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--q-surface2);
  color: var(--q-text);
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  box-shadow: var(--shadow-card);
  z-index: 100;
}
.write-guard:hover::after { opacity: 1; }
.write-guard.active-rw {
  color: var(--q-green);
  background: var(--q-green-dim);
  border-color: rgba(159,232,112,0.3);
}
/* Light mode: starker Kontrast fuer Write-Guard */
[data-theme="light"] .write-guard {
  color: #92400e;
  background: rgba(245,158,11,0.15);
  border-color: rgba(245,158,11,0.4);
}
[data-theme="light"] .write-guard.active-rw {
  color: #166534;
  background: rgba(22,101,52,0.12);
  border-color: rgba(22,101,52,0.3);
}

.health-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--q-text2);
}

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--q-gray);
  flex-shrink: 0;
  transition: all var(--duration);
}
.health-dot.green { background: var(--q-green); box-shadow: 0 0 8px rgba(34,197,94,0.5); }
.health-dot.yellow { background: var(--q-yellow); box-shadow: 0 0 8px rgba(234,179,8,0.5); }
.health-dot.red { background: var(--q-red); box-shadow: 0 0 8px rgba(239,68,68,0.5); }

/* -- Hamburger (mobile) --------------------------------------------- */
.hamburger {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 150;
  background: var(--q-surface);
  border: 1px solid var(--q-border);
  border-radius: var(--radius);
  color: var(--q-text);
  padding: 8px;
  cursor: pointer;
  transition: background var(--duration);
}
.hamburger:hover { background: var(--q-surface2); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 190;
}

/* ===================================================================
   DASHBOARD HEADER BAR (glassmorphism)
   =================================================================== */
.dash-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background: var(--q-surface-glass);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
  border: 1px solid var(--q-border);
  border-radius: var(--radius-xl);
  margin-bottom: 20px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.dash-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(16,185,129,0.03) 0%, transparent 50%, rgba(0,229,255,0.02) 100%);
  pointer-events: none;
}

.dash-header-gauge {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.dash-header-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  z-index: 1;
}

.dash-header-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.dash-header-label {
  font-size: 10px;
  color: var(--q-text2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.dash-header-sep {
  width: 1px;
  height: 40px;
  background: var(--q-border);
  flex-shrink: 0;
}

.dash-header-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* Marketplace dropdown */
.marketplace-select {
  background: var(--q-surface2);
  border: 1px solid var(--q-border);
  border-radius: var(--radius);
  padding: 6px 28px 6px 10px;
  color: var(--q-text);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7a92' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color var(--duration);
  outline: none;
}
.marketplace-select:focus { border-color: var(--q-emerald); }
.marketplace-select:focus-visible { box-shadow: 0 0 0 3px var(--q-emerald-glow); }

/* ===================================================================
   MAIN CONTENT
   =================================================================== */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 24px 28px;
  padding-bottom: calc(var(--ticker-h) + var(--footer-h) + 24px);
  transition: margin-left var(--duration) var(--ease);
}

#app { max-width: 1440px; }

/* ===================================================================
   GLOBAL TOPBAR (persistent Marketplace + Breadcrumb)
   =================================================================== */
.global-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 16px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--q-border);
}
.topbar-left { font-size: 13px; color: var(--q-text3); }
.topbar-right { display: flex; align-items: center; gap: 12px; }

/* Write-Mode Toggle (Topbar) */
/* -- Notification Bell ------------------------------------------------ */
.notif-bell {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--q-surface);
  border: 1px solid var(--q-border);
  transition: background 0.2s, border-color 0.2s;
}
.notif-bell:hover { background: var(--q-surface2); border-color: var(--q-border-hover); }
.notif-bell svg { color: var(--q-text2); transition: color 0.2s; }
.notif-bell:hover svg { color: var(--q-text); }
.notif-bell.has-unread svg { color: var(--q-green, #9FE870); }
.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--q-red, #ff453a);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
/* Notification Panel */
.notif-panel {
  position: fixed;
  top: 52px;
  right: 16px;
  width: 380px;
  max-height: 480px;
  background: var(--q-surface);
  border: 1px solid var(--q-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--q-border);
  font-size: 14px;
}
.notif-read-all {
  background: none;
  border: 1px solid var(--q-border);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--q-text2);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}
.notif-read-all:hover { background: var(--q-surface2); color: var(--q-text); }
.notif-panel-body {
  overflow-y: auto;
  max-height: 420px;
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--q-border);
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:hover { background: var(--q-surface2); }
.notif-item.unread { background: rgba(159, 232, 112, 0.04); }
.notif-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
}
.notif-dot.sev-info { background: var(--q-green, #9FE870); }
.notif-dot.sev-warning { background: var(--q-orange, #ff9f0a); }
.notif-dot.sev-critical { background: var(--q-red, #ff453a); }
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--q-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-msg { font-size: 11px; color: var(--q-text2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: 10px; color: var(--q-text3); margin-top: 3px; }

.write-mode-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--q-surface);
  border: 1px solid var(--q-border);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}
.write-mode-toggle:hover { border-color: var(--q-border-hover); background: var(--q-surface-hover, rgba(255,255,255,0.06)); }
.write-mode-toggle.mode-rw {
  border-color: var(--q-green, #9FE870);
  background: rgba(159, 232, 112, 0.08);
}
.write-mode-toggle.mode-ro {
  border-color: var(--q-yellow, #ffd700);
  background: rgba(255, 215, 0, 0.06);
}
/* Toggle Track (der Schalter) */
.toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--q-yellow, #ffd700);
  border-radius: 10px;
  transition: background 0.25s;
  flex-shrink: 0;
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.write-mode-toggle.mode-rw .toggle-track { background: var(--q-green, #9FE870); }
.write-mode-toggle.mode-rw .toggle-thumb { transform: translateX(16px); }
/* Labels */
.write-mode-label, .write-mode-label-rw {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: color 0.2s, opacity 0.2s;
}
.write-mode-label { color: var(--q-yellow, #ffd700); }
.write-mode-label-rw { color: var(--q-text2); opacity: 0.4; }
.write-mode-toggle.mode-rw .write-mode-label { color: var(--q-text2); opacity: 0.4; }
.write-mode-toggle.mode-rw .write-mode-label-rw { color: var(--q-green, #9FE870); opacity: 1; }

/* Write-Guard: Buttons visuell dimmen im READ-ONLY Modus */
[data-write-locked="true"] .qa-btn:not(.btn-disabled) {
  opacity: 0.5;
  pointer-events: auto;
}
[data-write-locked="true"] .qa-btn:not(.btn-disabled):hover::after {
  content: 'READ-ONLY';
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--q-yellow, #ffd700);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
[data-write-locked="true"] .btn-cyan,
[data-write-locked="true"] .btn-green {
  opacity: 0.5;
}

.marketplace-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--q-surface);
  border: 1px solid var(--q-border);
  border-radius: 20px;
  padding: 6px 14px 6px 10px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.marketplace-pill:hover { border-color: var(--q-border-hover); }
.marketplace-flag { font-size: 18px; line-height: 1; }
.marketplace-global-select {
  background: transparent;
  border: none;
  color: var(--q-text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  padding-right: 16px;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a1a1a6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
}
.marketplace-global-select option { background: var(--q-surface); color: var(--q-text); }

/* ===================================================================
   PAGE HEADER
   =================================================================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--q-text);
  margin: 0;
}

h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--q-text);
  margin: 0;
}

h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--q-text);
  margin-bottom: 12px;
}

/* ===================================================================
   AMPEL GRID — Command Center (ROT / GELB / GRUEN)
   =================================================================== */
.ampel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.ampel-zone {
  background: var(--q-surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 200px;
  transition: box-shadow var(--duration-slow) var(--ease), border-color var(--duration-slow);
  position: relative;
  overflow: hidden;
}

/* Glassmorphism shimmer on zones */
.ampel-zone::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}

.ampel-zone.zone-red {
  border: 1px solid rgba(239,68,68,0.25);
  border-top: 3px solid var(--q-red);
}
.ampel-zone.zone-red.has-issues {
  box-shadow: var(--shadow-glow-red);
  animation: pulse-red 3s ease-in-out infinite;
}

@keyframes pulse-red {
  0%, 100% { box-shadow: var(--shadow-glow-red); }
  50% { box-shadow: 0 0 30px rgba(239,68,68,0.2), 0 0 60px rgba(239,68,68,0.08); }
}

.ampel-zone.zone-yellow {
  border: 1px solid rgba(234,179,8,0.2);
  border-top: 3px solid var(--q-yellow);
}

.ampel-zone.zone-green {
  border: 1px solid rgba(16,185,129,0.2);
  border-top: 3px solid var(--q-emerald);
}

.ampel-zone-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.ampel-zone-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.zone-red .ampel-zone-dot { background: var(--q-red); box-shadow: 0 0 10px var(--q-red); }
.zone-yellow .ampel-zone-dot { background: var(--q-yellow); box-shadow: 0 0 10px var(--q-yellow); }
.zone-green .ampel-zone-dot { background: var(--q-emerald); box-shadow: 0 0 10px var(--q-emerald); }

.ampel-zone-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.zone-red .ampel-zone-title { color: var(--q-red); }
.zone-yellow .ampel-zone-title { color: var(--q-yellow); }
.zone-green .ampel-zone-title { color: var(--q-emerald); }

.ampel-zone-count {
  margin-left: auto;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
}
.zone-red .ampel-zone-count { color: var(--q-red); }
.zone-yellow .ampel-zone-count { color: var(--q-yellow); }
.zone-green .ampel-zone-count { color: var(--q-emerald); }

.ampel-items { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.ampel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  gap: 8px;
}
.zone-red .ampel-item { background: var(--q-red-dim); }
.zone-red .ampel-item:hover { background: rgba(239,68,68,0.18); }
.zone-yellow .ampel-item { background: var(--q-yellow-dim); }
.zone-yellow .ampel-item:hover { background: rgba(234,179,8,0.15); }
.zone-green .ampel-item { background: var(--q-emerald-dim); }
.zone-green .ampel-item:hover { background: rgba(16,185,129,0.15); }

.ampel-item-icon {
  flex-shrink: 0;
  opacity: 0.7;
}

.ampel-item-label {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ampel-item-count {
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.zone-red .ampel-item-count { color: var(--q-red); }
.zone-yellow .ampel-item-count { color: var(--q-yellow); }
.zone-green .ampel-item-count { color: var(--q-emerald); }

.ampel-empty {
  font-size: 13px;
  color: var(--q-text3);
  padding: 20px 10px;
  text-align: center;
  font-style: italic;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================================================================
   KPI CARDS
   =================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--q-surface);
  border: 1px solid var(--q-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all var(--duration) var(--ease);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.kpi-card:hover {
  border-color: var(--q-border-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-icon.cyan { background: var(--q-cyan-dim); color: var(--q-cyan); }
.kpi-icon.green { background: var(--q-green-dim); color: var(--q-green); }
.kpi-icon.emerald { background: var(--q-emerald-dim); color: var(--q-emerald); }
.kpi-icon.red { background: var(--q-red-dim); color: var(--q-red); }
.kpi-icon.orange { background: var(--q-orange-dim); color: var(--q-orange); }
.kpi-icon.yellow { background: var(--q-yellow-dim); color: var(--q-yellow); }
.kpi-icon.gray { background: var(--q-gray-dim); color: var(--q-gray); }
.kpi-icon.purple { background: var(--q-purple-dim); color: var(--q-purple); }

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

.kpi-value {
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.kpi-value.cyan { color: var(--q-cyan); }
.kpi-value.green { color: var(--q-green); }
.kpi-value.emerald { color: var(--q-emerald); }
.kpi-value.red { color: var(--q-red); }
.kpi-value.orange { color: var(--q-orange); }
.kpi-value.gray { color: var(--q-text2); }

.kpi-label {
  font-size: 11px;
  color: var(--q-text2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 4px;
  font-weight: 600;
}

.kpi-sub {
  font-size: 11px;
  color: var(--q-text3);
  margin-top: 2px;
}

.kpi-sparkline {
  position: absolute;
  bottom: 0;
  right: 0;
  opacity: 0.4;
  pointer-events: none;
}

/* ===================================================================
   CARDS (glassmorphism-touch)
   =================================================================== */
.card {
  background: var(--q-surface);
  border: 1px solid var(--q-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--duration);
}
.card:hover { border-color: var(--q-border-hover); }

.card-glass {
  background: var(--q-surface-glass);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-header h3 { margin-bottom: 0; }

/* ===================================================================
   REIMBURSEMENT BANNER
   =================================================================== */
.reimburse-banner {
  background: linear-gradient(135deg, rgba(16,185,129,0.12) 0%, rgba(0,229,255,0.08) 100%);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  animation: shimmer-banner 3s ease-in-out infinite;
}

@keyframes shimmer-banner {
  0%, 100% { border-color: rgba(16,185,129,0.3); }
  50% { border-color: rgba(16,185,129,0.5); }
}

.reimburse-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--q-emerald-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--q-emerald);
  flex-shrink: 0;
}

.reimburse-banner-body { flex: 1; }
.reimburse-banner-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--q-emerald);
}
.reimburse-banner-desc {
  font-size: 13px;
  color: var(--q-text2);
  margin-top: 2px;
}

/* ===================================================================
   TABLES
   =================================================================== */
.table-wrap {
  background: var(--q-surface);
  border: 1px solid var(--q-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

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

.q-table thead th {
  background: var(--q-surface2);
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--q-text2);
  border-bottom: 1px solid var(--q-border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--duration);
  position: sticky;
  top: 0;
  z-index: 1;
}
.q-table thead th:hover { color: var(--q-emerald); }

.q-table thead th .sort-arrow {
  display: inline-block;
  margin-left: 3px;
  font-size: 11px;
  opacity: 0.3;
}
.q-table thead th .sort-arrow.active { opacity: 1; color: var(--q-emerald); }

.q-table tbody tr { transition: background var(--duration); }
.q-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.012); }
.q-table tbody tr:hover { background: rgba(16,185,129,0.04); }

.q-table tbody td {
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--q-border);
  vertical-align: middle;
}
.q-table tbody tr:last-child td { border-bottom: none; }
.q-table .clickable { cursor: pointer; }

/* ===================================================================
   BADGES
   =================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: capitalize;
  white-space: nowrap;
}
.badge-active { background: var(--q-green-dim); color: var(--q-green); }
.badge-inactive { background: var(--q-gray-dim); color: var(--q-gray); }
.badge-suppressed { background: var(--q-red-dim); color: var(--q-red); }
.badge-draft { background: var(--q-orange-dim); color: var(--q-orange); }
.badge-pending { background: var(--q-yellow-dim); color: var(--q-yellow); }
.badge-done, .badge-complete { background: var(--q-green-dim); color: var(--q-green); }
.badge-failed, .badge-error { background: var(--q-red-dim); color: var(--q-red); }
.badge-processing { background: var(--q-cyan-dim); color: var(--q-cyan); }
.badge-warning { background: var(--q-orange-dim); color: var(--q-orange); }
.badge-green { background: var(--q-green-dim); color: var(--q-green); }
.badge-red { background: var(--q-red-dim); color: var(--q-red); }
.badge-orange { background: var(--q-orange-dim); color: var(--q-orange); }

/* Chips — Interactive filter tags */
.chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--q-surface2);
  color: var(--q-text2);
  border: 1px solid var(--q-border);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.chip:hover { background: var(--q-surface3); color: var(--q-text); }
.chip-active { background: var(--q-green-dim); color: var(--q-green); border-color: var(--q-border-active); }
.chip-sm { padding: 2px 8px; font-size: 10px; }

/* Feed filter chips */
.feed-filter-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ===================================================================
   BUTTONS
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  outline: none;
}
.btn:focus-visible { box-shadow: 0 0 0 3px var(--q-emerald-glow); }
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--q-emerald); color: #163300; }
.btn-primary:hover { background: #0ea572; box-shadow: 0 0 16px var(--q-emerald-glow); }

.btn-secondary {
  background: var(--q-surface2);
  color: var(--q-text);
  border: 1px solid var(--q-border);
}
.btn-secondary:hover { border-color: var(--q-emerald); color: var(--q-emerald); }

.btn-ghost { background: none; color: var(--q-text2); }
.btn-ghost:hover { color: var(--q-text); background: var(--q-surface2); }

.btn-danger { background: var(--q-red-dim); color: var(--q-red); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-cyan { background: var(--q-cyan); color: #000; font-weight: 700; }
.btn-cyan:hover { background: #00c8e8; box-shadow: 0 0 16px var(--q-cyan-glow); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--q-surface2);
  border: 1px solid var(--q-border);
  color: var(--q-text2);
  cursor: pointer;
  transition: all var(--duration);
}
.btn-icon:hover { color: var(--q-emerald); border-color: var(--q-emerald); }

/* ===================================================================
   INPUTS
   =================================================================== */
.input {
  background: var(--q-surface2);
  border: 1px solid var(--q-border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--q-text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--duration), box-shadow var(--duration);
}
.input:focus {
  border-color: var(--q-emerald);
  box-shadow: 0 0 0 3px var(--q-emerald-dim);
}
.input:focus-visible {
  box-shadow: 0 0 0 3px var(--q-emerald-glow);
}
.input::placeholder { color: var(--q-text3); }

textarea.input { resize: vertical; min-height: 80px; }

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7a92' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

/* ===================================================================
   FORM GROUPS
   =================================================================== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--q-text2);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.char-count {
  font-size: 11px;
  color: var(--q-text3);
  margin-top: 2px;
  text-align: right;
}
.form-group .input { width: 100%; }
.form-group.full { grid-column: 1 / -1; }

/* ===================================================================
   ACTIONS BAR
   =================================================================== */
.actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-input { width: 260px; }

/* ===================================================================
   PAGINATION
   =================================================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--q-border);
  font-size: 12px;
  color: var(--q-text2);
}

.pagination-btns { display: flex; gap: 4px; }

/* ===================================================================
   GAUGE (Health Score)
   =================================================================== */
.gauge-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gauge {
  position: relative;
}
.gauge svg { transform: rotate(-90deg); }

.gauge-bg {
  fill: none;
  stroke: var(--q-surface3);
  stroke-width: 10;
}

.gauge-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s;
}

.gauge-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-number {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.gauge-label-text {
  font-size: 10px;
  color: var(--q-text2);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
  margin-top: 4px;
}

/* ===================================================================
   DETAIL VIEW
   =================================================================== */
.detail-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.info-table { width: 100%; border-collapse: collapse; }
.info-table td {
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--q-border);
  vertical-align: top;
}
.info-table .label-cell {
  color: var(--q-text2);
  font-weight: 600;
  width: 120px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===================================================================
   TAGS / KEYWORDS
   =================================================================== */
.tags-wrap { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--q-surface2);
  border: 1px solid var(--q-border);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 12px;
  color: var(--q-text);
  transition: border-color var(--duration);
}
.tag:hover { border-color: var(--q-border-hover); }
.tag .tag-rank { color: var(--q-emerald); font-weight: 700; }
.tag .tag-indexed { color: var(--q-green); }
.tag .tag-remove {
  cursor: pointer;
  color: var(--q-red);
  font-weight: bold;
  opacity: 0.5;
  transition: opacity var(--duration);
}
.tag .tag-remove:hover { opacity: 1; }

.tag-add { display: flex; gap: 6px; margin-top: 12px; }
.tag-add .input { flex: 1; }

/* ===================================================================
   BULLET POINTS
   =================================================================== */
.bullet-list { list-style: none; counter-reset: bullet; }
.bullet-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 0;
  border-bottom: 1px solid var(--q-border);
  font-size: 13px;
}
.bullet-list li::before {
  counter-increment: bullet;
  content: counter(bullet) ".";
  color: var(--q-emerald);
  font-weight: 700;
  flex-shrink: 0;
  width: 20px;
}

/* ===================================================================
   TABS
   =================================================================== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--q-border);
  margin-bottom: 16px;
}

.tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--q-text2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--duration) var(--ease);
  user-select: none;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}
.tab:hover { color: var(--q-text); }
.tab.active {
  color: var(--q-emerald);
  border-bottom-color: var(--q-emerald);
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s var(--ease); }

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

/* ===================================================================
   RANGE SELECTOR (Charts)
   =================================================================== */
.range-selector {
  display: flex;
  gap: 2px;
  background: var(--q-surface2);
  border-radius: var(--radius);
  padding: 2px;
  border: 1px solid var(--q-border);
}

.range-btn {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--q-text2);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--duration);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: inherit;
}
.range-btn:hover { color: var(--q-text); }
.range-btn.active { background: var(--q-emerald); color: var(--q-forest); }

/* ===================================================================
   CHARTS ROW
   =================================================================== */
.charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.mini-chart-card {
  display: flex;
  flex-direction: column;
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
}
.chart-card-header h3 { margin-bottom: 0; }

/* ===================================================================
   SWOT GRID
   =================================================================== */
.swot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.swot-cell {
  background: var(--q-surface);
  border: 1px solid var(--q-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-height: 160px;
  transition: border-color var(--duration);
}
.swot-cell:hover { border-color: var(--q-border-hover); }

.swot-cell h4 {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.swot-strengths { border-top: 3px solid var(--q-emerald); }
.swot-strengths h4 { color: var(--q-emerald); }
.swot-weaknesses { border-top: 3px solid var(--q-red); }
.swot-weaknesses h4 { color: var(--q-red); }
.swot-opportunities { border-top: 3px solid var(--q-cyan); }
.swot-opportunities h4 { color: var(--q-cyan); }
.swot-threats { border-top: 3px solid var(--q-orange); }
.swot-threats h4 { color: var(--q-orange); }

.swot-item {
  display: flex;
  gap: 8px;
  font-size: 13px;
  padding: 4px 0;
  color: var(--q-text);
  line-height: 1.4;
}
.swot-item::before {
  content: "\2022";
  flex-shrink: 0;
  color: var(--q-text3);
}

/* ===================================================================
   FINANCIAL VIEW
   =================================================================== */
.fin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Donut Chart */
.donut-chart { filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15)); }
.donut-slice { transition: opacity 0.2s, transform 0.2s; transform-origin: center; cursor: pointer; }
.donut-slice:hover { opacity: 1 !important; filter: brightness(1.15); }
.donut-chart:hover .donut-slice:not(:hover) { opacity: 0.5; }

.fee-legend { display: flex; flex-direction: column; gap: 8px; }
.fee-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background 0.2s;
  cursor: default;
}
.fee-legend-item:hover { background: var(--q-surface2); }
.fee-dot { width: 12px; height: 12px; border-radius: var(--radius); flex-shrink: 0; }

.bar-track {
  flex: 1;
  height: 8px;
  background: var(--q-surface3);
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s var(--ease);
}

.rev-fee-bars { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.rev-fee-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.rev-fee-row > span:first-child { width: 60px; flex-shrink: 0; color: var(--q-text2); font-weight: 600; }
.rev-fee-row > span:last-child { flex-shrink: 0; font-weight: 700; white-space: nowrap; }

/* ===================================================================
   FUNNEL VISUAL
   =================================================================== */
.funnel-visual { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; }
.funnel-step { display: flex; align-items: center; gap: 12px; }
.funnel-bar {
  height: 32px;
  border-radius: 4px;
  transition: width 0.8s var(--ease);
  min-width: 40px;
}
.funnel-label { font-size: 13px; color: var(--q-text2); white-space: nowrap; }
.funnel-label strong { color: var(--q-text); }

/* ===================================================================
   REPORTS
   =================================================================== */
.report-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.report-cat-card {
  background: var(--q-surface);
  border: 1px solid var(--q-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: all var(--duration);
  box-shadow: var(--shadow-card);
}
.report-cat-card:hover { border-color: var(--q-border-hover); box-shadow: var(--shadow-hover); }
.report-cat-info h3 { margin-bottom: 4px; }
.report-cat-info p { font-size: 12px; color: var(--q-text2); margin: 0; }

/* ===================================================================
   SETTINGS
   =================================================================== */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--q-border);
  gap: 16px;
}
.settings-row:last-child { border-bottom: none; }
.settings-key { font-size: 13px; font-weight: 600; min-width: 180px; }
.settings-value { flex: 1; }
.settings-value .input { width: 100%; }
.settings-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Marketplace Settings Card */
.mkt-settings { display: flex; flex-direction: column; gap: 16px; }
.mkt-current {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: var(--q-surface2);
  border: 1px solid var(--q-border);
  border-radius: var(--radius);
}
.mkt-flag { font-size: 28px; line-height: 1; }
.mkt-label { font-size: 16px; font-weight: 700; color: var(--q-text); }
.mkt-code {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  padding: 2px 8px; border-radius: 4px;
  background: var(--q-cyan); color: var(--q-bg);
}
.mkt-switch {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.mkt-switch-label { font-size: 13px; color: var(--q-text2); white-space: nowrap; }
.mkt-select-lg {
  min-width: 200px; padding: 8px 32px 8px 12px; font-size: 14px;
}
#mkt-save:disabled { opacity: 0.4; cursor: not-allowed; }
.card-title {
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--q-text2);
  margin-bottom: 14px;
}

/* ===================================================================
   ALERT STACK
   =================================================================== */
.alert-stack { display: flex; flex-direction: column; gap: 6px; }

.alert-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration);
}
.alert-bar:hover { transform: translateX(2px); }

.alert-critical { background: var(--q-red-dim); border: 1px solid rgba(239,68,68,0.25); color: var(--q-red); }
.alert-warning { background: var(--q-orange-dim); border: 1px solid rgba(245,158,11,0.25); color: var(--q-orange); }
.alert-info { background: var(--q-cyan-dim); border: 1px solid rgba(0,229,255,0.15); color: var(--q-cyan); }

.alert-icon { flex-shrink: 0; }
.alert-msg { flex: 1; }

.alert-action-btn {
  background: rgba(255,255,255,0.08) !important;
  color: inherit !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  font-weight: 700 !important;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-size: 10px !important;
}
.alert-action-btn:hover { background: rgba(255,255,255,0.15) !important; }

/* ===================================================================
   ACTION CARDS
   =================================================================== */
.action-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.action-card {
  background: var(--q-surface);
  border: 1px solid var(--q-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-card);
  transition: all var(--duration);
}
.action-card:hover { box-shadow: var(--shadow-hover); border-color: var(--q-border-hover); }

.action-card-body { flex: 1; min-width: 0; }
.action-card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.action-card-desc { font-size: 12px; color: var(--q-text2); }
.action-card-btn {
  flex-shrink: 0;
  font-weight: 700 !important;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ===================================================================
   BULK ACTIONS BAR
   =================================================================== */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--q-emerald-dim);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--q-emerald);
  font-weight: 600;
}
.bulk-bar.hidden { display: none; }

/* ===================================================================
   TOKEN TACHO (Rate-Limits Widget)
   =================================================================== */
.token-tacho {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.tacho-ring {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.tacho-ring svg { transform: rotate(-90deg); }
.tacho-bg { fill: none; stroke: var(--q-surface3); stroke-width: 4; }
.tacho-fill {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s var(--ease), stroke 0.3s;
}
.tacho-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--q-text2);
}

.tacho-info {
  font-size: 11px;
  color: var(--q-text2);
  line-height: 1.3;
}
.tacho-info strong { color: var(--q-text); font-weight: 700; }

/* ===================================================================
   INVENTORY AGING BUCKETS
   =================================================================== */
.aging-buckets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.aging-bucket {
  text-align: center;
  padding: 12px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--q-border);
  transition: border-color var(--duration);
}
.aging-bucket:hover { border-color: var(--q-border-hover); }

.aging-bucket-value {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.aging-bucket-label {
  font-size: 10px;
  color: var(--q-text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-top: 2px;
}

/* ===================================================================
   TOAST
   =================================================================== */
.toast {
  position: fixed;
  bottom: calc(var(--ticker-h) + var(--footer-h) + 16px);
  right: 24px;
  background: #0d7a3e;
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  z-index: 1100;
  transform: translateY(0);
  opacity: 1;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.toast.hidden { opacity: 0; transform: translateY(8px); pointer-events: none; }
.toast.error { background: var(--q-red); }
.toast.warning { background: var(--q-orange); color: #000; }
.toast.info { background: #2563eb; }

/* ===================================================================
   EMPTY STATE
   =================================================================== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--q-text2);
  font-size: 14px;
}
.empty-state svg { margin-bottom: 12px; opacity: 0.2; }
.empty-state .empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--q-text);
  margin-bottom: 4px;
}
.empty-state .empty-desc { font-size: 13px; color: var(--q-text3); }
.empty-state .empty-cta { margin-top: 16px; }

/* ===================================================================
   LOADING SPINNER
   =================================================================== */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--q-text3);
  border-top-color: var(--q-cyan);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* -- Listing Thumbnails (Zero-Knowledge: direkt von Amazon CDN) -- */
.td-thumb { width: 44px; padding: 4px !important; }
.listing-thumb {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--q-surface2);
  border: 1px solid var(--q-border);
}
.listing-thumb-empty {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--q-surface2);
  border: 1px solid var(--q-border);
  color: var(--q-text3);
  font-size: 16px;
}

/* ===================================================================
   IMAGE CAROUSEL v2 — Listing Detail
   Steve (CDO): Glassmorphism, Lightbox, Touch-Swipe, Dark+Light
   =================================================================== */

/* -- Gallery wrapper -- */
.img-gallery { padding: 16px; max-width: 420px; }
/* -- Q-Hint: Global pulsing tooltip system -- */
.q-hint {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--q-text3); cursor: help;
  padding: 3px 8px; border-radius: 6px;
  transition: opacity 0.3s, background 0.3s, box-shadow 0.3s;
  position: relative;
}
.q-hint.q-hint--seen { opacity: 0.45; }
.q-hint.q-hint--unseen {
  opacity: 1;
  background: rgba(var(--q-accent-rgb, 99,102,241), 0.08);
  animation: q-hint-pulse 2s ease-in-out 3;
}
.q-hint:hover {
  opacity: 1 !important;
  background: rgba(var(--q-accent-rgb, 99,102,241), 0.12);
}
.q-hint svg { flex-shrink: 0; opacity: 0.5; }
.q-hint.q-hint--unseen svg { opacity: 0.9; }
.q-hint::after {
  content: attr(data-tooltip);
  position: absolute; top: calc(100% + 6px); left: 0;
  white-space: normal; width: max-content; max-width: 280px;
  background: var(--q-bg3, #1e1e2e); color: var(--q-text1, #cdd6f4);
  border: 1px solid var(--q-border, #45475a);
  padding: 8px 10px; border-radius: 8px; font-size: 11px; line-height: 1.4;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  z-index: 9999;
}
.q-hint:hover::after { opacity: 1; }
@keyframes q-hint-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--q-accent-rgb, 99,102,241), 0); }
  50% { box-shadow: 0 0 0 6px rgba(var(--q-accent-rgb, 99,102,241), 0.15); }
}

.img-gallery-hint { margin-bottom: 8px; }

/* -- Carousel container -- */
.carousel {
  position: relative;
  user-select: none;
  outline: none;
}

/* -- Main image area (arrow + frame + zoom-hint) -- */
.carousel-main-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--q-surface2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
  min-height: 200px;
  max-height: 420px;
}

.carousel-main-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 200px;
  max-height: 420px;
  cursor: zoom-in;
}

.img-main {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 8px;
  transition: opacity 0.15s var(--ease);
  display: block;
}

.img-main.carousel-fade { opacity: 0; }
.img-main.img-error { opacity: 0.3; filter: grayscale(1); }

/* -- Carousel arrows -- */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--q-surface-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--q-border);
  color: var(--q-text2);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.45;
  transition: opacity var(--duration) var(--ease), background var(--duration) var(--ease), color var(--duration) var(--ease), transform var(--duration) var(--ease);
  font-family: system-ui, sans-serif;
  padding: 0;
}
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-arrow:hover {
  opacity: 1;
  background: var(--q-surface3);
  color: var(--q-cyan);
  border-color: var(--q-cyan);
}
.carousel-prev:hover { transform: translateY(-50%) scale(1.1); }
.carousel-next:hover { transform: translateY(-50%) scale(1.1); }
.carousel-arrow:active { transform: translateY(-50%) scale(0.95); }

/* Hide arrows when only 1 image */
.carousel[data-idx] .carousel-arrow:only-of-type { display: none; }

/* -- Zoom hint badge -- */
.carousel-zoom-hint {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 11px;
  color: var(--q-text2);
  background: var(--q-surface-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--q-border);
  border-radius: 20px;
  padding: 3px 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.carousel-main-wrap:hover .carousel-zoom-hint { opacity: 1; }

/* -- Dots indicator -- */
.carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}
.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--q-text3);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all var(--duration) var(--ease);
  opacity: 0.5;
}
.carousel-dot:hover { opacity: 0.8; background: var(--q-text2); }
.carousel-dot.active {
  opacity: 1;
  background: var(--q-cyan);
  width: 20px;
  border-radius: 4px;
  box-shadow: 0 0 6px var(--q-cyan-glow);
}

/* -- Thumbnails strip -- */
.img-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
}
.img-thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.55;
  transition: all var(--duration) var(--ease);
  background: var(--q-surface2);
}
.img-thumb:hover {
  opacity: 0.85;
  border-color: var(--q-border-hover);
  transform: scale(1.05);
}
.img-thumb.active {
  opacity: 1;
  border-color: var(--q-cyan);
  box-shadow: 0 0 10px rgba(0,229,255,0.35);
  transform: scale(1.05);
}

/* -- Empty placeholder -- */
.carousel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--q-text3);
  text-align: center;
}
.carousel-empty svg { opacity: 0.35; }
.carousel-empty p { font-size: 14px; font-weight: 600; color: var(--q-text2); margin: 0; }
.carousel-empty span { font-size: 12px; color: var(--q-text3); }

/* ===================================================================
   LIGHTBOX — Full-res overlay
   =================================================================== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lbFadeIn 0.2s var(--ease);
  cursor: zoom-out;
}

@keyframes lbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 92vw;
  max-height: 92vh;
  cursor: default;
  animation: lbScaleIn 0.25s var(--ease);
}

@keyframes lbScaleIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.lightbox-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 88vw;
  max-height: 88vh;
}

.lightbox-img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 80px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.06);
  display: block;
}

/* Close button */
.lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration), transform var(--duration);
  padding: 0;
  font-family: system-ui, sans-serif;
}
.lightbox-close:hover {
  background: rgba(239,68,68,0.7);
  transform: scale(1.1);
}

/* Lightbox arrows */
.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration) var(--ease);
  padding: 0;
  font-family: system-ui, sans-serif;
  z-index: 10;
}
.lightbox-prev { left: -56px; }
.lightbox-next { right: -56px; }
.lightbox-arrow:hover {
  background: rgba(0,229,255,0.2);
  border-color: var(--q-cyan);
  color: var(--q-cyan);
  transform: translateY(-50%) scale(1.1);
}

/* Counter badge */
.lightbox-counter {
  position: absolute;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

/* Light mode adjustments */
[data-theme="light"] .lightbox-overlay { background: rgba(0, 0, 0, 0.8); }
[data-theme="light"] .carousel-arrow {
  background: rgba(255,255,255,0.75);
  border-color: var(--q-border-hover);
  color: var(--q-text2);
}
[data-theme="light"] .carousel-zoom-hint {
  background: rgba(255,255,255,0.8);
  border-color: var(--q-border-hover);
}

.loading-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 12px;
  color: var(--q-text2);
  font-size: 14px;
}

/* ===================================================================
   BOOTSTRAP OVERLAY (First-Time Load)
   =================================================================== */
.bootstrap-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--q-bg);
  z-index: 9999;
}
.bootstrap-card {
  text-align: center;
  background: var(--q-card);
  border: 1px solid var(--q-border);
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.bootstrap-hourglass {
  margin-bottom: 8px;
}
.bootstrap-progress {
  height: 8px;
  background: var(--q-surface);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.bootstrap-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--q-emerald), var(--q-green), var(--q-emerald));
  background-size: 200% 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
  animation: bootstrap-pulse-bar 1.8s ease-in-out infinite;
  box-shadow: 0 0 12px var(--q-emerald), 0 0 4px var(--q-green);
}
@keyframes bootstrap-pulse-bar {
  0%, 100% { background-position: 0% 50%; opacity: 1; }
  50% { background-position: 100% 50%; opacity: 0.85; }
}
.bootstrap-hourglass svg {
  animation: bootstrap-glow 2.5s ease-in-out infinite;
}
@keyframes bootstrap-glow {
  0%, 100% { filter: drop-shadow(0 0 8px var(--q-emerald)); }
  50% { filter: drop-shadow(0 0 24px var(--q-emerald)) drop-shadow(0 0 48px rgba(159,232,112,0.3)); }
}
.bootstrap-card {
  animation: bootstrap-card-enter 0.6s ease-out;
}
@keyframes bootstrap-card-enter {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.bootstrap-report-pending {
  animation: bootstrap-row-pulse 2s ease-in-out infinite;
}
@keyframes bootstrap-row-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ===================================================================
   LAUNCH SEQUENCE — Starship Video
   =================================================================== */
.rocket-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  z-index: 10000;
  overflow: hidden;
}
.rocket-overlay video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rocket-overlay.fade-out {
  animation: rocket-fade 1.5s ease-out forwards;
}
@keyframes rocket-fade {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ===================================================================
   BACK LINK
   =================================================================== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--q-text2);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  cursor: pointer;
  transition: color var(--duration);
  background: none;
  border: none;
  font-family: inherit;
}
.back-link:hover { color: var(--q-emerald); }

/* ===================================================================
   TICKER BAR (Auto-Aktionen)
   =================================================================== */
.ticker-bar {
  position: fixed;
  bottom: var(--footer-h);
  left: var(--sidebar-w);
  right: 0;
  height: var(--ticker-h);
  background: var(--q-surface);
  border-top: 1px solid var(--q-border);
  display: flex;
  align-items: center;
  z-index: 100;
  overflow: hidden;
  padding: 0 16px;
}

.ticker-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--q-emerald);
  flex-shrink: 0;
  margin-right: 14px;
}

.ticker-track {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.ticker-content {
  display: flex;
  gap: 40px;
  white-space: nowrap;
  animation: tickerScroll 40s linear infinite;
  font-size: 12px;
  color: var(--q-text2);
}
.ticker-content span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ticker-content .ticker-ok { color: var(--q-emerald); }
.ticker-content .ticker-warn { color: var(--q-orange); }
.ticker-content .ticker-err { color: var(--q-red); }

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===================================================================
   QUICK ACTIONS FOOTER
   =================================================================== */
.quick-actions-footer {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--footer-h);
  background: var(--q-surface);
  border-top: 1px solid var(--q-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  z-index: 100;
}

.qa-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--q-border);
  background: var(--q-surface2);
  color: var(--q-text);
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  font-family: inherit;
}
.qa-btn:hover {
  border-color: var(--q-emerald);
  color: var(--q-emerald);
  background: var(--q-emerald-dim);
}
.qa-btn:focus-visible { box-shadow: 0 0 0 3px var(--q-emerald-glow); }
.qa-btn:active { transform: scale(0.96); }
.qa-btn svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ===================================================================
   COUNTUP ANIMATION HELPER
   =================================================================== */
.countup {
  font-variant-numeric: tabular-nums;
}

/* ===================================================================
   FIX #8: INLINE EDIT (.iec) HOVER-HINWEIS
   =================================================================== */
td.iec {
  cursor: text;
  position: relative;
  transition: background var(--duration);
}
td.iec:hover {
  background: rgba(16,185,129,0.06);
  outline: 1px dashed rgba(16,185,129,0.4);
  outline-offset: -2px;
}
td.iec::after {
  content: 'Doppelklick zum Bearbeiten';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--q-surface3);
  color: var(--q-text2);
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--q-border);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration);
  z-index: 10;
}
td.iec:hover::after {
  opacity: 1;
}

/* ===================================================================
   ZERO-KNOWLEDGE BADGE
   =================================================================== */
.conf-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 6px;
}
.conf-high { background: rgba(16,185,129,0.2); color: var(--q-green); border: 1px solid rgba(16,185,129,0.4); }
.conf-medium { background: rgba(245,158,11,0.2); color: var(--q-orange); border: 1px solid rgba(245,158,11,0.4); }
.conf-low { background: rgba(239,68,68,0.2); color: var(--q-red); border: 1px solid rgba(239,68,68,0.4); }

.zk-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.35);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--q-emerald);
  letter-spacing: 0.3px;
  animation: zk-pulse 4s ease-in-out infinite;
  white-space: nowrap;
}

@keyframes zk-pulse {
  0%, 100% { border-color: rgba(16,185,129,0.35); }
  50% { border-color: rgba(16,185,129,0.6); box-shadow: 0 0 12px rgba(16,185,129,0.15); }
}

/* ===================================================================
   EXTRA CARDS ROW (Pain Index + Fee Auditor)
   =================================================================== */
.extra-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
  margin-bottom: 16px;
}

/* Community Pain Index */
.pain-index-card {}

.pain-live-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--q-red);
  background: var(--q-red-dim);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 4px;
  padding: 2px 7px;
  animation: pulse-badge 2s ease-in-out infinite;
}

.pain-ticker,
.pain-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.pain-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--q-surface2);
  border: 1px solid var(--q-border);
  font-size: 13px;
  opacity: 0.4;
  transform: scale(0.98);
  transition: all 0.4s var(--ease);
}
.pain-item.pain-item-active {
  opacity: 1;
  transform: scale(1);
  background: rgba(var(--pain-color, 245,158,11), 0.06);
  border-color: rgba(var(--pain-color, 245,158,11), 0.25);
  border-left: 3px solid var(--pain-color, var(--q-orange));
}

.pain-rank {
  font-size: 11px;
  font-weight: 800;
  color: var(--pain-color, var(--q-orange));
  flex-shrink: 0;
  min-width: 22px;
}
.pain-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--q-text);
}
.pain-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--q-text2);
  flex-shrink: 0;
}

/* Fee Auditor Preview */
.fee-auditor-card {}

.coming-soon-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--q-purple);
  background: var(--q-purple-dim);
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: 4px;
  padding: 2px 7px;
}

.fee-auditor-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fee-sparkline-placeholder {
  opacity: 0.5;
  pointer-events: none;
}

.fee-auditor-teaser {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.fee-anomaly-count {
  font-size: 36px;
  font-weight: 900;
  color: var(--q-purple);
  line-height: 1;
  letter-spacing: -1px;
}
.fee-anomaly-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--q-text2);
}
.fee-auditor-desc {
  font-size: 12px;
  color: var(--q-text3);
  line-height: 1.5;
}

/* ===================================================================
   FIX #5: LOADING TIMEOUT STYLE
   =================================================================== */
.loading-timeout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px;
  color: var(--q-text2);
  font-size: 13px;
  justify-content: center;
  flex-wrap: wrap;
}
.loading-timeout svg {
  color: var(--q-orange);
  flex-shrink: 0;
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */

/* FIX #3: Ampel-Grid 2-spaltig bei 1024px */
@media (max-width: 1024px) {
  .ampel-grid { grid-template-columns: 1fr 1fr; }
  .extra-cards-row { grid-template-columns: 1fr; }
}

/* Ampel-Grid 1-spaltig bei 640px */
@media (max-width: 640px) {
  .ampel-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .sidebar-overlay.open { display: block; }
  .hamburger { display: block; }

  .main {
    margin-left: 0;
    padding: 20px 14px;
    padding-top: 54px;
    padding-bottom: calc(var(--ticker-h) + var(--footer-h) + 24px);
  }

  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .ampel-grid { grid-template-columns: 1fr; }
  .extra-cards-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .search-input { width: 100%; }
  .report-categories { grid-template-columns: 1fr; }
  .fin-grid { grid-template-columns: 1fr; }
  .swot-grid { grid-template-columns: 1fr; }
  .action-cards-grid { grid-template-columns: 1fr; }
  .charts-row { grid-template-columns: 1fr; }

  .actions-bar { width: 100%; }
  .actions-bar .input, .actions-bar select.input { flex: 1; min-width: 0; }

  .page-header { flex-direction: column; align-items: flex-start; }

  .ticker-bar { left: 0; }
  .quick-actions-footer { left: 0; }

  .dash-header { flex-direction: column; gap: 12px; }
  .dash-header-sep { display: none; }
  .dash-header-actions { margin-left: 0; width: 100%; justify-content: flex-start; }

  .quick-actions-footer {
    flex-wrap: wrap;
    height: auto;
    padding: 6px 10px;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-card { padding: 12px; }
  .kpi-value { font-size: 24px; }
  .kpi-icon { width: 32px; height: 32px; }

  .q-table { font-size: 12px; }
  .q-table thead th, .q-table tbody td { padding: 8px 10px; }

  .alert-bar { flex-wrap: wrap; }
  .alert-action-btn { width: 100%; text-align: center; }

  .aging-buckets { grid-template-columns: repeat(3, 1fr); }
}

/* ===================================================================
   v5 UX-FIXES — Steve (CDO)
   =================================================================== */

/* -- Custom Confirm Modal (glassmorphism) -- */
.q-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s var(--ease);
}

.q-modal {
  background: var(--q-surface-glass);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
  border: 1px solid var(--q-border-hover);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--q-border);
  animation: modalSlideIn 0.25s var(--ease);
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.q-modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--q-text);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.q-modal-message {
  font-size: 13px;
  color: var(--q-text2);
  line-height: 1.6;
  margin-bottom: 24px;
}

.q-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* -- Disabled Button (Phase 3 features) -- */
.btn-disabled,
.tab-disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
  pointer-events: auto;
  position: relative;
}
.btn-disabled:hover,
.tab-disabled:hover {
  transform: none !important;
  box-shadow: none !important;
  border-color: var(--q-border) !important;
  color: inherit !important;
  background: inherit !important;
}
.tab-disabled {
  color: var(--q-text3) !important;
  border-bottom-color: transparent !important;
}

/* Tooltip via data-tooltip */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: var(--q-surface3);
  color: var(--q-text2);
  font-size: 10px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--q-border);
  white-space: normal;
  max-width: 280px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration);
  z-index: 20;
}
[data-tooltip]:hover::after {
  opacity: 1;
}

/* -- Tab Loading Spinner -- */
.tab-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  gap: 12px;
  color: var(--q-text2);
  font-size: 14px;
}

/* -- n/a Badge (BuyBox, Conversion etc.) -- */
.na-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--q-text3);
  font-size: 13px;
  font-weight: 500;
  position: relative;
}
.na-badge .na-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--q-surface3);
  color: var(--q-text3);
  font-size: 10px;
  flex-shrink: 0;
}
.na-badge .na-icon svg {
  width: 10px;
  height: 10px;
}

/* -- Snapshot Timeline -------------------------------------------------- */
.snapshot-timeline {
  position: relative;
  padding-left: 24px;
}
.snapshot-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--q-border);
  border-radius: 1px;
}
.snapshot-entry {
  position: relative;
  padding-bottom: 20px;
}
.snapshot-entry:last-child {
  padding-bottom: 0;
}
.snapshot-dot {
  position: absolute;
  left: -20px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--q-surface3);
  border: 2px solid var(--q-cyan);
  z-index: 1;
}
.snapshot-entry:first-child .snapshot-dot {
  background: var(--q-cyan);
  box-shadow: 0 0 8px var(--q-cyan-glow);
}
.snapshot-content {
  background: var(--q-surface2);
  border: 1px solid var(--q-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  transition: border-color var(--duration) var(--ease);
}
.snapshot-content:hover {
  border-color: var(--q-border-hover);
}
.snapshot-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.snapshot-time {
  font-size: 13px;
  color: var(--q-text);
  font-weight: 500;
}
.snapshot-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.snapshot-badge-cyan {
  background: var(--q-cyan-dim);
  color: var(--q-cyan);
  border: 1px solid rgba(0,229,255,0.2);
}
.snapshot-badge-green {
  background: var(--q-green-dim);
  color: var(--q-green);
  border: 1px solid rgba(34,197,94,0.2);
}
.snapshot-badge-orange {
  background: var(--q-orange-dim);
  color: var(--q-orange);
  border: 1px solid rgba(245,158,11,0.2);
}
.snapshot-badge-purple {
  background: var(--q-purple-dim);
  color: var(--q-purple);
  border: 1px solid rgba(168,85,247,0.2);
}
.snapshot-badge-blue {
  background: var(--q-blue-dim);
  color: var(--q-blue);
  border: 1px solid rgba(59,130,246,0.2);
}
.snapshot-badge-gray {
  background: var(--q-gray-dim);
  color: var(--q-gray);
  border: 1px solid rgba(107,114,128,0.2);
}
.snapshot-note {
  font-size: 12px;
  color: var(--q-text2);
  font-style: italic;
  margin-bottom: 6px;
}
.snapshot-meta {
  font-size: 12px;
  color: var(--q-text2);
  margin-bottom: 8px;
}
.snapshot-actions {
  display: flex;
  gap: 6px;
}

/* Snapshot Diff */
.snap-diff-panel {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--q-border);
}
.snap-diff {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.snap-diff-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.02);
}
.snap-diff-label {
  color: var(--q-text2);
  min-width: 90px;
  font-weight: 500;
  text-transform: capitalize;
}
.snap-diff-old {
  color: var(--q-red);
  text-decoration: line-through;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.snap-diff-arrow {
  color: var(--q-text3);
  flex-shrink: 0;
}
.snap-diff-new {
  color: var(--q-green);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.snap-diff-none {
  font-size: 12px;
  color: var(--q-text3);
  font-style: italic;
  padding: 4px 0;
}
.snap-diff-detail {
  font-size: 12px;
  line-height: 1.6;
  flex: 1;
}
.snap-diff-detail del {
  background: rgba(239,68,68,0.2);
  color: var(--q-red);
  text-decoration: line-through;
  padding: 1px 3px;
  border-radius: 3px;
}
.snap-diff-detail ins {
  background: rgba(16,185,129,0.2);
  color: var(--q-green);
  text-decoration: none;
  font-weight: 600;
  padding: 1px 3px;
  border-radius: 3px;
}

/* ===================================================================
   WYSIWYG Editor — Listing Description (Amazon-HTML-Subset)
   Erlaubte Tags: <p>, <br>, <b>, <strong>, <i>, <em>, <ul>, <li>
   =================================================================== */

/* -- Toolbar -------------------------------------------------------- */
.wysiwyg-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--q-surface2);
  border: 1px solid var(--q-border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}

.wysiwyg-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--q-border);
  border-radius: 4px;
  background: var(--q-surface3);
  color: var(--q-text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--duration) var(--ease),
              border-color var(--duration) var(--ease),
              color var(--duration) var(--ease);
}

.wysiwyg-toolbar button:hover {
  background: var(--q-emerald-dim);
  border-color: var(--q-emerald);
  color: var(--q-emerald);
}

.wysiwyg-toolbar button:active {
  transform: scale(0.96);
}
.wysiwyg-toolbar button.active {
  background: var(--q-emerald);
  color: var(--q-bg);
  border-color: var(--q-emerald);
  font-weight: 700;
}

.wysiwyg-sep {
  width: 1px;
  height: 20px;
  background: var(--q-border);
  margin: 0 4px;
}

/* -- Editor Area ---------------------------------------------------- */
.wysiwyg-editor {
  min-height: 140px;
  max-height: 400px;
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: 0 0 var(--radius) var(--radius) !important;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  outline: none;
}

.wysiwyg-editor:focus {
  border-color: var(--q-emerald);
  box-shadow: 0 0 0 2px var(--q-emerald-glow);
}
.wysiwyg-editor:focus-visible {
  box-shadow: 0 0 0 3px var(--q-emerald-glow);
}

.wysiwyg-editor:empty::before {
  content: "Produktbeschreibung eingeben...";
  color: var(--q-text3);
  pointer-events: none;
}

/* Inline-Styles fuer den Editor-Content */
.wysiwyg-editor p {
  margin: 0 0 8px 0;
}

.wysiwyg-editor ul {
  margin: 4px 0 8px 0;
  padding-left: 20px;
}

.wysiwyg-editor li {
  margin-bottom: 2px;
}

.wysiwyg-editor b,
.wysiwyg-editor strong {
  font-weight: 700;
  color: var(--q-text);
}

.wysiwyg-editor i,
.wysiwyg-editor em {
  font-style: italic;
}

/* ===================================================================
   ACCESSIBILITY — WCAG 2.1 AA
   =================================================================== */

/* Reduced Motion — deaktiviert Animationen fuer empfindliche User */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ticker-content { animation: none !important; }
}

/* Minimum font-size 11px (WCAG Lesbarkeit) */
.notif-badge,
.nav-badge { font-size: 11px !important; }

/* Focus-visible fuer alle interaktiven Elemente */
.nav-item:focus-visible,
.theme-toggle:focus-visible,
.sidebar-close:focus-visible,
.hamburger:focus-visible,
.notif-bell:focus-visible,
.write-mode-toggle:focus-visible,
.notif-read-all:focus-visible {
  outline: 2px solid var(--q-emerald);
  outline-offset: 2px;
}

/* ── Spellcheck Annotations (Pixel+Basti) ─────────────────────────── */
.sc-annotations {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--q-surface2);
  border: 1px solid var(--q-border);
  font-size: 12px;
}
.sc-annotation-item {
  padding: 4px 6px;
  border-radius: 6px;
  margin-bottom: 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.sc-annotation-item:last-child { margin-bottom: 0; }
.sc-annotation-item.sc-error {
  background: var(--q-red-dim);
}
.sc-annotation-item.sc-warning {
  background: var(--q-orange-dim);
}
.sc-snippet {
  font-weight: 600;
  text-decoration: wavy underline;
  text-decoration-color: var(--q-red);
  text-underline-offset: 3px;
}
.sc-warning .sc-snippet {
  text-decoration-color: var(--q-orange);
}
.sc-message {
  color: var(--q-text2);
}
.sc-suggestion {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  background: var(--q-green-dim);
  color: var(--q-green);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(159,232,112,0.2);
  transition: background 0.15s, border-color 0.15s;
}
.sc-suggestion:hover {
  background: rgba(159,232,112,0.2);
  border-color: var(--q-green);
}
.sc-ignore {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 10px;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
  margin-left: 4px;
}
.sc-ignore:hover {
  opacity: 1;
  color: var(--text-secondary);
}
