/* ============================================================
   NEXUS — Super Agente Omnicanal
   CSS Premium — Identidade Visual Única
   Autor: NEXUS Design System
   ============================================================ */

/* ---- Custom Properties ---- */
:root {
  /* Core Palette — Dark Futurism */
  --bg-void: #030508;
  --bg-deep: #080c12;
  --bg-surface: #0d1117;
  --bg-card: #111827;
  --bg-card-hover: #161f2e;
  --bg-elevated: #1a2235;
  --bg-overlay: rgba(3,5,8,0.92);

  /* Brand Spectrum */
  --violet: #7C3AED;
  --violet-light: #9F5FFF;
  --violet-glow: rgba(124,58,237,0.35);
  --cyan: #06B6D4;
  --cyan-light: #22D3EE;
  --cyan-glow: rgba(6,182,212,0.25);
  --amber: #F59E0B;
  --amber-glow: rgba(245,158,11,0.25);
  --rose: #F43F5E;
  --rose-glow: rgba(244,63,94,0.25);
  --emerald: #10B981;
  --emerald-glow: rgba(16,185,129,0.25);

  /* Text Hierarchy */
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #475569;
  --text-accent: #7C3AED;

  /* Borders */
  --border-subtle: rgba(255,255,255,0.04);
  --border-card: rgba(255,255,255,0.08);
  --border-hover: rgba(124,58,237,0.4);
  --border-glow: rgba(124,58,237,0.6);

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #7C3AED 0%, #06B6D4 100%);
  --grad-fire: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
  --grad-success: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
  --grad-card: linear-gradient(135deg, rgba(124,58,237,0.08) 0%, rgba(6,182,212,0.04) 100%);
  --grad-hero: linear-gradient(135deg, rgba(124,58,237,0.15) 0%, rgba(6,182,212,0.08) 50%, rgba(245,158,11,0.05) 100%);

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.05) inset;
  --shadow-glow: 0 0 40px rgba(124,58,237,0.2);
  --shadow-hover: 0 8px 40px rgba(124,58,237,0.25), 0 2px 0 rgba(255,255,255,0.06) inset;
  --shadow-btn: 0 4px 20px rgba(124,58,237,0.4);

  /* Layout */
  --sidebar-w: 260px;
  --sidebar-collapsed: 72px;
  --topbar-h: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-fast: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --dur-fast: 150ms;
  --dur-normal: 250ms;
  --dur-slow: 400ms;
}

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

html { scroll-behavior: smooth; font-size: 14px; }

body {
  font-family: var(--font-body);
  background: var(--bg-void);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  line-height: 1.6;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--violet); border-radius: 99px; }

::selection { background: var(--violet-glow); color: var(--text-primary); }

/* ---- Neural Network Background ---- */
#neural-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

/* ---- Cursor Glow ---- */
.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.08) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s;
}

/* ---- App Shell ---- */
.app-shell {
  position: relative;
  z-index: 2;
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  height: 100%;
  background: var(--bg-deep);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--dur-slow) var(--ease-smooth);
  overflow: hidden;
  position: relative;
  z-index: 100;
}
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px; height: 100%;
  background: linear-gradient(180deg, transparent, var(--violet) 30%, var(--cyan) 70%, transparent);
  opacity: 0.3;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .sidebar-status span,
.sidebar.collapsed .status-wave { display: none; }

/* Logo */
.sidebar-logo {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  min-height: 72px;
  flex-shrink: 0;
}
.logo-mark {
  width: 36px; height: 36px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(124,58,237,0.6));
  animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(124,58,237,0.6)); }
  50% { filter: drop-shadow(0 0 24px rgba(6,182,212,0.8)); }
}
.logo-text { flex: 1; overflow: hidden; }
.logo-name {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 3px;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.logo-sub {
  display: block;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}
.sidebar-toggle {
  width: 28px; height: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  transition: all var(--dur-fast);
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--violet); color: white; border-color: var(--violet); }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}
.nav-group {
  padding: 0 12px 4px;
  margin-bottom: 4px;
}
.nav-label {
  display: block;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-muted);
  padding: 8px 8px 4px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-fast);
  position: relative;
  overflow: hidden;
  margin-bottom: 2px;
  white-space: nowrap;
}
.nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 3px; height: 100%;
  background: var(--grad-primary);
  border-radius: 0 2px 2px 0;
  transform: scaleY(0);
  transition: transform var(--dur-fast) var(--ease-bounce);
}
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active {
  background: var(--grad-card);
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
}
.nav-item.active::before { transform: scaleY(1); }
.nav-icon {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.nav-item.active .nav-icon { color: var(--violet-light); }
.nav-pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  margin-left: auto;
  animation: pulse 2s infinite;
  box-shadow: 0 0 6px var(--emerald);
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.nav-badge {
  margin-left: auto;
  background: var(--violet);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}
.nav-badge.urgent { background: var(--amber); color: #000; }

/* Sidebar Status */
.sidebar-status {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online {
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  animation: pulse 2s infinite;
}
.status-wave {
  display: flex; gap: 2px; align-items: center; margin-left: auto;
}
.status-wave span {
  width: 2px; height: 8px;
  background: var(--violet);
  border-radius: 99px;
  animation: wave 1.2s ease-in-out infinite;
}
.status-wave span:nth-child(2) { animation-delay: 0.15s; height: 14px; }
.status-wave span:nth-child(3) { animation-delay: 0.3s; }
@keyframes wave {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.4); }
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  background: rgba(8,12,18,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.bc-root { color: var(--violet-light); font-weight: 600; }
.breadcrumb .fa-chevron-right { font-size: 8px; }
.bc-current { color: var(--text-secondary); }
.topbar-center { flex: 1; max-width: 480px; }
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 8px 14px;
  transition: all var(--dur-normal);
}
.search-bar:focus-within {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-glow);
}
.search-bar i { color: var(--text-muted); font-size: 12px; }
.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-card);
  border-radius: 4px;
  color: var(--text-muted);
}
.topbar-right { display: flex; align-items: center; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.action-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--grad-primary);
  color: white; border: none;
  padding: 7px 14px; border-radius: 8px;
  font-family: var(--font-body); font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast);
  box-shadow: var(--shadow-btn);
}
.action-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(124,58,237,0.5); }
.icon-btn {
  width: 36px; height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  position: relative;
  transition: all var(--dur-fast);
}
.icon-btn:hover { border-color: var(--violet); color: var(--violet-light); }
.notif-dot {
  position: absolute;
  top: -3px; right: -3px;
  width: 16px; height: 16px;
  background: var(--amber);
  border-radius: 50%;
  font-size: 8px; font-weight: 700;
  color: #000;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-deep);
}
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 99px;
  cursor: pointer;
  transition: all var(--dur-fast);
}
.user-chip:hover { border-color: var(--violet); }
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: white;
}
.user-name { font-size: 12px; font-weight: 600; }
.user-role { font-size: 10px; color: var(--text-muted); display: block; line-height: 1; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.sections-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px;
}

/* ---- Sections ---- */
.section { display: none; animation: sectionIn var(--dur-slow) var(--ease-smooth); }
.section.active { display: block; }
@keyframes sectionIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Section Header ---- */
.section-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 28px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}
.title-accent {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.header-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 13px; font-weight: 500;
  padding: 8px 16px; cursor: pointer;
  transition: all var(--dur-fast);
}
.header-btn:hover { background: var(--violet); border-color: var(--violet); }
.date-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  padding: 6px 12px; border-radius: 8px;
}
.date-badge i { color: var(--emerald); animation: pulse 2s infinite; }

/* ============================================================
   KPI GRID
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--dur-normal) var(--ease-smooth);
  cursor: default;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.kpi-primary::before { background: var(--grad-primary); }
.kpi-secondary::before { background: var(--grad-fire); }
.kpi-tertiary::before { background: var(--grad-success); }
.kpi-quaternary::before { background: linear-gradient(135deg, var(--cyan), var(--violet)); }
.kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}
.kpi-bg-icon {
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  opacity: 0.04;
  transition: opacity var(--dur-normal);
}
.kpi-card:hover .kpi-bg-icon { opacity: 0.08; }
.kpi-label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 8px;
}
.kpi-delta {
  font-size: 11px;
  display: flex; align-items: center; gap: 4px;
}
.kpi-delta.positive { color: var(--emerald); }
.kpi-delta.negative { color: var(--rose); }
.kpi-delta.neutral { color: var(--text-muted); }
.kpi-spark { height: 32px; margin-top: 8px; }

/* ============================================================
   DASHBOARD GRID
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-auto-rows: auto;
  gap: 16px;
}
.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur-normal);
}
.dash-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-card);
  opacity: 0;
  transition: opacity var(--dur-normal);
  pointer-events: none;
}
.dash-card:hover { border-color: var(--border-hover); }
.dash-card:hover::after { opacity: 1; }
.dash-card-lg { grid-column: 1 / -1; }
.dash-card-md { grid-column: span 1; }
.dash-card-highlight {
  background: linear-gradient(135deg, rgba(124,58,237,0.12) 0%, rgba(6,182,212,0.06) 100%);
  border-color: rgba(124,58,237,0.3);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.card-title-group { display: flex; align-items: center; gap: 10px; }
.card-header h3 {
  font-size: 14px; font-weight: 600;
  color: var(--text-primary);
}
.card-badge {
  font-size: 10px; font-weight: 600;
  padding: 3px 8px; border-radius: 99px;
  letter-spacing: 0.5px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-card);
}
.card-badge.success { background: var(--emerald-glow); color: var(--emerald); border-color: rgba(16,185,129,0.3); }
.card-badge.warning { background: var(--amber-glow); color: var(--amber); border-color: rgba(245,158,11,0.3); }
.card-controls { display: flex; gap: 4px; }
.ctrl-btn {
  padding: 4px 10px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  font-size: 11px; cursor: pointer;
  transition: all var(--dur-fast);
}
.ctrl-btn.active, .ctrl-btn:hover {
  background: var(--violet); border-color: var(--violet);
  color: white;
}
.chart-wrapper { position: relative; width: 100%; }
.card-link {
  background: none; border: none;
  color: var(--violet-light); font-size: 12px;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: gap var(--dur-fast);
}
.card-link:hover { gap: 10px; }
.live-indicator {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  color: var(--rose);
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--rose);
  animation: pulse 1s infinite;
  box-shadow: 0 0 6px var(--rose);
}

/* Platform Legend */
.platform-legend {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 12px;
}
.pl-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-secondary);
}
.pl-dot { width: 8px; height: 8px; border-radius: 2px; }

/* Activity Feed */
.activity-feed { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; }
.feed-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  transition: background var(--dur-fast);
  animation: feedIn 0.3s var(--ease-smooth);
}
@keyframes feedIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
.feed-item:hover { background: var(--bg-elevated); }
.feed-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0;
}
.feed-content { flex: 1; min-width: 0; }
.feed-text { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.feed-text strong { color: var(--text-primary); }
.feed-time { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* Top Content List */
.top-content-list { display: flex; flex-direction: column; gap: 8px; }
.tc-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  transition: all var(--dur-fast);
  cursor: pointer;
}
.tc-item:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.tc-rank {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 800;
  color: var(--text-muted);
  width: 24px; flex-shrink: 0;
}
.tc-item:first-child .tc-rank { color: var(--amber); }
.tc-info { flex: 1; min-width: 0; }
.tc-title { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-platform { font-size: 10px; color: var(--text-muted); }
.tc-metric { text-align: right; }
.tc-value { font-size: 14px; font-weight: 700; color: var(--emerald); }
.tc-label { font-size: 9px; color: var(--text-muted); }

/* Sentiment Ring */
.sentiment-display { display: flex; align-items: center; gap: 20px; }
.sentiment-ring {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: conic-gradient(
    var(--emerald) 0% 82%,
    var(--cyan) 82% 95%,
    var(--rose) 95% 100%
  );
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.sentiment-ring::before {
  content: '';
  position: absolute;
  inset: 12px;
  background: var(--bg-card);
  border-radius: 50%;
}
.sentiment-inner {
  position: relative; z-index: 1;
  text-align: center;
}
.sentiment-score {
  display: block;
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800;
  color: var(--emerald);
}
.sentiment-label { font-size: 10px; color: var(--text-muted); }
.sentiment-breakdown { display: flex; flex-direction: column; gap: 8px; }
.sb-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.sb-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.sb-dot.positive { background: var(--emerald); }
.sb-dot.neutral { background: var(--cyan); }
.sb-dot.negative { background: var(--rose); }
.sb-item span { flex: 1; color: var(--text-secondary); }
.sb-item strong { color: var(--text-primary); }

/* AI Recommendation */
.ai-recommendation { padding: 4px 0; }
.rec-text { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }
.rec-text strong { color: var(--text-primary); }
.rec-actions { display: flex; gap: 10px; }
.rec-btn {
  padding: 8px 16px; border-radius: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all var(--dur-fast);
  border: none;
}
.rec-btn.primary { background: var(--grad-primary); color: white; }
.rec-btn.primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-btn); }
.rec-btn.ghost { background: transparent; border: 1px solid var(--border-card); color: var(--text-secondary); }
.rec-btn.ghost:hover { border-color: var(--violet); color: var(--violet-light); }

/* ============================================================
   INGEST MODULE
   ============================================================ */
.ingest-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
}
.ingest-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 24px;
}
.ingest-main { }
.ingest-tabs {
  display: flex; gap: 6px;
  background: var(--bg-surface);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--border-subtle);
}
.itab {
  flex: 1; padding: 8px 12px;
  border: none; border-radius: 7px;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-body); font-size: 12px; font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all var(--dur-fast);
}
.itab.active { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-card); }
.itab:hover:not(.active) { color: var(--text-secondary); }

.ingest-panel { display: none; }
.ingest-panel.active { display: block; }

.brief-area {
  position: relative;
}
.brief-area textarea {
  width: 100%; min-height: 180px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 16px;
  color: var(--text-primary);
  font-family: var(--font-body); font-size: 13px;
  resize: vertical;
  outline: none;
  transition: border-color var(--dur-fast);
  line-height: 1.6;
}
.brief-area textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-glow); }
.brief-meta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 4px 0;
}
.char-count { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.brief-tools { display: flex; gap: 6px; }
.tool-btn {
  width: 28px; height: 28px;
  background: var(--bg-surface); border: 1px solid var(--border-card);
  border-radius: 6px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer;
  transition: all var(--dur-fast);
}
.tool-btn:hover { background: var(--violet); border-color: var(--violet); color: white; }

.media-drop-zone {
  border: 2px dashed var(--border-card);
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  transition: all var(--dur-normal);
  min-height: 180px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
}
.media-drop-zone:hover, .media-drop-zone.drag-over {
  border-color: var(--violet);
  background: rgba(124,58,237,0.04);
}
.drop-visual { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.drop-icon {
  width: 60px; height: 60px;
  background: var(--grad-card);
  border: 1px solid var(--border-card);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--violet-light);
}
.audio-pulse { animation: audioPulse 2s ease-in-out infinite; }
@keyframes audioPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--violet-glow); }
  50% { box-shadow: 0 0 0 12px transparent; }
}
.drop-visual h4 { font-size: 14px; color: var(--text-primary); }
.drop-visual p { font-size: 12px; color: var(--text-muted); }
.drop-sub { font-size: 11px !important; color: var(--violet-light) !important; }
.upload-btn {
  margin-top: 4px;
  padding: 8px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body); font-size: 12px; font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: all var(--dur-fast);
}
.upload-btn:hover { background: var(--violet); border-color: var(--violet); }
.upload-btn.compact { padding: 8px 16px; }

.url-input-row {
  display: flex; gap: 8px; width: 100%;
}
.url-field {
  flex: 1;
  background: var(--bg-elevated); border: 1px solid var(--border-card);
  border-radius: 8px; padding: 8px 12px;
  color: var(--text-primary); font-family: var(--font-body); font-size: 12px;
  outline: none;
}
.url-field:focus { border-color: var(--violet); }
.divider-text {
  font-size: 11px; color: var(--text-muted);
  display: block;
}

.scrape-input-group {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.scrape-input-group i { color: var(--text-muted); }
.scrape-field {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-primary); font-family: var(--font-body); font-size: 13px;
}
.scrape-btn {
  padding: 6px 14px;
  background: var(--grad-primary);
  border: none; border-radius: 6px;
  color: white; font-size: 12px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}

/* Platform Toggles */
.platform-targets {
  margin-top: 20px;
}
.platform-targets h4, .tone-selector h4 {
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 1px;
}
.platform-toggles, .tone-options {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.ptoggle, .tone-opt {
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 99px;
  color: var(--text-secondary);
  font-family: var(--font-body); font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: all var(--dur-fast);
}
.ptoggle.active, .tone-opt.active {
  background: var(--violet);
  border-color: var(--violet);
  color: white;
}
.ptoggle:hover:not(.active), .tone-opt:hover:not(.active) {
  border-color: var(--violet);
  color: var(--violet-light);
}
.tone-selector { margin-top: 16px; }

/* Generate Button */
.generate-btn {
  width: 100%; padding: 16px;
  margin-top: 24px;
  background: var(--grad-primary);
  border: none; border-radius: 12px;
  color: white;
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  position: relative; overflow: hidden;
  transition: all var(--dur-normal);
  box-shadow: var(--shadow-btn);
}
.generate-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 40px rgba(124,58,237,0.5); }
.generate-btn:active { transform: translateY(0); }
.gen-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0) 100%);
  transform: translateX(-100%);
  transition: transform 0.5s;
}
.generate-btn:hover .gen-bg { transform: translateX(100%); }

/* Ingest Sidebar */
.ingest-sidebar { display: flex; flex-direction: column; gap: 16px; }
.ingest-tips-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.ingest-tips-card h4 {
  font-size: 12px; font-weight: 600;
  color: var(--amber); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.tips-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tips-list li { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.recent-ingests {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  flex: 1;
}
.recent-ingests h4 {
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 12px;
  text-transform: uppercase; letter-spacing: 1px;
}

/* Processing Overlay */
.processing-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg-overlay);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
}
.processing-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-2xl);
  padding: 40px;
  text-align: center;
  max-width: 360px; width: 100%;
  box-shadow: var(--shadow-glow);
}
.processing-brain {
  position: relative;
  width: 100px; height: 100px;
  margin: 0 auto 24px;
  display: flex; align-items: center; justify-content: center;
}
.brain-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
  animation: ringRotate 2s linear infinite;
}
.r1 { inset: 0; border-top-color: var(--violet); }
.r2 { inset: 10px; border-right-color: var(--cyan); animation-duration: 1.5s; animation-direction: reverse; }
.r3 { inset: 20px; border-bottom-color: var(--amber); animation-duration: 1s; }
@keyframes ringRotate { to { transform: rotate(360deg); } }
.brain-icon { font-size: 32px; color: var(--violet-light); }
.processing-modal h3 {
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
  margin-bottom: 24px;
}
.processing-steps { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.proc-step {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--text-muted);
  transition: color var(--dur-normal);
}
.proc-step.active { color: var(--text-primary); }
.proc-step.done { color: var(--emerald); }
.step-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border-card);
  flex-shrink: 0;
  transition: all var(--dur-normal);
}
.proc-step.active .step-dot { background: var(--violet); border-color: var(--violet); box-shadow: 0 0 8px var(--violet); animation: pulse 1s infinite; }
.proc-step.done .step-dot { background: var(--emerald); border-color: var(--emerald); }

/* Upload Progress */
.upload-progress { width: 100%; padding: 0 20px; }
.prog-bar { height: 4px; background: var(--bg-elevated); border-radius: 2px; overflow: hidden; }
.prog-fill { height: 100%; background: var(--grad-primary); border-radius: 2px; width: 0%; transition: width 0.3s; }

/* ============================================================
   CAMPAIGNS
   ============================================================ */
.campaigns-filters {
  display: flex; gap: 8px; margin-bottom: 20px;
}
.filter-btn {
  padding: 6px 16px;
  background: var(--bg-card); border: 1px solid var(--border-card);
  border-radius: 99px; color: var(--text-secondary);
  font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all var(--dur-fast);
}
.filter-btn.active { background: var(--violet); border-color: var(--violet); color: white; }
.filter-btn:hover:not(.active) { border-color: var(--violet); color: var(--violet-light); }
.campaigns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.campaign-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--dur-normal);
  position: relative;
  overflow: hidden;
}
.campaign-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
}
.campaign-card.status-active::before { background: var(--grad-success); }
.campaign-card.status-draft::before { background: linear-gradient(135deg, var(--text-muted), var(--text-secondary)); }
.campaign-card.status-completed::before { background: var(--grad-primary); }
.campaign-card:hover { transform: translateY(-3px); border-color: var(--border-hover); box-shadow: var(--shadow-hover); }
.cc-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.cc-title { font-size: 15px; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.cc-status {
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  flex-shrink: 0;
}
.cc-status.active { background: var(--emerald-glow); color: var(--emerald); }
.cc-status.draft { background: var(--bg-elevated); color: var(--text-muted); }
.cc-status.completed { background: var(--violet-glow); color: var(--violet-light); }
.cc-platforms { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.cc-plat-badge {
  padding: 3px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 99px;
  font-size: 10px; color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
}
.cc-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.cc-metric { text-align: center; }
.cc-metric-val { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--text-primary); display: block; }
.cc-metric-lbl { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* Campaign Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: var(--bg-overlay);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-2xl);
  width: 100%; max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky; top: 0;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  z-index: 1;
}
.modal-header h2 { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  background: var(--bg-elevated); border: 1px solid var(--border-card);
  border-radius: 8px; color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 13px; transition: all var(--dur-fast);
}
.modal-close:hover { background: var(--rose); border-color: var(--rose); color: white; }
.modal-body { padding: 24px; }

/* Platform Content Tabs */
.platform-content-tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.pct-btn {
  padding: 6px 14px;
  background: var(--bg-surface); border: 1px solid var(--border-card);
  border-radius: 8px; color: var(--text-muted);
  font-size: 12px; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: all var(--dur-fast);
}
.pct-btn.active { background: var(--violet); border-color: var(--violet); color: white; }
.pct-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px;
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.7;
  min-height: 120px;
}

/* ============================================================
   PUBLISHER
   ============================================================ */
.publisher-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}
.publisher-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 20px;
}
.pub-selector-tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}
.pub-tab {
  padding: 8px 16px;
  background: none; border: 1px solid transparent;
  border-radius: 8px; color: var(--text-muted);
  font-family: var(--font-body); font-size: 12px; font-weight: 500;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: all var(--dur-fast);
}
.pub-tab.active { background: var(--bg-elevated); border-color: var(--border-card); color: var(--text-primary); }
.pub-tab:hover:not(.active) { color: var(--text-secondary); }

/* Phone Mockup */
.phone-preview-container {
  display: grid; grid-template-columns: 240px 1fr; gap: 24px;
  align-items: start;
}
.phone-mockup {
  background: #0A0A0A;
  border: 2px solid #222;
  border-radius: 36px;
  padding: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1);
  position: relative;
}
.phone-screen {
  background: #111;
  border-radius: 28px;
  overflow: hidden;
  min-height: 400px;
}
.phone-status-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 4px;
  font-size: 11px; color: var(--text-secondary);
  font-family: var(--font-mono);
}
.phone-icons { display: flex; gap: 4px; font-size: 9px; }
.phone-app-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #222;
}
.app-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.app-info strong { display: block; font-size: 11px; }
.app-info span { font-size: 10px; color: #888; }
.phone-app-header i { margin-left: auto; font-size: 14px; color: #888; }
.phone-post-content {
  padding: 12px;
  font-size: 12px; color: #ccc;
  line-height: 1.6;
  min-height: 200px;
}
.phone-post-actions {
  display: flex; gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid #222;
  font-size: 18px; color: #888;
}
.pub-content-editor h4 {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted);
  margin-bottom: 10px;
}
.pub-content-editor textarea {
  width: 100%; min-height: 200px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 14px;
  color: var(--text-primary); font-family: var(--font-body); font-size: 13px;
  resize: vertical; outline: none;
  transition: border-color var(--dur-fast);
  line-height: 1.6;
}
.pub-content-editor textarea:focus { border-color: var(--violet); }
.pub-editor-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px;
}
.char-limits { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }

/* Publisher Sidebar */
.publisher-sidebar {
  display: flex; flex-direction: column; gap: 16px;
}
.publisher-sidebar h4 {
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 1px;
}
.pub-campaign-select,
.pub-schedule,
.pub-platforms,
.pub-status-log {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.styled-select {
  width: 100%;
  background: var(--bg-surface); border: 1px solid var(--border-card);
  border-radius: 8px; padding: 8px 12px;
  color: var(--text-primary); font-family: var(--font-body); font-size: 13px;
  outline: none; cursor: pointer;
  appearance: none;
}
.styled-select.compact { width: auto; padding: 6px 10px; font-size: 12px; }
.schedule-toggle { display: flex; gap: 4px; background: var(--bg-surface); border-radius: 8px; padding: 3px; margin-bottom: 10px; }
.sched-btn {
  flex: 1; padding: 6px 10px;
  background: none; border: none;
  border-radius: 6px; color: var(--text-muted);
  font-family: var(--font-body); font-size: 11px; font-weight: 500;
  cursor: pointer; transition: all var(--dur-fast);
}
.sched-btn.active { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-card); }
.datetime-input {
  width: 100%;
  background: var(--bg-surface); border: 1px solid var(--border-card);
  border-radius: 8px; padding: 8px 12px;
  color: var(--text-primary); font-family: var(--font-body); font-size: 12px; outline: none;
}
.platform-check {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  cursor: pointer; font-size: 13px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  transition: color var(--dur-fast);
}
.platform-check:last-child { border-bottom: none; }
.platform-check:hover { color: var(--text-primary); }
.platform-check input { accent-color: var(--violet); width: 14px; height: 14px; cursor: pointer; }
.platform-check i { width: 16px; text-align: center; }
.publish-btn {
  padding: 14px;
  background: var(--grad-primary);
  border: none; border-radius: 12px;
  color: white; font-family: var(--font-display); font-size: 15px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: all var(--dur-normal);
  box-shadow: var(--shadow-btn);
}
.publish-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(124,58,237,0.5); }
.log-entries { display: flex; flex-direction: column; gap: 6px; max-height: 150px; overflow-y: auto; }
.log-empty { font-size: 12px; color: var(--text-muted); text-align: center; padding: 16px 0; }
.log-entry {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px;
  background: var(--bg-surface);
  font-size: 11px;
}
.log-entry i { font-size: 10px; }
.log-entry.success { color: var(--emerald); }
.log-entry.error { color: var(--rose); }
.log-entry.pending { color: var(--amber); }

/* ============================================================
   SCHEDULER
   ============================================================ */
.scheduler-container { display: grid; grid-template-columns: 1fr 240px; gap: 20px; }
.calendar-header {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-bottom: 12px;
  grid-column: 1;
}
.calendar-header h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.cal-nav {
  width: 32px; height: 32px;
  background: var(--bg-card); border: 1px solid var(--border-card);
  border-radius: 8px; color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--dur-fast);
}
.cal-nav:hover { background: var(--violet); border-color: var(--violet); color: white; }
.calendar-days-header {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; margin-bottom: 4px;
  grid-column: 1;
}
.calendar-days-header span {
  text-align: center; font-size: 10px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); padding: 6px;
}
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  grid-column: 1;
}
.cal-day {
  aspect-ratio: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--dur-fast);
  min-height: 52px;
}
.cal-day:hover { background: var(--bg-card); border-color: var(--border-card); }
.cal-day.today { background: var(--violet-glow); border-color: var(--violet); }
.cal-day.other-month .day-num { color: var(--text-muted); }
.day-num { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.cal-day.today .day-num { color: var(--violet-light); font-weight: 700; }
.day-events { display: flex; flex-direction: column; gap: 1px; width: 100%; margin-top: 2px; }
.day-event-dot {
  height: 3px; border-radius: 1px;
  font-size: 0;
}
.scheduler-sidebar { display: flex; flex-direction: column; gap: 12px; }
.best-times-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg); padding: 16px;
}
.best-times-card h4 {
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.best-times-list { display: flex; flex-direction: column; gap: 8px; }
.bt-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-secondary);
}
.bt-item i { width: 16px; text-align: center; }
.bt-item span { flex: 1; }
.bt-item strong { color: var(--text-primary); font-size: 11px; }

/* ============================================================
   ANALYTICS
   ============================================================ */
.analytics-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
}
.analytics-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg); padding: 20px;
  transition: border-color var(--dur-normal);
}
.analytics-card:hover { border-color: var(--border-hover); }
.ac-wide { grid-column: 1 / -1; }

/* Funnel */
.funnel-chart { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.funnel-step { }
.funnel-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.funnel-bar-wrap { height: 28px; background: var(--bg-surface); border-radius: 4px; overflow: hidden; }
.funnel-bar-fill {
  height: 100%; border-radius: 4px;
  display: flex; align-items: center; padding: 0 10px;
  font-size: 11px; font-weight: 600; color: white;
  transition: width 1s var(--ease-smooth);
}

/* Format Stats */
.format-stats { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.fs-item { }
.fs-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.fs-bar { height: 6px; background: var(--bg-surface); border-radius: 3px; overflow: hidden; }
.fs-fill { height: 100%; border-radius: 3px; transition: width 1.2s var(--ease-smooth); }

/* ============================================================
   INSIGHTS
   ============================================================ */
.insights-header-bar {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.insights-count-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--grad-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg); padding: 14px 20px;
  flex: 1;
}
.insights-count-card i { font-size: 24px; color: var(--amber); }
.insights-count-card .icount { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--text-primary); display: block; }
.insights-count-card span { font-size: 12px; color: var(--text-muted); }
.learning-cycle {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border-card);
  border-radius: var(--radius-lg); padding: 14px 20px;
  flex: 1;
}
.lc-icon { font-size: 20px; color: var(--cyan); animation: ringRotate 3s linear infinite; }
.lc-text { display: flex; flex-direction: column; }
.lc-text span { font-size: 11px; color: var(--text-muted); }
.lc-text strong { font-size: 14px; color: var(--text-primary); }
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg); padding: 20px;
  position: relative; overflow: hidden;
  transition: all var(--dur-normal);
}
.insight-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.insight-card.priority-high::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad-fire);
}
.insight-card.priority-medium::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(135deg, var(--amber), var(--cyan));
}
.insight-card.priority-low::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad-success);
}
.insight-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.insight-platform-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.insight-platform-icon.instagram { background: linear-gradient(135deg,#833AB4,#E1306C,#F77737); }
.insight-platform-icon.linkedin { background: #0077B5; }
.insight-platform-icon.tiktok { background: #000; }
.insight-platform-icon.twitter { background: #1DA1F2; }
.insight-meta { flex: 1; }
.insight-platform-name { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.insight-priority-badge {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 9px; font-weight: 700; text-transform: uppercase;
}
.priority-high .insight-priority-badge { background: var(--rose-glow); color: var(--rose); }
.priority-medium .insight-priority-badge { background: var(--amber-glow); color: var(--amber); }
.priority-low .insight-priority-badge { background: var(--emerald-glow); color: var(--emerald); }
.insight-text { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; }
.insight-improvement {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--emerald);
  margin-bottom: 12px;
}
.insight-improvement i { font-size: 10px; }
.insight-suggestion {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px; padding: 10px 12px;
  font-size: 12px; color: var(--text-secondary); line-height: 1.5;
  border-left: 3px solid var(--violet);
}

/* Weekly Report */
.weekly-report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl); padding: 24px;
}
.wr-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.wr-title-group { display: flex; align-items: center; gap: 10px; }
.wr-title-group i { color: var(--violet-light); font-size: 18px; }
.wr-title-group h3 { font-size: 15px; font-weight: 600; }
.generate-report-btn {
  padding: 8px 16px;
  background: var(--grad-primary); border: none; border-radius: 8px;
  color: white; font-size: 12px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: all var(--dur-fast);
}
.generate-report-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-btn); }
.wr-placeholder {
  text-align: center; padding: 40px;
}
.wr-placeholder i { font-size: 36px; color: var(--text-muted); margin-bottom: 12px; }
.wr-placeholder p { font-size: 13px; color: var(--text-muted); }
.wr-report-content { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.wr-metric {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 14px;
  text-align: center;
}
.wr-metric-val { font-family: var(--font-display); font-size: 24px; font-weight: 800; }
.wr-metric-lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   PROMPT MAESTRO
   ============================================================ */
.prompt-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }
.prompt-editor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.prompt-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}
.prompt-badge {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 2px;
  background: var(--violet-glow); color: var(--violet-light);
  padding: 3px 10px; border-radius: 99px;
}
.prompt-tools { display: flex; gap: 6px; }
.ptool-btn {
  width: 28px; height: 28px;
  background: var(--bg-elevated); border: 1px solid var(--border-card);
  border-radius: 6px; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 11px; transition: all var(--dur-fast);
}
.ptool-btn:hover { background: var(--violet); border-color: var(--violet); color: white; }
.prompt-editor-wrap { flex: 1; }
.prompt-editor {
  width: 100%; min-height: 400px;
  background: var(--bg-deep);
  border: none; outline: none;
  padding: 20px;
  color: var(--cyan-light);
  font-family: var(--font-mono); font-size: 13px;
  line-height: 1.8; resize: vertical;
}
.prompt-editor-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}
.prompt-char-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.save-prompt-btn {
  padding: 7px 16px;
  background: var(--grad-primary); border: none; border-radius: 8px;
  color: white; font-size: 12px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: all var(--dur-fast);
}
.save-prompt-btn:hover { transform: translateY(-1px); }

/* Prompt Sidebar */
.prompt-sidebar { display: flex; flex-direction: column; gap: 14px; }
.prompt-vars-card, .prompt-test-card, .prompt-history-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg); padding: 16px;
}
.prompt-vars-card h4, .prompt-test-card h4, .prompt-history-card h4 {
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 12px;
  text-transform: uppercase; letter-spacing: 1px;
  display: flex; align-items: center; gap: 6px;
}
.var-list { display: flex; flex-direction: column; gap: 4px; }
.var-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  background: var(--bg-surface);
  cursor: pointer; transition: all var(--dur-fast);
}
.var-item:hover { background: var(--violet-glow); border-color: var(--violet); }
.var-item code {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--cyan-light); background: var(--bg-elevated);
  padding: 2px 6px; border-radius: 4px; white-space: nowrap;
}
.var-item span { font-size: 11px; color: var(--text-muted); }
.prompt-test-card textarea {
  width: 100%; min-height: 80px;
  background: var(--bg-surface); border: 1px solid var(--border-card);
  border-radius: 8px; padding: 10px;
  color: var(--text-primary); font-family: var(--font-body); font-size: 12px;
  resize: vertical; outline: none; margin-bottom: 10px;
}
.test-run-btn {
  width: 100%; padding: 8px;
  background: var(--grad-primary); border: none; border-radius: 8px;
  color: white; font-size: 12px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all var(--dur-fast);
}
.test-run-btn:hover { transform: translateY(-1px); }
.test-output {
  margin-top: 12px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 8px; padding: 12px;
}
.test-output h5 { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.test-result-content { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.ph-list { display: flex; flex-direction: column; gap: 8px; }
.ph-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  background: var(--bg-surface);
  cursor: pointer;
}
.ph-item.active { background: var(--violet-glow); }
.ph-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.ph-item.active .ph-dot { background: var(--violet); box-shadow: 0 0 6px var(--violet); }
.ph-info { flex: 1; }
.ph-name { display: block; font-size: 12px; color: var(--text-primary); }
.ph-date { font-size: 10px; color: var(--text-muted); }

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg); padding: 20px;
}
.settings-card h3 {
  font-size: 14px; font-weight: 600;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
  color: var(--text-primary);
}
.settings-card h3 i { color: var(--violet-light); }
.settings-form { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.form-input {
  background: var(--bg-surface); border: 1px solid var(--border-card);
  border-radius: 8px; padding: 9px 12px;
  color: var(--text-primary); font-family: var(--font-body); font-size: 13px;
  outline: none; width: 100%; transition: border-color var(--dur-fast);
}
.form-input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-glow); }
.api-connections { display: flex; flex-direction: column; gap: 10px; }
.api-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: 10px; transition: all var(--dur-fast);
}
.api-item:hover { border-color: var(--border-card); }
.api-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: white; flex-shrink: 0;
}
.api-info { flex: 1; }
.api-info span { display: block; font-size: 12px; color: var(--text-secondary); }
.api-status { font-size: 10px !important; margin-top: 1px; }
.api-status.disconnected { color: var(--rose) !important; }
.api-status.connected { color: var(--emerald) !important; }
.connect-btn {
  padding: 5px 12px;
  background: var(--bg-elevated); border: 1px solid var(--border-card);
  border-radius: 6px; color: var(--text-secondary);
  font-size: 11px; cursor: pointer;
  transition: all var(--dur-fast);
}
.connect-btn:hover { background: var(--violet); border-color: var(--violet); color: white; }
.api-key-input { display: flex; gap: 6px; }
.key-toggle {
  width: 38px;
  background: var(--bg-elevated); border: 1px solid var(--border-card);
  border-radius: 8px; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 12px; transition: all var(--dur-fast); flex-shrink: 0;
}
.key-toggle:hover { background: var(--violet); border-color: var(--violet); color: white; }
.schedule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sched-day {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: 8px; padding: 10px 12px;
}
.sched-day-name { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.sched-day-times { font-size: 12px; color: var(--violet-light); }
.settings-save-bar {
  grid-column: 1 / -1;
  display: flex; justify-content: flex-end;
}
.save-settings-btn {
  padding: 10px 24px;
  background: var(--grad-primary); border: none; border-radius: 10px;
  color: white; font-family: var(--font-body); font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: all var(--dur-normal); box-shadow: var(--shadow-btn);
}
.save-settings-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(124,58,237,0.5); }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  min-width: 280px; max-width: 380px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: toastIn 0.3s var(--ease-bounce);
  position: relative; overflow: hidden;
}
.toast::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
}
.toast.success::before { background: var(--emerald); }
.toast.error::before { background: var(--rose); }
.toast.warning::before { background: var(--amber); }
.toast.info::before { background: var(--violet); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast-icon { font-size: 16px; margin-top: 1px; }
.toast.success .toast-icon { color: var(--emerald); }
.toast.error .toast-icon { color: var(--rose); }
.toast.warning .toast-icon { color: var(--amber); }
.toast.info .toast-icon { color: var(--violet-light); }
.toast-content { flex: 1; }
.toast-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.toast-msg { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.toast-close {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer; font-size: 12px;
  padding: 0; transition: color var(--dur-fast);
  line-height: 1; margin-top: 1px;
}
.toast-close:hover { color: var(--text-primary); }
.toast-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  animation: toastProgress 4s linear forwards;
}
.toast.success .toast-progress { background: var(--emerald); }
.toast.error .toast-progress { background: var(--rose); }
.toast.warning .toast-progress { background: var(--amber); }
.toast.info .toast-progress { background: var(--violet); }
@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ============================================================
   ANIMATIONS & UTILITIES
   ============================================================ */
.fade-in { animation: fadeIn 0.5s var(--ease-smooth); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.slide-up { animation: slideUp 0.4s var(--ease-bounce); }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Shimmer loading */
.shimmer {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .publisher-grid { grid-template-columns: 1fr; }
  .phone-preview-container { grid-template-columns: 1fr; }
  .phone-mockup { max-width: 240px; margin: 0 auto; }
}
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dash-card-lg, .dash-card-md { grid-column: 1; }
  .ingest-grid { grid-template-columns: 1fr; }
  .prompt-grid { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
  .ac-wide { grid-column: 1; }
  .settings-grid { grid-template-columns: 1fr; }
  .scheduler-container { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 240px; }
  .sidebar { position: fixed; left: -240px; z-index: 1000; transition: left var(--dur-slow); }
  .sidebar.mobile-open { left: 0; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar-center { display: none; }
  .section-title { font-size: 22px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .sections-container { padding: 16px; }
}
