/* ============================================
   AI CMO - JOLIOO | Premium Dark Design System
   Inspired by Linear, Vercel, Stripe, Raycast
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================
   DESIGN TOKENS (CSS Custom Properties)
   ============================================ */
:root {
  /* --- Color Scale (Neutral, Radix-inspired) --- */
  --gray-1: #09090B;
  --gray-2: #0F0F12;
  --gray-3: #15151A;
  --gray-4: #1A1A21;
  --gray-5: #202028;
  --gray-6: #28282F;
  --gray-7: #323239;
  --gray-8: #3F3F46;
  --gray-9: #52525B;
  --gray-10: #71717A;
  --gray-11: #A1A1AA;
  --gray-12: #E4E4E7;
  --white: #FAFAFA;

  /* --- Accent Colors --- */
  --accent: #6366F1;
  --accent-light: #818CF8;
  --accent-muted: rgba(99, 102, 241, 0.12);
  --accent-glow: rgba(99, 102, 241, 0.25);
  --blue: #3B82F6;
  --blue-muted: rgba(59, 130, 246, 0.12);
  --cyan: #22D3EE;
  --cyan-muted: rgba(34, 211, 238, 0.12);
  --violet: #A78BFA;
  --violet-muted: rgba(167, 139, 250, 0.12);
  --green: #34D399;
  --green-muted: rgba(52, 211, 153, 0.12);
  --red: #F87171;
  --red-muted: rgba(248, 113, 113, 0.12);
  --amber: #FBBF24;
  --amber-muted: rgba(251, 191, 36, 0.12);

  /* --- Surfaces --- */
  --bg-primary: var(--gray-1);
  --bg-secondary: var(--gray-2);
  --bg-tertiary: var(--gray-3);
  --bg-elevated: rgba(255, 255, 255, 0.03);
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-active: rgba(255, 255, 255, 0.07);

  /* --- Borders --- */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(99, 102, 241, 0.3);

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

  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-md: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 28px;

  --leading-tight: 1.3;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;

  /* --- Spacing (4px grid) --- */
  --space-0: 0px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 36px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* --- Radii --- */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* --- Shadows (layered, like Stripe) --- */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.08);
  --shadow-glow-strong: 0 0 40px rgba(99, 102, 241, 0.15);

  /* --- Transitions --- */
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
  --duration-slower: 500ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* --- Z-index scale --- */
  --z-base: 1;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-overlay: 30;
  --z-modal: 40;
  --z-toast: 50;

  /* --- Sidebar --- */
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --topbar-height: 52px;
}

:root[data-theme="light"] {
  --gray-1: #F8FAFC;
  --gray-2: #F1F5F9;
  --gray-3: #E2E8F0;
  --gray-4: #CBD5E1;
  --gray-5: #B6C2D1;
  --gray-6: #94A3B8;
  --gray-7: #78869B;
  --gray-8: #5D6B81;
  --gray-9: #475569;
  --gray-10: #334155;
  --gray-11: #1E293B;
  --gray-12: #0F172A;
  --white: #FFFFFF;

  --accent-muted: rgba(99, 102, 241, 0.18);
  --accent-glow: rgba(99, 102, 241, 0.2);

  --bg-primary: #F8FAFC;
  --bg-secondary: #EEF2F7;
  --bg-tertiary: #E5EBF3;
  --bg-elevated: rgba(255, 255, 255, 0.86);
  --bg-hover: rgba(15, 23, 42, 0.06);
  --bg-active: rgba(99, 102, 241, 0.14);

  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-default: rgba(15, 23, 42, 0.12);
  --border-strong: rgba(15, 23, 42, 0.2);
  --border-accent: rgba(99, 102, 241, 0.42);

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.12), 0 2px 4px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.12), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--gray-12);
  background: var(--bg-primary);
  min-height: 100vh;
  overflow: hidden;
  transition: background-color 0.3s, color 0.3s;
}

/* Subtle ambient light -- very restrained, not cheap glow */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

:root[data-theme="light"] body::before {
  background:
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 46%),
    radial-gradient(circle at 82% 18%, rgba(59, 130, 246, 0.07) 0%, transparent 48%);
}

/* Tabular numbers for data display */
.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* ============================================
   SCROLLBAR (Minimal, Linear-style)
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

/* ============================================
   GLASS TOKENS (Raycast-quality blur)
   ============================================ */
.glass {
  background: var(--bg-elevated);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--border-subtle);
}

.glass-strong {
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(56px) saturate(180%);
  -webkit-backdrop-filter: blur(56px) saturate(180%);
  border: 1px solid var(--border-subtle);
}

/* ============================================
   FOCUS STATES (Accessibility, Radix-style)
   ============================================ */
:focus {
  outline: none;
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--accent);
}

/* ============================================
   LAYOUT
   ============================================ */
.app-layout {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: var(--z-base);
}

/* ============================================
   SIDEBAR (Linear-inspired, polished)
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 0;
  transition: width var(--duration-slow) var(--ease-out),
              min-width var(--duration-slow) var(--ease-out);
  position: relative;
  z-index: var(--z-sticky);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
}

.sidebar.collapsed .team-switcher {
  display: none;
}

.sidebar.collapsed .sidebar-logo span,
.sidebar.collapsed .nav-item-text,
.sidebar.collapsed .badge,
.sidebar.collapsed .team-details,
.sidebar.collapsed .theme-toggle-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

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

.sidebar-logo-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}

.sidebar-logo-icon svg {
  width: 32px;
  height: 32px;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-logo h1 {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #818CF8, #6366F1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.sidebar-logo span {
  font-size: var(--text-xs);
  color: var(--gray-9);
  font-weight: 500;
  display: block;
  margin-top: 1px;
  letter-spacing: 0.01em;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.sidebar.collapsed .sidebar-logo-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

.team-switcher {
  padding: var(--space-3) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.team-switcher label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-9);
}

.team-switcher-select {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-tertiary);
  color: var(--gray-12);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 7px 9px;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}

.team-switcher-select:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.team-switcher-select:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 2px var(--accent-muted);
}

.team-switcher-meta {
  min-height: 14px;
  font-size: var(--text-xs);
  color: var(--gray-10);
}

/* Sidebar collapse toggle */
.sidebar-toggle {
  position: absolute;
  top: var(--space-6);
  right: calc(-1 * var(--space-3));
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--gray-4);
  border: 1px solid var(--border-default);
  color: var(--gray-10);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
  z-index: 10;
}

.sidebar:hover .sidebar-toggle {
  opacity: 1;
}

.sidebar-toggle:hover {
  background: var(--gray-5);
  color: var(--gray-12);
}

.sidebar-toggle svg {
  width: 12px;
  height: 12px;
  transition: transform var(--duration-fast) var(--ease-out);
}

.sidebar.collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

/* Section labels */
.sidebar-section-label {
  padding: var(--space-4) var(--space-4) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--gray-8);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-3) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--gray-10);
  font-size: var(--text-base);
  font-weight: 500;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
  border: 1px solid transparent;
  text-decoration: none;
  position: relative;
  min-height: 36px;
}

.nav-item:hover {
  color: var(--gray-12);
  background: var(--bg-hover);
}

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

/* Active indicator bar (Linear-style left accent) */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

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

.nav-item .nav-item-text {
  transition: opacity var(--duration-normal) var(--ease-out);
}

.nav-item .badge {
  margin-left: auto;
  background: var(--bg-active);
  color: var(--gray-10);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}

.nav-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-2) var(--space-3);
}

/* Collapsed sidebar tooltips */
.sidebar.collapsed .nav-item[data-tooltip] {
  position: relative;
}

.sidebar.collapsed .nav-item[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--gray-3);
  color: var(--gray-12);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-md);
  z-index: 100;
}

.sidebar.collapsed .nav-item[data-tooltip]:hover::after {
  opacity: 1;
}

.sidebar.collapsed .sidebar-section-label {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

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

.theme-toggle {
  width: 100%;
  margin-top: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-tertiary);
  color: var(--gray-11);
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--gray-12);
}

.theme-toggle-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
}

.theme-toggle-icon svg {
  width: 16px;
  height: 16px;
}

.theme-toggle-label {
  transition: opacity var(--duration-normal) var(--ease-out);
}

.sidebar.collapsed .theme-toggle {
  justify-content: center;
  padding: var(--space-2);
}

/* Version badge */
.sidebar-version {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-1) 0;
}

.version-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--accent-muted);
  color: var(--accent-light);
  letter-spacing: 0.02em;
}

.version-label {
  font-size: 10px;
  color: var(--gray-9);
  transition: opacity var(--duration-normal) var(--ease-out);
}

.sidebar.collapsed .version-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-version {
  justify-content: center;
}

.team-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.team-info:hover {
  background: var(--bg-hover);
}

.team-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), #8B5CF6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.team-details {
  overflow: hidden;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.team-details .name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-12);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-details .id {
  font-size: var(--text-xs);
  color: var(--gray-9);
}

.team-details .credits {
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: 2px;
  letter-spacing: 0.01em;
}

.team-details .credits.credit-high {
  color: var(--green);
}

.team-details .credits.credit-mid {
  color: var(--amber);
}

.team-details .credits.credit-low {
  color: var(--red);
}

/* Online status dot */
.team-avatar-wrap {
  position: relative;
}

.status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--green);
  border: 2px solid var(--bg-secondary);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
}

/* ============================================
   TOP BAR (Stripe-inspired, functional)
   ============================================ */
.topbar {
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(9, 9, 11, 0.7);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  z-index: var(--z-sticky);
}

.sidebar,
.main-content,
.topbar,
.kpi-card,
.chart-card,
.report-card,
.campaign-stat-card,
.settings-card {
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

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

.topbar h2 {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--gray-12);
  letter-spacing: -0.01em;
}

/* Breadcrumb separator */
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--gray-9);
}

.topbar-breadcrumb span {
  color: var(--gray-12);
  font-weight: 500;
}

/* Command palette trigger */
.search-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--gray-9);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
  min-width: 200px;
}

.search-trigger:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.search-trigger svg {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

.search-trigger .kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gray-8);
  background: var(--gray-4);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  line-height: 1;
}

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

/* Notification bell */
.notification-btn {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--gray-10);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}

.notification-btn:hover {
  color: var(--gray-12);
  background: var(--bg-hover);
}

.notification-btn svg {
  width: 16px;
  height: 16px;
}

.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--red);
  border: 1.5px solid var(--bg-primary);
}

/* Notification panel */
.notification-wrap {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-primary);
  line-height: 1;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.notification-panel.open {
  display: flex;
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.notification-panel-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.notification-panel-body {
  flex: 1;
  overflow-y: auto;
  max-height: 350px;
}

.alert-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--duration-fast) var(--ease-out);
}

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

.alert-item:hover {
  background: var(--bg-hover);
}

.alert-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.alert-icon.warning { background: var(--amber-muted); color: var(--amber); }
.alert-icon.success { background: var(--green-muted); color: var(--green); }
.alert-icon.info { background: var(--blue-muted); color: var(--blue); }

.alert-content {
  flex: 1;
  min-width: 0;
}

.alert-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.alert-message {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

.alert-priority {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 3px;
  align-self: flex-start;
  flex-shrink: 0;
}

.alert-priority-high { background: var(--red-muted); color: var(--red); }
.alert-priority-medium { background: var(--amber-muted); color: var(--amber); }
.alert-priority-low { background: var(--green-muted); color: var(--green); }

/* Ghost button (refined) */
.btn-ghost {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--gray-10);
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}

.btn-ghost:hover {
  color: var(--gray-12);
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.btn-ghost:active {
  background: var(--bg-active);
}

.btn-ghost svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

/* Mobile menu toggle - hidden by default, shown on mobile */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--gray-10);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}

.mobile-menu-btn:hover {
  color: var(--gray-12);
  background: var(--bg-hover);
}

.mobile-menu-btn svg {
  width: 18px;
  height: 18px;
}

/* Primary button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px var(--space-4);
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent);
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1),
              var(--shadow-glow);
}

.btn-primary:active {
  opacity: 0.85;
  transform: scale(0.98);
}

/* ============================================
   CONTENT AREA
   ============================================ */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
}

/* ============================================
   PAGE SECTIONS (with transitions)
   ============================================ */
.page {
  display: none;
  animation: pageIn var(--duration-slow) var(--ease-out) both;
}

.page.active {
  display: block;
}

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

/* ============================================
   KPI CARDS (Stripe-quality data display)
   ============================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.kpi-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  transition: border-color var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

/* Subtle top accent gradient strip */
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-muted), transparent);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

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

.kpi-card:hover::before {
  opacity: 1;
}

/* Stagger entrance animation */
.kpi-card:nth-child(1) { animation: cardIn var(--duration-slow) var(--ease-out) both; animation-delay: 0ms; }
.kpi-card:nth-child(2) { animation: cardIn var(--duration-slow) var(--ease-out) both; animation-delay: 50ms; }
.kpi-card:nth-child(3) { animation: cardIn var(--duration-slow) var(--ease-out) both; animation-delay: 100ms; }
.kpi-card:nth-child(4) { animation: cardIn var(--duration-slow) var(--ease-out) both; animation-delay: 150ms; }

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

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

.kpi-card .kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-card .kpi-icon.blue { background: var(--blue-muted); }
.kpi-card .kpi-icon.purple { background: var(--accent-muted); }
.kpi-card .kpi-icon.cyan { background: var(--cyan-muted); }
.kpi-card .kpi-icon.violet { background: var(--violet-muted); }

.kpi-card .kpi-icon svg {
  width: 16px;
  height: 16px;
}

/* Trend indicator */
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}

.kpi-trend.up {
  color: var(--green);
  background: var(--green-muted);
}

.kpi-trend.down {
  color: var(--red);
  background: var(--red-muted);
}

.kpi-trend.neutral {
  color: var(--gray-10);
  background: var(--bg-active);
}

.kpi-card .kpi-value {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--gray-12);
  font-variant-numeric: tabular-nums;
  line-height: var(--leading-tight);
  /* Remove gradient text - clean solid color is more premium */
}

.kpi-card .kpi-label {
  font-size: var(--text-sm);
  color: var(--gray-9);
  margin-top: var(--space-1);
  font-weight: 500;
}

/* Mini sparkline container */
.kpi-sparkline {
  margin-top: var(--space-3);
  height: 24px;
  opacity: 0.6;
}

.kpi-sparkline svg {
  width: 100%;
  height: 24px;
}

/* ============================================
   CHART CARDS (Refined with time selectors)
   ============================================ */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.chart-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: border-color var(--duration-normal) var(--ease-out);
}

.chart-card:hover {
  border-color: var(--border-strong);
}

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

.chart-card h3 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--gray-11);
  letter-spacing: -0.005em;
}

/* Time range selector pills */
.time-range {
  display: flex;
  gap: 1px;
  background: var(--gray-4);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.time-range button {
  padding: 3px 8px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--gray-9);
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
  letter-spacing: 0.02em;
}

.time-range button:hover {
  color: var(--gray-12);
}

.time-range button.active {
  background: var(--gray-6);
  color: var(--gray-12);
  box-shadow: var(--shadow-xs);
}

.chart-card canvas {
  max-height: 260px;
}

/* Chart loading state */
.chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 260px;
}

/* ============================================
   RECOMMENDATIONS (Marketing Pulse)
   ============================================ */
.recs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.rec-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: border-color var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}

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

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

.rec-card .card-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--gray-12);
  letter-spacing: -0.01em;
}

.rec-card .card-date {
  font-size: var(--text-xs);
  color: var(--gray-9);
  background: var(--gray-4);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.rec-card .events {
  margin-bottom: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.event-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--accent-muted);
  color: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.15);
  letter-spacing: 0.01em;
}

.rec-card .tips {
  list-style: none;
}

.rec-card .tips li {
  font-size: var(--text-sm);
  color: var(--gray-11);
  padding: 6px 0 6px var(--space-5);
  position: relative;
  line-height: var(--leading-relaxed);
}

.rec-card .tips li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--accent);
  opacity: 0.6;
}

.seasonal-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(139, 92, 246, 0.04));
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-top: var(--space-4);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--gray-11);
}

.seasonal-banner strong {
  color: var(--accent-light);
}

.recs-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-16);
  color: var(--gray-9);
  font-size: var(--text-md);
}

.recs-error {
  text-align: center;
  padding: var(--space-8);
  color: var(--red);
  font-size: var(--text-base);
}

/* ============================================
   CHAT (Modern, Linear-quality)
   ============================================ */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-height) - var(--space-12));
}

.chat-examples {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.chat-examples button {
  padding: 8px var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: var(--font-sans);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  color: var(--gray-10);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.chat-examples button:hover {
  border-color: var(--border-accent);
  color: var(--gray-12);
  background: var(--bg-hover);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-2) 0 var(--space-4);
}

.msg {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  max-width: 78%;
  line-height: var(--leading-relaxed);
  font-size: var(--text-md);
  white-space: pre-wrap;
  animation: msgIn var(--duration-slow) var(--ease-out) both;
}

/* M8 fix: Bot messages use markdown HTML, so override pre-wrap */
.msg.bot {
  white-space: normal;
}

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

.msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--white);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.msg.bot {
  align-self: flex-start;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm) var(--radius-lg) var(--radius-lg) var(--radius-lg);
  color: var(--gray-12);
}

.msg.bot h1, .msg.bot h2, .msg.bot h3 {
  color: var(--accent-light);
  margin: var(--space-3) 0 var(--space-2);
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
}

.msg.bot strong {
  color: var(--accent-light);
  font-weight: 600;
}

.msg.bot table {
  border-collapse: collapse;
  margin: var(--space-2) 0;
  width: 100%;
  font-size: var(--text-sm);
}

.msg.bot th, .msg.bot td {
  border: 1px solid var(--border-subtle);
  padding: var(--space-2) var(--space-3);
  text-align: left;
}

.msg.bot th {
  background: var(--gray-4);
  color: var(--accent-light);
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.msg.bot td {
  color: var(--gray-11);
}

.msg.bot code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 2px 5px;
  background: var(--gray-4);
  border-radius: 4px;
  color: var(--accent-light);
}

.msg.bot pre {
  background: var(--gray-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
  font-size: var(--text-sm);
}

.msg.bot pre code {
  background: none;
  padding: 0;
}

.msg.bot ul, .msg.bot ol {
  padding-left: var(--space-5);
  margin: var(--space-2) 0;
}

.msg.bot li {
  margin: var(--space-1) 0;
  color: var(--gray-11);
}

/* Typing indicator */
.typing-indicator {
  display: inline-flex;
  gap: 4px;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm) var(--radius-lg) var(--radius-lg) var(--radius-lg);
  align-self: flex-start;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--gray-8);
  animation: typingDot 1.4s infinite both;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingDot {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  30% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Message timestamp */
.msg-time {
  font-size: 10px;
  color: var(--gray-8);
  margin-top: var(--space-1);
  font-variant-numeric: tabular-nums;
}

.msg.user .msg-time {
  text-align: right;
}

/* Tools detail */
.tools-detail {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--gray-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  border: 1px solid var(--border-subtle);
}

.tools-detail summary {
  cursor: pointer;
  color: var(--accent-light);
  font-weight: 600;
  font-size: var(--text-sm);
  user-select: none;
}

.tools-detail summary:hover {
  color: var(--accent);
}

.tools-detail pre {
  margin-top: var(--space-2);
  color: var(--gray-9);
  overflow-x: auto;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  margin-right: var(--space-1);
  letter-spacing: 0.03em;
}

.tool-badge.sql {
  background: var(--cyan-muted);
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.15);
}

.tool-badge.web {
  background: var(--violet-muted);
  color: var(--violet);
  border: 1px solid rgba(167, 139, 250, 0.15);
}

/* Chat input */
.chat-input-row {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) 0 0;
  border-top: 1px solid var(--border-subtle);
}

.chat-input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--gray-12);
  font-size: var(--text-md);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.chat-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.chat-input::placeholder {
  color: var(--gray-8);
}

.chat-send {
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  border: none;
  background: var(--accent);
  color: var(--white);
  font-size: var(--text-md);
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.chat-send:hover {
  opacity: 0.9;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1),
              var(--shadow-glow);
}

.chat-send:active {
  transform: scale(0.97);
}

.chat-send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ============================================
   LOGIN PAGE (Dramatic, Investor-grade)
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: auto;
}

/* Animated mesh gradient background */
.login-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
  animation: loginAmbient 15s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes loginAmbient {
  0% {
    transform: translate(0, 0) scale(1);
    filter: hue-rotate(0deg);
  }
  50% {
    transform: translate(-2%, 2%) scale(1.02);
    filter: hue-rotate(10deg);
  }
  100% {
    transform: translate(2%, -1%) scale(1);
    filter: hue-rotate(-5deg);
  }
}

/* Subtle grid pattern overlay */
.login-page::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  opacity: 0.5;
}

.login-card {
  width: 400px;
  position: relative;
  z-index: 1;
  background: rgba(15, 15, 20, 0.85);
  backdrop-filter: blur(56px) saturate(180%);
  -webkit-backdrop-filter: blur(56px) saturate(180%);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
  box-shadow: var(--shadow-xl),
              0 0 60px rgba(99, 102, 241, 0.05);
  animation: loginCardIn 600ms var(--ease-out) both;
}

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

.login-card h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-1);
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #818CF8, #6366F1, #8B5CF6);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.login-card p {
  text-align: center;
  color: var(--gray-9);
  font-size: var(--text-base);
  margin-bottom: var(--space-8);
}

/* Social proof strip */
.login-social-proof {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--gray-8);
  margin-bottom: var(--space-6);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.login-social-proof strong {
  color: var(--gray-10);
}

.form-group {
  margin-bottom: var(--space-5);
}

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-11);
  margin-bottom: var(--space-2);
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--gray-12);
  font-size: var(--text-md);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-input::placeholder {
  color: var(--gray-8);
}

.login-btn {
  width: 100%;
  padding: var(--space-3);
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--white);
  font-size: var(--text-md);
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
  margin-top: var(--space-2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.login-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transition: left 0.5s;
}

.login-btn:hover {
  opacity: 0.95;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1),
              var(--shadow-glow-strong);
}

.login-btn:hover::after {
  left: 100%;
}

.login-btn:active {
  transform: scale(0.98);
}

.login-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.login-error {
  color: var(--red);
  font-size: var(--text-sm);
  text-align: center;
  margin-top: var(--space-4);
  display: none;
  padding: var(--space-3);
  background: var(--red-muted);
  border-radius: var(--radius-md);
  border: 1px solid rgba(248, 113, 113, 0.15);
}

.login-error.show {
  display: block;
  animation: shakeX 400ms var(--ease-out);
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Login footer links */
.login-footer {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
  font-size: var(--text-xs);
}

.login-footer a {
  color: var(--gray-8);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.login-footer a:hover {
  color: var(--gray-11);
}

/* ============================================
   LOADING SPINNER (Refined)
   ============================================ */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
}

.spinner.lg {
  width: 24px;
  height: 24px;
  border-width: 2.5px;
}

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

/* ============================================
   SKELETON LOADING (Premium shimmer)
   ============================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-4) 0%,
    var(--gray-5) 40%,
    var(--gray-4) 80%
  );
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 12px;
  margin: var(--space-2) 0;
  border-radius: var(--radius-sm);
}

.skeleton-text.lg {
  height: 28px;
  width: 120px;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
}

@keyframes skeleton-wave {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* KPI Skeleton */
.kpi-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 4px 0;
}

.kpi-skeleton .skeleton-value {
  height: 32px;
  width: 80px;
  border-radius: var(--radius-md);
}

.kpi-skeleton .skeleton-label {
  height: 10px;
  width: 60%;
  border-radius: var(--radius-sm);
}

/* Page transition loading */
.page-loading {
  position: relative;
}

.page-loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  animation: page-load-bar 1.5s infinite;
  z-index: 10;
  border-radius: 1px;
}

@keyframes page-load-bar {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Fade-in for loaded content */
.fade-in {
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

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

/* Table skeleton rows */
.table-skeleton-row td {
  padding: 12px !important;
}

.table-skeleton-row .skeleton-cell {
  height: 12px;
  border-radius: var(--radius-sm);
}

/* ============================================
   SECTION HEADER
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.section-header h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--gray-12);
  letter-spacing: -0.01em;
}

.section-header .subtitle {
  font-size: var(--text-sm);
  color: var(--gray-9);
  margin-top: var(--space-1);
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
}

.empty-state svg {
  margin-bottom: var(--space-4);
  opacity: 0.15;
}

.empty-state h3 {
  color: var(--gray-9);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.empty-state p {
  color: var(--gray-8);
  font-size: var(--text-md);
  max-width: 360px;
  margin: 0 auto;
  line-height: var(--leading-relaxed);
}

.state-card {
  min-height: 260px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-default);
  background: rgba(255, 255, 255, 0.015);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
  padding: var(--space-6);
}

.state-card svg {
  opacity: 0.4;
}

.state-card h4 {
  margin: 0;
  color: var(--gray-12);
  font-size: var(--text-md);
  font-weight: 600;
}

.state-card p {
  margin: 0;
  color: var(--gray-10);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  max-width: 320px;
}

.state-card.error {
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.08);
}

.state-card.error h4 {
  color: var(--red);
}

.state-retry-btn {
  margin-top: var(--space-2);
}

.chart-skeleton {
  height: 260px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
}

.chart-skeleton .skeleton-line {
  height: 12px;
  border-radius: var(--radius-sm);
}

.chart-skeleton .skeleton-line.tall {
  flex: 1;
  min-height: 140px;
}

.social-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.social-skeleton-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.social-skeleton-card .skeleton-line {
  height: 12px;
  border-radius: var(--radius-sm);
}

.social-skeleton-card .skeleton-line.big {
  height: 22px;
  width: 40%;
}

@media (max-width: 1024px) {
  .social-skeleton-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   BADGE / TAG SYSTEM
   ============================================ */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-status.success {
  background: var(--green-muted);
  color: var(--green);
}

.badge-status.warning {
  background: var(--amber-muted);
  color: var(--amber);
}

.badge-status.error {
  background: var(--red-muted);
  color: var(--red);
}

.badge-status.info {
  background: var(--blue-muted);
  color: var(--blue);
}

/* Status dot inside badge */
.badge-status::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background: currentColor;
}

/* ============================================
   TOOLTIP
   ============================================ */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--gray-6);
  color: var(--gray-12);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
  box-shadow: var(--shadow-md);
  z-index: var(--z-tooltip, 50);
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ============================================
   DIVIDER
   ============================================ */
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-4) 0;
}

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

/* Large desktop (1440px+) */
@media (min-width: 1440px) {
  .kpi-grid {
    gap: var(--space-5);
  }

  .charts-grid {
    gap: var(--space-5);
  }

  .content-area {
    padding: var(--space-8);
  }
}

/* Tablet landscape / Small desktop */
@media (max-width: 1200px) {
  .recs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

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

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

  .search-trigger {
    display: none;
  }
}

/* Mobile landscape */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    min-width: 280px;
    z-index: var(--z-overlay);
    transform: translateX(-100%);
    transition: transform var(--duration-slow) var(--ease-out);
    box-shadow: var(--shadow-xl);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .mobile-menu-btn {
    display: flex;
  }

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

  .sidebar-overlay.active {
    display: block;
  }

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

  .kpi-card {
    padding: var(--space-4);
  }

  .kpi-card .kpi-value {
    font-size: var(--text-xl);
  }

  .content-area {
    padding: var(--space-4);
  }

  .topbar {
    padding: 0 var(--space-4);
  }

  .msg {
    max-width: 90%;
  }

  .login-card {
    width: calc(100vw - var(--space-8));
    margin: var(--space-4);
    padding: var(--space-6);
  }
}

/* Mobile portrait */
@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .chat-examples {
    flex-direction: column;
  }

  .chat-examples button {
    width: 100%;
    text-align: left;
  }

  .topbar h2 {
    font-size: var(--text-base);
  }

  .topbar-actions {
    gap: var(--space-1);
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  body {
    background: white;
    color: black;
  }

  .sidebar,
  .topbar,
  .chat-input-row,
  .chat-examples {
    display: none !important;
  }

  .main-content {
    overflow: visible;
  }

  .content-area {
    padding: 0;
  }

  .kpi-card,
  .chart-card,
  .rec-card {
    background: white;
    border: 1px solid #e5e5e5;
    box-shadow: none;
  }
}

/* ============================================
   REDUCED MOTION (Accessibility)
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fade-in {
  animation: fadeIn var(--duration-slow) var(--ease-out) both;
}

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

.slide-up {
  animation: slideUp var(--duration-slow) var(--ease-out) both;
}

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

/* ============================================
   APEXCHARTS GLASS TOOLTIP
   ============================================ */
.glass-tooltip {
  background: rgba(9, 9, 11, 0.9) !important;
  backdrop-filter: blur(40px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(40px) saturate(180%) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: var(--space-2) var(--space-3) !important;
}

.glass-tooltip .apexcharts-tooltip-title {
  background: var(--bg-hover) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  color: var(--gray-11) !important;
  font-size: var(--text-sm) !important;
}

.glass-tooltip .apexcharts-tooltip-y-group .apexcharts-tooltip-text-y-value {
  color: var(--white) !important;
  font-weight: 600 !important;
}

.apexcharts-legend-text {
  color: var(--gray-10) !important;
}

/* ============================================
   CHAT INLINE CHARTS
   ============================================ */
.chat-chart-container {
  position: relative;
  margin: var(--space-3) 0 var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: chartSlideIn var(--duration-slow) var(--ease-out);
}

.chat-chart-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-muted), rgba(139, 92, 246, 0.15), transparent);
}

.chat-chart-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--gray-12);
  margin-bottom: var(--space-2);
}

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

/* ============================================
   CAMPAIGN PAGE
   ============================================ */
.campaign-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-2);
}

.campaign-stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  transition: border-color var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}

.campaign-stat-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transform: translateY(-1px);
}

.campaign-stat-card .stat-value {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--accent-light);
  font-variant-numeric: tabular-nums;
}

.campaign-stat-card .stat-label {
  font-size: var(--text-xs);
  color: var(--gray-9);
  margin-top: var(--space-1);
  font-weight: 500;
}

.campaign-ai-card {
  grid-column: 1 / -1;
}

.campaign-suggestion {
  padding: var(--space-1) 0;
}

.cs-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.cs-name {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--gray-12);
  letter-spacing: -0.01em;
}

.cs-type {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--accent-muted);
  color: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.15);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cs-desc {
  font-size: var(--text-base);
  color: var(--gray-11);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

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

.cs-metric {
  text-align: center;
  padding: var(--space-3);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.cs-metric-val {
  display: block;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--accent-light);
  font-variant-numeric: tabular-nums;
}

.cs-metric-lbl {
  display: block;
  font-size: 10px;
  color: var(--gray-9);
  margin-top: 2px;
  font-weight: 500;
}

.cs-actions {
  font-size: var(--text-base);
  color: var(--gray-11);
}

.cs-actions strong {
  color: var(--accent-light);
}

.cs-actions ul {
  list-style: none;
  margin-top: var(--space-2);
}

.cs-actions li {
  padding: var(--space-1) 0 var(--space-1) var(--space-5);
  position: relative;
  line-height: var(--leading-relaxed);
}

.cs-actions li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--accent);
}

/* ============================================
   CAMPAIGN RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .campaign-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .cs-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ============================================
   PULSE - GUTSCHEIN BUTTON
   ============================================ */
.rec-card-actions {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.rec-gutschein-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-muted);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.rec-gutschein-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--accent-light);
}

.rec-gutschein-btn svg {
  width: 14px;
  height: 14px;
}

/* ============================================
   GUTSCHEIN STUDIO PAGE
   ============================================ */
.gutschein-studio {
  max-width: 900px;
}

.gutschein-form-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
}

.gutschein-form-card h4 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--gray-12);
  margin-bottom: var(--space-1);
}

.form-hint {
  font-size: var(--text-sm);
  color: var(--gray-9);
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

.gutschein-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  color: var(--gray-12);
  font-size: var(--text-sm);
  font-family: inherit;
  resize: vertical;
  transition: border-color var(--duration-fast) var(--ease-out);
  box-sizing: border-box;
}

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

.gutschein-input::placeholder {
  color: var(--gray-7);
}

.gutschein-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--space-3);
  padding: 10px 24px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.gutschein-create-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.gutschein-create-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Generating state */
.gutschein-generating {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-5);
}

.gutschein-generating strong {
  color: var(--gray-12);
  font-size: var(--text-base);
}

.gutschein-generating p {
  color: var(--gray-9);
  font-size: var(--text-sm);
  margin-top: var(--space-1);
}

.gutschein-error {
  padding: var(--space-4);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-lg);
  color: var(--red);
  font-size: var(--text-sm);
}

/* Voucher Preview Card */
.gutschein-preview {
  margin-bottom: var(--space-5);
  animation: pageIn var(--duration-slow) var(--ease-out);
}

.gutschein-card-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-lg);
}

.gutschein-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-6);
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.1) 100%);
}

.gutschein-amount {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  font-size: 2rem;
  font-weight: 800;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  background: rgba(99, 102, 241, 0.85);
  padding: 4px 16px;
  border-radius: var(--radius-lg);
}

.gutschein-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  margin-bottom: var(--space-1);
}

.gutschein-desc {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.85);
  line-height: var(--leading-relaxed);
  max-width: 500px;
}

.gutschein-company {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.6);
  margin-top: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Actions */
.gutschein-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: white;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

/* Meta details */
.gutschein-meta {
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--gray-9);
}

.gutschein-meta summary {
  cursor: pointer;
  color: var(--gray-8);
  padding: var(--space-2) 0;
}

.gutschein-meta pre {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: var(--text-xs);
  color: var(--gray-10);
  margin-top: var(--space-2);
}

/* History grid */
#gutscheinHistory h4 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--gray-11);
  margin-bottom: var(--space-3);
}

.gutschein-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}

.gutschein-thumb {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  transition: all var(--duration-fast) var(--ease-out);
}

.gutschein-thumb:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.gutschein-thumb img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

.gutschein-thumb-info {
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elevated);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gutschein-thumb-title {
  font-size: var(--text-xs);
  color: var(--gray-11);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}

.gutschein-thumb-amount {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
}

/* Responsive gutschein */
@media (max-width: 768px) {
  .gutschein-amount { font-size: 1.5rem; }
  .gutschein-title { font-size: var(--text-lg); }
  .gutschein-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ============================================
   Reports / Industry Intelligence
   ============================================ */
.report-loading {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 3rem 2rem;
  color: var(--text-secondary);
}
.report-loading strong { color: var(--text-primary); display: block; margin-bottom: 0.25rem; }
.report-loading p { font-size: var(--text-sm); margin: 0; }

.report-error {
  padding: 2rem;
  color: #f87171;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.15);
  border-radius: var(--radius-lg);
}

.report-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-tertiary);
  gap: 1rem;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.report-date {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* Report sections */
.report-section {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.report-section h4 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* Executive Summary */
.report-summary {
  border-left: 3px solid var(--accent);
}
.report-exec-summary {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
}

/* SWOT Grid */
.report-swot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}
.swot-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.swot-header {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.swot-icon { font-size: 1rem; }
.swot-strengths .swot-header { color: #4ade80; }
.swot-opportunities .swot-header { color: #818cf8; }
.swot-threats .swot-header { color: #fb923c; }
.swot-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.swot-card li {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.swot-card li:last-child { border-bottom: none; }
.swot-card li::before {
  content: '›';
  margin-right: 0.5rem;
  color: var(--text-tertiary);
}

/* Competitors */
.report-competitors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
}
.competitor-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.comp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.comp-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.comp-type {
  font-size: var(--text-xs);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-weight: 500;
}
.comp-type-direct {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}
.comp-type-indirect {
  background: rgba(251, 146, 60, 0.12);
  color: #fb923c;
}
.comp-row {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  padding: 0.25rem 0;
}
.comp-label {
  font-weight: 600;
  color: var(--text-tertiary);
}

/* Market Trends */
.report-trends {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.trend-row {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.trend-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.trend-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.trend-impact {
  font-size: var(--text-xs);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.trend-impact-high {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}
.trend-impact-medium {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}
.trend-impact-low {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}
.trend-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0 0 0.5rem 0;
  line-height: 1.6;
}
.trend-action {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.trend-action strong { color: var(--accent); }

/* Benchmarks */
.report-benchmarks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}
.bench-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}
.bench-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.bench-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.bench-rec {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Regional Insights */
.report-regional { }
.reg-note {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
  line-height: 1.6;
}
.reg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.reg-col strong {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.reg-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.reg-col li {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: 0.3rem 0;
}
.reg-col li::before {
  content: '•';
  margin-right: 0.5rem;
  color: var(--accent);
}

/* Recommendations */
.report-recs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rec-item {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.rec-item-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.rec-priority {
  font-size: var(--text-xs);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rec-priority-high {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}
.rec-priority-medium {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}
.rec-title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.rec-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

/* Responsive reports */
@media (max-width: 768px) {
  .report-swot-grid,
  .report-competitors,
  .report-benchmarks,
  .reg-grid { grid-template-columns: 1fr; }
  .report-section { padding: 1rem; }
}

/* ============================================
   Social Media Intelligence — Investor Tier
   ============================================ */

/* --- SVG Gauge Animation --- */
@keyframes gaugeStroke {
  from { stroke-dashoffset: 339.292; }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulseGlow {
  0%, 100% { filter: drop-shadow(0 0 8px var(--glow-c, rgba(99,102,241,0.3))); }
  50% { filter: drop-shadow(0 0 20px var(--glow-c, rgba(99,102,241,0.5))); }
}

/* Hero: 3-column layout — gauge | summary | 3 mini KPIs */
.sm-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
  background: linear-gradient(135deg, rgba(99,102,241,0.06) 0%, rgba(139,92,246,0.04) 50%, rgba(34,211,238,0.03) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}
.sm-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.08), transparent 60%);
  pointer-events: none;
}
.sm-gauge {
  position: relative;
  width: 130px;
  height: 130px;
  flex-shrink: 0;
}
.sm-gauge svg {
  width: 130px;
  height: 130px;
  transform: rotate(-90deg);
}
.sm-gauge-bg {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 8;
}
.sm-gauge-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  animation: gaugeStroke 1.2s var(--ease-out) forwards;
  filter: drop-shadow(0 0 6px var(--gauge-color, var(--accent)));
}
.sm-gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.sm-gauge-val {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
.sm-gauge-lbl {
  font-size: var(--text-xs);
  color: var(--gray-10);
  margin-top: 2px;
}
.sm-hero-body {
  position: relative;
  z-index: 1;
}
.sm-hero-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--white);
  margin: 0 0 var(--space-2) 0;
  letter-spacing: -0.01em;
}
.sm-hero-desc {
  font-size: var(--text-sm);
  color: var(--gray-11);
  margin: 0;
  line-height: var(--leading-relaxed);
  max-width: 440px;
}
.sm-hero-kpis {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
  z-index: 1;
}
.sm-hero-kpi {
  text-align: right;
  padding: var(--space-3) var(--space-4);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  min-width: 120px;
}
.sm-hero-kpi-val {
  display: block;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}
.sm-hero-kpi-lbl {
  display: block;
  font-size: 10px;
  color: var(--gray-10);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 3px;
}

/* Platform cards — 2-col */
.sm-platforms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}
.sm-plat {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
  animation: fadeSlideUp 0.4s var(--ease-out) both;
}
.sm-plat:nth-child(2) { animation-delay: 0.08s; }
.sm-plat:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}
.sm-plat-top {
  padding: var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}
.sm-plat-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.sm-plat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.sm-plat-icon-ig { background: linear-gradient(135deg, #833AB4, #FD1D1D, #F77737); }
.sm-plat-icon-google { background: var(--amber-muted); }
.sm-plat-icon-web { background: var(--accent-muted); }
.sm-plat-meta { flex: 1; min-width: 0; }
.sm-plat-name {
  display: block;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--white);
}
.sm-plat-sub {
  font-size: var(--text-xs);
  color: var(--gray-10);
}
.sm-plat-score {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.sm-plat-score svg {
  width: 44px;
  height: 44px;
  transform: rotate(-90deg);
}
.sm-plat-score-bg { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 3; }
.sm-plat-score-fill { fill: none; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 113.097; }
.sm-plat-score-val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
}

/* Stats row inside platform */
.sm-plat-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-subtle);
}
.sm-plat-stat {
  text-align: center;
  padding: var(--space-3) var(--space-2);
  background: var(--bg-secondary);
}
.sm-plat-stat-v {
  display: block;
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}
.sm-plat-stat-l {
  display: block;
  font-size: 9px;
  color: var(--gray-9);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

/* Assessment + tags inside platform */
.sm-plat-body {
  padding: var(--space-4) var(--space-5);
}
.sm-plat-assess {
  font-size: var(--text-sm);
  color: var(--gray-11);
  line-height: var(--leading-relaxed);
  margin: 0 0 var(--space-3) 0;
}
.sm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-2);
}
.sm-tag {
  font-size: 10px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.sm-tag-good { background: rgba(52,211,153,0.1); color: var(--green); border: 1px solid rgba(52,211,153,0.18); }
.sm-tag-warn { background: rgba(251,191,36,0.1); color: var(--amber); border: 1px solid rgba(251,191,36,0.18); }
.sm-tag-info { background: var(--accent-muted); color: var(--accent-light); border: 1px solid rgba(99,102,241,0.18); }

/* 2-col detail panels: Posts | Reviews */
.sm-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}
.sm-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: fadeSlideUp 0.5s var(--ease-out) both;
}
.sm-panel:nth-child(2) { animation-delay: 0.1s; }
.sm-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}
.sm-panel-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--white);
  margin: 0;
}
.sm-panel-count {
  font-size: var(--text-xs);
  color: var(--gray-9);
  background: rgba(255,255,255,0.04);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.sm-panel-list {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 420px;
  overflow-y: auto;
}
.sm-panel-list::-webkit-scrollbar { width: 3px; }
.sm-panel-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

/* Post item */
.sm-post {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.sm-post:hover {
  border-color: var(--border-subtle);
  background: rgba(255,255,255,0.035);
}
.sm-post-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.sm-post-type {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-light);
  background: var(--accent-muted);
  padding: 1px 7px;
  border-radius: 3px;
}
.sm-post-date {
  font-size: 10px;
  color: var(--gray-9);
}
.sm-post-text {
  font-size: var(--text-xs);
  color: var(--gray-11);
  line-height: 1.45;
  margin: 0 0 5px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sm-post-metrics {
  display: flex;
  gap: var(--space-4);
  font-size: 10px;
  color: var(--gray-9);
}
.sm-post-metric { display: flex; align-items: center; gap: 3px; }

/* Review item */
.sm-review {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.sm-review:hover {
  border-color: var(--border-subtle);
  background: rgba(255,255,255,0.035);
}
.sm-review-top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 4px;
}
.sm-review-author {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--white);
}
.sm-review-stars {
  font-size: 10px;
  letter-spacing: 1px;
}
.sm-review-date {
  font-size: 10px;
  color: var(--gray-9);
  margin-left: auto;
}
.sm-review-text {
  font-size: var(--text-xs);
  color: var(--gray-11);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sm-review-reply {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.04);
  font-size: 10px;
  color: var(--gray-9);
  line-height: 1.4;
}

/* Web Presence — full width */
.sm-web {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-6);
  animation: fadeSlideUp 0.5s var(--ease-out) 0.15s both;
}
.sm-web-top {
  padding: var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}
.sm-web-body {
  padding: var(--space-4) var(--space-5);
}
.sm-web-assess {
  font-size: var(--text-sm);
  color: var(--gray-11);
  line-height: var(--leading-relaxed);
  margin: 0 0 var(--space-3) 0;
}
.sm-web-missing {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-3);
  font-size: var(--text-xs);
  color: var(--gray-10);
}
.sm-web-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.sm-mention {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-3);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color var(--duration-normal), transform var(--duration-fast) var(--ease-out), background var(--duration-fast);
}
.sm-mention:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  background: rgba(255,255,255,0.04);
}
.sm-mention-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sm-mention-url {
  font-size: 9px;
  color: var(--accent-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sm-mention-text {
  font-size: 10px;
  color: var(--gray-10);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

/* Action Plan */
.sm-actions {
  margin-bottom: var(--space-6);
  animation: fadeSlideUp 0.5s var(--ease-out) 0.2s both;
}
.sm-section-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.sm-section-title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--white);
  margin: 0;
}
.sm-section-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}
.sm-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}
.sm-action {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: relative;
  transition: border-color var(--duration-normal), box-shadow var(--duration-normal);
}
.sm-action:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}
.sm-action-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--space-3);
}
.sm-action-prio {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.sm-action-prio-high { background: var(--red-muted); color: var(--red); }
.sm-action-prio-medium { background: var(--amber-muted); color: var(--amber); }
.sm-action-prio-low { background: var(--green-muted); color: var(--green); }
.sm-action-plat {
  font-size: 9px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-muted);
  color: var(--accent-light);
}
.sm-action-text {
  font-size: var(--text-sm);
  color: var(--white);
  margin: 0 0 var(--space-2) 0;
  line-height: var(--leading-normal);
}
.sm-action-impact {
  font-size: var(--text-xs);
  color: var(--gray-10);
  margin: 0;
  line-height: 1.4;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-subtle);
}

/* Industry Comparison */
.sm-comparison {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
  position: relative;
  overflow: hidden;
  animation: fadeSlideUp 0.5s var(--ease-out) 0.25s both;
}
.sm-comparison::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--violet), var(--cyan));
}
.sm-comparison h4 {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--white);
  margin: 0 0 var(--space-3) 0;
}
.sm-comparison p {
  font-size: var(--text-sm);
  color: var(--gray-11);
  margin: 0;
  line-height: var(--leading-relaxed);
}

/* Responsive */
@media (max-width: 900px) {
  .sm-hero { grid-template-columns: auto 1fr; }
  .sm-hero-kpis { flex-direction: row; }
  .sm-hero-kpi { min-width: auto; text-align: center; }
  .sm-platforms { grid-template-columns: 1fr; }
  .sm-details { grid-template-columns: 1fr; }
  .sm-web-grid { grid-template-columns: 1fr 1fr; }
  .sm-action-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .sm-hero { grid-template-columns: 1fr; text-align: center; padding: var(--space-5); }
  .sm-gauge { margin: 0 auto; }
  .sm-hero-kpis { flex-direction: row; justify-content: center; }
  .sm-hero-kpi { text-align: center; }
  .sm-plat-stats { grid-template-columns: repeat(2, 1fr); }
  .sm-web-grid { grid-template-columns: 1fr; }
}
/* ============================================
   PRINT STYLES (TASK-12)
   ============================================ */
@media print {
  @page { margin: 2cm; size: A4; }
  
  /* Hide non-printable elements */
  .sidebar, .topbar, .btn-ghost, .chat-input-row, .campaign-ai-card button,
  .mobile-menu-btn, .sidebar-overlay, .sidebar-toggle, .section-actions button,
  .notification-btn, .search-trigger, .gutschein-create-btn {
    display: none !important;
  }

  /* Reset layout */
  body, .app-layout, .main-content {
    background: white !important;
    color: black !important;
    height: auto !important;
    width: 100% !important;
    overflow: visible !important;
    display: block !important;
    position: static !important;
  }

  .content-area {
    padding: 0 !important;
    overflow: visible !important;
    height: auto !important;
  }

  /* Show only active page */
  .page {
    display: none !important;
  }
  .page.active {
    display: block !important;
    animation: none !important;
  }

  /* Printable Header */
  .page.active::before {
    content: "AI CMO Report — JOLIOO Partner";
    display: block;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
  }

  /* Card styling for print */
  .kpi-card, .chart-card, .report-card, .campaign-stat-card, .social-kpi, .social-web-card {
    border: 1px solid #ddd !important;
    background: white !important;
    box-shadow: none !important;
    break-inside: avoid;
    color: black !important;
    margin-bottom: 20px !important;
    page-break-inside: avoid;
  }

  h1, h2, h3, h4, span, div, p, .subtitle, .report-date {
    color: black !important;
  }
  
  /* Adjust charts for print visibility */
.apexcharts-canvas {
    filter: invert(1) hue-rotate(180deg);
  }
}

/* ============================================
   SETTINGS PAGE (TASK-18)
   ============================================ */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.settings-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-card h4 {
  font-size: var(--text-md);
  color: var(--gray-12);
  margin: 0;
}

.settings-card-wide {
  grid-column: span 2;
}

.settings-fields-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-fields-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.settings-field span {
  font-size: var(--text-sm);
  color: var(--gray-10);
  font-weight: 500;
}

.settings-field input[type="number"],
.settings-field input[type="text"] {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-tertiary);
  color: var(--gray-12);
  font-size: var(--text-sm);
  padding: 8px 10px;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.settings-field input[type="number"]:focus,
.settings-field input[type="text"]:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 2px var(--accent-muted);
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-11);
  font-size: var(--text-sm);
  user-select: none;
}

.settings-toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.settings-status {
  margin-top: 14px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-10);
}

.settings-status.success {
  color: var(--green);
}

.settings-status.error {
  color: var(--red);
}

.settings-status.info {
  color: var(--gray-10);
}


/* ============================================
   RESPONSIVE (TASK-13)
   ============================================ */
@media screen and (max-width: 1024px) {
  .sidebar {
    width: 64px;
    min-width: 64px;
  }
  .sidebar .team-switcher {
    display: none;
  }
  .sidebar .sidebar-logo h1,
  .sidebar .sidebar-logo span,
  .sidebar .nav-item-text,
  .sidebar .badge,
  .sidebar .team-details,
  .sidebar .theme-toggle-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
    transition: none;
  }
  .sidebar:hover {
    width: 240px;
    z-index: 999;
  }
  .sidebar:hover .sidebar-logo h1,
  .sidebar:hover .sidebar-logo span,
  .sidebar:hover .nav-item-text,
  .sidebar:hover .badge,
  .sidebar:hover .team-details,
  .sidebar:hover .theme-toggle-label {
    opacity: 1;
    width: auto;
    pointer-events: auto;
    transition: opacity 0.2s;
  }
  .sidebar:hover .team-switcher {
    display: flex;
  }
}

@media screen and (max-width: 768px) {
  /* Mobile Sidebar */
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 240px;
    min-width: 240px;
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    z-index: 1000;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: block; opacity: 0; pointer-events: none;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 900;
    transition: opacity 0.3s;
    backdrop-filter: blur(4px);
  }
  .sidebar-overlay.active { opacity: 1; pointer-events: auto; }
  
  .mobile-menu-btn { display: flex !important; }
  .sidebar-toggle { display: none; }
  
  .sidebar .sidebar-logo h1, .sidebar .nav-item-text, .sidebar .team-details {
    opacity: 1; width: auto; pointer-events: auto;
  }
  .sidebar .theme-toggle-label { opacity: 1; width: auto; pointer-events: auto; }
  .sidebar .team-switcher { display: flex; }

  /* Dashboard Grid - 2x2 KPIs */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }
  
  /* Charts stack vertically */
  .charts-grid {
    grid-template-columns: 1fr !important;
  }
  .chart-card {
    grid-column: span 1 !important;
  }
  
  /* Gutschein Form */
  .gutschein-studio { flex-direction: column; }
  .gutschein-form-card, #gutscheinResult { width: 100%; margin-bottom: 20px; }

  .settings-grid {
    grid-template-columns: 1fr;
  }
  .settings-card-wide {
    grid-column: span 1;
  }
  .settings-fields-row {
    grid-template-columns: 1fr;
  }
  
  /* Social Page single column */
  .sm-hero, .sm-web-grid, .sm-action-grid, .sm-plat-stats {
    grid-template-columns: 1fr !important;
  }
  .sm-hero-kpis { flex-wrap: wrap; }
}

/* ============================================
   BILLING PAGE
   ============================================ */
.billing-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.billing-balance-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
}

.billing-balance-label {
  font-size: 13px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.billing-balance-value {
  font-size: 48px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 4px;
}

.billing-balance-value.credit-high { color: var(--green); }
.billing-balance-value.credit-mid { color: var(--amber); }
.billing-balance-value.credit-low { color: var(--red); }

.billing-balance-sub {
  font-size: 12px;
  color: var(--text-tertiary);
}

.billing-stats-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.billing-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.billing-stat-label {
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.billing-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.billing-chart-card,
.billing-history-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.billing-chart-card h4,
.billing-history-card h4 {
  margin: 0 0 16px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.billing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.billing-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}

.billing-table td {
  padding: 10px 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.billing-table tr:last-child td { border-bottom: none; }

.billing-table .text-right { text-align: right; }

.billing-amount-add {
  color: var(--green) !important;
  font-weight: 600;
}

.billing-amount-sub {
  color: var(--red) !important;
  font-weight: 600;
}

.billing-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.billing-type-chat { background: var(--accent-muted); color: var(--accent-light); }
.billing-type-image_generate { background: var(--violet-muted); color: var(--violet); }
.billing-type-campaign { background: var(--blue-muted); color: var(--blue); }
.billing-type-report { background: var(--cyan-muted); color: var(--cyan); }
.billing-type-social { background: var(--amber-muted); color: var(--amber); }
.billing-type-gutschein { background: var(--green-muted); color: var(--green); }
.billing-type-points_update { background: rgba(113, 113, 122, 0.12); color: var(--gray-11); }

@media screen and (max-width: 768px) {
  .billing-overview {
    grid-template-columns: 1fr;
  }
  .billing-balance-value {
    font-size: 36px;
  }
  .billing-stats-row {
    flex-direction: row;
  }
  .billing-stat {
    flex: 1;
  }
}

@media screen and (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr !important; }
  .topbar h2 { font-size: 16px; }
  .search-trigger span { display: none; }
  .search-trigger { min-width: auto; width: 36px; padding: 0; justify-content: center; }
  .search-trigger svg { margin: 0; }
  .search-trigger::after { content: ""; } /* Hide text hack */
}


/* Language Switcher Terminal Chic */
.language-switcher.terminal-chic { display: inline-flex; gap: 8px; border: 1px solid #3F3F46; padding: 4px 8px; border-radius: 6px; font-family: var(--font-mono, monospace); font-size: 12px; background: rgba(0,0,0,0.3); backdrop-filter: blur(10px); transition: all 0.2s ease; cursor: pointer; color: var(--gray-11, #a1a1aa); } .language-switcher.terminal-chic:hover { border-color: var(--accent, #6366F1); box-shadow: 0 0 10px rgba(99,102,241,0.2); } .language-switcher.terminal-chic span { padding: 2px 4px; border-radius: 4px; cursor: pointer; } .language-switcher.terminal-chic span:hover { color: #fff; background: rgba(255,255,255,0.1); }
