/* ── Theme Variables ── */
:root {
  --bg: #080818;
  --bg-surface: rgba(255,255,255,0.03);
  --bg-surface2: rgba(255,255,255,0.06);
  --text: #e0e0f0;
  --text-bright: #fff;
  --text-sub: #b0b0c0;
  --text-muted: #8888a8;
  --border: rgba(255,255,255,0.08);
  --border-light: rgba(255,255,255,0.05);
  --border-subtle: rgba(255,255,255,0.04);
  --nav-bg: rgba(8,8,24,0.92);
  --card-bg: rgba(255,255,255,0.03);
  --card-border: rgba(255,255,255,0.06);
  --input-bg: rgba(255,255,255,0.06);
  --select-bg: #0c0c20;
  --sidebar-bg: rgba(8,8,24,0.98);
  --accent: #FF0057;
  --accent-hover: #ff3378;
  --teal: #00C9A7;
  --gold: #c9a24d;
  --orange: #FF6B35;
  --blue: #4A90D9;
  --purple: #9B59B6;
  --red: #FF3B30;
  --green: #34C759;
}

[data-theme="light"] {
  --bg: #f7f5f0;
  --bg-surface: #FFFFFF;
  --bg-surface2: #f0ede6;
  --text: #1a1a2e;
  --text-bright: #1a1a2e;
  --text-sub: #444;
  --text-muted: #777;
  --border: rgba(27,42,107,0.12);
  --border-light: rgba(27,42,107,0.08);
  --border-subtle: rgba(27,42,107,0.06);
  --nav-bg: rgba(247,245,240,0.92);
  --card-bg: #FFFFFF;
  --card-border: rgba(27,42,107,0.10);
  --input-bg: rgba(27,42,107,0.06);
  --select-bg: #f0ede6;
  --sidebar-bg: rgba(247,245,240,0.98);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.6; overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Login Gate ── */
.login-gate {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
  background: var(--bg);
}
.login-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px; padding: 48px 40px;
  max-width: 420px; width: 100%;
  backdrop-filter: blur(20px);
  position: relative; overflow: hidden;
}
.login-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--orange), var(--gold));
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img { height: 48px; }
.login-title { text-align: center; font-size: 20px; font-weight: 700; color: var(--text-bright); margin-bottom: 8px; }
.login-subtitle { text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 32px; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-sub); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-input {
  width: 100%; padding: 12px 16px; background: var(--input-bg);
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 14px; font-family: inherit;
  transition: border-color 0.2s; outline: none;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }
.btn-login {
  width: 100%; padding: 14px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--orange));
  color: #fff; font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: opacity 0.2s; margin-top: 8px;
}
.btn-login:hover { opacity: 0.9; }
.btn-login:disabled { opacity: 0.5; cursor: not-allowed; }
.login-error { color: var(--red); font-size: 13px; text-align: center; margin-top: 12px; display: none; }

/* ── Admin Shell ── */
.admin-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: 260px; position: fixed; top: 0; left: 0; bottom: 0;
  background: var(--sidebar-bg); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 100;
  backdrop-filter: blur(20px);
  transition: transform 0.3s, width 0.3s, background-color 0.3s;
}
.sidebar-header {
  padding: 20px 20px 16px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-header img { height: 32px; }
.sidebar-header span { font-size: 14px; font-weight: 700; color: var(--text-bright); }
.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  color: var(--text-sub); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; border: none;
  background: none; width: 100%; text-align: left; font-family: inherit;
}
.nav-item:hover { background: var(--bg-surface2); color: var(--text-bright); }
.nav-item.active {
  background: rgba(255,0,87,0.08); color: var(--accent);
  border-left: 3px solid var(--accent);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-section { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; padding: 16px 14px 6px; }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border-light); display: flex; gap: 8px; }
.btn-icon {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg-surface2); color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon svg { width: 16px; height: 16px; }

/* ── Main Content ── */
.main-content {
  margin-left: 260px; flex: 1; min-height: 100vh;
  transition: margin-left 0.3s;
}
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: 16px 32px; display: flex; align-items: center; justify-content: space-between;
  transition: background-color 0.3s;
}
.topbar-title { font-size: 18px; font-weight: 700; color: var(--text-bright); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-email { font-size: 12px; color: var(--text-muted); }
.hamburger { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 4px; }
.hamburger svg { width: 24px; height: 24px; }

.page-content { padding: 28px 32px; }
.page-section { display: none; }
.page-section.active { display: block; }

/* ── Stat Cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 16px; padding: 20px; backdrop-filter: blur(10px);
  transition: transform 0.2s, border-color 0.2s;
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.pink { background: rgba(255,0,87,0.12); color: var(--accent); }
.stat-icon.teal { background: rgba(0,201,167,0.12); color: var(--teal); }
.stat-icon.gold { background: rgba(201,162,77,0.12); color: var(--gold); }
.stat-icon.orange { background: rgba(255,107,53,0.12); color: var(--orange); }
.stat-icon.blue { background: rgba(74,144,217,0.12); color: var(--blue); }
.stat-icon.purple { background: rgba(155,89,182,0.12); color: var(--purple); }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-bright); line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Charts ── */
.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 28px; }
.chart-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 16px; padding: 20px; backdrop-filter: blur(10px);
}
.chart-title { font-size: 14px; font-weight: 600; color: var(--text-bright); margin-bottom: 16px; }
.chart-wrap { position: relative; height: 260px; }
.chart-wrap canvas { display: block; width: 100% !important; height: 100% !important; }

/* ── Detail Modal ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 9000; backdrop-filter: blur(4px); }
.modal-overlay.open { display: flex; align-items: center; justify-content: center; }
.modal {
  background: var(--sidebar-bg); border: 1px solid var(--border);
  border-radius: 20px; width: 560px; max-height: 80vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5); animation: cmdIn 0.2s ease-out;
  position: relative;
}
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: 16px; font-weight: 700; color: var(--text-bright); }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 20px; padding: 4px; }
.modal-close:hover { color: var(--accent); }
.modal-body { padding: 24px; }
.modal-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.modal-row:last-child { border-bottom: none; }
.modal-label { font-size: 13px; color: var(--text-muted); }
.modal-value { font-size: 13px; color: var(--text-bright); font-weight: 500; }
.modal-actions { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.btn-modal {
  padding: 8px 16px; border-radius: 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all 0.2s; border: 1px solid var(--border);
}
.btn-modal-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-modal-primary:hover { opacity: 0.9; }
.btn-modal-danger { background: rgba(255,59,48,0.1); color: var(--red); border-color: var(--red); }
.btn-modal-danger:hover { background: rgba(255,59,48,0.2); }
.btn-modal-default { background: var(--bg-surface2); color: var(--text-sub); }
.btn-modal-default:hover { border-color: var(--accent); color: var(--accent); }

/* ── Revenue Goal Progress ── */
.goal-bar-wrap { margin-bottom: 28px; }
.goal-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.goal-label { font-size: 13px; color: var(--text-sub); }
.goal-value { font-size: 13px; font-weight: 700; color: var(--text-bright); }
.goal-bar { height: 8px; background: var(--bg-surface2); border-radius: 4px; overflow: hidden; }
.goal-fill {
  height: 100%; border-radius: 4px; transition: width 1s ease-out;
  background: linear-gradient(90deg, var(--accent), var(--orange), var(--gold));
  position: relative;
}
.goal-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

/* ── Data Tables ── */
.table-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.table-title { font-size: 16px; font-weight: 700; color: var(--text-bright); }
.table-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-input {
  padding: 8px 14px 8px 36px; background: var(--input-bg);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 13px; font-family: inherit;
  outline: none; width: 240px; transition: border-color 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238888a8' viewBox='0 0 24 24'%3E%3Cpath d='M21 21l-4.35-4.35M11 19a8 8 0 100-16 8 8 0 000 16z' stroke='%238888a8' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center;
}
.search-input:focus { border-color: var(--accent); }
.filter-select {
  padding: 8px 12px; background: var(--select-bg);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 13px; font-family: inherit;
  outline: none; cursor: pointer;
}
.table-wrap {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 16px; overflow: hidden; backdrop-filter: blur(10px);
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--bg-surface2); color: var(--text-muted);
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 16px; font-size: 13px; color: var(--text-sub);
  border-bottom: 1px solid var(--border-subtle);
}
.data-table tr:hover td { background: var(--bg-surface); }
.data-table tr:last-child td { border-bottom: none; }

/* ── Status Badges ── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.badge-confirmed, .badge-published, .badge-active, .badge-completed { background: rgba(0,201,167,0.12); color: var(--teal); }
.badge-pending, .badge-draft, .badge-processing { background: rgba(201,162,77,0.12); color: var(--gold); }
.badge-refunded, .badge-cancelled, .badge-failed, .badge-inactive { background: rgba(255,59,48,0.12); color: var(--red); }

/* ── Pagination ── */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 16px; }
.pagination-info { font-size: 12px; color: var(--text-muted); }
.pagination-btns { display: flex; gap: 6px; }
.page-btn {
  padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-surface); color: var(--text-sub); font-size: 12px;
  cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Loading ── */
.loading-overlay {
  display: flex; align-items: center; justify-content: center;
  padding: 60px; color: var(--text-muted); font-size: 14px;
}
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin-right: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 14px; }

/* ── Section Header ── */
.section-header { margin-bottom: 24px; }
.section-title { font-size: 20px; font-weight: 700; color: var(--text-bright); margin-bottom: 4px; }
.section-subtitle { font-size: 13px; color: var(--text-muted); }

/* ── Settings ── */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.setting-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 16px; padding: 24px;
}
.setting-card h3 { font-size: 14px; font-weight: 600; color: var(--text-bright); margin-bottom: 12px; }
.setting-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.setting-item:last-child { border-bottom: none; }
.setting-label { font-size: 13px; color: var(--text-sub); }
.setting-value { font-size: 13px; color: var(--text-muted); font-family: monospace; }
.btn-setting {
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-surface2); color: var(--text); font-size: 12px;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.btn-setting:hover { border-color: var(--accent); color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .sidebar { width: 70px; }
  .sidebar-header span, .nav-item span, .nav-section { display: none; }
  .sidebar-header { justify-content: center; padding: 16px; }
  .nav-item { justify-content: center; padding: 12px; }
  .main-content { margin-left: 70px; }
  .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: 260px; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-header span, .nav-item span, .nav-section { display: block; }
  .main-content { margin-left: 0; }
  .hamburger { display: block; }
  .page-content { padding: 20px 16px; }
  .topbar { padding: 12px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .search-input { width: 160px; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
  .sidebar.open ~ .sidebar-overlay { display: block; }
}
/* ── Animated Counter ── */
.stat-value { transition: all 0.3s; }

/* ── Sparkline in Cards ── */
.stat-sparkline { margin-top: 8px; height: 32px; }
.stat-sparkline svg { width: 100%; height: 32px; }
.stat-sparkline path { fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.stat-sparkline .fill { stroke: none; opacity: 0.1; }

/* ── Trend Indicator ── */
.stat-trend { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; margin-top: 4px; padding: 2px 8px; border-radius: 12px; }
.stat-trend.up { color: var(--teal); background: rgba(0,201,167,0.1); }
.stat-trend.down { color: var(--red); background: rgba(255,59,48,0.1); }
.stat-trend svg { width: 12px; height: 12px; }

/* ── Skeleton Loading ── */
.skeleton { background: var(--bg-surface2); border-radius: 8px; position: relative; overflow: hidden; }
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  animation: shimmer 1.5s infinite;
}
[data-theme="light"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.04), transparent);
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.skeleton-card { height: 120px; border-radius: 16px; }
.skeleton-row { height: 48px; margin-bottom: 4px; }
.skeleton-chart { height: 260px; border-radius: 16px; }

/* ── Toast Notifications ── */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 20px; border-radius: 12px; font-size: 13px; font-weight: 500;
  color: #fff; display: flex; align-items: center; gap: 10px;
  backdrop-filter: blur(20px); box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  animation: toastIn 0.3s ease-out; min-width: 280px;
  border: 1px solid rgba(255,255,255,0.1);
}
.toast.hiding { animation: toastOut 0.3s ease-in forwards; }
.toast-success { background: rgba(0,201,167,0.9); }
.toast-error { background: rgba(255,59,48,0.9); }
.toast-info { background: rgba(74,144,217,0.9); }
.toast-warning { background: rgba(201,162,77,0.9); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(120%); opacity: 0; } }

/* ── Command Palette ── */
.cmd-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 10000; backdrop-filter: blur(4px); }
.cmd-overlay.open { display: flex; align-items: flex-start; justify-content: center; padding-top: 15vh; }
.cmd-palette {
  background: var(--sidebar-bg); border: 1px solid var(--border);
  border-radius: 16px; width: 520px; max-height: 400px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  animation: cmdIn 0.2s ease-out;
}
@keyframes cmdIn { from { transform: scale(0.95) translateY(-10px); opacity: 0; } }
.cmd-input-wrap { padding: 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.cmd-input-wrap svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.cmd-input {
  flex: 1; background: none; border: none; color: var(--text-bright);
  font-size: 15px; font-family: inherit; outline: none;
}
.cmd-input::placeholder { color: var(--text-muted); }
.cmd-results { max-height: 300px; overflow-y: auto; padding: 8px; }
.cmd-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 8px; cursor: pointer; color: var(--text-sub); font-size: 13px;
  transition: background 0.15s;
}
.cmd-item:hover, .cmd-item.selected { background: var(--bg-surface2); color: var(--text-bright); }
.cmd-item svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.cmd-item .cmd-shortcut { margin-left: auto; font-size: 11px; color: var(--text-muted); background: var(--bg-surface); padding: 2px 6px; border-radius: 4px; }
.cmd-hint { padding: 12px 16px; font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--border-subtle); text-align: center; }

/* ── Activity Feed ── */
.activity-feed { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; padding: 16px; max-height: 320px; overflow-y: auto; }
.activity-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.activity-dot.green { background: var(--teal); }
.activity-dot.pink { background: var(--accent); }
.activity-dot.gold { background: var(--gold); }
.activity-dot.blue { background: var(--blue); }
.activity-text { font-size: 13px; color: var(--text-sub); line-height: 1.4; }
.activity-text strong { color: var(--text-bright); }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Connection Status ── */
.conn-status { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); }
.conn-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.last-updated { font-size: 10px; color: var(--text-muted); }

/* ── Sortable Columns ── */
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--accent); }
.data-table th .sort-icon { display: inline-block; margin-left: 4px; font-size: 10px; opacity: 0.4; }
.data-table th.sorted .sort-icon { opacity: 1; color: var(--accent); }

/* ── Row Actions ── */
.row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.2s; }
tr:hover .row-actions { opacity: 1; }
.row-btn {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-surface2); color: var(--text-sub); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.row-btn:hover { border-color: var(--accent); color: var(--accent); }
.row-btn svg { width: 14px; height: 14px; }

/* ── Page Transitions ── */
.page-section.active { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Date Range Picker ── */
.date-range { display: flex; gap: 8px; align-items: center; }
.date-input {
  padding: 7px 10px; background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 12px; font-family: inherit; outline: none;
}
.date-input:focus { border-color: var(--accent); }

/* ── Bulk Actions Bar ── */
.bulk-bar {
  display: none; position: sticky; bottom: 0; z-index: 60;
  background: var(--accent); color: #fff; padding: 12px 24px;
  border-radius: 12px 12px 0 0; margin: 0 -1px;
  display: none; align-items: center; justify-content: space-between;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
}
.bulk-bar.visible { display: flex; }
.bulk-info { font-size: 13px; font-weight: 600; }
.bulk-actions { display: flex; gap: 8px; }
.bulk-btn {
  padding: 6px 14px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1); color: #fff; font-size: 12px;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.bulk-btn:hover { background: rgba(255,255,255,0.2); }
.bulk-btn.danger { border-color: rgba(255,255,255,0.5); }

/* ── Checkbox in tables ── */
.row-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ── Heatmap ── */
.heatmap-wrap { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; padding: 20px; }
.heatmap-title { font-size: 14px; font-weight: 600; color: var(--text-bright); margin-bottom: 12px; }
.heatmap-grid { display: grid; grid-template-columns: 40px repeat(4, 1fr); gap: 3px; max-width: 500px; }
.heatmap-label { font-size: 10px; color: var(--text-muted); display: flex; align-items: center; }
.heatmap-cell {
  height: 24px; border-radius: 4px; transition: all 0.2s;
  position: relative; cursor: default;
}
.heatmap-cell:hover { transform: scale(1.1); z-index: 1; }
.heatmap-header { font-size: 10px; color: var(--text-muted); text-align: center; }

/* ── Avatar Initials ── */
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
  color: #fff; flex-shrink: 0; margin-right: 8px; vertical-align: middle;
}
.avatar-1 { background: linear-gradient(135deg, var(--accent), var(--orange)); }
.avatar-2 { background: linear-gradient(135deg, var(--teal), var(--blue)); }
.avatar-3 { background: linear-gradient(135deg, var(--purple), var(--accent)); }
.avatar-4 { background: linear-gradient(135deg, var(--gold), var(--orange)); }
.avatar-5 { background: linear-gradient(135deg, var(--blue), var(--teal)); }

/* ── Results Count ── */
.results-count { font-size: 11px; color: var(--text-muted); margin-left: 8px; }

/* ── Keyboard Shortcuts Modal ── */
.shortcuts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shortcut-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.shortcut-key { background: var(--bg-surface2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 4px; font-size: 11px; color: var(--text-sub); font-family: monospace; min-width: 60px; text-align: center; }
.shortcut-desc { font-size: 12px; color: var(--text-muted); }

/* ── Status Mini Chart ── */
.status-chart { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; }
.status-bar-segment { height: 8px; border-radius: 4px; transition: width 0.8s ease-out; }

/* ── Print Styles ── */
/* ── Revenue Comparison Widget ── */
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.comparison-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 16px; padding: 20px; backdrop-filter: blur(10px);
}
.comparison-title { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.comparison-value { font-size: 24px; font-weight: 800; color: var(--text-bright); }
.comparison-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.comparison-bar { display: flex; gap: 4px; align-items: flex-end; height: 40px; margin-top: 12px; }
.comparison-bar-item { flex: 1; border-radius: 3px 3px 0 0; transition: height 0.8s ease-out; min-height: 2px; }

/* ── Event Countdown ── */
.countdown-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 24px; }
.countdown-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 16px; display: flex; align-items: center; gap: 16px;
  transition: border-color 0.2s;
}
.countdown-card:hover { border-color: var(--accent); }
.countdown-timer { display: flex; gap: 6px; }
.countdown-unit { text-align: center; }
.countdown-num { font-size: 20px; font-weight: 800; color: var(--accent); line-height: 1; }
.countdown-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; }
.countdown-info { flex: 1; }
.countdown-name { font-size: 13px; font-weight: 600; color: var(--text-bright); }
.countdown-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Geo Distribution ── */
.geo-list { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; padding: 20px; }
.geo-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.geo-item:last-child { border-bottom: none; }
.geo-flag { font-size: 18px; }
.geo-city { font-size: 13px; color: var(--text-bright); flex: 1; }
.geo-count { font-size: 13px; font-weight: 600; color: var(--text-sub); }
.geo-bar { width: 80px; height: 6px; background: var(--bg-surface2); border-radius: 3px; overflow: hidden; }
.geo-bar-fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width 0.8s ease-out; }

/* ── Quick Action Buttons ── */
.action-btn {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid transparent;
  background: none; color: var(--text-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: all 0.15s;
  padding: 0;
}
.action-btn:hover { color: var(--accent); border-color: var(--border); background: var(--bg-surface2); }
.action-btn.danger:hover { color: var(--red); }
.action-btn svg { width: 14px; height: 14px; }
.actions-cell { display: flex; gap: 2px; }

/* ── Dashboard Footer ── */
.dash-footer {
  padding: 20px 32px; border-top: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--text-muted); margin-top: 40px;
}
.dash-footer a { color: var(--text-muted); }
.dash-footer a:hover { color: var(--accent); }

/* ── Confetti ── */
.confetti-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 99999; overflow: hidden; }
.confetti-piece {
  position: absolute; top: -10px;
  width: 10px; height: 10px; border-radius: 2px;
  animation: confettiFall 3s ease-out forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg) scale(0.5); opacity: 0; }
}

/* ── Fullscreen Toggle ── */
.fullscreen-btn { position: fixed; bottom: 16px; right: 16px; z-index: 200; }

/* ── Session Warning ── */
.session-bar {
  display: none; position: fixed; bottom: 0; left: 260px; right: 0;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  color: #fff; padding: 8px 24px; font-size: 12px; font-weight: 600;
  z-index: 200; text-align: center;
}
.session-bar.visible { display: block; }
.session-bar button { background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3); color: #fff; padding: 4px 12px; border-radius: 6px; font-size: 11px; cursor: pointer; margin-left: 12px; }

/* ── Welcome Banner ── */
.welcome-banner {
  background: linear-gradient(135deg, rgba(255,0,87,0.08), rgba(255,107,53,0.08));
  border: 1px solid rgba(255,0,87,0.15); border-radius: 16px;
  padding: 20px 24px; margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between;
}
.welcome-text h2 { font-size: 18px; font-weight: 700; color: var(--text-bright); margin-bottom: 4px; }
.welcome-text p { font-size: 13px; color: var(--text-sub); }
.welcome-actions { display: flex; gap: 8px; }
.welcome-btn {
  padding: 8px 16px; border-radius: 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all 0.2s; border: none;
}
.welcome-btn-primary { background: var(--accent); color: #fff; }
.welcome-btn-primary:hover { opacity: 0.9; }
.welcome-btn-secondary { background: var(--bg-surface2); color: var(--text-sub); border: 1px solid var(--border); }
.welcome-btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ── Metric Tooltip ── */
.stat-card { position: relative; }
.stat-tooltip {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--sidebar-bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: 11px; color: var(--text-sub); white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3); z-index: 10;
}
.stat-card:hover .stat-tooltip { display: block; }

/* ── Gauge Chart ── */
.gauge-wrap { display: flex; flex-direction: column; align-items: center; }
.gauge-svg { filter: drop-shadow(0 2px 8px rgba(255,0,87,0.15)); }
.gauge-label { font-size: 11px; color: var(--text-muted); margin-top: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.gauge-score { font-size: 28px; font-weight: 800; }

/* ── Forecast Banner ── */
.forecast-card {
  background: linear-gradient(135deg, rgba(74,144,217,0.08), rgba(0,201,167,0.08));
  border: 1px solid rgba(74,144,217,0.15); border-radius: 16px;
  padding: 20px 24px; margin-bottom: 24px; display: flex; align-items: center; gap: 16px;
}
.forecast-icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(74,144,217,0.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.forecast-icon svg { width: 24px; height: 24px; color: var(--blue); }
.forecast-text { flex: 1; }
.forecast-title { font-size: 14px; font-weight: 700; color: var(--text-bright); margin-bottom: 4px; }
.forecast-desc { font-size: 13px; color: var(--text-sub); line-height: 1.5; }
.forecast-value { font-size: 24px; font-weight: 800; color: var(--teal); }

/* ── Anomaly Alert ── */
.anomaly-alert {
  background: linear-gradient(135deg, rgba(255,59,48,0.08), rgba(255,0,87,0.08));
  border: 1px solid rgba(255,59,48,0.2); border-radius: 16px;
  padding: 16px 24px; margin-bottom: 16px; display: flex; align-items: center; gap: 16px;
  animation: anomalyPulse 2s infinite;
}
@keyframes anomalyPulse { 0%,100% { border-color: rgba(255,59,48,0.2); } 50% { border-color: rgba(255,59,48,0.5); } }
.anomaly-icon { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,59,48,0.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.anomaly-icon svg { width: 20px; height: 20px; color: var(--red); }
.anomaly-text { flex: 1; font-size: 13px; color: var(--text-sub); }
.anomaly-text strong { color: var(--text-bright); }

/* ── Performance Score Cards ── */
.perf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px; }
.perf-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 16px; padding: 16px; text-align: center; backdrop-filter: blur(10px);
}
.perf-name { font-size: 12px; font-weight: 600; color: var(--text-bright); margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perf-detail { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Narrative Insight ── */
.narrative-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 16px; padding: 24px; margin-bottom: 24px;
}
.narrative-title { font-size: 14px; font-weight: 700; color: var(--text-bright); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.narrative-title svg { width: 18px; height: 18px; color: var(--blue); }
.narrative-body { font-size: 13px; color: var(--text-sub); line-height: 1.8; }
.narrative-body strong { color: var(--text-bright); }
.narrative-body .highlight { color: var(--accent); font-weight: 600; }
.narrative-body .positive { color: var(--teal); }
.narrative-body .negative { color: var(--red); }

/* ── Live Order Ticker ── */
.ticker-wrap {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 12px; overflow: hidden; margin-bottom: 24px; position: relative;
  height: 44px;
}
.ticker-label {
  position: absolute; left: 0; top: 0; bottom: 0; width: 80px;
  background: linear-gradient(90deg, var(--accent), rgba(255,0,87,0.6));
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; text-transform: uppercase;
  letter-spacing: 1px; z-index: 2;
}
.ticker-label::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; margin-right: 6px; animation: pulse 1.5s infinite; }
.ticker-track {
  display: flex; align-items: center; height: 44px;
  animation: tickerScroll 40s linear infinite;
  padding-left: 90px;
}
.ticker-item {
  display: flex; align-items: center; gap: 6px; padding: 0 20px;
  white-space: nowrap; font-size: 12px; color: var(--text-sub);
  border-right: 1px solid var(--border-subtle); height: 100%;
}
.ticker-item:last-child { border-right: none; }
.ticker-item strong { color: var(--text-bright); }
.ticker-amount { color: var(--teal); font-weight: 700; }
@keyframes tickerScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ── Funnel Chart ── */
.funnel-wrap {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 16px; padding: 24px; margin-bottom: 24px;
}
.funnel-title { font-size: 14px; font-weight: 600; color: var(--text-bright); margin-bottom: 16px; }
.funnel-stages { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.funnel-stage {
  display: flex; align-items: center; gap: 16px; width: 100%;
  padding: 12px 20px; border-radius: 8px; transition: all 0.3s;
  position: relative;
}
.funnel-bar {
  height: 32px; border-radius: 6px; display: flex; align-items: center;
  padding: 0 12px; font-size: 12px; font-weight: 600; color: #fff;
  transition: width 1s ease-out; min-width: 40px; max-width: 100%;
}
.funnel-label { font-size: 13px; color: var(--text-sub); min-width: 120px; }
.funnel-value { font-size: 13px; font-weight: 700; color: var(--text-bright); min-width: 60px; text-align: right; }
.funnel-drop { font-size: 11px; color: var(--red); margin-left: 8px; }

/* ── Leaderboard ── */
.leaderboard {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 16px; padding: 20px;
}
.leaderboard-title { font-size: 14px; font-weight: 600; color: var(--text-bright); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.leaderboard-title svg, .leaderboard svg { width: 18px; height: 18px; flex-shrink: 0; }
.leaderboard-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.leaderboard-item:last-child { border-bottom: none; }
.leaderboard-rank {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; }
.rank-2 { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); color: #000; }
.rank-3 { background: linear-gradient(135deg, #CD7F32, #A0522D); color: #fff; }
.rank-other { background: var(--bg-surface2); color: var(--text-muted); }
.leaderboard-name { flex: 1; font-size: 13px; color: var(--text-bright); font-weight: 500; }
.leaderboard-stat { font-size: 13px; font-weight: 700; color: var(--teal); }
.leaderboard-bar { width: 80px; height: 6px; background: var(--bg-surface2); border-radius: 3px; overflow: hidden; }
.leaderboard-bar-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease-out; }

/* ── Cohort Matrix ── */
.cohort-wrap {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 16px; padding: 20px; overflow-x: auto;
}
.cohort-title { font-size: 14px; font-weight: 600; color: var(--text-bright); margin-bottom: 16px; }
.cohort-table { border-collapse: collapse; width: 100%; }
.cohort-table th { font-size: 10px; color: var(--text-muted); padding: 6px 10px; text-align: center; text-transform: uppercase; }
.cohort-table td { padding: 4px; text-align: center; }
.cohort-cell {
  width: 44px; height: 28px; border-radius: 4px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 10px; font-weight: 600;
  color: #fff; transition: all 0.2s;
}
.cohort-cell:hover { transform: scale(1.15); }
.cohort-label { font-size: 11px; color: var(--text-muted); text-align: left; padding-right: 12px; white-space: nowrap; }

/* ── Event Comparison ── */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.compare-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 16px; padding: 20px;
}
.compare-header { font-size: 14px; font-weight: 700; color: var(--text-bright); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.compare-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.compare-row:last-child { border-bottom: none; }
.compare-metric { font-size: 12px; color: var(--text-muted); }
.compare-value { font-size: 13px; font-weight: 600; color: var(--text-bright); }
.compare-winner { color: var(--teal); }

/* ── Top Loading Bar ── */
.loading-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 99999;
  pointer-events: none;
}
.loading-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--orange), var(--gold));
  border-radius: 0 2px 2px 0;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px var(--accent);
}
.loading-bar-fill.active { animation: loadBarProgress 2s ease-out forwards; }
.loading-bar-fill.done { width: 100% !important; transition: width 0.2s; }
.loading-bar-fill.fade { opacity: 0; transition: opacity 0.4s; }
@keyframes loadBarProgress { 0% { width: 0; } 30% { width: 45%; } 60% { width: 70%; } 80% { width: 85%; } 100% { width: 92%; } }

/* ── Sticky Table Headers ── */
.table-wrap { max-height: 500px; overflow-y: auto; }
.data-table thead { position: sticky; top: 0; z-index: 5; }
.data-table thead th { background: var(--bg-surface2); backdrop-filter: blur(10px); }
[data-theme="light"] .data-table thead th { background: #eee; }

/* ── Row Hover Tooltip ── */
.row-tooltip {
  display: none; position: fixed; z-index: 9000;
  background: var(--sidebar-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px; min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4); pointer-events: none;
  font-size: 12px; color: var(--text-sub);
}
.row-tooltip.visible { display: block; animation: fadeIn 0.15s ease-out; }
.row-tooltip-title { font-size: 13px; font-weight: 700; color: var(--text-bright); margin-bottom: 6px; }
.row-tooltip-row { display: flex; justify-content: space-between; padding: 2px 0; }
.row-tooltip-label { color: var(--text-muted); }
.row-tooltip-value { font-weight: 600; color: var(--text-bright); }

/* ── Light Mode Extra Polish ── */
[data-theme="light"] .stat-card { box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
[data-theme="light"] .chart-card { box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
[data-theme="light"] .sidebar { box-shadow: 2px 0 8px rgba(0,0,0,0.04); }
[data-theme="light"] .topbar { box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
[data-theme="light"] .welcome-banner { background: linear-gradient(135deg, rgba(255,0,87,0.04), rgba(255,107,53,0.04)); }
[data-theme="light"] .forecast-card { background: linear-gradient(135deg, rgba(74,144,217,0.04), rgba(0,201,167,0.04)); }
[data-theme="light"] .anomaly-alert { background: linear-gradient(135deg, rgba(255,59,48,0.04), rgba(255,0,87,0.04)); }
[data-theme="light"] .modal { box-shadow: 0 24px 64px rgba(0,0,0,0.15); }
[data-theme="light"] .cmd-palette { box-shadow: 0 24px 64px rgba(0,0,0,0.15); }
[data-theme="light"] .toast { box-shadow: 0 8px 32px rgba(0,0,0,0.1); }
[data-theme="light"] .insight-card { box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
[data-theme="light"] .comparison-card { box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
[data-theme="light"] .countdown-card { box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
[data-theme="light"] .leaderboard { box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
[data-theme="light"] .narrative-card { box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
[data-theme="light"] .perf-card { box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
[data-theme="light"] .notif-dropdown { box-shadow: 0 8px 32px rgba(0,0,0,0.1); }
[data-theme="light"] .login-card { box-shadow: 0 8px 32px rgba(0,0,0,0.08); }
[data-theme="light"] .badge-confirmed, [data-theme="light"] .badge-published, [data-theme="light"] .badge-active { background: rgba(0,201,167,0.08); }
[data-theme="light"] .badge-pending, [data-theme="light"] .badge-draft, [data-theme="light"] .badge-processing { background: rgba(201,162,77,0.08); }
[data-theme="light"] .badge-refunded, [data-theme="light"] .badge-cancelled, [data-theme="light"] .badge-failed, [data-theme="light"] .badge-inactive { background: rgba(255,59,48,0.08); }

/* ── i18n Language Selector ── */
.lang-selector {
  display: flex; gap: 2px; background: var(--bg-surface2);
  border-radius: 6px; padding: 2px;
}
.lang-btn {
  padding: 3px 8px; border: none; border-radius: 4px; font-size: 10px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  background: transparent; color: var(--text-muted); transition: all 0.2s;
}
.lang-btn.active { background: var(--accent); color: #fff; }
.lang-btn:hover:not(.active) { color: var(--text-bright); }

/* ── Audit Log ── */
.audit-item {
  display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}
.audit-item:last-child { border-bottom: none; }
.audit-time { font-size: 11px; color: var(--text-muted); min-width: 80px; flex-shrink: 0; }
.audit-action { color: var(--text-sub); flex: 1; }
.audit-action strong { color: var(--text-bright); }
.audit-badge { font-size: 10px; padding: 2px 8px; border-radius: 10px; }
.audit-view { background: rgba(74,144,217,0.1); color: var(--blue); }
.audit-export { background: rgba(0,201,167,0.1); color: var(--teal); }
.audit-login { background: rgba(255,0,87,0.1); color: var(--accent); }

/* ── Revenue Calculator ── */
.calc-wrap {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 16px; padding: 24px;
}
.calc-row { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.calc-input {
  flex: 1; padding: 10px 14px; background: var(--input-bg);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 14px; font-family: inherit; outline: none;
}
.calc-input:focus { border-color: var(--accent); }
.calc-label { font-size: 12px; color: var(--text-muted); min-width: 100px; }
.calc-result {
  background: linear-gradient(135deg, rgba(0,201,167,0.08), rgba(74,144,217,0.08));
  border: 1px solid rgba(0,201,167,0.15); border-radius: 12px;
  padding: 16px; margin-top: 16px; text-align: center;
}
.calc-result-value { font-size: 28px; font-weight: 800; color: var(--teal); }
.calc-result-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.calc-breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.calc-breakdown-item { text-align: center; }
.calc-breakdown-num { font-size: 16px; font-weight: 700; color: var(--text-bright); }
.calc-breakdown-label { font-size: 10px; color: var(--text-muted); }

/* ── Pinned/Favorites ── */
.pin-btn { cursor: pointer; background: none; border: none; color: var(--text-muted); padding: 2px; transition: all 0.2s; }
.pin-btn:hover, .pin-btn.pinned { color: var(--gold); }
.pin-btn svg { width: 14px; height: 14px; }
.pinned-section { margin-bottom: 24px; }
.pinned-title { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.pinned-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pinned-chip {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px;
  background: var(--bg-surface2); border: 1px solid var(--border);
  border-radius: 20px; font-size: 12px; color: var(--text-sub); cursor: pointer;
  transition: all 0.2s;
}
.pinned-chip:hover { border-color: var(--accent); color: var(--accent); }
.pinned-chip svg { width: 12px; height: 12px; color: var(--gold); }

/* ── Progress Ring ── */
.progress-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring-text { position: absolute; font-size: 11px; font-weight: 700; color: var(--text-bright); }

@media print {
  .sidebar, .topbar, .sidebar-overlay, .toast-container, .cmd-overlay, .modal-overlay { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  body { background: #fff !important; color: #000 !important; }
  .stat-card { border: 1px solid #ddd !important; background: #fff !important; }
  .data-table th { background: #f0f0f0 !important; color: #333 !important; }
  .data-table td { color: #333 !important; }
  .badge { border: 1px solid currentColor; }
}

/* ── Smart Insights ── */
.insights-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 24px; }
.insight-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 16px; display: flex; gap: 12px; align-items: flex-start;
  transition: border-color 0.2s;
}
.insight-card:hover { border-color: var(--accent); }
.insight-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.insight-icon svg { width: 18px; height: 18px; }
.insight-icon.green { background: rgba(0,201,167,0.12); color: var(--teal); }
.insight-icon.pink { background: rgba(255,0,87,0.12); color: var(--accent); }
.insight-icon.gold { background: rgba(201,162,77,0.12); color: var(--gold); }
.insight-icon.blue { background: rgba(74,144,217,0.12); color: var(--blue); }
.insight-text { font-size: 13px; color: var(--text-sub); line-height: 1.5; }
.insight-text strong { color: var(--text-bright); }

/* ── Notification Bell ── */
.notif-bell { position: relative; }
.notif-count {
  position: absolute; top: -4px; right: -4px; width: 16px; height: 16px;
  background: var(--accent); color: #fff; font-size: 9px; font-weight: 700;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.notif-dropdown {
  display: none; position: absolute; top: 100%; right: 0; margin-top: 8px;
  width: 320px; background: var(--sidebar-bg); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  z-index: 200; overflow: hidden;
}
.notif-dropdown.open { display: block; }
.notif-header { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--text-bright); }
.notif-list { max-height: 300px; overflow-y: auto; }
.notif-item { padding: 10px 16px; border-bottom: 1px solid var(--border-subtle); font-size: 12px; color: var(--text-sub); cursor: pointer; transition: background 0.15s; }
.notif-item:hover { background: var(--bg-surface2); }
.notif-item:last-child { border-bottom: none; }
.notif-item .notif-time { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.notif-item.unread { border-left: 3px solid var(--accent); }

/* ── Kbd shortcut hint in topbar ── */
.kbd-hint { font-size: 11px; color: var(--text-muted); background: var(--bg-surface); border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px; cursor: pointer; }
.kbd-hint:hover { border-color: var(--accent); color: var(--accent); }

/* ── Health Check ── */
.health-check { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; padding: 20px; margin-bottom: 24px; }
.health-title { font-size: 14px; font-weight: 700; color: var(--text-bright); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.health-score-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.health-score-num { font-size: 32px; font-weight: 800; }
.health-score-fill { flex: 1; height: 8px; background: var(--bg-surface2); border-radius: 4px; overflow: hidden; }
.health-score-fill-inner { height: 100%; border-radius: 4px; transition: width 1s ease-out; }
.health-items { display: grid; gap: 6px; }
.health-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; background: var(--bg-surface); font-size: 13px; color: var(--text-sub); }
.health-item.pass { border-left: 3px solid var(--teal); }
.health-item.fail { border-left: 3px solid var(--red); }
.health-item.warn { border-left: 3px solid var(--gold); }
.health-icon { width: 18px; text-align: center; font-size: 12px; }

/* ── Segmentation Tags ── */
.seg-tag { display: inline-flex; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; margin-left: 6px; }
.seg-vip { background: rgba(201,162,77,0.12); color: var(--gold); }
.seg-repeat { background: rgba(74,144,217,0.12); color: var(--blue); }
.seg-new { background: rgba(0,201,167,0.12); color: var(--teal); }

/* ── Survey Feedback ── */
.survey-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; padding: 20px; }
.survey-stars { font-size: 20px; margin: 8px 0; }
.survey-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12px; }
.survey-bar { flex: 1; height: 6px; background: var(--bg-surface2); border-radius: 3px; overflow: hidden; }
.survey-bar-fill { height: 100%; background: var(--gold); border-radius: 3px; }

/* ── Share Tools ── */
.share-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.share-btn { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-sub); font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: inherit; }
.share-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Revenue Tips ── */
.tip-card { background: linear-gradient(135deg, rgba(201,162,77,0.06), rgba(255,107,53,0.06)); border: 1px solid rgba(201,162,77,0.12); border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; font-size: 13px; color: var(--text-sub); line-height: 1.5; display: flex; gap: 10px; align-items: flex-start; }
.tip-card strong { color: var(--text-bright); }
.tip-bullet { color: var(--gold); font-size: 16px; flex-shrink: 0; }

/* ── AI Generator ── */
.ai-card { background: linear-gradient(135deg, rgba(155,89,182,0.08), rgba(74,144,217,0.08)); border: 1px solid rgba(155,89,182,0.15); border-radius: 16px; padding: 20px; margin-bottom: 16px; }
.ai-title { font-size: 14px; font-weight: 700; color: var(--text-bright); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.ai-output { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px; font-size: 13px; color: var(--text-sub); line-height: 1.7; min-height: 60px; white-space: pre-wrap; }
.ai-btn { background: linear-gradient(135deg, #9B59B6, #4A90D9); color: #fff; border: none; padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: opacity 0.2s; }
.ai-btn:hover { opacity: 0.9; }
.ai-btn:disabled { opacity: 0.5; }

/* ── Revenue Simulator ── */
.sim-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; padding: 20px; }
.sim-scenarios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.sim-scenario { text-align: center; padding: 16px; border-radius: 12px; border: 1px solid var(--border); }
.sim-scenario.pessimistic { border-color: rgba(255,59,48,0.3); }
.sim-scenario.realistic { border-color: rgba(201,162,77,0.3); }
.sim-scenario.optimistic { border-color: rgba(0,201,167,0.3); }
.sim-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.sim-value { font-size: 22px; font-weight: 800; }
.sim-detail { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Smart Schedule ── */
.schedule-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.schedule-cell { text-align: center; padding: 8px 4px; border-radius: 6px; font-size: 11px; cursor: default; transition: all 0.2s; }
.schedule-cell:hover { transform: scale(1.05); }
.schedule-header { font-size: 10px; color: var(--text-muted); font-weight: 600; }
.schedule-best { border: 2px solid var(--teal); }

/* ── Audience Tracker ── */
.milestone-track { display: flex; align-items: center; gap: 0; margin: 16px 0; position: relative; }
.milestone-line { flex: 1; height: 3px; background: var(--bg-surface2); }
.milestone-line.done { background: var(--teal); }
.milestone-dot { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; z-index: 1; flex-shrink: 0; }
.milestone-dot.done { background: var(--teal); color: #fff; }
.milestone-dot.next { background: var(--gold); color: #fff; animation: pulse 2s infinite; }
.milestone-dot.future { background: var(--bg-surface2); color: var(--text-muted); }

/* ── Marketing ROI ── */
.roi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.roi-channel { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.roi-channel-name { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.roi-channel-value { font-size: 18px; font-weight: 800; color: var(--text-bright); }
.roi-channel-sub { font-size: 10px; color: var(--text-muted); }

/* ── Exclusive Badge ── */
.exclusive-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 12px; font-size: 10px; font-weight: 700; background: linear-gradient(135deg, rgba(201,162,77,0.15), rgba(255,107,53,0.15)); color: var(--gold); border: 1px solid rgba(201,162,77,0.2); }
