/* ============================================
   AI FINANSIST - PREMIUM DARK THEME
   My Life Planner Financial Dashboard
   ============================================ */

:root {
  color-scheme: dark;
  /* Colors */
  --bg-primary: #08090a;
  --bg-secondary: #111216;
  --bg-card: #121418;
  --bg-card-hover: #16191f;
  --bg-elevated: #1a1d24;
  --bg-glass: rgba(17, 18, 22, 0.95);

  --accent-primary: #D4F03B;
  --accent-primary-text: #D4F03B;
  --accent-secondary: #E4FC4A;
  --accent-tertiary: #9EBA0D;
  --accent-green: #D4F03B;
  --accent-red: #FF4A5A;
  --accent-yellow: #D4F03B;
  --accent-orange: #a3a3a3;

  --text-primary: #ffffff;
  --text-secondary: #a1a1a6;
  --text-muted: #6e6e73;

  --border-color: rgba(255, 255, 255, 0.05);
  --border-hover: rgba(212, 240, 59, 0.3);

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --sidebar-bg: #111216;
  --topbar-bg: rgba(10, 11, 13, 0.85);

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(212, 240, 59, 0.1);
  --sidebar-active-text: #000000;
  --btn-primary-text: #000000;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg-primary:    #ffffff;
  --bg-secondary:  #f9f9fb;
  --bg-card:       #ffffff;
  --bg-card-hover: #f3f3f6;
  --bg-elevated:   #eef0f3;
  --bg-glass:      rgba(255, 255, 255, 0.95);

  --accent-primary:    #D4F03B;
  --accent-primary-text: #5C7A00;
  --accent-secondary:  #E4FC4A;
  --accent-tertiary:   #9eba0d;
  --accent-green:      #D4F03B;
  --accent-red:        #FF4A5A;
  --accent-yellow:     #D4F03B;
  --accent-orange:     #a3a3a3;

  --text-primary:   #000000;
  --text-secondary: #55555a;
  --text-muted:     #8e8e93;

  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);

  --sidebar-bg:  #ffffff;
  --topbar-bg:   rgba(255, 255, 255, 0.85);

  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 30px rgba(212, 240, 59, 0.08);
  --sidebar-active-text: #000000;
  --btn-primary-text: #000000;
}



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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  display: flex;
}

/* ===================== ANIMATED BACKGROUND ===================== */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(212, 240, 59, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 240, 59, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: rgba(212, 240, 59, 0.04);
  top: -200px;
  right: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 450px;
  height: 450px;
  background: rgba(255, 146, 51, 0.02);
  bottom: 100px;
  left: -100px;
  animation-delay: -6s;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: rgba(212, 240, 59, 0.02);
  top: 40%;
  left: 30%;
  animation-delay: -12s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ===================== SIDEBAR ===================== */
.sidebar {
  width: var(--sidebar-width);
  height: calc(100vh - 48px);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 16px;
  top: 24px;
  z-index: 100;
  overflow: visible !important;
  transition: var(--transition);
}

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

.sidebar.collapsed .logo-text,
.sidebar.collapsed .logo-icon,

.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-pulse,
.sidebar.collapsed .sync-status span,
.sidebar.collapsed .last-sync {
  display: none !important;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 24px 0 20px;
}
.sidebar.collapsed .sidebar-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

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

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.logo-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: var(--transition);
}

.logo-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.sidebar-toggle {
  width: 32px;
  height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

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

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

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.nav-section {
  margin-bottom: 20px;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 8px;
  display: block;
  margin-bottom: 6px;
  transition: var(--transition);
}

.sidebar.collapsed .nav-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-item span {
  white-space: nowrap;
  overflow: hidden;
  transition: var(--transition);
}

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

.nav-item.active {
  background: var(--accent-primary);
  color: #000000 !important;
  border: none;
  font-weight: 600;
}

.nav-item.active svg {
  color: #000000 !important;
  stroke: #000000 !important;
}

.nav-item.active span {
  color: #000000 !important;
}

.nav-badge {
  margin-left: auto;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.nav-pulse {
  margin-left: auto;
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
}

.sync-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.sync-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

.last-sync {
  font-size: 10px;
  color: var(--text-muted);
}

/* ===================== MAIN CONTENT ===================== */
.main-content {
  flex: 1;
  margin-left: calc(var(--sidebar-width) + 32px);
  padding-right: 16px;
  padding-top: 16px;
  padding-bottom: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  transition: var(--transition);
  overflow-x: hidden;
}

.sidebar.collapsed ~ .main-content {
  margin-left: calc(var(--sidebar-collapsed) + 32px);
}

/* ===================== TOPBAR ===================== */
.topbar {
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  margin-bottom: 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

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

.breadcrumb {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.02em;
}

.page-header {
  display: none !important;
}

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

.date-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.date-display svg { width: 14px; height: 14px; }

.period-selector {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  overflow-x: auto;
  max-width: 350px;
  scrollbar-width: none; /* Firefox */
}
.period-selector::-webkit-scrollbar {
  display: none; /* Safari/Chrome */
}

.period-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.period-btn.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
}

/* ===================== DROPDOWN SELECTOR ===================== */
.dropdown-selector {
  position: relative;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.dropdown-trigger:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

.dropdown-trigger.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #000000 !important;
  border-color: transparent;
}

.dropdown-trigger.active svg {
  transform: rotate(180deg);
  stroke: #000000 !important;
}

.dropdown-trigger svg {
  transition: transform 0.2s ease;
  opacity: 0.7;
}

.month-trigger {
  font-size: 12px;
  padding: 6px 12px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
}

.month-trigger.has-selection {
  background: rgba(212, 240, 59, 0.15);
  border-color: rgba(212, 240, 59, 0.3);
  color: var(--accent-primary-text);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: #0f1219;
  border: 1px solid rgba(212, 240, 59, 0.15);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
  z-index: 200;
  backdrop-filter: none;
  animation: dropdownSlide 0.15s ease;
}

.dropdown-menu.open {
  display: block;
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}

.dropdown-item:hover {
  background: rgba(212, 240, 59, 0.08) !important;
  color: var(--text-primary);
}

.dropdown-item.active {
  background: rgba(212, 240, 59, 0.15) !important;
  color: var(--accent-primary-text) !important;
  font-weight: 600;
}

.dropdown-item .check-icon {
  margin-left: auto;
  opacity: 0;
  color: var(--accent-primary-text);
}

.dropdown-item.active .check-icon {
  opacity: 1;
}

.refresh-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.refresh-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary-text);
}

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

/* ===================== PAGES ===================== */
.pages-container { flex: 1; padding: 24px 0; width: 100%; max-width: 1600px; margin: 0 auto; position: relative; }

/* ── Smooth page transitions (visibility trick — no display:none flash) ── */
.page {
  display: none;
}
.page.active {
  display: block;
  animation: fadeInPage 0.25s ease-out forwards;
}

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

/* Consistent spacing between all page sections */
.page > .page-header,
.page > div:not(.page-header),
.page > .dashboard-grid,
.page > .transactions-container,
.page > .chart-card {
  margin-bottom: 20px;
}
.page > *:last-child {
  margin-bottom: 0;
}

.page-header {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.page-header-left { flex: 1; min-width: 0; }

.page-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.page-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

.page-header-left { flex: 1; min-width: 0; }
.page-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  overflow: hidden;
  max-width: 200px;
}
.margin-inline-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.margin-inline-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #F59E0B;
  letter-spacing: -0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}



/* ===================== KPI CARDS ===================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: default;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  display: none;
}

.kpi-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.kpi-card.income .kpi-icon { background: rgba(212, 240, 59, 0.1); color: var(--accent-primary-text); }
.kpi-card.expense .kpi-icon { background: rgba(255, 90, 95, 0.1); color: var(--accent-red); }
.kpi-card.profit .kpi-icon { background: rgba(212, 240, 59, 0.1); color: var(--accent-primary-text); }
.kpi-card.commission .kpi-icon { background: rgba(212, 240, 59, 0.1); color: var(--accent-primary-text); }
.kpi-card.balance .kpi-icon { background: rgba(212, 240, 59, 0.1); color: var(--accent-primary-text); }
[data-theme="light"] .kpi-card.balance .kpi-icon { background: rgba(6, 182, 212, 0.12); }

.kpi-content { flex: 1; }
.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-value { font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-trend { display: flex; align-items: center; gap: 4px; font-size: 11px; margin-top: 6px; }
.kpi-trend svg { width: 12px; height: 12px; }
.kpi-trend.positive { color: var(--accent-primary-text); }
.kpi-trend.negative { color: var(--accent-red); }
.kpi-trend.warning { color: var(--accent-primary-text); }

.kpi-chart { height: 40px; }
.kpi-chart canvas { width: 100% !important; height: 40px !important; }

/* ===================== DASHBOARD GRID ===================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ===================== CHART CARDS ===================== */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  margin-bottom: 20px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

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

.chart-card.large { }
.chart-card.full-width, .metrics-card.full-width { grid-column: 1 / -1; }

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

.chart-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-actions {
  display: flex;
  gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 5px;
  backdrop-filter: blur(10px);
}

.chart-btn {
  position: relative;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.chart-btn:hover:not(.active) {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.1);
}

/* Unified Active Selection Buttons */
.chart-btn.active,
.chart-btn[data-fmode].active,
.chart-btn[data-chart-type].active {
  background: var(--accent-primary) !important;
  color: var(--sidebar-active-text) !important;
  border-color: transparent !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
  font-weight: 700;
}

.chart-body { position: relative; height: 350px; width: 100%; max-width: 100%; overflow: hidden; display: flex; flex-direction: column; }
.chart-body canvas { height: 100% !important; width: 100% !important; border-radius: 8px; }

.donut-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.donut-total {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.donut-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===================== BOTTOM ROW ===================== */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

/* AI Insights */
.insights-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  transition: var(--transition);
}

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

.ai-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(212, 240, 59, 0.08);
  border: 1px solid rgba(212, 240, 59, 0.25);
  padding: 6px 12px;
  border-radius: 20px;
  color: var(--accent-primary-text);
}

.ai-badge svg { width: 14px; height: 14px; }

.insight-refresh {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.insight-refresh:hover { color: var(--accent-primary-text); border-color: var(--accent-primary); }
.insight-refresh svg { width: 14px; height: 14px; }

.insights-list { display: flex; flex-direction: column; gap: 10px; }

.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 10px;
  transition: var(--transition-fast);
}

.insight-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.insight-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.insight-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

.insight-item.success .insight-icon { background: rgba(212, 240, 59, 0.12); color: var(--accent-primary-text); }
.insight-item.warning .insight-icon { background: rgba(255, 74, 90, 0.12); color: #FF4A5A; }
.insight-item.danger .insight-icon { background: rgba(255, 74, 90, 0.12); color: #FF4A5A; }
.insight-item.info .insight-icon { background: rgba(212, 240, 59, 0.12); color: var(--accent-primary-text); }

.insight-text { flex: 1; min-width: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.insight-text strong { color: var(--text-primary); display: block; margin-bottom: 2px; font-weight: 600; }

/* Sources Card */
.sources-card, .breakdown-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
}

.sources-list, .breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.source-item, .breakdown-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  margin-bottom: 10px;
  transition: var(--transition-fast);
}

.source-item:hover, .breakdown-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}

.source-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.source-info { flex: 1; min-width: 0; }
.source-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.source-count { font-size: 11px; color: var(--text-muted); }

.source-amount {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-primary-text);
}

.source-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}

.source-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s ease;
}

/* ===================== ANALYTICS PAGE ===================== */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.metrics-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.metric-item {
  text-align: center;
  padding: 16px;
  background: rgba(255,255,255,0.02);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.metric-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-primary-text);
  margin-bottom: 4px;
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===================== REPORTS PAGE ===================== */
.reports-container { max-width: 900px; }

.report-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.report-tab {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.report-tab.active {
  background: rgba(212, 240, 59, 0.15);
  border-color: rgba(212, 240, 59, 0.45);
  color: var(--accent-primary-text) !important;
}

.report-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  min-height: 300px;
}

.report-section { margin-bottom: 20px; }

.report-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

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

.report-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.report-stat {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
}

.report-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.report-stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.report-stat-value.green { color: var(--accent-primary-text); }
.report-stat-value.red { color: var(--accent-red); }
.report-stat-value.blue { color: var(--accent-primary-text); }

.report-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.report-recommendations {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rec-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
}

.rec-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.rec-text { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.rec-text strong { color: var(--text-primary); }

.report-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

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

.action-btn.primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--btn-primary-text) !important;
}

.action-btn.primary:hover { opacity: 0.9; transform: translateY(-1px); }

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

.action-btn.secondary:hover { border-color: var(--accent-primary); color: var(--text-primary); }

.action-btn.telegram {
  background: linear-gradient(135deg, #229ED9, #1a87c0);
  color: white;
}

.action-btn.telegram:hover { opacity: 0.9; transform: translateY(-1px); }

/* ===================== FORECAST PAGE ===================== */
.forecast-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.forecast-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.forecast-intro {
  display: flex;
  align-items: center;
  gap: 16px;
}

.forecast-title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-brain-icon { font-size: 40px; }

.forecast-intro h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.forecast-intro p {
  font-size: 13px;
  color: var(--text-secondary);
}

.forecast-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.forecast-controls label {
  font-size: 13px;
  color: var(--text-secondary);
}

.forecast-controls select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

.forecast-legend {
  display: flex;
  gap: 12px;
  font-size: 12px;
}

.legend-item.actual { color: var(--accent-primary-text); }
.legend-item.predicted { color: var(--accent-primary-text); }
.legend-item.confidence { color: rgba(212, 240, 59, 0.35); }

.forecast-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.forecast-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.forecast-card-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.forecast-card-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-primary-text);
  margin-bottom: 4px;
}

.forecast-card-label {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ===================== TRANSACTIONS PAGE ===================== */
.transactions-container { }

.transactions-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0 14px;
  height: 40px;
  max-width: 320px;
  transition: var(--transition-fast);
}

.search-box:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(212, 240, 59, 0.1);
}

.search-box svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }

.search-box input {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  width: 100%;
  outline: none;
}

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

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-secondary);
  padding: 0 12px;
  height: 40px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: var(--transition-fast);
}

.filter-select:hover {
  border-color: var(--accent-primary);
}

.transactions-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 560px;
  overflow-y: auto;
}

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

.transactions-table th {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 10;
  padding: 14px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.transactions-table td {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

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

.transactions-table tbody tr:hover td {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.tx-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.tx-badge.income { background: rgba(16, 185, 129, 0.1); color: var(--accent-primary-text); }
.tx-badge.expense { background: rgba(239, 68, 68, 0.1); color: var(--accent-red); }

.tx-amount.positive { color: var(--accent-primary-text); font-family: 'Space Grotesk', monospace; font-weight: 600; }
.tx-amount.negative { color: var(--accent-red); font-family: 'Space Grotesk', monospace; font-weight: 600; }

.tx-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.tx-status::before { content: '●'; font-size: 8px; }
.tx-status.completed { color: var(--accent-primary-text); }
.tx-status.pending { color: var(--accent-primary-text); }

/* ===================== SYNC PAGE ===================== */
.sync-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.main-sync {
  grid-column: 1 / -1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.sync-icon-large {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.sync-icon-large svg { width: 100%; height: 100%; }

.sync-info { flex: 1; min-width: 0; }
.sync-info h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.sync-info p { font-size: 13px; color: var(--text-secondary); }

.sync-config { display: flex; flex-direction: column; gap: 10px; min-width: 320px; }

.config-item { display: flex; flex-direction: column; gap: 4px; }
.config-item label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.config-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  transition: var(--transition-fast);
  font-family: 'Inter', monospace;
}

.config-input:focus { border-color: var(--accent-primary); }

.sync-status-card, .auto-report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
}

.sync-status-card h3, .auto-report-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}

.status-list { display: flex; flex-direction: column; gap: 10px; }

.status-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
}

.status-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.status-item.success .status-icon { background: rgba(16,185,129,0.2); color: var(--accent-primary-text); }
.status-item.info .status-icon { background: rgba(99,102,241,0.2); color: var(--accent-primary-text); }
.status-item.warning .status-icon { background: rgba(245,158,11,0.2); color: var(--accent-primary-text); }

.status-text { flex: 1; }
.status-text strong { display: block; font-size: 13px; color: var(--text-primary); margin-bottom: 2px; }
.status-text span { font-size: 11px; color: var(--text-muted); }

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

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
}

.setting-info strong { display: block; font-size: 13px; color: var(--text-primary); margin-bottom: 2px; }
.setting-info span { font-size: 11px; color: var(--text-muted); }

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-card-hover);
  border-radius: 24px;
  transition: var(--transition-fast);
  border: 1px solid var(--border-color);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: var(--transition-fast);
}

.toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-color: transparent;
}

.toggle input:checked + .toggle-slider::before {
  background: white;
  transform: translateX(20px);
}

.telegram-config {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px 12px;
}

/* ===================== AI CHAT PAGE ===================== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.chat-message {
  display: flex;
  gap: 12px;
  animation: messageIn 0.3s ease;
}

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

.chat-message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.ai-avatar { background: linear-gradient(135deg, rgba(212, 240, 59, 0.25), rgba(20, 21, 25, 0.4)); }
.user-avatar { background: rgba(255,255,255,0.05); }

.message-content { max-width: 75%; }

.message-bubble {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.chat-message.user .message-bubble {
  background: linear-gradient(135deg, rgba(212, 240, 59, 0.1), rgba(20, 21, 25, 0.6));
  border-color: rgba(212, 240, 59, 0.35);
  color: var(--text-primary);
}

.message-bubble p { margin-bottom: 8px; }
.message-bubble p:last-of-type { margin-bottom: 0; }
.message-bubble strong { color: var(--text-primary); }

.quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quick-q {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.quick-q:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary-text);
  background: rgba(99,102,241,0.1);
}

.chat-input-area {
  border-top: 1px solid var(--border-color);
  padding: 16px 20px;
  background: rgba(255,255,255,0.02);
}

.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 8px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

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

@keyframes typing {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

#chatInput {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  resize: none;
  outline: none;
  font-family: inherit;
  max-height: 120px;
  transition: var(--transition-fast);
}

#chatInput:focus { border-color: var(--accent-primary); }
#chatInput::placeholder { color: var(--text-muted); }

.send-btn {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  border-radius: 12px;
  color: #000000 !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.send-btn:hover { transform: scale(1.05); opacity: 0.9; }
.send-btn svg { width: 18px; height: 18px; }

/* ===================== TOAST NOTIFICATIONS ===================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999999;
}

.toast {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-primary);
  animation: toastIn 0.3s ease;
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow-card);
}

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

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

.toast-icon { font-size: 18px; }
.toast-text { flex: 1; }
.toast-text strong { display: block; margin-bottom: 2px; }
.toast-text span { color: var(--text-secondary); font-size: 12px; }

/* ===================== LOADING ===================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 15, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 20px;
  opacity: 1;
  transition: opacity 0.3s cubic-bezier(0.4,0,0.2,1),
              visibility 0s linear 0s;
  visibility: visible;
}
.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.4,0,0.2,1),
              visibility 0s linear 0.3s;
}

.loading-spinner {
  position: relative;
  width: 60px;
  height: 60px;
}

.loading-spinner .spinner-ring {
  position: absolute;
  inset: 0;
}

.spinner-ring {
  display: inline-block;
  position: relative;
  border-radius: 50%;
  border: 2px solid transparent;
  animation: spin 1.2s linear infinite;
  box-sizing: border-box;
}

.spinner-ring:nth-child(1) { border-top-color: var(--accent-primary); animation-duration: 0.8s; }
.spinner-ring:nth-child(2) { border-right-color: var(--accent-secondary); inset: 8px; animation-duration: 1.2s; animation-direction: reverse; }
.spinner-ring:nth-child(3) { border-bottom-color: var(--accent-tertiary); inset: 16px; animation-duration: 1.6s; }

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

.loading-text {
  font-size: 14px;
  color: var(--text-secondary);
  animation: pulse 1s infinite alternate;
}

/* ===================== LANDING PAGE ===================== */
.landing-page {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: transparent;
  display: none; /* Changed from flex to none to prevent flashing */
  flex-direction: column;
  overflow-y: auto;
  font-family: 'Space Grotesk', sans-serif;
  padding: 0 20px;
}

.lp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.lp-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.lp-logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.lp-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.lp-nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: var(--transition-fast);
  font-family: 'Inter', sans-serif;
}

.lp-nav-link:hover {
  color: var(--text-primary);
}

.lp-btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  display: inline-block;
}

.lp-btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.lp-btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  color: var(--btn-primary-text) !important;
  padding: 10px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 4px 14px rgba(212, 240, 59, 0.2);
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  display: inline-block;
}

.lp-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 240, 59, 0.35);
}

.lp-btn-large {
  padding: 16px 36px;
  font-size: 17px;
  border-radius: 14px;
}

.lp-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 60px;
}

.lp-hero {
  text-align: center;
  margin-top: 80px;
  margin-bottom: 80px;
  max-width: 800px;
  animation: slideUp 0.8s ease-out;
}

.lp-badge {
  display: inline-block;
  background: #0f2409 !important;
  border: 1px solid rgba(212, 240, 59, 0.3) !important;
  color: #D4F03B !important;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 24px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.lp-title {
  font-size: 56px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 24px;
  letter-spacing: -0.03em;
}

.text-gradient {
  background: linear-gradient(135deg, #D4F03B, #a8c02e, #D4F03B);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lp-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 40px;
  font-family: 'Inter', sans-serif;
}

.lp-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.lp-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  animation: slideUp 1s ease-out;
}

.lp-feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 32px;
  border-radius: 24px;
  transition: var(--transition-fast);
}

.lp-feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(212, 240, 59, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.lp-feature-icon {
  font-size: 32px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.03);
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
}

.lp-feature-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.lp-feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  font-family: 'Inter', sans-serif;
}

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

@media (max-width: 768px) {
  .lp-header { padding: 20px; flex-direction: column; gap: 20px; }
  .lp-nav { flex-wrap: wrap; justify-content: center; }
  .lp-title { font-size: 40px; }
  .lp-features { grid-template-columns: 1fr; }
  .lp-cta-group { flex-direction: column; }
  .lp-cta-group a, .lp-cta-group button { width: 100%; text-align: center; }
}

/* ===================== SHIMMER (SKELETON) ===================== */
.shimmer {
  position: relative;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.05);
}

.shimmer::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0.05) 20%,
    rgba(255, 255, 255, 0.1) 60%,
    rgba(255, 255, 255, 0)
  );
  animation: shimmer 2s infinite;
  content: '';
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
  .bottom-row { grid-template-columns: 1fr 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr !important; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .page-header-right { align-self: flex-end; }
}

@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  /* Ensure no horizontal overflow from any fixed widths */
  .chart-card, .kpi-card, .transactions-container { max-width: 100%; }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 1000;
    width: min(280px, 85vw);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  #sidebarToggle { display: none; }
  .main-content { margin-left: 0 !important; }
  .menu-btn { display: flex !important; }
  .sync-container { grid-template-columns: 1fr; }
  .main-sync { flex-direction: column; }
  .sync-config { min-width: unset; width: 100%; }
  .forecast-cards { grid-template-columns: repeat(2, 1fr); }
  /* Sidebar overlay */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .sidebar-overlay.active {
    display: block;
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .bottom-row { grid-template-columns: 1fr; }
  .topbar-right .date-display { display: none; }
  .period-selector { display: none; }
  .report-stats { grid-template-columns: 1fr; }
  .forecast-cards { grid-template-columns: 1fr; }
  .report-actions { flex-direction: column; }
  .pages-container { padding: 12px 0; }
  .transactions-toolbar { flex-direction: column; align-items: stretch; }
  .report-tabs { flex-wrap: wrap; }
  .auth-card { padding: 24px 20px; width: 95%; max-width: 340px; }
  .topbar { padding: 0 12px; height: 52px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header h1 { font-size: 20px; }
  .topbar-right { gap: 8px; }
  .menu-btn { width: 38px; height: 38px; }
  .page-header-right { display: none; }
  .chart-body { height: 220px !important; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .pages-container { padding: 8px 0; }
  .kpi-card { padding: 16px; }
  .chart-body { height: 200px !important; }
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── AUTH OVERLAY ─── */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 99999;
  display: none; /* Changed from flex to none to prevent flashing */
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s cubic-bezier(0.4,0,0.2,1),
              visibility 0s linear 0s;
}
.auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4,0,0.2,1),
              visibility 0s linear 0.3s;
}
.auth-card {
  position: relative;
  background: rgba(13, 17, 23, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 48px 40px;
  width: 90%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 0 40px rgba(212, 240, 59, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 150px;
  background: rgba(212, 240, 59, 0.15);
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 10;
}

.auth-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: rotate(90deg);
}

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

.auth-icon-wrapper {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 24px auto;
  background: rgba(212, 240, 59, 0.1);
  border: 1px solid rgba(212, 240, 59, 0.25);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary-text);
  z-index: 1;
}

.auth-icon-wrapper svg {
  width: 32px;
  height: 32px;
}

.auth-card h2 { 
  position: relative;
  font-size: 28px; 
  font-weight: 800; 
  margin-bottom: 12px; 
  color: var(--text-primary); 
  letter-spacing: -0.02em;
  z-index: 1;
}

.auth-card p { 
  position: relative;
  color: var(--text-secondary); 
  font-size: 15px; 
  margin-bottom: 32px; 
  line-height: 1.6; 
  z-index: 1;
}

.auth-google-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.auth-card input {
  width: 100%; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px 16px; border-radius: 12px; color: #fff; font-family: inherit;
  font-size: 16px; text-align: center; letter-spacing: 2px; margin-bottom: 15px; transition: .2s ease;
}
.auth-card input:focus { outline: none; border-color: var(--accent-primary); background: rgba(212, 240, 59, 0.05); }
.auth-card button:not(.auth-close-btn) {
  width: 100%; padding: 14px; border-radius: 12px; background: var(--accent-primary);
  color: #000000; font-weight: 700; font-size: 15px; border: none; cursor: pointer; transition: opacity .2s;
}
.auth-card button:not(.auth-close-btn):hover { opacity: 0.9; }
.auth-err { color: #EF4444; font-size: 13px; margin-top: 15px; display: none; }

/* ============================================================
   LIGHT THEME OVERRIDES — COMPREHENSIVE
   ============================================================ */
[data-theme="light"] body { background: var(--bg-primary); color: var(--text-primary); }

/* ── Sidebar in light mode ── */
[data-theme="light"] .sidebar {
  background: #ffffff;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .sidebar .nav-item { color: #55555a; }
[data-theme="light"] .sidebar .nav-item:hover { background: rgba(0, 0, 0, 0.03); color: #000000; }
[data-theme="light"] .sidebar .nav-item.active { background: #D4F03B; color: #000000; }
[data-theme="light"] .sidebar .logo-name { color: #000000; }
[data-theme="light"] .sidebar .logo-sub { color: #8e8e93; }
[data-theme="light"] .sidebar .sync-status,
[data-theme="light"] .sidebar .last-sync { color: #8e8e93; }
[data-theme="light"] .sidebar-footer { border-top: 1px solid rgba(0, 0, 0, 0.08); }
[data-theme="light"] .sidebar .nav-item svg { color: currentColor; }

/* ── Topbar ── */
[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: none;
}
[data-theme="light"] .breadcrumb,
[data-theme="light"] #pageBreadcrumb { color: var(--text-primary); }
[data-theme="light"] .menu-btn { background: #f3f3f6; border-color: rgba(0,0,0,0.08); color: var(--text-secondary); }
[data-theme="light"] .date-display { background: #f3f3f6; border-color: rgba(0,0,0,0.08); color: var(--text-secondary); }

/* ── Period Selector ── */
[data-theme="light"] .period-selector { background: #eef0f3; border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .period-btn { color: var(--text-secondary); }
[data-theme="light"] .period-btn.active { background: var(--accent-primary); color: #000000; font-weight: 700; }
[data-theme="light"] .refresh-btn { background: #f3f3f6; border-color: rgba(0,0,0,0.08); color: var(--text-secondary); }
[data-theme="light"] #datePickerBtn { color: var(--text-secondary); }

/* ── Dropdown menu ── */
[data-theme="light"] .dropdown-menu {
  background: #ffffff;
  border-color: rgba(0,0,0,.08);
  box-shadow: 0 8px 32px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.04);
}
[data-theme="light"] .dropdown-item { color: var(--text-secondary); }
[data-theme="light"] .dropdown-item:hover { background: rgba(0, 0, 0, 0.04); color: #000000; }
[data-theme="light"] .dropdown-item.active { background: rgba(212, 240, 59, 0.15); color: #000000; font-weight: 600; }
[data-theme="light"] .dropdown-trigger { color: #000000; background: #ffffff; border-color: rgba(0,0,0,.08); }
[data-theme="light"] .dropdown-trigger:hover { background: #f9f9fb; border-color: var(--accent-primary); }
[data-theme="light"] .month-trigger.has-selection { background: rgba(212, 240, 59, 0.12); border-color: rgba(212, 240, 59, 0.3); color: #000000; font-weight: 600; }

/* ── Page header ── */
[data-theme="light"] .page-header h1 { color: #000000; -webkit-text-fill-color: #000000; }
[data-theme="light"] .page-header p  { color: var(--text-secondary); }

/* ── KPI Cards ── */
[data-theme="light"] .kpi-card { background: #ffffff; border-color: rgba(0,0,0,.08); box-shadow: 0 4px 16px rgba(0,0,0,.02); }
[data-theme="light"] .kpi-value { color: #000000; }
[data-theme="light"] .kpi-label { color: var(--text-muted); }

/* ── Card containers ── */
[data-theme="light"] .chart-card,
[data-theme="light"] .sources-card,
[data-theme="light"] .breakdown-card,
[data-theme="light"] .insights-card,
[data-theme="light"] .metrics-card,
[data-theme="light"] .forecast-header-card,
[data-theme="light"] .forecast-card,
[data-theme="light"] .transactions-table-wrapper,
[data-theme="light"] .main-sync,
[data-theme="light"] .sync-status-card,
[data-theme="light"] .auto-report-card,
[data-theme="light"] .chat-container,
[data-theme="light"] .report-content {
  background: #ffffff;
  border-color: rgba(0,0,0,.09);
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
[data-theme="light"] .chart-header h3 { color: #000000; }
[data-theme="light"] .chart-header span { color: var(--text-muted); }

/* ── Chart action buttons ── */
[data-theme="light"] .chart-actions {
  background: rgba(0,0,0,.03);
  border-color: rgba(0,0,0,.08);
}
[data-theme="light"] .chart-btn { color: var(--text-secondary); }
[data-theme="light"] .chart-btn:hover:not(.active) {
  background: rgba(0,0,0,.04);
  color: #000000;
  border-color: rgba(0,0,0,.1);
}

/* ── Source / breakdown items ── */
[data-theme="light"] .source-name { color: var(--text-secondary); }
[data-theme="light"] .source-amount { color: #000000; }
[data-theme="light"] .source-bar { background: rgba(0,0,0,.06); }

/* ── Insight items ── */
[data-theme="light"] .insight-item { background: rgba(0,0,0,.02); }
[data-theme="light"] .insight-text strong { color: #000000; }
[data-theme="light"] .insight-text { color: var(--text-secondary); }

/* ── Metrics page ── */
[data-theme="light"] .metric-item { background: rgba(0,0,0,.02); border-color: rgba(0,0,0,.06); }
[data-theme="light"] .metric-label { color: var(--text-muted); }

/* ── Tab buttons ── */
[data-theme="light"] .tab-btn { background: #f3f3f6; color: var(--text-secondary); border-color: rgba(0,0,0,.08); }
[data-theme="light"] .tab-btn.active { background: var(--accent-primary); color: #000000; font-weight: 700; }

/* ── Report ── */
[data-theme="light"] .report-card,
[data-theme="light"] .analytics-card { background: #ffffff; border-color: rgba(0,0,0,.08); }
[data-theme="light"] .report-text { color: var(--text-secondary); background: #f9f9fb; border-color: rgba(0,0,0,.06); }
[data-theme="light"] .report-tab { background: #f3f3f6; border-color: rgba(0,0,0,.08); color: var(--text-secondary); }
[data-theme="light"] .report-tab.active { background: rgba(212, 240, 59, 0.15); border-color: rgba(212, 240, 59, 0.4); color: #000000; }
[data-theme="light"] .report-stat { background: rgba(0,0,0,.02); border-color: rgba(0,0,0,.06); }
[data-theme="light"] .report-stat-label { color: var(--text-muted); }
[data-theme="light"] .report-title { color: #000000; }
[data-theme="light"] .report-subtitle { color: var(--text-muted); }
[data-theme="light"] .report-divider { background: rgba(0,0,0,.06); }
[data-theme="light"] .rec-item { background: rgba(0,0,0,.02); border-color: rgba(0,0,0,.06); }
[data-theme="light"] .rec-text { color: var(--text-secondary); }
[data-theme="light"] .rec-text strong { color: #000000; }
[data-theme="light"] .action-btn.secondary { background: #f3f3f6; border-color: rgba(0,0,0,.08); color: var(--text-secondary); }
[data-theme="light"] .action-btn.secondary:hover { border-color: var(--accent-primary); color: #000000; }

/* ── Stat cards ── */
[data-theme="light"] .stat-card { background: #ffffff; border-color: rgba(0,0,0,.08); }
[data-theme="light"] .stat-value { color: #000000; }
[data-theme="light"] .stat-label { color: var(--text-muted); }

/* ── Forecast page ── */
[data-theme="light"] .forecast-intro h2 { color: #000000; }
[data-theme="light"] .forecast-intro p { color: var(--text-secondary); }
[data-theme="light"] .forecast-controls label { color: var(--text-secondary); }
[data-theme="light"] .forecast-controls select {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
  color: #000000;
}
[data-theme="light"] .forecast-card-date { color: var(--text-muted); }
[data-theme="light"] .forecast-card-label { color: var(--text-secondary); }

/* ── Transactions table ── */
[data-theme="light"] .transactions-table th {
  background: rgba(0,0,0,0.02);
  border-bottom-color: rgba(0,0,0,0.06);
  color: var(--text-muted);
}
[data-theme="light"] .transactions-table td {
  color: var(--text-secondary);
  border-bottom-color: rgba(0,0,0,0.04);
}
[data-theme="light"] .transactions-table tbody tr:hover td {
  background: rgba(212, 240, 59, 0.08);
  color: #000000;
}
[data-theme="light"] .search-box { background: #f9f9fb; border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .search-box input { color: #000000; }
[data-theme="light"] .filter-select { background: #f9f9fb; border-color: rgba(0,0,0,0.08); color: var(--text-secondary); }

/* ── Sync page ── */
[data-theme="light"] .config-input { background: #f9f9fb; border-color: rgba(0,0,0,0.08); color: #000000; }
[data-theme="light"] .sync-info h2 { color: #000000; }
[data-theme="light"] .sync-info p { color: var(--text-secondary); }
[data-theme="light"] .sync-status-card h3,
[data-theme="light"] .auto-report-card h3 { color: #000000; }
[data-theme="light"] .status-item { background: rgba(0,0,0,.02); }
[data-theme="light"] .status-text strong { color: #000000; }
[data-theme="light"] .status-text span { color: var(--text-muted); }
[data-theme="light"] .setting-row { background: rgba(0,0,0,.02); }
[data-theme="light"] .setting-info strong { color: #000000; }
[data-theme="light"] .setting-info span { color: var(--text-muted); }
[data-theme="light"] .toggle-slider { background: #eef0f3; border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .toggle-slider::before { background: #8e8e93; }

/* ── AI Chat ── */
[data-theme="light"] .chat-input-area { background: #f9f9fb; border-top-color: rgba(0,0,0,0.06); }
[data-theme="light"] #chatInput { background: #ffffff; border-color: rgba(0,0,0,0.08); color: #000000; }
[data-theme="light"] #chatInput::placeholder { color: var(--text-muted); }
[data-theme="light"] .message-bubble {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.06);
  color: var(--text-secondary);
}
[data-theme="light"] .message-bubble strong { color: #000000; }
[data-theme="light"] .chat-message.user .message-bubble {
  background: rgba(212, 240, 59, 0.12);
  border-color: rgba(212, 240, 59, 0.2);
  color: #000000;
}
[data-theme="light"] .user-avatar { background: #D4F03B; color: #000000; font-weight: 700; }
[data-theme="light"] .quick-q {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.06);
  color: var(--text-secondary);
}
[data-theme="light"] .quick-q:hover { background: rgba(212, 240, 59, 0.12); color: #000000; border-color: rgba(212, 240, 59, 0.25); }

/* ── Main content ── */
[data-theme="light"] .main-content { background: #f4f4f6; }
[data-theme="light"] .page { background: transparent; }

/* ── Toast ── */
[data-theme="light"] .toast { background: #ffffff; border-color: rgba(0,0,0,.08); color: #000000; box-shadow: 0 8px 32px rgba(0,0,0,.08); }
[data-theme="light"] .toast-title { color: #000000; }
[data-theme="light"] .toast-msg { color: var(--text-secondary); }

/* ── Auth ── */
[data-theme="light"] .auth-overlay { background: rgba(244,244,246,.95); }
[data-theme="light"] .auth-card { background: #ffffff; box-shadow: 0 8px 40px rgba(0,0,0,.08); border-color: rgba(0,0,0,.06); }
[data-theme="light"] .auth-card h2 { color: #000000; }
[data-theme="light"] .auth-card p { color: var(--text-secondary); }
[data-theme="light"] .auth-card input { background: #f9f9fb; border-color: rgba(0,0,0,0.08); color: #000000; }
[data-theme="light"] .auth-close-btn { background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.06); }
[data-theme="light"] .auth-close-btn:hover { background: rgba(0,0,0,.1); color: #0f172a; }

/* ── Loading overlay ── */
[data-theme="light"] .loading-overlay { background: rgba(240,244,248,.93); }
[data-theme="light"] .loading-text { color: #475569; }

/* ── Shimmer (hardcoded dark rgba) ── */
[data-theme="light"] .shimmer { background-color: rgba(0,0,0,.06); }
[data-theme="light"] .shimmer::after {
  background-image: linear-gradient(
    90deg,
    rgba(0,0,0,0) 0,
    rgba(0,0,0,.04) 20%,
    rgba(0,0,0,.08) 60%,
    rgba(0,0,0,0)
  );
}

/* ── Landing page ── */
[data-theme="light"] .lp-btn-outline {
  border-color: rgba(0,0,0,.15);
  color: #0f172a;
}
[data-theme="light"] .lp-btn-outline:hover {
  background: rgba(0,0,0,.05);
  border-color: rgba(0,0,0,.2);
}
[data-theme="light"] .lp-feature-card { background: #ffffff; border-color: rgba(0,0,0,.09); }
[data-theme="light"] .lp-feature-icon { background: rgba(99,102,241,.08); }
[data-theme="light"] .lp-feature-card h3 { color: #0f172a; }
[data-theme="light"] .lp-feature-card p { color: #475569; }

/* ── Scrollbar ── */
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.25); }

/* ─── DIVIDEND SUMMARY STYLES ─── */
.div-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.div-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-primary);
  border-radius: 14px;
  padding: 18px 20px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
}
.div-summary-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, transparent 60%);
  opacity: 0.04;
  border-radius: 0 14px 0 80px;
}
.div-summary-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.12);
  border-color: var(--accent-primary);
}
.div-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-color);
}
.div-summary-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.div-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.div-summary-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.div-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.div-stat-label {
  color: var(--text-muted);
  font-size: 13px;
}
.div-stat-value {
  font-variant-numeric: tabular-nums;
}
.div-summary-total {
  display: flex;
  gap: 20px;
  padding: 20px;
  border-radius: 14px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(99,102,241,0.06) 0%, rgba(16,185,129,0.04) 100%);
  box-shadow: 0 2px 12px rgba(99,102,241,0.08);
}
.div-total-box {
  flex: 1;
  padding: 8px 0;
}
.div-total-box + .div-total-box {
  border-left: 1px solid var(--border-color);
  padding-left: 16px;
}
.div-total-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.div-total-val {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Dark mode enhancements */
[data-theme="dark"] .div-summary-card {
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .div-summary-card:hover {
  box-shadow: 0 8px 24px rgba(99,102,241,0.2);
}
[data-theme="dark"] .div-summary-total {
  background: linear-gradient(135deg, rgba(99,102,241,0.1) 0%, rgba(16,185,129,0.06) 100%);
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

/* Light mode enhancements */
[data-theme="light"] .div-summary-card {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  border-color: #e2e8f0;
}
[data-theme="light"] .div-summary-card:hover {
  box-shadow: 0 8px 24px rgba(99,102,241,0.15);
}
[data-theme="light"] .div-summary-total {
  background: linear-gradient(135deg, rgba(99,102,241,0.05) 0%, rgba(16,185,129,0.03) 100%);
  border-color: #e2e8f0;
}

@media (max-width: 768px) {
  .div-summary-total {
    flex-direction: column;
    gap: 12px;
  }
  .div-total-box + .div-total-box {
    border-left: none;
    border-top: 1px solid var(--border-color);
    padding-left: 0;
    padding-top: 12px;
  }
  .div-summary-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
.skeleton-mode .chart-body canvas,
.skeleton-mode .metrics-grid .metric-item,
.skeleton-mode .expense-item,
.skeleton-mode .donut-center span,
.skeleton-mode .div-stat-value,
.skeleton-mode .div-total-val,
.skeleton-mode .div-progress-fill {
  color: transparent !important;
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-color) 50%, var(--bg-secondary) 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: 8px;
  border: none !important;
}
.skeleton-mode .chart-body canvas {
  opacity: 0.2;
}

/* ── Micro-interactions ── */
.action-btn:active,
.report-tab:active,
.filter-btn:active,
.theme-toggle:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}
.nav-item:active {
  transform: scale(0.98);
}


/* ===================== BUSINESS SWITCHER ===================== */

.business-switcher {
  position: relative;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.bs-current {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.bs-current:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}
.bs-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(212, 240, 59, 0.08);
  color: var(--accent-primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bs-icon svg { width: 14px; height: 14px; }

.bs-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.bs-name {
  font-weight: 600;
  font-size: 13px;
  color: #f1f5f9 !important; /* Force white for dark sidebar */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bs-role {
  font-size: 11px;
  color: #94a3b8 !important;
}

.business-switcher svg:last-child {
  width: 16px;
  height: 16px;
  color: #64748b;
  transition: transform 0.2s;
}
.business-switcher.open .bs-current svg:last-child {
  transform: rotate(180deg);
}

.bs-dropdown {
  position: absolute;
  top: 100%;
  margin-top: 6px;
  left: 0;
  right: 0;
  background: #1e293b; /* Dark bg */
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  max-height: 250px;
  overflow-y: auto;
}
.business-switcher.open .bs-dropdown {
  display: flex;
}
.bs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.bs-item:hover {
  background: rgba(255,255,255,0.05);
}
.bs-item.active {
  background: rgba(212, 240, 59, 0.08);
  border-left: 2px solid var(--accent-primary);
}
.bs-item .bs-icon {
  width: 24px;
  height: 24px;
  font-size: 12px;
  background: rgba(255,255,255,0.05);
  color: #94a3b8;
}
.bs-item.active .bs-icon {
  color: var(--accent-primary-text);
  background: rgba(212, 240, 59, 0.15);
}
.bs-item .bs-name {
  font-size: 13px;
  color: #f1f5f9;
}

.sidebar.collapsed .business-switcher .bs-info,
.sidebar.collapsed .business-switcher > .bs-current > svg:last-child {
  display: none !important;
}
.sidebar.collapsed .business-switcher .bs-current {
  justify-content: center;
  padding: 8px 0;
}
.sidebar.collapsed .business-switcher {
  border-top: none;
  margin-top: 10px;
  padding-top: 10px;
}


/* ============================================================
   PAYLO OVERHAUL DESIGNS (GRID, BANNER, KPI AND SLIM SIDEBAR)
   ============================================================ */

/* 1. Main Dashboard Grid Layout */
.dashboard-main-grid {
  display: grid;
  grid-template-columns: 6.8fr 3.2fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 800px) {
  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }
}

.hero-banner-card {
  position: relative;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%) !important;
  border: none !important;
  border-radius: 24px;
  padding: 32px;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 200px;
}

.hero-banner-content {
  max-width: 60%;
  z-index: 2;
}

.hero-txn-tag {
  display: inline-block;
  background: rgba(0, 0, 0, 0.08) !important;
  color: #000000 !important;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.hero-banner-content h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.7) !important;
  margin: 0 0 10px 0;
  line-height: 1.3;
}

.hero-banner-content h2 .highlight-text {
  color: #000000 !important;
  font-weight: 800;
}

.hero-banner-content p {
  color: rgba(0, 0, 0, 0.65) !important;
  font-size: 14px;
  margin: 0 0 24px 0;
  line-height: 1.5;
  font-weight: 500;
}

.hero-progress-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
}

.hero-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.65) !important;
  font-weight: 600;
}

.hero-progress-info strong {
  color: #000000 !important;
  font-weight: 800;
}

.hero-progress-bar-wrapper {
  background: rgba(0, 0, 0, 0.06) !important;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.hero-progress-bar {
  background: #000000 !important;
  height: 100%;
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(0,0,0,0.15) !important;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-progress-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: rgba(0, 0, 0, 0.5) !important;
  font-weight: 600;
  padding: 0 2px;
}

.hero-banner-visual {
  position: relative;
  width: 180px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* Glass coin effect from paylo mockup */
.glass-coins-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.glass-coin {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 0.65) 100%) !important;
  backdrop-filter: blur(5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.4), inset 0 2px 10px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0,0,0,0.1) !important;
}

.coin-1 {
  width: 70px;
  height: 70px;
  bottom: 10px;
  right: 20px;
  transform: rotate(-15deg);
  z-index: 3;
}

.coin-2 {
  width: 80px;
  height: 80px;
  top: 15px;
  right: 50px;
  transform: rotate(20deg);
  z-index: 2;
}

.coin-3 {
  width: 60px;
  height: 60px;
  top: 45px;
  right: 10px;
  transform: rotate(-45deg);
  z-index: 1;
  opacity: 0.6;
}

/* 3. KPI Mini Cards Row */
.kpi-row-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

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

.kpi-row-grid .kpi-card {
  background: #111216;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* 4. Overriding Sidebar to be Narrow floating vertical island */
.sidebar {
  width: 90px !important;
  left: 16px !important;
  top: 24px !important;
  height: calc(100vh - 48px) !important;
  border-radius: 24px !important;
  background: rgba(13, 14, 18, 0.9) !important;
  backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: center !important;
}

/* Hide texts and details on sidebar to achieve slim modern profile */
.sidebar .logo-text,
.sidebar .logo-sub,
.sidebar .nav-label,
.sidebar .nav-badge,
.sidebar .last-sync,
.sidebar .sync-status span,
.sidebar .bs-info,
.sidebar .sidebar-toggle,
.sidebar .bs-current > svg:last-child {
  display: none !important;
}

.sidebar-header {
  display: none !important;
}

.sidebar-nav {
  padding: 0 !important;
  padding-top: 40px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100% !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: visible !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.sidebar-nav::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
}

.sidebar-nav .nav-section {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  margin-bottom: 0 !important;
  padding-top: 8px !important;
}

.sidebar .nav-item:first-of-type {
  margin-top: 0 !important;
}

/* Sidebar hover tooltips */
.sidebar .nav-item {
  position: relative;
}

.sidebar .nav-item span {
  display: block !important;
  position: fixed;
  left: var(--tooltip-left, 76px);
  top: var(--tooltip-top, 50%);
  transform: translateY(-50%) translateX(10px);
  background: rgba(18, 19, 23, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid var(--accent-primary);
  color: #ffffff !important;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  z-index: 1000;
}

/* Tooltip arrow pointing left */
.sidebar .nav-item span::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: rgba(18, 19, 23, 0.96);
  border-left: 1px solid var(--accent-primary);
  border-bottom: 1px solid var(--accent-primary);
}

.sidebar .nav-item:hover span {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.sidebar .nav-item {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 8px auto !important;
  overflow: visible !important;
  transition: var(--transition-fast) !important;
}

.sidebar .nav-item.active {
  background: var(--accent-primary) !important;
  color: var(--sidebar-active-text) !important;
  box-shadow: 0 0 20px var(--border-hover) !important;
}

.sidebar .nav-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
}

.sidebar .nav-item svg {
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
}

.sidebar .business-switcher {
  border-top: none !important;
  padding: 16px 0 !important;
  justify-content: center !important;
  margin: 0 !important;
  width: 100% !important;
}

.sidebar .bs-current {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto !important;
}

.sidebar .bs-current .bs-icon {
  background: transparent !important;
  width: auto !important;
  height: auto !important;
  color: var(--text-secondary) !important;
}

.sidebar .bs-current .bs-icon svg {
  width: 20px !important;
  height: 20px !important;
}

.sidebar-footer {
  border-top: none !important;
  padding: 20px 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  margin-top: auto !important;
  width: 100% !important;
}

/* Adjust Main Content area margin to account for fixed slim sidebar */
.main-content {
  margin-left: 122px !important;
  padding: 24px !important;
}

@media (max-width: 1024px) {
  .sidebar {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
    padding: 16px !important;
  }
}

.source-amount {
  color: var(--accent-primary-text) !important;
}

.sidebar .bs-dropdown {
  position: absolute !important;
  left: 80px !important;
  top: 0 !important;
  right: auto !important;
  width: 240px !important;
  margin-top: 0 !important;
  background: var(--bg-glass) !important;
  backdrop-filter: blur(20px) !important;
  border: 1px solid var(--border-color) !important;
}

/* Premium Modal System */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 9, 10, 0.75);
  backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  animation: fadeInModal 0.25s ease;
}

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

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 32px;
  width: 440px;
  max-width: 95vw;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  position: relative;
  animation: slideUpModal 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

[data-theme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.45);
}

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

.modal-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

[data-theme="light"] .modal-close-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--text-muted);
}

/* Custom Select Dropdowns */
.custom-select-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

.custom-select-trigger {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
  box-sizing: border-box;
}

.custom-select-trigger:hover {
  border-color: var(--border-hover);
}

.custom-select-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.custom-select-wrapper.open .custom-select-chevron {
  transform: rotate(180deg);
}

.custom-select-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(25px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.6);
  z-index: 99999;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.custom-select-wrapper.open .custom-select-options {
  display: flex;
}

.custom-select-option {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.custom-select-option:hover {
  background: var(--accent-primary) !important;
  color: var(--sidebar-active-text) !important;
  font-weight: 600;
}

.custom-select-option.selected {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-weight: 600;
}

[data-theme="light"] .custom-select-options {
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

[data-theme="light"] .custom-select-option.selected {
  background: rgba(0, 0, 0, 0.03);
}

/* Force hide default OS select dropdown arrows in Chrome/Safari/Firefox */
select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

/* Force black text for top bar user profile initials on neon background */
#userAvatarBtn, #userAvatarInitials {
  color: #000000 !important;
}

/* Flatpickr Premium Dark Neon Theme Overrides */
.flatpickr-calendar {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 16px !important;
  box-shadow: var(--shadow-card) !important;
  font-family: 'Space Grotesk', 'Inter', sans-serif !important;
}

.flatpickr-months .flatpickr-month {
  color: var(--text-primary) !important;
}

.flatpickr-current-month .numInputWrapper span.arrowUp::after {
  border-bottom-color: var(--accent-primary) !important;
}
.flatpickr-current-month .numInputWrapper span.arrowDown::after {
  border-top-color: var(--accent-primary) !important;
}

.flatpickr-months .flatpickr-prev-month, 
.flatpickr-months .flatpickr-next-month {
  color: var(--accent-primary-text) !important;
  fill: var(--accent-primary-text) !important;
}

.flatpickr-weekday {
  color: var(--text-secondary) !important;
  font-weight: 600 !important;
}

.flatpickr-day {
  color: var(--text-primary) !important;
  border-radius: 8px !important;
  transition: all 0.15s ease !important;
}

.flatpickr-day:hover, 
.flatpickr-day:focus {
  background: rgba(212, 240, 59, 0.15) !important;
  color: var(--text-primary) !important;
  border-color: var(--accent-primary) !important;
}

.flatpickr-day.selected, 
.flatpickr-day.startRange, 
.flatpickr-day.endRange {
  background: var(--accent-primary) !important;
  color: #000000 !important;
  font-weight: 700 !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 10px rgba(212, 240, 59, 0.4) !important;
}

.flatpickr-day.today {
  border-color: var(--accent-primary) !important;
  color: var(--accent-primary-text) !important;
}

.flatpickr-day.flatpickr-disabled {
  color: var(--text-muted) !important;
}

.flatpickr-monthDropdown-months {
  background: var(--bg-elevated) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  padding: 4px 10px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  outline: none !important;
  transition: border-color 0.15s ease !important;
}

.flatpickr-monthDropdown-months:hover {
  border-color: var(--accent-primary) !important;
}

.flatpickr-monthDropdown-months option {
  background: var(--bg-elevated) !important;
  color: var(--text-primary) !important;
  padding: 6px !important;
}

/* ── Light theme specific overrides for Sidebar and KPI Cards ── */
[data-theme="light"] .sidebar {
  background: #ffffff !important;
  border-right: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .sidebar .nav-item {
  color: #000000 !important;
}

[data-theme="light"] .sidebar .nav-item:hover:not(.active) {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #000000 !important;
}

[data-theme="light"] .sidebar .nav-item.active {
  background: #D4F03B !important;
  color: #000000 !important;
  box-shadow: 0 4px 12px rgba(212, 240, 59, 0.3) !important;
}

[data-theme="light"] .sidebar .sync-dot {
  background: #798c10 !important;
}

[data-theme="light"] .sidebar .bs-current {
  background: rgba(0, 0, 0, 0.03) !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .sidebar .bs-current .bs-icon {
  color: #000000 !important;
}

[data-theme="light"] .kpi-row-grid .kpi-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02) !important;
}

[data-theme="light"] .kpi-row-grid .kpi-card .kpi-value {
  color: #000000 !important;
}

[data-theme="light"] .kpi-row-grid .kpi-card .kpi-label {
  color: #55555a !important;
}

#mainChartTypeSelector:hover {
  border-color: var(--accent-primary) !important;
}
