/* ============================================================
   CARTEIRA PRO — ESTILOS GLOBAIS
   ============================================================ */

:root {
  /* Dark theme (padrão) */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #263348;
  --bg-sidebar: #0f172a;
  --bg-input: #0f172a;
  --border: #334155;
  --border-light: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-blue: #3b82f6;
  --accent-blue-light: #60a5fa;
  --accent-green: #10b981;
  --accent-green-light: #34d399;
  --accent-red: #ef4444;
  --accent-red-light: #f87171;
  --accent-yellow: #f59e0b;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-orange: #f97316;
  --gradient-blue: linear-gradient(135deg, #1d4ed8, #3b82f6);
  --gradient-green: linear-gradient(135deg, #065f46, #10b981);
  --gradient-red: linear-gradient(135deg, #991b1b, #ef4444);
  --gradient-purple: linear-gradient(135deg, #4c1d95, #8b5cf6);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --sidebar-width: 240px;
  --header-height: 60px;
}

body.light {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-sidebar: #1e293b;
  --bg-input: #f8fafc;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
#app-root { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
  border-right: 1px solid rgba(255,255,255,0.05);
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo .logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 36px; height: 36px;
  background: var(--gradient-blue);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}

.logo-text {
  display: flex; flex-direction: column;
}

.logo-text strong {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.logo-text span {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 12px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s ease;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover { background: rgba(255,255,255,0.06); color: #e2e8f0; }
.nav-item.active { background: rgba(59,130,246,0.15); color: #60a5fa; }
.nav-item.active .nav-icon { color: #3b82f6; }

.nav-item .nav-icon {
  width: 18px; text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* CONTEÚDO PRINCIPAL */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

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

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all 0.15s;
}

.btn-icon:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.update-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
}

.dot-green { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-green); }
.dot-yellow { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-yellow); animation: pulse 2s infinite; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* PÁGINA */
.page-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.page { display: none; }
.page.active { display: block; }

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

.stats-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all 0.2s;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-glass {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  padding: 18px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
  cursor: default;
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-color, var(--accent-blue));
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.stat-card.green { --card-color: var(--accent-green); }
.stat-card.red { --card-color: var(--accent-red); }
.stat-card.yellow { --card-color: var(--accent-yellow); }
.stat-card.purple { --card-color: var(--accent-purple); }
.stat-card.cyan { --card-color: var(--accent-cyan); }
.stat-card.orange { --card-color: var(--accent-orange); }

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stat-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  background: rgba(59,130,246,0.12);
  color: var(--accent-blue);
}

.stat-icon.green { background: rgba(16,185,129,0.12); color: var(--accent-green); }
.stat-icon.red { background: rgba(239,68,68,0.12); color: var(--accent-red); }
.stat-icon.yellow { background: rgba(245,158,11,0.12); color: var(--accent-yellow); }
.stat-icon.purple { background: rgba(139,92,246,0.12); color: var(--accent-purple); }
.stat-icon.cyan { background: rgba(6,182,212,0.12); color: var(--accent-cyan); }
.stat-icon.orange { background: rgba(249,115,22,0.12); color: var(--accent-orange); }

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-value.small { font-size: 16px; }

.stat-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-up { color: var(--accent-green); }
.badge-down { color: var(--accent-red); }
.badge-neutral { color: var(--text-muted); }

/* ============================================================
   CHARTS SECTION
   ============================================================ */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.charts-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

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

.chart-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.chart-actions {
  display: flex;
  gap: 4px;
}

.chart-btn {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.chart-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}

.chart-btn:hover:not(.active) {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* ============================================================
   TABELAS
   ============================================================ */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

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

.table-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.table-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
}

.search-input input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  width: 160px;
}

.search-input input::placeholder { color: var(--text-muted); }

.select-filter {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
}

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

.data-table th {
  background: var(--bg-primary);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}

.data-table th:hover { color: var(--text-primary); }
.data-table th.sorted { color: var(--accent-blue); }
.data-table th.right, .data-table td.right { text-align: right; }

.data-table tr {
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s;
}

.data-table tr:hover td { background: var(--bg-card-hover); }
.data-table tr:last-child { border-bottom: none; }

.data-table td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
}

.asset-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.asset-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--gradient-blue);
  color: #fff;
}

.asset-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.asset-info span {
  font-size: 11px;
  color: var(--text-muted);
}

.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.type-ACAO { background: rgba(59,130,246,0.15); color: #60a5fa; }
.type-FII { background: rgba(16,185,129,0.15); color: #34d399; }
.type-ETF { background: rgba(139,92,246,0.15); color: #a78bfa; }
.type-BDR { background: rgba(245,158,11,0.15); color: #fbbf24; }
.type-CRIPTO { background: rgba(249,115,22,0.15); color: #fb923c; }
.type-RF { background: rgba(6,182,212,0.15); color: #22d3ee; }
.type-OUTRO { background: rgba(100,116,139,0.15); color: #94a3b8; }

.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-yellow { color: var(--accent-yellow); }
.text-blue { color: var(--accent-blue); }
.text-muted { color: var(--text-muted); }

.font-mono { font-family: 'SF Mono', 'Fira Code', monospace; }

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  outline: none;
}

.btn-primary {
  background: var(--accent-blue);
  color: #fff;
}

.btn-primary:hover { background: #2563eb; }

.btn-success {
  background: var(--accent-green);
  color: #fff;
}

.btn-success:hover { background: #059669; }

.btn-danger {
  background: var(--accent-red);
  color: #fff;
}

.btn-danger:hover { background: #dc2626; }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-outline:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 15px; }

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13.5px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.form-control:focus { border-color: var(--accent-blue); }
.form-control::placeholder { color: var(--text-muted); }

select.form-control { cursor: pointer; }
select.form-control option { background: var(--bg-secondary); }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}

.modal-lg { max-width: 860px; }

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

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ============================================================
   TOAST / NOTIFICAÇÕES
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  animation: toastIn 0.3s ease;
  font-size: 13px;
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error { border-left: 3px solid var(--accent-red); }
.toast.warning { border-left: 3px solid var(--accent-yellow); }
.toast.info { border-left: 3px solid var(--accent-blue); }

/* ============================================================
   LOADING
   ============================================================ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  gap: 10px;
}

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
}

.empty-icon {
  font-size: 40px;
  opacity: 0.3;
  margin-bottom: 8px;
}

.empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-desc { font-size: 13px; max-width: 300px; }

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent-blue);
  transition: width 0.5s ease;
}

.progress-fill.green { background: var(--accent-green); }
.progress-fill.red { background: var(--accent-red); }
.progress-fill.yellow { background: var(--accent-yellow); }

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  width: fit-content;
}

.tab-btn {
  padding: 6px 14px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.tab-btn:hover:not(.active) { color: var(--text-primary); }

/* ============================================================
   DIVIDEND CALENDAR
   ============================================================ */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: default;
  font-size: 12px;
  transition: background 0.15s;
}

.cal-day.has-event {
  background: rgba(16,185,129,0.15);
  color: var(--accent-green);
  cursor: pointer;
  font-weight: 700;
}

.cal-day.today {
  background: rgba(59,130,246,0.2);
  color: var(--accent-blue);
  font-weight: 700;
}

.cal-day-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  padding: 4px;
}

/* ============================================================
   ALLOCATION TARGETS
   ============================================================ */
.allocation-item {
  margin-bottom: 14px;
}

.allocation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
}

.allocation-diff {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
}

.diff-up { background: rgba(16,185,129,0.12); color: var(--accent-green); }
.diff-down { background: rgba(239,68,68,0.12); color: var(--accent-red); }
.diff-ok { background: rgba(59,130,246,0.12); color: var(--accent-blue); }

/* ============================================================
   SIMULADOR
   ============================================================ */
.simulator-result-card {
  background: var(--gradient-blue);
  border-radius: var(--radius-lg);
  padding: 24px;
  color: #fff;
  text-align: center;
}

.simulator-result-value {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
}

/* ============================================================
   ONBOARDING / WIZARD
   ============================================================ */
.wizard-steps {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  overflow: hidden;
}

.wizard-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
  position: relative;
}

.wizard-step::after {
  content: '';
  position: absolute;
  top: 20px; right: 0;
  width: 50%; height: 2px;
  background: var(--border);
}

.wizard-step::before {
  content: '';
  position: absolute;
  top: 20px; left: 0;
  width: 50%; height: 2px;
  background: var(--border);
}

.wizard-step:first-child::before, .wizard-step:last-child::after { display: none; }

.wizard-step.done::before, .wizard-step.done::after,
.wizard-step.active::before { background: var(--accent-blue); }

.step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  background: var(--bg-secondary);
  position: relative;
  z-index: 1;
}

.wizard-step.done .step-num {
  border-color: var(--accent-blue);
  background: var(--accent-blue);
  color: #fff;
}

.wizard-step.active .step-num {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* ============================================================
   RANKINGS
   ============================================================ */
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

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

.rank-num {
  width: 24px; height: 24px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.rank-1 { background: rgba(245,158,11,0.2); color: #f59e0b; }
.rank-2 { background: rgba(148,163,184,0.2); color: #94a3b8; }
.rank-3 { background: rgba(180,83,9,0.2); color: #b45309; }
.rank-other { background: var(--bg-primary); color: var(--text-muted); }

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

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f1f5f9;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  border: 1px solid var(--border);
  z-index: 100;
}

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

/* ============================================================
   HIGHLIGHT SECTIONS
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ============================================================
   MOBILE MENU TOGGLE
   ============================================================ */
.mobile-menu-btn {
  display: none;
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .charts-row-3 { grid-template-columns: 1fr 1fr; }
  .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main-content { margin-left: 0; }

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

  .charts-row, .charts-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .form-row-3, .form-row-4 { grid-template-columns: 1fr 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }

  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }

  .simulator-result-value { font-size: 28px; }
}

@media (max-width: 480px) {
  .stats-grid, .stats-grid-4 { grid-template-columns: 1fr; }
  .form-row-3, .form-row-4, .form-row-2 { grid-template-columns: 1fr; }
  .modal { border-radius: var(--radius-md); }
}

/* ============================================================
   OVERLAY SIDEBAR MOBILE
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 190;
}

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

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.rounded { border-radius: var(--radius-sm); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   ONBOARDING SCREEN
   ============================================================ */
.onboard-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: 20px;
}

.onboard-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
}

/* ============================================================
   DEMO DATA BANNER
   ============================================================ */
.demo-banner {
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12px;
  color: var(--accent-yellow);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
