/* ============================================
   SUPERNOVA ADS — Marketing Strategy Builder Pro
   Main Stylesheet
   ============================================ */

/* ---- CSS Variables ---- */
:root {
  --font-display: Arial, Helvetica, sans-serif;
  --font-body: Arial, Helvetica, sans-serif;

  /* Brand */
  --brand-primary: #FF6B1A;
  --brand-secondary: #FF9A4A;
  --brand-accent: #FFD166;
  --brand-glow: rgba(255,107,26,0.35);

  /* Dark Mode (default) */
  --bg-base: #0A0B0F;
  --bg-surface: #111318;
  --bg-card: #161921;
  --bg-card-hover: #1D2028;
  --bg-glass: rgba(22,25,33,0.7);
  --bg-input: #1A1D26;

  --border-subtle: rgba(255,255,255,0.06);
  --border-medium: rgba(255,255,255,0.12);
  --border-accent: rgba(255,107,26,0.35);

  --text-primary: #F0F2F7;
  --text-secondary: #8B91A7;
  --text-muted: #555C72;
  --text-brand: #FF6B1A;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.5);
  --shadow-brand: 0 0 40px rgba(255,107,26,0.2);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --sidebar-w: 260px;
  --header-h: 64px;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="light"] {
  --bg-base: #F4F5F9;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8F9FC;
  --bg-glass: rgba(255,255,255,0.85);
  --bg-input: #F0F2F8;
  --border-subtle: rgba(0,0,0,0.06);
  --border-medium: rgba(0,0,0,0.1);
  --text-primary: #0D0F1A;
  --text-secondary: #5C6280;
  --text-muted: #9EA5BD;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.12);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-primary); }

/* ---- App Layout ---- */
#app { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition), width var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 20px var(--brand-glow);
  flex-shrink: 0;
}

.sidebar-logo-text { display: flex; flex-direction: column; }
.sidebar-logo-text strong {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.sidebar-logo-text span {
  font-size: 10px;
  color: var(--brand-primary);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav { padding: 16px 12px; flex: 1; }
.sidebar-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 16px 8px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  text-decoration: none;
  position: relative;
}
.nav-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.nav-item.active {
  background: rgba(255,107,26,0.12);
  color: var(--brand-primary);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--brand-primary);
  border-radius: 0 3px 3px 0;
}
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--brand-primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

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

/* ---- Main Content ---- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Header ---- */
.header {
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

.header-left { display: flex; align-items: center; gap: 16px; }
.header-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}
.header-breadcrumb { color: var(--text-muted); font-size: 13px; }

.header-right { display: flex; align-items: center; gap: 10px; }

.btn-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
}
.btn-icon:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

.theme-toggle { cursor: pointer; }

/* ---- Page Content ---- */
.page-content { padding: 28px; flex: 1; }
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease; }

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

/* ---- Section Headers ---- */
.section-header { margin-bottom: 28px; }
.section-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.section-subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 6px; }

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
}
.card:hover { border-color: var(--border-medium); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.card-subtitle { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

/* ---- Glass Cards ---- */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ---- KPI Cards ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}
.kpi-card:hover { transform: translateY(-2px); border-color: var(--border-accent); box-shadow: var(--shadow-brand); }
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
}

.kpi-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(255,107,26,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  margin-bottom: 14px;
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}
.kpi-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.kpi-change {
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.kpi-change.up { color: #22C55E; }
.kpi-change.down { color: #EF4444; }

/* ---- Forms ---- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.full { grid-column: 1 / -1; }

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-label .required { color: var(--brand-primary); margin-left: 3px; }

.form-input, .form-select, .form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 11px 14px;
  transition: all var(--transition);
  outline: none;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(255,107,26,0.12);
}
.form-input::placeholder { color: var(--text-muted); }
.form-select { cursor: pointer; }
.form-select option { background: var(--bg-card); color: var(--text-primary); }
.form-textarea { resize: vertical; min-height: 100px; }

.input-prefix {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  overflow: hidden;
  transition: all var(--transition);
}
.input-prefix:focus-within { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(255,107,26,0.12); }
.input-prefix-text {
  padding: 11px 12px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-card);
  border-right: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.input-prefix .form-input { border: none; box-shadow: none; }
.input-prefix .form-input:focus { box-shadow: none; }

/* Checkbox tags */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-tag { display: none; }
.checkbox-tag + label {
  padding: 7px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-input);
  user-select: none;
}
.checkbox-tag + label:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.checkbox-tag:checked + label {
  background: rgba(255,107,26,0.15);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  font-weight: 600;
}

/* Platform cards */
.platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.platform-card {
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  background: var(--bg-card);
  user-select: none;
}
.platform-card:hover { border-color: var(--border-accent); transform: translateY(-2px); }
.platform-card.selected {
  border-color: var(--brand-primary);
  background: rgba(255,107,26,0.08);
  box-shadow: var(--shadow-brand);
}
.platform-card .platform-icon { font-size: 28px; margin-bottom: 8px; }
.platform-card .platform-name { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.platform-card.selected .platform-name { color: var(--brand-primary); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  outline: none;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: white;
  box-shadow: 0 4px 20px rgba(255,107,26,0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(255,107,26,0.45); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}
.btn-secondary:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

.btn-ghost { background: transparent; color: var(--text-secondary); border: none; }
.btn-ghost:hover { color: var(--brand-primary); }

.btn-danger { background: rgba(239,68,68,0.12); color: #EF4444; border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: var(--radius-md); }
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 6px; }
.btn-full { width: 100%; }

.btn-generate {
  background: linear-gradient(135deg, var(--brand-primary) 0%, #FF9A4A 50%, var(--brand-accent) 100%);
  color: white;
  font-size: 16px;
  font-weight: 800;
  padding: 18px 40px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 40px rgba(255,107,26,0.4);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: var(--font-display);
  position: relative;
  overflow: hidden;
}
.btn-generate::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s ease;
}
.btn-generate:hover::before { left: 100%; }
.btn-generate:hover { transform: translateY(-2px); box-shadow: 0 12px 50px rgba(255,107,26,0.5); }

/* ---- Tags / Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-orange { background: rgba(255,107,26,0.15); color: var(--brand-primary); }
.badge-green { background: rgba(34,197,94,0.12); color: #22C55E; }
.badge-red { background: rgba(239,68,68,0.12); color: #EF4444; }
.badge-blue { background: rgba(59,130,246,0.12); color: #3B82F6; }
.badge-purple { background: rgba(168,85,247,0.12); color: #A855F7; }
.badge-yellow { background: rgba(234,179,8,0.12); color: #EAB308; }
.badge-gray { background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border-subtle); }

/* ---- Divider ---- */
.divider { height: 1px; background: var(--border-subtle); margin: 24px 0; }

/* ---- Progress ---- */
.progress-bar-wrap { background: var(--bg-input); border-radius: 99px; height: 8px; overflow: hidden; }
.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

/* ---- Score Gauge ---- */
.gauge-container { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.gauge-svg { filter: drop-shadow(0 0 20px var(--brand-glow)); }
.gauge-value {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 800;
  color: var(--brand-primary);
  line-height: 1;
}
.gauge-label { font-size: 14px; color: var(--text-secondary); font-weight: 500; }

/* ---- Strategy Result ---- */
.strategy-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.strategy-section-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

.budget-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.budget-bar-label { width: 130px; font-size: 13px; font-weight: 500; color: var(--text-primary); flex-shrink: 0; }
.budget-bar-pct { width: 40px; text-align: right; font-size: 12px; font-weight: 700; color: var(--brand-primary); flex-shrink: 0; }
.budget-bar-value { font-size: 12px; color: var(--text-muted); width: 80px; flex-shrink: 0; }

.funnel-stage {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  margin-bottom: 10px;
  border-left: 3px solid;
}
.funnel-stage.top { border-color: #3B82F6; }
.funnel-stage.mid { border-color: var(--brand-accent); }
.funnel-stage.bottom { border-color: #22C55E; }
.funnel-stage-icon { font-size: 20px; flex-shrink: 0; }
.funnel-stage-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.funnel-stage.top .funnel-stage-label { color: #3B82F6; }
.funnel-stage.mid .funnel-stage-label { color: var(--brand-accent); }
.funnel-stage.bottom .funnel-stage-label { color: #22C55E; }
.funnel-stage-items { font-size: 12.5px; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 6px; }
.funnel-stage-items .tag {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}
.insight-item.positive { border-color: rgba(34,197,94,0.2); background: rgba(34,197,94,0.04); }
.insight-item.warning { border-color: rgba(234,179,8,0.2); background: rgba(234,179,8,0.04); }
.insight-item.danger { border-color: rgba(239,68,68,0.2); background: rgba(239,68,68,0.04); }
.insight-icon { font-size: 18px; flex-shrink: 0; }
.insight-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.insight-text strong { color: var(--text-primary); }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}
tbody tr:hover td { background: var(--bg-card-hover); color: var(--text-primary); }
tbody tr:last-child td { border-bottom: none; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--brand-primary); border-bottom-color: var(--brand-primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease; }

/* ---- Import Zone ---- */
.import-zone {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
}
.import-zone:hover, .import-zone.drag-over {
  border-color: var(--brand-primary);
  background: rgba(255,107,26,0.04);
}
.import-zone-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.6; }
.import-zone-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.import-zone-sub { font-size: 13px; color: var(--text-muted); }

/* ---- Notification ---- */
.notification {
  position: fixed;
  top: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 360px;
}
.notification.show { transform: translateX(0); }
.notification.success { border-color: rgba(34,197,94,0.3); }
.notification.error { border-color: rgba(239,68,68,0.3); }
.notification-icon { font-size: 22px; }
.notification-text { font-size: 13.5px; font-weight: 500; color: var(--text-primary); }

/* ---- Loading ---- */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(10,11,15,0.85);
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.loading-overlay.show { opacity: 1; pointer-events: all; }
.loading-spinner {
  width: 56px; height: 56px;
  border: 3px solid var(--border-medium);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 15px; color: var(--text-secondary); font-weight: 500; }

/* ---- Empty State ---- */
.empty-state { text-align: center; padding: 64px 32px; }
.empty-icon { font-size: 52px; margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.empty-sub { font-size: 14px; color: var(--text-muted); }

/* ---- Simulator ---- */
.simulator-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.result-card {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  border: 1px solid var(--border-subtle);
}
.result-card-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--brand-primary);
}
.result-card-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---- Client Cards ---- */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.client-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all var(--transition);
}
.client-card:hover { border-color: var(--border-accent); transform: translateY(-2px); box-shadow: var(--shadow-brand); }
.client-avatar {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
  font-weight: 800;
  font-family: var(--font-display);
  color: white;
}
.client-name { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.client-company { font-size: 12.5px; color: var(--text-muted); margin-bottom: 12px; }
.client-meta { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
  padding: 20px;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-overlay.show .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--text-primary); }
.modal-close { width: 32px; height: 32px; border-radius: 8px; border: none; background: var(--bg-card); color: var(--text-muted); cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; transition: all var(--transition); }
.modal-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }

/* ---- Chart containers ---- */
.chart-container { width: 100%; position: relative; }
canvas { max-width: 100%; }

/* ---- Misc ---- */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-sm { font-size: 12.5px; }
.text-muted { color: var(--text-muted) !important; }
.text-brand { color: var(--brand-primary) !important; }
.text-green { color: #22C55E !important; }
.text-red { color: #EF4444 !important; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); width: 260px; }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; }
  .form-grid, .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .simulator-grid { grid-template-columns: 1fr; }
  .header { padding: 0 16px; }
  .hamburger { display: flex !important; }
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 6px;
}
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ---- Print / PDF ---- */
@media print {
  .sidebar, .header, .btn-generate, .tab-btn { display: none !important; }
  .main-content { margin-left: 0; }
  .page { display: block !important; }
}
