/* ============================================================
   AI BUDGET — DESIGN SYSTEM
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---------- CSS VARIABLES ---------- */
:root {
  /* Shared */
  --accent: #00d4a8;
  --accent-dim: rgba(0, 212, 168, 0.15);
  --accent-glow: rgba(0, 212, 168, 0.3);
  --danger: #ff4d6d;
  --warning: #ffab40;
  --success: #00d4a8;
  --sidebar-width: 220px;
  --header-height: 64px;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 4px 24px rgba(0,0,0,0.18);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.28);
}

/* ---------- DARK MODE (DEFAULT) ---------- */
body.dark {
  --bg:         #0b0f1a;
  --bg-2:       #10162a;
  --card:       #131929;
  --card-2:     #1c2540;
  --card-hover: #1e2a45;
  --border:     rgba(255,255,255,0.06);
  --border-accent: rgba(0,212,168,0.25);
  --text:       #f0f4ff;
  --text-2:     #a0aec0;
  --text-3:     #64748b;
  --sidebar-bg: #0d1221;
  --header-bg:  rgba(11,15,26,0.85);
  --accent:     #00d4a8;
  --accent-text:#00d4a8;
}

/* ---------- LIGHT MODE ---------- */
body.light {
  --bg:         #e8f5f2;
  --bg-2:       #d4ede8;
  --card:       #ffffff;
  --card-2:     #f0faf7;
  --card-hover: #e8f8f4;
  --border:     rgba(0,0,0,0.07);
  --border-accent: rgba(20,120,95,0.3);
  --text:       #1a2332;
  --text-2:     #4a5568;
  --text-3:     #8a9bb0;
  --sidebar-bg: #c8e8e0;
  --header-bg:  rgba(232,245,242,0.9);
  --accent:     #14785f;
  --accent-text:#14785f;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  transition: background var(--transition), color var(--transition);
  overflow: hidden;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-wrapper {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  border-right: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
  z-index: 100;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

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

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent), #00b894);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.logo-text { line-height: 1.1; }
.logo-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.logo-sub {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  height: 60%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #0b0f1a;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
}

.sidebar-bottom {
  padding: 16px 12px 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  margin-top: 8px;
}

.sidebar-user:hover { background: var(--accent-dim); }

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-info { line-height: 1.2; min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-plan { font-size: 10px; color: var(--accent); font-weight: 500; }

/* ---------- MAIN AREA ---------- */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

/* ---------- HEADER ---------- */
.top-header {
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  flex-shrink: 0;
  z-index: 50;
  transition: background var(--transition), border-color var(--transition);
}

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

.header-brand-text { font-size: 14px; font-weight: 700; color: var(--text); }
.header-brand-sub { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }

.header-nav {
  display: flex;
  gap: 4px;
  margin-right: auto;
}

.header-nav-item {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
}

.header-nav-item:hover { color: var(--text); }
.header-nav-item.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  border-radius: 0;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 14px;
  min-width: 180px;
  transition: all var(--transition);
}

.header-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.header-search input {
  background: none;
  border: none;
  outline: none;
  font-size: 12px;
  color: var(--text);
  font-family: inherit;
  width: 100%;
}

.header-search input::placeholder { color: var(--text-3); }
 
/* ---------- SEARCH RESULTS DROPDOWN ---------- */
.header-search { position: relative; }
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  max-height: 480px;
  overflow-y: auto;
  padding: 8px;
  display: none; /* Show when there are results */
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(12px);
}
 
.search-results-dropdown.active { display: block; }
 
.search-section {
  margin-bottom: 12px;
}
 
.search-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
 
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
 
.search-result-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
}
 
.result-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 14px;
}
 
.search-result-item:hover .result-icon {
  background: var(--accent);
  color: #0b0f1a;
}
 
.result-info {
  flex: 1;
}
 
.result-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}
 
.result-meta {
  font-size: 10px;
  color: var(--text-3);
}

.search-no-results {
  padding: 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 42px; /* Slightly larger for 3D presence */
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: linear-gradient(145deg, var(--card-2), var(--card));
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-2);
  font-size: 18px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 
    4px 4px 10px rgba(0, 0, 0, 0.4), 
    -1px -1px 2px rgba(255, 255, 255, 0.04),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.icon-btn:hover { 
  transform: translateY(-2px);
  background: linear-gradient(145deg, var(--card-hover), var(--card-2));
  color: var(--accent);
  border-color: var(--border-accent);
  box-shadow: 
    6px 8px 16px rgba(0, 0, 0, 0.5), 
    -1px -1px 2px rgba(255, 255, 255, 0.05),
    inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.icon-btn:active {
  transform: translateY(1px);
  box-shadow: 
    inset 2px 2px 5px rgba(0, 0, 0, 0.5),
    inset -1px -1px 2px rgba(255, 255, 255, 0.05);
}

.icon-btn .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  background: linear-gradient(135deg, var(--danger), #ff1a4a);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 4px;
  border: 2px solid var(--header-bg);
  box-shadow: 0 4px 8px rgba(255, 77, 109, 0.4);
  animation: badgePulse 2s infinite;
  z-index: 2;
}

@keyframes badgePulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.4); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(255, 77, 109, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 77, 109, 0); }
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 212, 168, 0.5); }
  60%  { box-shadow: 0 0 0 8px rgba(0, 212, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 212, 168, 0); }
}

.theme-toggle {
  width: 56px;
  height: 28px;
  border-radius: 14px;
  background: var(--card-2);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle .toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
  transition: transform var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

body.light .theme-toggle .toggle-thumb {
  transform: translateX(28px);
}

.btn-new {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #0b0f1a;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-new:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 14px var(--accent-glow);
  transform: translateY(-1px);
}

/* ---------- CONTENT AREA ---------- */
.content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.content-area::-webkit-scrollbar { width: 5px; }
.content-area::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ---------- PAGES ---------- */
.page { display: none; padding: 28px; animation: fadeIn 0.3s ease; }
.page.active { display: block; }

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

/* ============================================================
   AI STRATEGIC CHAT UI
   ============================================================ */
.ai-chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #0b0f1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--accent-glow);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
}

.ai-chat-fab:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 12px 32px var(--accent-glow);
}

.ai-chat-fab.active {
  transform: scale(0.8) rotate(-45deg);
  opacity: 0;
  pointer-events: none;
}

.ai-chat-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 48px);
  background: rgba(19, 25, 41, 0.85); /* Glassmorphism */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-accent);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1001;
  overflow: hidden;
}

.ai-chat-panel.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.chat-close {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s;
}

.chat-close:hover { color: var(--danger); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
}

.chat-msg.ai {
  align-self: flex-start;
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #0b0f1a;
  font-weight: 600;
  border-bottom-right-radius: 4px;
}

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

.chat-prompts {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chat-prompts::-webkit-scrollbar { display: none; }

.chat-prompt {
  background: var(--card-2);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 10px;
  color: var(--text-2);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-prompt:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chat-input-wrap {
  display: flex;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  transition: border-color 0.3s;
}

.chat-input-wrap:focus-within { border-color: var(--accent); }

.chat-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}

.chat-input-wrap button {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: transform 0.2s;
}

.chat-input-wrap button:hover { transform: translateX(2px); }

/* ============================================================
   COMMON COMPONENTS
   ============================================================ */

/* ---------- CARDS ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow);
}

.card-glass {
  background: linear-gradient(135deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(8px);
}

.card-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin-bottom: 4px;
}

.card-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.card-value.accent { color: var(--accent); }

.card-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ---------- SECTION HEADERS ---------- */
.section-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-3);
  margin-bottom: 6px;
}

.section-title {
  font-size: 36px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 8px;
}

/* ---------- BADGES ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-accent { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--border-accent); }
.badge-danger { background: rgba(255,77,109,0.15); color: var(--danger); }
.badge-warning { background: rgba(255,171,64,0.15); color: var(--warning); }
.badge-primary { background: rgba(102,126,234,0.15); color: #667eea; }

/* ---------- PROGRESS BAR ---------- */
/* ---------- PROGRESS BAR ---------- */
.progress-container { margin: 24px 0 32px 0; position: relative; }
.progress-track {
  height: 28px;
  background: var(--card-2);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.05); /* 3D Inner Depth */
  position: relative;
}
.progress-fill {
  height: 100%;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--accent) 0%, #00f5c8 45%, #00a884 55%, var(--accent) 100%); /* Glossy Curvature Gradient */
  box-shadow: 0 0 20px var(--accent-glow), inset 0 1px 2px rgba(255,255,255,0.4);
  position: relative;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3D Glass Highlight overlay */
.progress-fill::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 40%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.25), transparent);
  border-radius: 14px 14px 0 0;
  pointer-events: none;
}

/* Animated Shine Shimmer */
.progress-fill::before {
  content: "";
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: skewX(-25deg);
  animation: shimmer 4s infinite linear;
}

@keyframes shimmer {
  0% { left: -100%; }
  45% { left: 150%; }
  100% { left: 150%; }
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  margin-top: 10px;
  letter-spacing: 0.02em;
}
.progress-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
}
.progress-badge-center {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  color: var(--accent);
  border: 1px solid var(--border-accent);
  font-size: 10px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #0b0f1a;
}
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 14px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--card-2); color: var(--text); }

.btn-danger { background: rgba(255,77,109,0.15); color: var(--danger); }
.btn-danger:hover { background: rgba(255,77,109,0.25); }

/* ---------- TABLES ---------- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 13px 12px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr {
  transition: background var(--transition);
  cursor: pointer;
}
.data-table tbody tr:hover { background: var(--card-2); }

/* ---------- STAT PILLS ---------- */
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}
.stat-pill.up { color: #00d4a8; background: rgba(0,212,168,0.1); }
.stat-pill.down { color: var(--danger); background: rgba(255,77,109,0.1); }

/* ---------- TOGGLES ---------- */
.toggle-switch {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--card-2);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: background 0.25s ease, border-color 0.25s ease;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  user-select: none;
}
.toggle-switch.on {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(0,212,168,0.3);
}
.toggle-switch .thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-3);
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), background 0.25s ease;
  pointer-events: none;
}
.toggle-switch.on .thumb {
  transform: translateX(20px);
  background: #fff;
}

/* ---------- SLIDER ---------- */
.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--card-2);
  outline: none;
  cursor: pointer;
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  cursor: pointer;
  transition: box-shadow var(--transition);
}
.range-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 6px var(--accent-dim);
}

/* ---------- CHART STYLE SWITCHER ---------- */
.chart-style-switcher {
  display: flex;
  background: var(--card-2);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}

.style-btn {
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-3);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
}

.style-btn:hover {
  background: var(--border);
  color: var(--text-2);
}

.style-btn.active {
  background: var(--accent);
  color: #0b0f1a;
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* ---------- CHIP SELECTOR ---------- */
.chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--card-2);
  transition: all var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0f1a;
  box-shadow: 0 2px 10px var(--accent-glow);
}

/* ---------- DIVIDER ---------- */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ============================================================
   DASHBOARD PAGE
   ============================================================ */
.dash-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.dash-total-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  text-align: right;
  min-width: 200px;
}

.dash-progress-section { margin-bottom: 24px; }
.progress-bar-tall .progress-track { height: 10px; }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

.dash-left { display: flex; flex-direction: column; gap: 20px; }
.dash-right { display: flex; flex-direction: column; gap: 16px; }

/* Strategy Indicators Grid */
.strategy-indicators {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.strategy-card {
  background: var(--card-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.strategy-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

.strategy-card.highlight {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--card-1) 0%, rgba(0,212,168,0.03) 100%);
  position: relative;
}

.strategy-card.highlight::before {
  content: 'OPTIMAL';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 8px;
  font-weight: 900;
  color: #000;
  background: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.1em;
}

/* Strategy card — interactive states */
.strategy-card {
  position: relative !important;
  cursor: pointer !important;
  user-select: none !important;
}

.strategy-card.selected {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(0,212,168,0.28), 0 10px 30px -10px rgba(0,0,0,0.4) !important;
  transform: translateY(-2px) !important;
}

.strategy-card.selected::after {
  content: 'ACTIVE' !important;
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  font-size: 8px !important;
  font-weight: 900 !important;
  color: #0b0f1a !important;
  background: var(--accent) !important;
  padding: 2px 7px !important;
  border-radius: 4px !important;
  letter-spacing: 0.1em !important;
  z-index: 2 !important;
}

/* When card is both OPTIMAL and ACTIVE — stack badges vertically */
.strategy-card.highlight.selected::before {
  top: 10px !important;
  right: 10px !important;
}
.strategy-card.highlight.selected::after {
  top: 28px !important;
  right: 10px !important;
}

.strat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.strat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.strat-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 2px;
}

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

.strat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--card-2);
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.strat-item:hover {
  background: var(--card-1);
  border-color: var(--border-accent);
}

.strat-item-main {
  display: flex;
  flex-direction: column;
}

.strat-item-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.strat-item-amt {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
}

.strat-item-stats {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.strat-item-months {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}

.strat-item-saved {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 2px;
}

.strat-empty {
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
  padding: 20px;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.ai-advisor-card {
  background: linear-gradient(135deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.ai-advisor-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  pointer-events: none;
}

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

.ai-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.ai-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.ai-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ai-focus-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 8px; }
.ai-focus-text { font-size: 13px; color: var(--text-2); line-height: 1.6; }
.ai-focus-text .highlight { color: var(--accent); font-weight: 600; }
.ai-focus-text .highlight-gold { color: var(--warning); font-weight: 600; }

.ai-card-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }

/* Spending Tracker */
.spending-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.spending-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.time-filter {
  display: flex;
  gap: 2px;
  background: var(--card-2);
  padding: 3px;
  border-radius: 8px;
}

.time-btn {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-3);
  transition: all var(--transition);
}

.time-btn.active {
  background: var(--accent);
  color: #0b0f1a;
}

.spending-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.transaction-list { margin-top: 14px; }
.transaction-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.transaction-item:last-child { border-bottom: none; }

.txn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.txn-name { font-size: 13px; font-weight: 500; color: var(--text); }
.txn-cat { font-size: 11px; color: var(--text-3); }
.txn-amount { margin-left: auto; font-size: 13px; font-weight: 700; }
.txn-amount.neg { color: var(--danger); }
.txn-amount.pos { color: var(--accent); }

/* Right Column */
.upcoming-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.upcoming-item:last-child { border-bottom: none; }

.upcoming-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.upcoming-name { font-size: 13px; font-weight: 600; color: var(--text); }
.upcoming-due { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.upcoming-amount { margin-left: auto; text-align: right; }
.upcoming-val { font-size: 13px; font-weight: 700; color: var(--text); }

.credit-score-display {
  display: flex;
  align-items: center;
  gap: 16px;
}

.credit-score-circle {
  position: relative;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-number {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
}

.credit-score-info .score-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); }
.credit-score-info .score-status { font-size: 14px; font-weight: 700; color: var(--accent); }
.credit-score-info .score-change { font-size: 11px; color: var(--text-2); }

.investments-value { font-size: 24px; font-weight: 800; color: var(--text); }
.investments-change { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: #00d4a8; }

.holding-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 12px;
}
.holding-name { color: var(--text-2); }
.holding-val { font-weight: 600; color: var(--text); }

/* Bottom Stats */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
}

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

.stat-value { font-size: 26px; font-weight: 900; color: var(--text); }
.stat-value.accent { color: var(--accent); }
.stat-value.warning { color: var(--warning); }
.stat-change { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; margin-left: 6px; }
.stat-change.pos { color: #00d4a8; }
.stat-change.neg { color: var(--danger); }

/* Interactive Stat Cards */
.stat-card-interactive {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.stat-card-interactive::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: left;
}

.stat-card-interactive:hover::after {
  transform: scaleX(1);
}

.stat-card-interactive:active {
  transform: scale(0.98);
}

.stat-card-info {
  margin-top: 16px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 6px 12px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-accent);
}

.stat-card-interactive:hover .stat-card-info {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   DEBTS PAGE
   ============================================================ */

/* Sub-tabs */
.debts-subtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.subtab {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.subtab:hover { color: var(--text); background: var(--card-2); }
.subtab.active { color: var(--accent); border-bottom: 2px solid var(--accent); border-radius: 0; }

.debts-header-card {
  background: linear-gradient(135deg, var(--accent), #00b894);
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  color: white;
  margin-bottom: 20px;
}

.debts-hero-meta { display: flex; align-items: start; justify-content: space-between; }
.debts-main-val { font-size: 42px; font-weight: 900; line-height: 1; margin: 6px 0; color: white; }
.debts-sub { font-size: 11px; }
.debts-meta-right { text-align: right; }
.debts-meta-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; }
.debts-meta-val { font-size: 16px; font-weight: 800; }

.debts-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.payoff-strategy-card { grid-column: span 1; }
.strategy-methods { display: flex; gap: 6px; margin: 12px 0; flex-wrap: wrap; }

/* Spending + Donut Grid */
.debts-spend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

/* Donut Chart */
.donut-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  flex-shrink: 0;
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.donut-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
  width: 100%;
}

/* 4 Obligation Cards in a Row */
.obligation-cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
  margin-bottom: 20px;
}

.obligation-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
}

.obligation-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-accent);
}

.obligation-card.priority { border-color: var(--danger); }

.obl-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.obl-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--card-2); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.obl-name { font-size: 13px; font-weight: 700; color: var(--text); }
.obl-type { font-size: 10px; color: var(--text-3); margin-bottom: 2px; }

/* Stacked stats for card layout */
.obl-stats-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.obl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Horizontal stats (for wider cards — kept for backward compat) */
.obl-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.obl-stat-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.obl-stat-val { font-size: 13px; font-weight: 700; color: var(--text); margin-top: 2px; }
.obl-stat-val.danger { color: var(--danger); }

/* Bottom grid: Transactions + Elimination */
.debts-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 16px;
  margin-bottom: 20px;
}

.ai-performance-card {
  background: linear-gradient(135deg, var(--card-2), var(--card));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-top: 0;
  margin-bottom: 20px;
}

.ai-perf-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ai-perf-title { font-size: 14px; font-weight: 700; }
.ai-perf-sub { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); }

.ai-perf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.ai-perf-metric { margin-bottom: 8px; }
.ai-perf-label { font-size: 10px; color: var(--text-3); }
.ai-perf-val { font-size: 14px; font-weight: 700; color: var(--text); }

/* Sub-tab content panels */
.debts-subtab-content { display: none; animation: fadeIn 0.3s ease; }
.debts-subtab-content.active { display: block; }

/* Legend dot indicator */
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Data table for transactions */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}

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

.data-table tr { transition: background var(--transition); }
.data-table tr:hover { background: var(--card-2); }

.badge-primary {
  background: rgba(0,212,168,0.15);
  color: var(--accent);
}

/* Budget & Breakdown Stats Row */
.budget-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.budget-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: all var(--transition);
}

.budget-stat-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow);
}

.budget-stat-value {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  margin: 6px 0 4px;
}

/* Budget main grid: donut + bar chart */
.budget-main-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 16px;
  margin-bottom: 20px;
}

/* Transactions Sub-tab */
.txn-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  flex: 1;
  max-width: 340px;
}

.txn-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  width: 100%;
}

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

.filter-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--card);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.filter-pill:hover { border-color: var(--border-accent); color: var(--text); }
.filter-pill.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

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

.filter-icon-btn:hover { border-color: var(--border-accent); color: var(--text); }

/* Full-width transaction table */
.txn-full-table th,
.txn-full-table td { padding: 14px 20px; }
.txn-date { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.txn-method { color: var(--text-3); font-size: 12px; }

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-indicator.completed { color: var(--accent); }
.status-indicator.pending { color: var(--warning); }
.status-indicator.failed { color: var(--danger); }

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.active { background: var(--accent); box-shadow: 0 0 6px var(--accent-glow); }
.status-dot.pending { background: var(--warning); box-shadow: 0 0 6px rgba(255, 171, 64, 0.4); }
.status-dot.failed { background: var(--danger); box-shadow: 0 0 6px rgba(255, 77, 109, 0.4); }

.txn-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 6px 16px;
  font-size: 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

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

/* ============================================================
   RECURRING PAYMENTS PAGE
   ============================================================ */
.rec-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  margin-bottom: 20px;
}

.optimize-wealth-bg {
  background: linear-gradient(135deg, rgba(0, 212, 168, 0.1) 0%, rgba(11, 15, 26, 0.9) 100%);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-accent);
}
.optimize-wealth-bg::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('https://images.unsplash.com/photo-1551288049-bebda4e38f71?auto=format&fit=crop&q=80&w=400') center/cover;
  opacity: 0.1;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* ---------- MAIN INTERACTIVE CALENDAR ---------- */
.cal-day-cell {
  background: var(--card-1);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

.cal-day-cell:hover {
  background: var(--card-2) !important;
  transform: scale(1.02);
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  border-radius: 8px;
  border-color: rgba(0,212,168,0.3) !important;
}

.cal-day-cell.empty {
  background: var(--bg);
  opacity: 0.3;
}

.cal-event-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: slideInLeft 0.3s ease-out;
  cursor: pointer;
  transition: all 0.2s;
}

.cal-event-badge:hover {
  filter: brightness(1.2);
  transform: translateX(2px);
}

.cal-event-badge.income {
  background: rgba(0, 212, 168, 0.1);
  color: var(--accent);
  border-left: 3px solid var(--accent);
}

.cal-event-badge.debt {
  background: rgba(255, 77, 109, 0.1);
  color: var(--danger);
  border-left: 3px solid var(--danger);
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Sidebar Specifics */
#cal-detailed-upcoming::-webkit-scrollbar {
  width: 4px;
}

#cal-detailed-upcoming::-webkit-scrollbar-track {
  background: transparent;
}

#cal-detailed-upcoming::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

#cal-detailed-upcoming {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-event-card {
  transition: all 0.3s ease;
}

.sidebar-event-card:hover {
  border-color: var(--accent) !important;
  background: var(--card-2) !important;
  transform: translateX(4px);
}

/* Fix for the structural mess in index.html */
#page-recurring .reveal-1 {
  animation-delay: 0.1s;
}

/* Main Calendar Label */
#cal-month-year {
  background: linear-gradient(to right, var(--text), var(--text-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cal-cell {
  background: var(--card);
  min-height: 60px;
  padding: 4px;
  font-size: 10px;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  transition: background 0.2s;
}

.cal-cell:hover:not(.empty) { background: var(--card-2); cursor: pointer; }
.cal-cell.empty { background: rgba(26, 35, 50, 0.4); color: transparent; }

.cal-event {
  margin-top: 4px;
  padding: 2px 4px;
  border-radius: 2px;
  font-size: 8px;
  font-weight: 700;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}
.cal-event.accent { background: rgba(0, 212, 168, 0.15); color: var(--accent); border-left: 2px solid var(--accent); }
.cal-event.warning { background: rgba(255, 171, 64, 0.15); color: var(--warning); border-left: 2px solid var(--warning); }
.cal-event.blue { background: rgba(102, 126, 234, 0.15); color: #667eea; border-left: 2px solid #667eea; }

/* Recurring payment calendar grid */
.custom-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-header {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  text-align: center;
  padding: 4px 0;
}

/* Today highlight in rec payment calendar */
.cal-cell.cal-today {
  background: rgba(0, 212, 168, 0.06);
  border: 1px solid rgba(0, 212, 168, 0.25);
}

/* Countdown Item */
.countdown-item .progress-bar {
  height: 4px;
  background: var(--card-2);
  border-radius: 2px;
  overflow: hidden;
}
.countdown-item .progress-fill { background: var(--accent); transition: width 0.6s ease; }

/* Rec stats bar responsive */
#rec-stats-bar { gap: 12px; margin-bottom: 16px; }
@media (max-width: 900px) {
  #rec-stats-bar { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Rec calendar body scroll — daily view only gets a scroll cap */
#rec-cal-body { overflow-y: auto; }
#rec-cal-body::-webkit-scrollbar { width: 4px; }
#rec-cal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Rec view toggle button active state */
.rec-cal-view-btn { transition: all 0.15s; }

/* Rec table icon */
.rec-row-icon {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Range Slider */
.custom-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* Toggle Switch — duplicate block removed; canonical definition at line 1006 */

/* Chat Prompt Chip */
.chat-prompt-chip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 10px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s;
}
.chat-prompt-chip:hover { border-color: var(--border-accent); color: var(--text); }
.chat-input-wrap:focus-within { border-color: var(--accent) !important; box-shadow: 0 0 8px rgba(0,212,168,0.1); }

.payments-table-card { margin-top: 20px; }
.payments-distrib { margin-top: 10px; }

.payment-row-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.active { background: var(--accent); }
.status-dot.pending { background: var(--warning); }
.status-dot.failed { background: var(--danger); }

.distrib-bar { margin: 8px 0; }
.distrib-label { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 4px; }
.distrib-track { height: 6px; background: var(--card-2); border-radius: 3px; overflow: hidden; }
.distrib-fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width 1s ease; }
.distrib-fill.purple { background: #667eea; }
.distrib-fill.orange { background: var(--warning); }

/* Payment Calendar */
.rec-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 12px;
}

.cal-day-header {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  text-align: center;
  padding: 4px 0;
}

.cal-day {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.cal-day:hover { background: var(--accent-dim); color: var(--accent); }
.cal-day.today { background: var(--accent); color: #0b0f1a; font-weight: 700; }
.cal-day.has-payment::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--danger);
}

.cal-day.empty { pointer-events: none; }

/* Payoff Countdown */
.countdown-item {
  margin-bottom: 14px;
}

.countdown-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.countdown-name { font-size: 12px; font-weight: 600; color: var(--text); }
.countdown-months { font-size: 12px; font-weight: 700; color: var(--accent); }
.countdown-date { font-size: 10px; color: var(--text-3); }
.countdown-progress-track { height: 6px; background: var(--card-2); border-radius: 3px; overflow: hidden; }
.countdown-progress-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), #00f5c8); }

/* Optimization AI Banner */
.optim-banner {
  background: linear-gradient(135deg, var(--card-2), var(--card));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.optim-item { display: flex; flex-direction: column; }
.optim-icon { font-size: 18px; margin-bottom: 6px; }
.optim-title { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.optim-text { font-size: 11px; color: var(--text-2); line-height: 1.5; }
.optim-text .highlight { color: var(--accent); font-weight: 600; }

/* ============================================================
   AI ADVISOR PAGE
   ============================================================ */
.advisor-hero {
  margin-bottom: 24px;
}

/* ============================================================
   AI ADVISOR PAGE
   ============================================================ */
.advisor-layout-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

.advisor-chat-container {
  display: flex;
  flex-direction: column;
  height: 700px;
  padding: 0; /* Override generic card padding */
}

.advisor-chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
}

.chat-msg {
  display: flex;
  gap: 16px;
  max-width: 85%;
}

.chat-msg.user {
  align-self: flex-end;
  justify-content: flex-end;
}

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

.ai-avatar {
  background: rgba(0,212,168,0.1);
  color: var(--accent);
}

.user-avatar-chat {
  background: var(--card-2);
  color: var(--text-3);
  border: 1px solid var(--border);
}

.chat-content {
  display: flex;
  flex-direction: column;
}

.chat-bubble {
  padding: 16px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.6;
}

.ai-bubble {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}

.user-bubble {
  background: var(--accent);
  color: #0b0f1a;
  border-top-right-radius: 4px;
  font-weight: 500;
}

.chat-metric-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 8px;
  font-weight: 800;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.advisor-chat-bottom {
  border-top: 1px solid var(--border);
  padding: 24px 32px;
  background: rgba(11, 15, 26, 0.5);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.advisor-suggestions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.chat-suggestion-chip {
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-suggestion-chip:hover {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--accent);
}

.chat-input-wrapper {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  transition: border 0.3s;
}

.chat-input-wrapper:focus-within {
  border-color: var(--accent);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 0 16px;
}

.advisor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }
.blinking-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

/* ============================================================
   SETTINGS PAGE
   ============================================================ */
.settings-journey-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.settings-journey-card {
  display: flex;
  flex-direction: column;
  padding: 32px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.settings-journey-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.1);
}

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

.sjc-icon-blob {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--card-2);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.02);
}

.sjc-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 12px;
}

.sjc-desc {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 32px;
  flex: 1;
}

.sjc-btn {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 16px;
}

/* ============================================================
   CHART CONTAINERS
   ============================================================ */
.chart-wrap {
  position: relative;
  width: 100%;
}

.chart-wrap canvas { width: 100% !important; display: block; }

/* ============================================================
   CANVAS DONUT
   ============================================================ */
.donut-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.donut-center {
  position: absolute;
  text-align: center;
  pointer-events: none;
}
.donut-val { font-size: 18px; font-weight: 900; color: var(--text); }
.donut-sub { font-size: 9px; color: var(--text-3); text-transform: uppercase; }

.donut-legend { margin-left: 16px; }
.legend-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 11px; color: var(--text-2); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal { animation: slideUp 0.5s ease both; }
.reveal-1 { animation-delay: 0.05s; }
.reveal-2 { animation-delay: 0.1s; }
.reveal-3 { animation-delay: 0.15s; }
.reveal-4 { animation-delay: 0.2s; }
.reveal-5 { animation-delay: 0.25s; }

/* ============================================================
   SCROLLBAR GLOBAL
   ============================================================ */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* ============================================================
   FOOTER
   ============================================================ */
.page-footer {
  text-align: center;
  padding: 20px 0 8px;
  font-size: 10px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

/* ============================================================
   ACTIVITY PAGE (PREMIUM AUDIT TRAIL)
   ============================================================ */
.activity-page-header {
  padding: 32px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.activity-filters {
  display: flex;
  gap: 16px;
}

.activity-log-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 32px;
}

.activity-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  gap: 24px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  animation: cardEntrance 0.6s backwards;
  backdrop-filter: blur(5px);
}

.activity-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.activity-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: transparent;
  transition: background 0.3s;
}

.activity-card.priority-high::before { background: var(--danger); }
.activity-card.type-ai::before { background: var(--accent); }

.activity-card.cleared { opacity: 0.5; filter: grayscale(0.5); }

.activity-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3), inset 0 0 1px 1px rgba(255,255,255,0.1);
}

.activity-card.type-ai .activity-icon-wrap { background: linear-gradient(135deg, rgba(0, 212, 168, 0.2) 0%, rgba(0, 212, 168, 0.05) 100%); color: var(--accent); }
.activity-card.priority-high .activity-icon-wrap { background: linear-gradient(135deg, rgba(255, 77, 109, 0.2) 0%, rgba(255, 77, 109, 0.05) 100%); color: var(--danger); }

.activity-content { flex: 1; }
.activity-meta { display: flex; justify-content: space-between; align-items: start; margin-bottom: 8px; }

.activity-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.activity-date {
  font-size: 11px;
  color: var(--text-4);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.activity-desc {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.7;
  margin-bottom: 16px;
  max-width: 90%;
}

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

/* ============================================================
   NOTIFICATION PANEL (PREMIUM)
   ============================================================ */
.notification-panel {
  position: absolute;
  top: 100%;
  right: 0;
  width: 380px;
  background: rgba(13, 18, 33, 0.94);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  margin-top: 20px;
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.6), 
    inset 0 1px 1px rgba(255, 255, 255, 0.05);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.96);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.notification-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 100px;
  background: linear-gradient(to bottom, rgba(0, 212, 168, 0.05), transparent);
  pointer-events: none;
}

.notification-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.notification-header {
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.notification-header h3 {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.notification-header button {
  background: rgba(0, 212, 168, 0.1);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.2s;
}

.notification-header button:hover {
  background: var(--accent);
  color: #0b0f1a;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.notification-list {
  max-height: 440px;
  overflow-y: auto;
  padding: 8px 0;
}

.notification-list::-webkit-scrollbar { width: 4px; }
.notification-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.notification-item {
  padding: 20px 28px;
  display: flex;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  position: relative;
}

.notification-item:hover {
  background: rgba(255, 255, 255, 0.03);
  padding-left: 32px;
}

.notification-item.unread::after {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.ni-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: var(--card-2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.3);
}

.ni-content {
  flex: 1;
  min-width: 0;
}

.ni-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.ni-text {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.5;
  margin-bottom: 8px;
}

.ni-time {
  font-size: 9px;
  color: var(--text-4);
  font-weight: 600;
}

.notification-footer {
  padding: 14px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.notification-footer a {
  font-size: 11px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 600;
}

.notification-footer a:hover {
  color: var(--accent);
}

/* SEARCH FEEDBACK */
.header-search:focus-within {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 15px rgba(0, 212, 168, 0.1);
}

.header-search:focus-within i {
  color: var(--accent);
}

.footer-links { display: flex; justify-content: center; gap: 16px; margin-top: 6px; }
.footer-link { color: var(--text-3); cursor: pointer; text-transform: uppercase; letter-spacing: 0.06em; font-size: 9px; }
.footer-link:hover { color: var(--accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-right { flex-direction: row; flex-wrap: wrap; }
  .dash-right .card { flex: 1 1 220px; }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 64px; }
  .logo-text, .nav-item span, .user-info, .nav-badge { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .sidebar-logo { padding: 0 16px 20px; }
  .sidebar-user { justify-content: center; }
}

@media (max-width: 768px) {
  .dash-stats-row { grid-template-columns: 1fr 1fr; }
  .obligation-cards { grid-template-columns: 1fr; }
  .advisor-main-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .advisor-hero-grid { grid-template-columns: 1fr; }
  .header-search { display: none; }
  .rec-bottom-grid { grid-template-columns: 1fr; }
  .advisor-title { font-size: 28px; }
}

/* Documents / Vault Styles */
.doc-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  cursor: pointer;
}
.doc-list-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0,212,168,0.05);
}

.btn-dashed {
  background: transparent;
  border: 1px dashed var(--text-3);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-dashed:hover {
  border-color: var(--border-accent);
  color: var(--accent);
  background: rgba(0,212,168,0.05);
}

/* ---------- ADJUSTMENT TEXT INPUTS ---------- */
.adj-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(0, 212, 168, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: border-color var(--transition);
}

.adj-input-wrapper:focus-within {
  border-color: var(--accent);
}

.currency-symbol {
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  margin-right: 2px;
}

.adj-value-input {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  width: 60px;
  outline: none;
  font-family: inherit;
  padding: 0;
}

/* Hide spin buttons */
.adj-value-input::-webkit-outer-spin-button,
.adj-value-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.adj-value-input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* ============================================================
   AI STRATEGIC CHAT UI
   ============================================================ */
.ai-chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #0b0f1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--accent-glow);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
}

.ai-chat-fab:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 12px 32px var(--accent-glow);
}

.ai-chat-fab.active {
  transform: scale(0.8) rotate(-45deg);
  opacity: 0;
  pointer-events: none;
}

.ai-chat-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 48px);
  background: rgba(19, 25, 41, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-accent);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1001;
  overflow: hidden;
}

.ai-chat-panel.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

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

.chat-close {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 20px;
  cursor: pointer;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}

.chat-msg.ai {
  align-self: flex-start;
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #0b0f1a;
  font-weight: 600;
  border-bottom-right-radius: 4px;
}

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.chat-prompts {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.chat-prompt {
  background: var(--card-2);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 10px;
  color: var(--text-2);
  cursor: pointer;
}

.chat-input-wrap {
  display: flex;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
}

.chat-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
}

.chat-input-wrap button {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 18px;
  cursor: pointer;
}

/* ============================================================
   BUDGETS PAGE
   ============================================================ */
.budget-layout-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

.budget-inputs-column { display: flex; flex-direction: column; gap: 24px; }
.budget-analytics-column { position: sticky; top: 24px; }

.param-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.param-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.param-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.param-icon {
  font-size: 24px;
  color: var(--accent);
  background: rgba(0,212,168,0.1);
  padding: 8px;
  border-radius: 8px;
}

.expense-toggle {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
  border: 1px solid var(--border);
}

.expense-toggle span {
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-3);
  transition: all 0.2s;
}

.expense-toggle span.active {
  background: var(--accent);
  color: #0b0f1a;
}
.expense-toggle span:not(.active):hover { color: var(--text); }

.timeline-result-block {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.budget-summary-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

@media (max-width: 900px) {
  .budget-layout-grid { grid-template-columns: 1fr; }
  .budget-analytics-column { position: static; }
}

/* ---------- ADJUSTMENT ITEMS ---------- */
.adjustment-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}

.adjustment-item:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

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

.adj-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.adj-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  background: rgba(0, 212, 168, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
}

.adj-limits {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-3);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ============================================================
   MODAL COMPONENT
   ============================================================ */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(4, 6, 11, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 450px;
  padding: 32px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  transform: translateY(10px);
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalSlideUp {
  to { transform: translateY(0); }
}

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

.modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.modal-close {
  cursor: pointer;
  color: var(--text-3);
  font-size: 20px;
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--danger);
}

/* Modal Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 11px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input, .form-group select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition);
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 32px;
}

/* ── Transactions tab enhancements ── */
.sort-indicator {
  font-size: 10px;
  margin-left: 2px;
  color: var(--accent);
  font-weight: 900;
}

.txn-row:hover { background: var(--card-2) !important; cursor: pointer; }
.txn-row:hover .btn-txn-del { opacity: 1 !important; }

.txn-full-table thead th[data-sort]:hover { color: var(--accent); }
.txn-full-table thead th[data-sort] { transition: color 0.2s; }

/* stats bar responsive */
@media (max-width: 900px) {
  #txn-stats-bar { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 600px) {
  #txn-stats-bar { grid-template-columns: 1fr !important; }
  .txn-filters { flex-direction: column; }
  .txn-search-wrap { max-width: 100% !important; }
}

/* Dropdown portal items */
.txn-dd-item:hover { background: var(--card-2); }

/* Filter adv panel inputs */
#txn-adv-panel input, #txn-adv-panel select {
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  font-family: inherit;
  transition: border-color 0.2s;
}
#txn-adv-panel input:focus, #txn-adv-panel select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Smooth detail panel */
#txn-detail-panel { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* Add transaction modal backdrop */
#txn-add-modal { backdrop-filter: none; }

/* filter-icon-btn active state */
.filter-icon-btn.active {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: var(--accent-dim) !important;
}
/* ── Settings Drawer ───────────────────────────────────── */
#settings-drawer {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
#settings-drawer::-webkit-scrollbar { width: 4px; }
#settings-drawer::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Settings Journey Card hover */
.settings-journey-card {
  transition: border-color 0.2s, box-shadow 0.2s;
}
.settings-journey-card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}

/* Footer links clickable */
.footer-link {
  cursor: pointer;
  transition: color 0.15s;
}
.footer-link:hover { color: var(--accent); }

/* Logout button base */
#btn-settings-logout:hover { opacity: 1 !important; }

/* ==========================================
   ONBOARDING REDESIGN 2.0
   ========================================== */
#onboarding-page {
  background: linear-gradient(135deg, #080d1a 0%, #0a1222 100%) !important;
}
.ob-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  max-width: 1120px;
  margin: 0 auto;
}
.ob-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 48px;
  overflow: hidden;
}
.ob-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 48px;
  border-left: 1px solid rgba(255,255,255,0.05);
}
.ob-glass {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 36px;
}
.ob-3d-wrap { perspective: 900px; }
.ob-3d-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 12px;
  transform: rotateY(-8deg) rotateX(4deg);
  transform-style: preserve-3d;
  animation: ob-float 5s ease-in-out infinite;
  transition: transform 0.3s;
  backdrop-filter: blur(8px);
}
.ob-3d-card:hover { transform: rotateY(-2deg) rotateX(1deg) scale(1.02); }
.ob-3d-card:nth-child(2) { animation-delay: -1.8s; }
.ob-3d-card:nth-child(3) { animation-delay: -3.5s; }
@keyframes ob-float {
  0%,100% { transform: rotateY(-8deg) rotateX(4deg) translateY(0); }
  50%      { transform: rotateY(-5deg) rotateX(2deg) translateY(-8px); }
}
.ob-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
}
.ob-content { position: relative; z-index: 1; }
.ob-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(0,212,168,0.08);
  border: 1px solid rgba(0,212,168,0.25);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 10px;
  font-weight: 700;
  color: #00d4a8;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.ob-ai-dot {
  width: 7px; height: 7px;
  background: #00d4a8;
  border-radius: 50%;
  animation: ob-pulse-dot 2s infinite;
}
@keyframes ob-pulse-dot {
  0%,100% { opacity:1; transform:scale(1); box-shadow:0 0 0 0 rgba(0,212,168,0.4); }
  50%      { opacity:0.6; transform:scale(0.85); box-shadow:0 0 0 5px rgba(0,212,168,0); }
}
.ob-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: #f0f4ff;
  font-size: 14px;
  transition: all 0.2s;
  box-sizing: border-box;
  outline: none;
  font-family: inherit;
}
.ob-input:focus {
  border-color: rgba(0,212,168,0.5);
  background: rgba(0,212,168,0.04);
  box-shadow: 0 0 0 3px rgba(0,212,168,0.1);
}
.ob-input::placeholder { color: rgba(255,255,255,0.25); }
.ob-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.ob-btn {
  width: 100%;
  padding: 15px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  letter-spacing: 0.2px;
  border: none;
}
.ob-btn-primary {
  background: linear-gradient(135deg, #00d4a8, #00b896);
  color: #000;
  box-shadow: 0 4px 20px rgba(0,212,168,0.3);
}
.ob-btn-primary:hover {
  box-shadow: 0 6px 28px rgba(0,212,168,0.5);
  transform: translateY(-1px);
}
.ob-btn-ghost {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: rgba(255,255,255,0.6);
}
.ob-btn-ghost:hover { background: rgba(255,255,255,0.08); color: #fff; }
.ob-back-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  transition: color 0.2s;
}
.ob-back-btn:hover { color: #fff; }
.ob-auth-tabs {
  display: flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 28px;
}
.ob-auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 9px;
  background: none;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.ob-auth-tab.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.3);
}
.ob-source-card {
  padding: 18px 20px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  width: 100%;
  color: #f0f4ff;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 16px;
}
.ob-source-card:hover {
  border-color: rgba(0,212,168,0.4);
  background: rgba(0,212,168,0.05);
  transform: translateX(4px);
}
.ob-source-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}
.ob-step-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 32px;
}
.ob-step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: all 0.3s;
}
.ob-step-dot.active { width: 24px; border-radius: 4px; background: #00d4a8; }
.ob-trust-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}
.ob-upload-zone {
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.ob-upload-zone:hover {
  border-color: rgba(0,212,168,0.4);
  background: rgba(0,212,168,0.03);
}
.ob-security-note {
  background: rgba(0,212,168,0.06);
  border: 1px solid rgba(0,212,168,0.2);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
@media (max-width: 768px) {
  .ob-layout { grid-template-columns: 1fr; }
  .ob-visual { display: none; }
  .ob-form-panel { padding: 32px 20px; border-left: none; }
  .ob-glass { padding: 28px 20px; }
}
