/* ============================================================
   MoneyFlow — Premium Purple Fintech Theme
   app.css
   ============================================================ */

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

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --primary:        #7c3aed;
  --primary-light:  #8b5cf6;
  --primary-dark:   #6d28d9;
  --primary-50:     rgba(124, 58, 237, 0.08);
  --primary-100:    rgba(124, 58, 237, 0.15);
  --primary-200:    rgba(124, 58, 237, 0.25);

  --secondary:      #4f46e5;
  --secondary-light:#6366f1;

  --accent:         #10b981;
  --accent-light:   #34d399;

  --income:         #10b981;
  --income-light:   rgba(16, 185, 129, 0.12);
  --expense:        #ef4444;
  --expense-light:  rgba(239, 68, 68, 0.12);
  --warning:        #f59e0b;
  --info:           #3b82f6;

  --bg:             #0f0d1a;
  --bg-card:        #17132b;
  --bg-card-2:      #1e1a35;
  --bg-input:       #211d3a;
  --bg-hover:       #251f42;

  --border:         rgba(255,255,255,0.07);
  --border-strong:  rgba(255,255,255,0.12);

  --text-primary:   #f1eeff;
  --text-secondary: #a094c7;
  --text-muted:     #6b5fa5;

  --sidebar-width:  260px;
  --topbar-height:  64px;

  --radius-sm:      8px;
  --radius:         12px;
  --radius-lg:      16px;
  --radius-xl:      20px;
  --radius-full:    9999px;

  --shadow-sm:      0 2px 8px rgba(0,0,0,0.25);
  --shadow:         0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg:      0 8px 40px rgba(0,0,0,0.45);
  --shadow-glow:    0 0 30px rgba(124,58,237,0.25);

  --transition:     all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg:             #f8fafc;
  --bg-card:        #ffffff;
  --bg-card-2:      #f1f5f9;
  --bg-input:       #f8fafc;
  --bg-hover:       #f1f5f9;

  --border:         rgba(0,0,0,0.1);
  --border-strong:  rgba(0,0,0,0.2);

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #64748b;
  
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.05);
  --shadow:         0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg:      0 8px 40px rgba(0,0,0,0.12);
}

[data-theme="dark"] {
  --bg:             #0a0a0a;
  --bg-card:        #121212;
  --bg-card-2:      #1a1a1a;
  --bg-input:       #222222;
  --bg-hover:       #2a2a2a;

  --border:         rgba(255,255,255,0.1);
  --border-strong:  rgba(255,255,255,0.2);

  --text-primary:   #ffffff;
  --text-secondary: #a3a3a3;
  --text-muted:     #737373;

  --bs-body-bg: #0a0a0a;
  --bs-body-color: #ffffff;
  --bs-card-bg: #121212;
  --bs-card-cap-bg: #1a1a1a;
  --bs-card-color: #ffffff;
  --bs-table-bg: #121212;
  --bs-table-color: #ffffff;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.06);
  --bs-border-color: rgba(255, 255, 255, 0.1);
  --bs-tertiary-bg: #1a1a1a;
  --bs-secondary-bg: #1a1a1a;
  --bs-modal-bg: #1a1a1a;
}

[data-theme="dark"] .text-dark {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-light,
[data-theme="dark"] .card-header.bg-white,
[data-theme="dark"] .card-footer.bg-white {
  background-color: var(--bg-card) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .table-light,
[data-theme="dark"] .table-light th,
[data-theme="dark"] .table-light td {
  background-color: var(--bg-card-2) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .table,
[data-theme="dark"] .table th,
[data-theme="dark"] .table td {
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .badge.bg-light {
  background-color: var(--bg-hover) !important;
  color: var(--text-secondary) !important;
}

/* ApexCharts Dark Theme Overrides */
[data-theme="dark"] .apexcharts-text tspan,
[data-theme="dark"] .apexcharts-text {
  fill: #e2e8f0 !important;
}
[data-theme="dark"] .apexcharts-legend-text {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .apexcharts-datalabel-label {
  fill: #94a3b8 !important;
}
[data-theme="dark"] .apexcharts-datalabel-value {
  fill: #f8fafc !important;
}

/* ── Base ──────────────────────────────────────────────────── */
*, *::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-primary);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* ── Typography ────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { color: var(--text-primary); font-weight: 700; line-height: 1.3; }
p { color: var(--text-secondary); }
a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-light); }

.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-income  { color: var(--income) !important; }
.text-expense { color: var(--expense) !important; }
.text-primary-app { color: var(--primary-light) !important; }

/* ── Layout Shell ──────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR — Premium MoneyFlow v2
   ═══════════════════════════════════════════════════════════ */

/* ── Sidebar shell ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(
    180deg,
    #110e24 0%,
    #170f2e 30%,
    #1a1035 60%,
    #120d28 100%
  );
  border-right: 1px solid rgba(124, 58, 237, 0.18);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 1000;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(124,58,237,0.3) transparent;
}

/* Ambient glow orbs */
.sidebar::before,
.sidebar::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.sidebar::before {
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(124,58,237,0.18) 0%, transparent 70%);
  top: -60px; left: -80px;
}
.sidebar::after {
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(168,85,247,0.12) 0%, transparent 70%);
  bottom: 80px; right: -60px;
}

.sidebar > * { position: relative; z-index: 1; }

/* ── Brand / Logo ──────────────────────────────────────────── */
.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 13px;
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: #fff;
  box-shadow: 0 4px 18px rgba(124,58,237,0.55),
              inset 0 1px 0 rgba(255,255,255,0.2);
  flex-shrink: 0;
  animation: pulse-glow 3s ease-in-out infinite;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-logo-text {
  font-size: 17px;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #c4b5fd 60%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
  line-height: 1;
}

.sidebar-tagline {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.75;
}

/* ── Navigation ────────────────────────────────────────────── */
.sidebar-nav {
  padding: 14px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(160, 148, 199, 0.45);
  padding: 10px 12px 4px;
  margin-top: 4px;
}

.nav-section-label::before {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124,58,237,0.2));
  display: none;
}

/* ── Nav Links ─────────────────────────────────────────────── */
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 13px;
  border-radius: 10px;
  color: rgba(160, 148, 199, 0.8);
  font-weight: 500;
  font-size: 13.5px;
  transition: background 0.2s ease, color 0.2s ease,
              transform 0.18s ease, box-shadow 0.2s ease;
  margin-bottom: 1px;
  position: relative;
  border: 1px solid transparent;
  text-decoration: none;
}

.nav-link .nav-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  color: rgba(160, 148, 199, 0.6);
}

.nav-link span.nav-label {
  flex: 1;
  line-height: 1;
}

/* Hover state */
.nav-link:hover {
  background: rgba(124, 58, 237, 0.1);
  color: #c4b5fd;
  transform: translateX(3px);
  border-color: rgba(124, 58, 237, 0.12);
  text-decoration: none;
}

.nav-link:hover .nav-icon {
  background: rgba(124, 58, 237, 0.2);
  color: var(--primary-light);
  transform: scale(1.08);
}

/* Active state with glow */
.nav-link.active {
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.22) 0%,
    rgba(168, 85, 247, 0.16) 100%
  );
  color: #e9d5ff;
  border-color: rgba(124, 58, 237, 0.30);
  box-shadow: 0 0 18px rgba(124, 58, 237, 0.20),
              inset 0 1px 0 rgba(255,255,255,0.06);
  font-weight: 600;
  transform: none;
}

.nav-link.active .nav-icon {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 3px 12px rgba(124, 58, 237, 0.5);
}

/* Active indicator bar */
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px;
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--accent) 100%);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.7);
}

/* ── Sidebar Footer / User ─────────────────────────────────── */
.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-user:hover {
  background: rgba(124,58,237,0.1);
  border-color: rgba(124,58,237,0.2);
}

.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(124,58,237,0.4);
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name  { font-size: 12.5px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.sidebar-user-chevron { color: var(--text-muted); font-size: 10px; flex-shrink: 0; }

/* Logout item — subtle red tint on hover */
.nav-link-logout:hover {
  background: rgba(239, 68, 68, 0.08) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.12) !important;
}
.nav-link-logout:hover .nav-icon {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
}

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

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 900;
  backdrop-filter: blur(10px);
}

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

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

.topbar-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.topbar-btn:hover { background: var(--primary-50); color: var(--primary-light); border-color: var(--primary-200); }

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 20px;
  padding: 4px;
}

/* ── Page Content ──────────────────────────────────────────── */
.page-content {
  padding: 28px;
  flex: 1;
}

.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 800;
}

.page-header p { font-size: 14px; margin-top: 4px; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

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

.card-body { padding: 24px; }
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
}

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

/* ── KPI Cards ─────────────────────────────────────────────── */
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-slow);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 0 var(--radius-lg) 0 80%;
  opacity: 0.08;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
  border-color: var(--primary-200);
}

.kpi-card.kpi-primary::before  { background: var(--primary); }
.kpi-card.kpi-income::before   { background: var(--income); }
.kpi-card.kpi-expense::before  { background: var(--expense); }
.kpi-card.kpi-savings::before  { background: var(--accent); }

.kpi-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  margin-bottom: 14px;
}

.kpi-primary  .kpi-icon { background: rgba(124,58,237,0.15); color: var(--primary-light); }
.kpi-income   .kpi-icon { background: var(--income-light);  color: var(--income); }
.kpi-expense  .kpi-icon { background: var(--expense-light); color: var(--expense); }
.kpi-savings  .kpi-icon { background: rgba(168,85,247,0.15); color: var(--accent); }

.kpi-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 6px; }
.kpi-value { font-size: 26px; font-weight: 800; color: var(--text-primary); line-height: 1; margin-bottom: 8px; }
.kpi-change { font-size: 12px; font-weight: 500; }
.kpi-change.up   { color: var(--income); }
.kpi-change.down { color: var(--expense); }
.kpi-change.neutral { color: var(--text-muted); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  border-radius: var(--radius);
  transition: var(--transition);
  display: inline-flex; align-items: center; gap: 7px;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: none;
  outline: none;
  font-size: 13.5px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(124,58,237,0.35);
  padding: 9px 20px;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124,58,237,0.5);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  padding: 9px 20px;
}
.btn-outline:hover { background: var(--primary-50); color: var(--primary-light); border-color: var(--primary-200); }

.btn-danger  { background: rgba(239,68,68,0.15); color: var(--expense); border: 1px solid rgba(239,68,68,0.25); padding: 9px 20px; }
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-success { background: rgba(16,185,129,0.15); color: var(--income); border: 1px solid rgba(16,185,129,0.25); padding: 9px 20px; }
.btn-success:hover { background: rgba(16,185,129,0.25); }

.btn-sm { padding: 6px 14px; font-size: 12.5px; }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-control, .form-select {
  background: var(--bg-input) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius) !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  font-family: 'Inter', sans-serif !important;
  transition: var(--transition) !important;
}

.form-control:focus, .form-select:focus {
  background: var(--bg-hover) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2) !important;
  color: var(--text-primary) !important;
  outline: none !important;
}

.form-control::placeholder { color: var(--text-muted) !important; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }

.input-group-text {
  background: var(--bg-card-2) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--text-muted) !important;
  border-radius: var(--radius) !important;
}

/* ── Tables ────────────────────────────────────────────────── */
.table {
  color: var(--text-primary) !important;
  margin: 0;
}
.table thead th {
  background: var(--bg-card-2) !important;
  color: var(--text-muted) !important;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 16px !important;
  border-color: var(--border) !important;
  white-space: nowrap;
}
.table tbody td {
  padding: 14px 16px !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
  vertical-align: middle;
}
.table tbody tr {
  transition: var(--transition);
}
.table tbody tr:hover { background: var(--primary-50) !important; }

/* ── Badges ────────────────────────────────────────────────── */
.badge-income  { background: var(--income-light);  color: var(--income);  padding: 4px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-expense { background: var(--expense-light); color: var(--expense); padding: 4px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-pill    { border-radius: var(--radius-full); font-size: 11px; font-weight: 700; padding: 3px 10px; }

/* ── Progress ──────────────────────────────────────────────── */
.progress {
  background: var(--bg-input) !important;
  border-radius: var(--radius-full) !important;
  height: 8px !important;
  overflow: hidden;
}
.progress-bar {
  border-radius: var(--radius-full) !important;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  transition: width 0.6s ease !important;
}
.progress-bar.danger { background: linear-gradient(90deg, #ef4444 0%, #f87171 100%) !important; }
.progress-bar.success { background: linear-gradient(90deg, var(--income) 0%, #34d399 100%) !important; }

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius) !important;
  border: 1px solid transparent !important;
  font-size: 13.5px;
  font-weight: 500;
}
.alert-success { background: rgba(16,185,129,0.12) !important; border-color: rgba(16,185,129,0.25) !important; color: #34d399 !important; }
.alert-danger  { background: rgba(239,68,68,0.12)  !important; border-color: rgba(239,68,68,0.25)  !important; color: #f87171 !important; }
.alert-warning { background: rgba(245,158,11,0.12) !important; border-color: rgba(245,158,11,0.25) !important; color: #fbbf24 !important; }
.alert-info    { background: rgba(59,130,246,0.12)  !important; border-color: rgba(59,130,246,0.25)  !important; color: #60a5fa !important; }

.alert .btn-close { filter: invert(0.8); }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-content {
  background: var(--bg-card-2) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-xl) !important;
  color: var(--text-primary) !important;
}
.modal-header {
  border-color: var(--border) !important;
  padding: 20px 24px !important;
}
.modal-body   { padding: 24px !important; }
.modal-footer {
  border-color: var(--border) !important;
  padding: 16px 24px !important;
}
.modal-title { font-weight: 700; font-size: 17px; }
.btn-close   { filter: invert(0.9); }
.modal-backdrop.show { opacity: 0.7 !important; }

/* ── Pagination ────────────────────────────────────────────── */
.pagination { gap: 4px; }
.page-item .page-link {
  background: var(--bg-card-2) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-secondary) !important;
  border-radius: var(--radius) !important;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}
.page-item.active .page-link,
.page-item .page-link:hover {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 2px 10px rgba(124,58,237,0.35) !important;
}

/* ── Category Dot ──────────────────────────────────────────── */
.cat-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.cat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

/* ── Savings Ring ──────────────────────────────────────────── */
.savings-ring {
  position: relative;
  width: 100px; height: 100px;
  flex-shrink: 0;
}

.savings-ring svg { transform: rotate(-90deg); }

.savings-ring-bg   { fill: none; stroke: var(--bg-input); stroke-width: 8; }
.savings-ring-fill { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray 0.8s ease; }

.savings-ring-text {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
}

.savings-ring-text span { font-size: 10px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* ── Health Score Meter ────────────────────────────────────── */
.health-meter { position: relative; width: 140px; height: 70px; margin: 0 auto; }
.health-meter svg { overflow: visible; }

/* ── Calendar (FullCalendar overrides) ─────────────────────── */
.fc {
  font-family: 'Inter', sans-serif !important;
}
.fc-theme-standard .fc-scrollgrid { border-color: var(--border) !important; }
.fc-col-header-cell { background: var(--bg-card-2) !important; }
.fc-col-header-cell-cushion { color: var(--text-muted) !important; font-size: 12px; font-weight: 700; text-transform: uppercase; padding: 10px 8px !important; }
.fc-daygrid-day { background: var(--bg-card) !important; }
.fc-daygrid-day-number { color: var(--text-secondary) !important; font-size: 12px; font-weight: 600; padding: 6px !important; }
.fc-day-today { background: var(--primary-50) !important; }
.fc-day-today .fc-daygrid-day-number { color: var(--primary-light) !important; }
.fc-daygrid-day-bg .fc-bg-event { opacity: 0.4; }
.fc-event { border-radius: 6px !important; border: none !important; font-size: 11px !important; font-weight: 600 !important; padding: 2px 6px !important; }
.fc-toolbar-title { color: var(--text-primary) !important; font-size: 18px !important; font-weight: 800 !important; }
.fc-button { background: var(--bg-card-2) !important; border: 1px solid var(--border-strong) !important; color: var(--text-secondary) !important; border-radius: var(--radius) !important; font-size: 12px !important; font-weight: 600 !important; padding: 6px 14px !important; transition: var(--transition) !important; }
.fc-button:hover, .fc-button-active { background: var(--primary-100) !important; color: var(--primary-light) !important; border-color: var(--primary-200) !important; }
.fc-button:focus { box-shadow: none !important; }
.fc-daygrid-event-dot { display: none !important; }
.fc-list-event { background: transparent !important; }
.fc-list-event:hover td { background: var(--primary-50) !important; }
.fc-list-day-cushion { background: var(--bg-card-2) !important; }
.fc-list-day-text, .fc-list-day-side-text { color: var(--text-secondary) !important; }
td.fc-daygrid-day { border-color: var(--border) !important; }

/* ── ApexCharts ────────────────────────────────────────────── */
.apexcharts-tooltip {
  background: var(--bg-card-2) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  color: var(--text-primary) !important;
}
.apexcharts-tooltip-title {
  background: var(--bg-hover) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
  font-weight: 700 !important;
}
.apexcharts-xaxistooltip { background: var(--bg-card-2) !important; border-color: var(--border) !important; color: var(--text-primary) !important; }
.apexcharts-legend-text { color: var(--text-secondary) !important; font-family: 'Inter', sans-serif !important; }
.apexcharts-gridline { stroke: var(--border) !important; }
.apexcharts-xaxis-label text, .apexcharts-yaxis-label text { fill: var(--text-muted) !important; font-family: 'Inter', sans-serif !important; }

/* ── Auth Layout ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(124,58,237,0.15) 0%, transparent 70%);
  top: -150px; left: -150px;
  pointer-events: none;
}

.auth-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(168,85,247,0.1) 0%, transparent 70%);
  bottom: -100px; right: -100px;
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.4s ease;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  justify-content: center;
}

.auth-logo-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
  box-shadow: 0 4px 20px rgba(124,58,237,0.45);
}

.auth-title { font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.auth-subtitle { font-size: 14px; color: var(--text-muted); text-align: center; margin-bottom: 32px; }

/* ── Utilities ─────────────────────────────────────────────── */
.rounded-app   { border-radius: var(--radius) !important; }
.rounded-lg-app{ border-radius: var(--radius-lg) !important; }
.border-app    { border: 1px solid var(--border) !important; }
.bg-card       { background: var(--bg-card) !important; }
.bg-card-2     { background: var(--bg-card-2) !important; }
.gap-2         { gap: 8px !important; }

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

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 15px rgba(124,58,237,0.3); }
  50%       { box-shadow: 0 0 30px rgba(124,58,237,0.6); }
}

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

.animate-fade-in { animation: fadeIn 0.3s ease; }
.animate-slide   { animation: slideInRight 0.3s ease; }

.kpi-card, .card { animation: fadeInUp 0.4s ease both; }
.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.10s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.20s; }

/* ── Transaction Type Selector ─────────────────────────────── */
.type-selector { display: flex; gap: 8px; }
.type-btn {
  flex: 1; padding: 10px; border-radius: var(--radius);
  border: 2px solid var(--border-strong);
  background: var(--bg-input); color: var(--text-secondary);
  cursor: pointer; font-weight: 700; font-size: 13px; text-align: center;
  transition: var(--transition);
}
.type-btn[data-type="income"].active  { border-color: var(--income); background: var(--income-light); color: var(--income); }
.type-btn[data-type="expense"].active { border-color: var(--expense); background: var(--expense-light); color: var(--expense); }

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i    { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h4   { font-size: 17px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p    { font-size: 13px; }

/* ── Insight Cards ─────────────────────────────────────────── */
.insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: var(--transition);
  animation: fadeInUp 0.4s ease both;
}
.insight-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.insight-icon {
  width: 42px; height: 42px; border-radius: var(--radius); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.insight-card.success .insight-icon { background: var(--income-light);  color: var(--income); }
.insight-card.warning .insight-icon { background: rgba(245,158,11,0.12); color: var(--warning); }
.insight-card.danger  .insight-icon { background: var(--expense-light); color: var(--expense); }
.insight-card.info    .insight-icon { background: rgba(59,130,246,0.12); color: var(--info); }

.insight-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.insight-body  { font-size: 13px; color: var(--text-secondary); }

/* ── Dropdown ──────────────────────────────────────────────── */
.dropdown-menu {
  background: var(--bg-card-2) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-lg) !important;
  padding: 8px !important;
  box-shadow: var(--shadow-lg) !important;
}
.dropdown-item {
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
  font-size: 13.5px;
  padding: 8px 14px !important;
  transition: var(--transition) !important;
}
.dropdown-item:hover { background: var(--primary-50) !important; color: var(--primary-light) !important; }
.dropdown-divider { border-color: var(--border) !important; }

/* ── Sidebar Overlay (mobile) ──────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.25s ease;
}
.sidebar-overlay.show { display: block; animation: fadeIn 0.25s ease; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    left: calc(-1 * var(--sidebar-width));
    box-shadow: none;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease;
  }
  .sidebar.open {
    left: 0;
    box-shadow: 8px 0 40px rgba(0,0,0,0.5),
                0 0 60px rgba(124,58,237,0.15);
  }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .kpi-value { font-size: 20px; }
  .auth-card { padding: 28px 20px; margin: 16px; }
}

@media (max-width: 576px) {
  .topbar-title { font-size: 15px; }
  .page-header h1 { font-size: 20px; }
}

/* ── Color picker input ─────────────────────────────────────── */
input[type="color"] {
  width: 44px; height: 40px; padding: 2px 4px;
  border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: var(--bg-input); cursor: pointer;
}

/* ── Tab Nav (Bootstrap, scoped to main content) ────────────── */
.main-content .nav-tabs { border-color: var(--border) !important; }
.main-content .nav-tabs .nav-link {
  color: var(--text-muted) !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  font-weight: 600; font-size: 13.5px;
  padding: 10px 16px !important;
  transition: var(--transition) !important;
  background: transparent !important;
  transform: none !important;
  box-shadow: none !important;
}
.main-content .nav-tabs .nav-link:hover {
  color: var(--text-primary) !important;
  background: transparent !important;
  transform: none !important;
}
.main-content .nav-tabs .nav-link.active {
  color: var(--primary-light) !important;
  border-bottom-color: var(--primary) !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* ── Number input arrows hide ──────────────────────────────── */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* ════════════════════════════════════════════════════════════
   DASHBOARD — Premium Homepage
   ════════════════════════════════════════════════════════════ */

/* ── Dashboard Header ──────────────────────────────────────── */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.dash-header-left { flex: 1; min-width: 0; }
.dash-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Welcome row */
.dash-welcome-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dash-avatar-lg {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; color: #fff;
  box-shadow: 0 4px 16px rgba(124,58,237,0.45);
  flex-shrink: 0;
}

.dash-welcome-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.dash-welcome-name {
  background: linear-gradient(135deg, #fff 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dash-welcome-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 3px 0 0;
}

/* ── Date Range Selector ───────────────────────────────────── */
.dash-range-selector {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: var(--bg-card-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
  user-select: none;
}

.dash-range-selector:hover {
  background: var(--primary-50);
  border-color: var(--primary-200);
  color: var(--primary-light);
}

.dash-range-selector i:first-child {
  color: var(--primary-light);
  font-size: 13px;
}

.dash-range-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 6px;
  min-width: 170px;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  animation: fadeInUp 0.15s ease;
}

.dash-range-dropdown.show { display: block; }

.dash-range-option {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.dash-range-option:hover { background: var(--primary-50); color: var(--primary-light); }
.dash-range-option.active {
  background: var(--primary-100);
  color: var(--primary-light);
  font-weight: 700;
}

/* ── Icon button (notifications) ──────────────────────────── */
.dash-icon-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  background: var(--bg-card-2);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  flex-shrink: 0;
}

.dash-icon-btn:hover {
  background: var(--primary-50);
  color: var(--primary-light);
  border-color: var(--primary-200);
}

.dash-notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--expense);
  border: 1px solid var(--bg-card-2);
  animation: pulse-glow 2s infinite;
}

/* ── Notification Panel ────────────────────────────────────── */
.dash-notif-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: var(--bg-card-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 600;
  animation: fadeInUp 0.18s ease;
  overflow: hidden;
}

.dash-notif-panel.show { display: block; }

.dash-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.dash-notif-count {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.dash-notif-list { max-height: 260px; overflow-y: auto; }

.dash-notif-item {
  display: flex;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.dash-notif-item:hover { background: var(--primary-50); }

.dash-notif-icon {
  width: 34px; height: 34px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.dash-notif-body { flex: 1; min-width: 0; }
.dash-notif-title { font-size: 12.5px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.dash-notif-text  { font-size: 11.5px; color: var(--text-secondary); line-height: 1.4; }

.dash-notif-empty {
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
}

.dash-notif-empty i { font-size: 28px; margin-bottom: 8px; color: var(--income); opacity: 0.6; }
.dash-notif-empty p { font-size: 13px; margin: 0; }

.dash-notif-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  text-align: right;
}

.dash-notif-footer a {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-light);
}

/* ── Profile Button ────────────────────────────────────────── */
.dash-profile {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 5px;
  background: var(--bg-card-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  user-select: none;
}

.dash-profile:hover {
  background: var(--primary-50);
  border-color: var(--primary-200);
}

.dash-profile-avatar {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; color: #fff;
  flex-shrink: 0;
}

.dash-profile-avatar-lg {
  width: 40px; height: 40px;
  border-radius: 10px;
  font-size: 16px;
}

.dash-profile-name { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1; }
.dash-profile-role { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }

.dash-profile-chevron {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

/* ── Profile Dropdown ──────────────────────────────────────── */
.dash-profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: var(--bg-card-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 600;
  overflow: hidden;
  animation: fadeInUp 0.18s ease;
}

.dash-profile-dropdown.show { display: block; }

.dash-profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.dash-profile-dropdown-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.dash-profile-dropdown-email { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.dash-profile-dropdown-divider { height: 1px; background: var(--border); margin: 2px 0; }

.dash-profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  text-decoration: none;
}

.dash-profile-dropdown-item:hover {
  background: var(--primary-50);
  color: var(--primary-light);
}

.dash-profile-dropdown-item i { width: 16px; text-align: center; }

.dash-profile-logout { color: var(--expense) !important; }
.dash-profile-logout:hover { background: rgba(239,68,68,0.08) !important; color: #f87171 !important; }

/* ── Dashboard Badge (trend indicator) ─────────────────────── */
.dash-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
}

.dash-badge-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════
   KPI CARDS — Premium 4-column grid
   ══════════════════════════════════════════════════════════════ */

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.dash-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 14px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  animation: fadeInUp 0.45s ease both;
}

.dash-kpi-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}

/* Glow ambient layer */
.dash-kpi-glow {
  position: absolute;
  bottom: -30px; right: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.dash-kpi-card:hover .dash-kpi-glow { opacity: 1; }

.dash-kpi-glow-expense { background: radial-gradient(circle, rgba(239,68,68,0.18) 0%, transparent 70%); }
.dash-kpi-glow-income  { background: radial-gradient(circle, rgba(16,185,129,0.18) 0%, transparent 70%); }
.dash-kpi-glow-savings { background: radial-gradient(circle, rgba(59,130,246,0.18) 0%, transparent 70%); }
.dash-kpi-glow-budget  { background: radial-gradient(circle, rgba(124,58,237,0.18) 0%, transparent 70%); }

/* Card hover border tints */
.dash-kpi-expense:hover { box-shadow: 0 8px 32px rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.25); }
.dash-kpi-income:hover  { box-shadow: 0 8px 32px rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.25); }
.dash-kpi-savings:hover { box-shadow: 0 8px 32px rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.25); }
.dash-kpi-budget:hover  { box-shadow: 0 8px 32px rgba(124,58,237,0.14); border-color: var(--primary-200); }

/* Top section */
.dash-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.dash-kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.dash-kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.dash-kpi-compare {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Icon */
.dash-kpi-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.dash-kpi-card:hover .dash-kpi-icon { transform: scale(1.1) rotate(-3deg); }

.dash-kpi-icon-expense { background: var(--expense-light);         color: var(--expense); }
.dash-kpi-icon-income  { background: var(--income-light);          color: var(--income); }
.dash-kpi-icon-savings { background: rgba(59,130,246,0.12);        color: var(--info); }
.dash-kpi-icon-budget  { background: rgba(124,58,237,0.12);        color: var(--primary-light); }

/* Sparkline area */
.dash-kpi-spark {
  margin: 8px -6px 0;
  height: 50px;
}

/* Footer */
.dash-kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.dash-kpi-footer-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dash-kpi-footer-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* Budget progress bar in card footer */
.dash-budget-bar-wrap {
  flex: 1;
  height: 5px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-right: 10px;
}

.dash-budget-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-kpi-value { font-size: 24px; }
}

@media (max-width: 768px) {
  .dash-header { flex-direction: column; align-items: flex-start; }
  .dash-header-right { width: 100%; justify-content: flex-end; }
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .dash-kpi-value { font-size: 22px; }
  .dash-kpi-card { padding: 16px 16px 12px; }
  .dash-welcome-title { font-size: 17px; }
  .dash-avatar-lg { width: 40px; height: 40px; font-size: 16px; }
  .dash-range-selector { font-size: 12px; padding: 7px 10px; }
  .dash-notif-panel { width: 300px; right: -60px; }
  .dash-profile-dropdown { right: -40px; }
}

@media (max-width: 480px) {
  .dash-kpi-grid { grid-template-columns: 1fr; }
  .dash-kpi-value { font-size: 26px; }
  .dash-notif-panel { width: 280px; right: -100px; }
}

/* ════════════════════════════════════════════════════════════
   ANALYTICS / REPORTS PAGE
   ════════════════════════════════════════════════════════════ */

/* ── Hero Header ───────────────────────────────────────────── */
.analytics-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.analytics-hero-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.analytics-hero-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
  box-shadow: 0 4px 18px rgba(124,58,237,0.45);
  flex-shrink: 0;
}

.analytics-hero-title {
  font-size: 26px;
  font-weight: 800;
  margin: 0;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.analytics-hero-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 3px 0 0;
}

.analytics-hero-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Year filter ──────────────────────────────────────────── */
.analytics-filter-form { display: flex; align-items: center; gap: 8px; }
.analytics-filter-group { display: flex; flex-direction: column; gap: 3px; }
.analytics-filter-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }

.analytics-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.analytics-select {
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-card-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 34px 7px 12px;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.analytics-select:hover,
.analytics-select:focus {
  border-color: var(--primary-200);
  background: var(--primary-50);
}

.analytics-select-wrap i {
  position: absolute;
  right: 10px;
  font-size: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Summary Strip ─────────────────────────────────────────── */
.analytics-strip {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 28px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.analytics-strip-item {
  flex: 1;
  min-width: 120px;
  text-align: center;
}

.analytics-strip-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.analytics-strip-val {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1;
}

.analytics-strip-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 8px;
}

/* ── Layout Grids ──────────────────────────────────────────── */
.analytics-main-row {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.analytics-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ── Widget Card Base ──────────────────────────────────────── */
.analytics-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.analytics-widget:hover {
  border-color: var(--border-strong);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.analytics-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}

.analytics-widget-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.analytics-widget-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

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

.analytics-widget-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.analytics-widget-badge {
  background: var(--primary-100);
  color: var(--primary-light);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
}

/* ── Doughnut Chart ─────────────────────────────────────────── */
.analytics-donut-wrap {
  position: relative;
  padding: 8px 22px 0;
}

.analytics-donut-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  margin-top: 4px;
}

.analytics-donut-center-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.analytics-donut-center-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  margin: 2px 0;
}

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

/* ── Doughnut Legend ─────────────────────────────────────────── */
.analytics-legend {
  padding: 12px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analytics-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.analytics-legend-left {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
}

.analytics-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.analytics-legend-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-legend-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.analytics-legend-pct {
  font-size: 12px;
  font-weight: 800;
  min-width: 38px;
  text-align: right;
}

.analytics-legend-amt {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 72px;
  text-align: right;
}

.analytics-legend-bar-wrap {
  width: 60px;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.analytics-legend-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

/* ── Trend Chart Tabs ───────────────────────────────────────── */
.analytics-chart-tabs {
  display: flex;
  gap: 4px;
  padding: 14px 22px 0;
}

.analytics-tab {
  padding: 6px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.analytics-tab:hover {
  background: var(--primary-50);
  color: var(--primary-light);
  border-color: var(--primary-200);
}

.analytics-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(124,58,237,0.35);
}

.analytics-trend-chart {
  padding: 8px 10px 4px;
  flex: 1;
}

/* ── Trend compare badge ────────────────────────────────────── */
.analytics-trend-compare {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.analytics-trend-compare-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.analytics-trend-compare-val {
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── Trend Stats Footer ─────────────────────────────────────── */
.analytics-trend-footer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  border-top: 1px solid var(--border);
  background: var(--border);
  margin-top: auto;
}

.analytics-trend-stat {
  background: var(--bg-card);
  padding: 14px 16px;
  text-align: center;
}

.analytics-trend-stat-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.analytics-trend-stat-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

/* ── Bar Chart Legend ───────────────────────────────────────── */
.analytics-bar-legend {
  display: flex;
  gap: 14px;
}

.analytics-bar-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.analytics-bar-legend-item span {
  width: 10px; height: 10px;
  border-radius: 3px;
  display: inline-block;
}

/* ── Category Table ─────────────────────────────────────────── */
.analytics-cat-table {
  display: flex;
  flex-direction: column;
}

.analytics-cat-table-head {
  display: grid;
  grid-template-columns: 1fr 90px 100px 130px;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-card-2);
  border-bottom: 1px solid var(--border);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.analytics-cat-table-row {
  display: grid;
  grid-template-columns: 1fr 90px 100px 130px;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.analytics-cat-table-row:last-child { border-bottom: none; }
.analytics-cat-table-row:hover { background: var(--primary-50); }

.analytics-cat-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
}

.analytics-cat-name span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-cat-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.analytics-cat-amt {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--expense);
  text-align: right;
}

.analytics-cat-share {
  display: flex;
  align-items: center;
  gap: 8px;
}

.analytics-cat-pct {
  font-size: 12px;
  font-weight: 800;
  min-width: 36px;
  text-align: right;
}

.analytics-cat-mini-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .analytics-main-row { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .analytics-bottom-row { grid-template-columns: 1fr; }
  .analytics-cat-table-head,
  .analytics-cat-table-row { grid-template-columns: 1fr 80px 90px; }
  .analytics-cat-share { display: none; }
}

@media (max-width: 768px) {
  .analytics-hero { flex-direction: column; align-items: flex-start; }
  .analytics-hero-right { width: 100%; }
  .analytics-strip { flex-wrap: wrap; gap: 14px; padding: 14px 16px; }
  .analytics-strip-divider { display: none; }
  .analytics-strip-item { flex: 1; min-width: 120px; }
  .analytics-trend-footer { grid-template-columns: repeat(2, 1fr); }
  .analytics-legend-bar-wrap { display: none; }
  .analytics-legend-amt { min-width: 60px; font-size: 11px; }
}

@media (max-width: 480px) {
  .analytics-strip-val { font-size: 18px; }
  .analytics-widget-header { padding: 14px 16px; }
  .analytics-legend { padding: 10px 16px 16px; }
}

/* ════════════════════════════════════════════════════════════
   BUDGET MANAGEMENT MODULE
   ════════════════════════════════════════════════════════════ */

/* ── Page Header ─────────────────────────────────────────────── */
.bud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.bud-header-left { display: flex; align-items: center; gap: 15px; }
.bud-header-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
  box-shadow: 0 4px 16px rgba(245,158,11,0.4);
  flex-shrink: 0;
}
.bud-header-title {
  font-size: 24px; font-weight: 800; margin: 0;
  background: linear-gradient(135deg, #fff 0%, var(--accent-light) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.bud-header-sub { font-size: 13px; color: var(--text-muted); margin: 3px 0 0; }
.bud-header-right { display: flex; align-items: center; gap: 10px; }

/* ── Month Navigator ─────────────────────────────────────────── */
.bud-month-nav {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 20px; margin-bottom: 20px;
}
.bud-month-arrow {
  width: 34px; height: 34px; border-radius: var(--radius);
  background: var(--bg-card-2); border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); cursor: pointer; transition: var(--transition);
  text-decoration: none; flex-shrink: 0;
}
.bud-month-arrow:hover { background: var(--primary-50); color: var(--primary-light); border-color: var(--primary-200); }
.bud-month-arrow-disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.bud-month-form { display: flex; align-items: center; gap: 10px; flex: 1; }
.bud-month-selects { display: flex; gap: 8px; }
.bud-month-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 15px; font-weight: 700; color: var(--text-primary); margin-left: 4px;
}

/* ── Summary Strip ───────────────────────────────────────────── */
.bud-summary-strip {
  display: flex; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 28px;
  margin-bottom: 24px; overflow-x: auto;
}
.bud-summary-divider { width: 1px; height: 48px; background: var(--border); flex-shrink: 0; margin: 0 24px; }

/* ── Radial Gauge ────────────────────────────────────────────── */
.bud-summary-gauge { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.bud-gauge-ring { position: relative; width: 80px; height: 80px; flex-shrink: 0; }
.bud-gauge-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.bud-gauge-track { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 8; }
.bud-gauge-fill { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray 1.2s cubic-bezier(0.4,0,0.2,1); }
.bud-gauge-fill-healthy { stroke: var(--income); filter: drop-shadow(0 0 4px rgba(16,185,129,0.5)); }
.bud-gauge-fill-warning { stroke: var(--warning); filter: drop-shadow(0 0 4px rgba(245,158,11,0.5)); }
.bud-gauge-fill-danger  { stroke: var(--expense); filter: drop-shadow(0 0 4px rgba(239,68,68,0.5)); }
.bud-gauge-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.bud-gauge-pct { font-size: 15px; font-weight: 800; line-height: 1; }
.bud-gauge-label { font-size: 9px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 1px; }
.bud-gauge-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.bud-gauge-month { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.bud-gauge-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: var(--radius-full); }
.bud-status-healthy { background: var(--income-light); color: var(--income); }
.bud-status-warning { background: rgba(245,158,11,0.12); color: var(--warning); }
.bud-status-danger  { background: var(--expense-light); color: var(--expense); }

/* ── KPI Cells ───────────────────────────────────────────────── */
.bud-kpi-cell { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 140px; }
.bud-kpi-cell-icon { width: 44px; height: 44px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.bud-kpi-cell-val { font-size: 20px; font-weight: 800; color: var(--text-primary); line-height: 1; margin-bottom: 3px; letter-spacing: -0.4px; }
.bud-kpi-cell-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   BUDGET CARD GRID
   ══════════════════════════════════════════════════════════════ */
.bud-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 24px; }

.bud-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column; position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  animation: fadeInUp 0.4s ease both;
}
.bud-card:hover { transform: translateY(-4px); }
.bud-card-healthy:hover { box-shadow: 0 8px 32px rgba(16,185,129,0.15);  border-color: rgba(16,185,129,0.3); }
.bud-card-warning:hover { box-shadow: 0 8px 32px rgba(245,158,11,0.15);  border-color: rgba(245,158,11,0.3); }
.bud-card-danger:hover  { box-shadow: 0 8px 32px rgba(239,68,68,0.15);   border-color: rgba(239,68,68,0.3); }

/* Top ribbon */
.bud-card-ribbon { height: 3px; width: 100%; flex-shrink: 0; }
.bud-ribbon-healthy { background: linear-gradient(90deg, var(--income), #34d399); }
.bud-ribbon-warning { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.bud-ribbon-danger  { background: linear-gradient(90deg, var(--expense), #f87171); }

/* Card header */
.bud-card-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; gap: 10px; }
.bud-card-cat { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bud-card-cat-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  flex-shrink: 0; transition: transform 0.25s ease;
}
.bud-card:hover .bud-card-cat-icon { transform: scale(1.08) rotate(-4deg); }
.bud-card-cat-name { font-size: 15px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bud-card-cat-period { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.bud-status-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-full); white-space: nowrap; flex-shrink: 0; }

/* Metrics row */
.bud-card-metrics { display: flex; align-items: stretch; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0 0 16px; }
.bud-metric { flex: 1; padding: 14px 16px; text-align: center; }
.bud-metric-divider { width: 1px; background: var(--border); flex-shrink: 0; }
.bud-metric-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 5px; }
.bud-metric-val { font-size: 16px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.3px; }

/* Progress bar */
.bud-card-progress-wrap { padding: 0 20px 14px; }
.bud-progress-labels { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.bud-progress-label-left, .bud-progress-label-right { font-size: 10px; color: var(--text-muted); font-weight: 600; }
.bud-progress-pct { font-size: 13px; font-weight: 800; }
.bud-progress-track { height: 10px; background: rgba(255,255,255,0.06); border-radius: var(--radius-full); overflow: visible; position: relative; }
.bud-progress-fill { height: 100%; border-radius: var(--radius-full); transition: width 1s cubic-bezier(0.4,0,0.2,1); position: relative; }
.bud-progress-fill::after {
  content: ''; position: absolute; top: 0; right: 0; width: 20px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  border-radius: var(--radius-full); animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-20px); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateX(20px); opacity: 0; }
}
.bud-progress-success { background: linear-gradient(90deg, #10b981, #34d399); }
.bud-progress-warn    { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bud-progress-danger  { background: linear-gradient(90deg, #ef4444, #f87171); }

/* Threshold markers */
.bud-progress-marker { position: absolute; top: -3px; width: 2px; height: 16px; border-radius: 2px; transform: translateX(-50%); pointer-events: none; }
.bud-marker-warn   { background: rgba(245,158,11,0.6); }
.bud-marker-danger { background: rgba(239,68,68,0.6); }

/* Overage label */
.bud-overage-label { display: flex; align-items: center; gap: 5px; margin-top: 7px; font-size: 11.5px; font-weight: 700; color: var(--expense); }

/* Card actions */
.bud-card-spark { height: 40px; margin: 0 8px 4px; }
.bud-card-actions { display: flex; gap: 8px; padding: 12px 16px 14px; border-top: 1px solid var(--border); margin-top: auto; }
.bud-action-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 12px; border-radius: var(--radius); font-family: 'Inter', sans-serif;
  font-size: 12.5px; font-weight: 600; cursor: pointer; transition: var(--transition);
  border: 1px solid transparent; background: none;
}
.bud-action-edit   { background: rgba(124,58,237,0.08); color: var(--primary-light); border-color: rgba(124,58,237,0.15); }
.bud-action-edit:hover { background: rgba(124,58,237,0.18); border-color: rgba(124,58,237,0.3); }
.bud-action-delete { background: rgba(239,68,68,0.08); color: var(--expense); border-color: rgba(239,68,68,0.15); }
.bud-action-delete:hover { background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.3); }

/* Add CTA tile */
.bud-card-add {
  background: var(--bg-card); border: 2px dashed rgba(124,58,237,0.2);
  border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition); min-height: 200px;
  animation: fadeInUp 0.4s ease both;
}
.bud-card-add:hover { border-color: rgba(124,58,237,0.5); background: rgba(124,58,237,0.04); }
.bud-card-add-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px; }
.bud-card-add-icon {
  width: 52px; height: 52px; border-radius: var(--radius-lg);
  background: rgba(124,58,237,0.1); border: 2px dashed rgba(124,58,237,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--primary-light); transition: var(--transition);
}
.bud-card-add:hover .bud-card-add-icon { background: rgba(124,58,237,0.2); transform: scale(1.08); }
.bud-card-add-title { font-size: 15px; font-weight: 700; color: var(--primary-light); }
.bud-card-add-sub { font-size: 12px; color: var(--text-muted); }

/* Empty state */
.bud-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 24px; text-align: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.bud-empty-icon { width: 80px; height: 80px; border-radius: var(--radius-xl); background: rgba(245,158,11,0.1); display: flex; align-items: center; justify-content: center; font-size: 34px; color: var(--warning); margin-bottom: 20px; animation: pulse-glow 3s ease-in-out infinite; }
.bud-empty-title { font-size: 20px; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; }
.bud-empty-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; max-width: 340px; }

/* ════════════════════════════════════════════════════════════
   CUSTOM MODALS
   ════════════════════════════════════════════════════════════ */
.bud-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 20px;
}
.bud-modal-overlay.show { display: flex; animation: fadeIn 0.2s ease; }
.bud-modal {
  background: var(--bg-card-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl); width: 100%; max-width: 520px; max-height: 90vh;
  overflow-y: auto; box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  animation: fadeInUp 0.25s ease;
}
.bud-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 18px; border-bottom: 1px solid var(--border); }
.bud-modal-title-group { display: flex; align-items: center; gap: 14px; }
.bud-modal-icon { width: 44px; height: 44px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; flex-shrink: 0; }
.bud-modal-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.bud-modal-sub   { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.bud-modal-close {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--bg-card); color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 13px; transition: var(--transition);
}
.bud-modal-close:hover { background: rgba(239,68,68,0.1); color: var(--expense); border-color: rgba(239,68,68,0.25); }
.bud-modal-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 20px; }
.bud-modal-footer { display: flex; gap: 10px; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--border); margin-top: 4px; }

/* Form elements */
.bud-form-group { display: flex; flex-direction: column; gap: 8px; }
.bud-form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bud-form-label { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }

/* Category chips */
.bud-cat-picker { display: flex; flex-wrap: wrap; gap: 8px; max-height: 160px; overflow-y: auto; padding: 4px 2px; }
.bud-cat-option input[type="radio"] { display: none; }
.bud-cat-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px;
  border-radius: var(--radius-full); border: 1px solid var(--border-strong);
  background: var(--bg-card); color: var(--text-secondary); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition); user-select: none;
}
.bud-cat-chip:hover { border-color: var(--primary-200); color: var(--primary-light); background: var(--primary-50); }
.bud-cat-option input:checked + .bud-cat-chip {
  background: linear-gradient(135deg, var(--primary-100), rgba(168,85,247,0.15));
  border-color: var(--primary-200); color: var(--primary-light);
  box-shadow: 0 0 10px rgba(124,58,237,0.2);
}
.bud-cat-chip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Amount input */
.bud-amount-input-wrap { position: relative; display: flex; align-items: center; }
.bud-amount-prefix {
  position: absolute; left: 10px; font-size: 14px; font-weight: 800;
  color: #a78bfa; background: rgba(124, 58, 237, 0.18);
  padding: 4px 8px; border-radius: 6px; pointer-events: none; z-index: 2;
  border: 1px solid rgba(124, 58, 237, 0.3);
}
.bud-amount-input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border-strong);
  border-radius: var(--radius); color: var(--text-primary); font-family: 'Inter', sans-serif;
  font-size: 22px; font-weight: 800; padding: 14px 16px 14px 72px; outline: none;
  transition: var(--transition); letter-spacing: -0.3px;
}
.bud-amount-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,0.18); background: var(--bg-hover); }
.bud-amount-preview { font-size: 12px; color: var(--text-muted); font-weight: 600; min-height: 16px; }
.bud-edit-preview-card { background: var(--bg-input); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 12px 16px; }
.bud-edit-preview-label { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1100px) { .bud-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
  .bud-header { flex-direction: column; align-items: flex-start; }
  .bud-header-right { width: 100%; }
  .bud-grid { grid-template-columns: 1fr; }
  .bud-summary-strip { flex-direction: column; align-items: flex-start; gap: 16px; padding: 16px 20px; }
  .bud-summary-divider { width: 100%; height: 1px; margin: 0; }
  .bud-summary-gauge { width: 100%; }
  .bud-month-nav { flex-wrap: wrap; gap: 8px; }
  .bud-form-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .bud-card-metrics { flex-direction: column; }
  .bud-metric-divider { width: 100%; height: 1px; }
  .bud-card-actions { flex-direction: column; }
}

/* ════════════════════════════════════════════════════════════
   TRANSACTIONS MANAGEMENT (ENTERPRISE UI)
   ════════════════════════════════════════════════════════════ */

/* ── Filter Card ─────────────────────────────────────────────── */
.tx-filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

.tx-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.tx-filter-group {
  position: relative;
  flex: 1;
  min-width: 140px;
}

.tx-filter-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.tx-filter-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px 8px 34px;
  outline: none;
  transition: var(--transition);
  appearance: none; /* For selects */
}

/* Add dropdown arrow for selects manually if needed, or rely on native */
select.tx-filter-input {
  cursor: pointer;
}

.tx-filter-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

/* ── Enterprise Table Card ───────────────────────────────────── */
.tx-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.tx-card-body {
  padding: 0;
}

.tx-table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tx-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
}

.tx-table th {
  background: var(--bg-card-2);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.tx-table td {
  padding: 16px 20px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  transition: background 0.15s ease;
}

.tx-table tr:hover td {
  background: var(--bg-hover);
}

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

/* ── Cells & Typography ──────────────────────────────────────── */
.tx-cell-date { white-space: nowrap; }
.tx-date-main { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.tx-date-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.tx-cell-desc { min-width: 220px; }
.tx-desc-main { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.tx-desc-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Category */
.tx-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card-2);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.tx-cat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

.tx-cat-un {
  font-size: 12px; color: var(--text-muted); font-style: italic;
}

/* Payment Method */
.tx-cell-method {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.tx-method-icon {
  color: var(--text-muted);
  margin-right: 6px;
  font-size: 14px;
  vertical-align: middle;
}

/* Status Badges */
.tx-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tx-status-success { background: var(--income-light); color: var(--income); }
.tx-status-warn    { background: rgba(245,158,11,0.12); color: var(--warning); }
.tx-status-danger  { background: var(--expense-light); color: var(--expense); }

/* Amount */
.tx-cell-amount {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: -0.3px;
}

.tx-income { color: var(--income); }
.tx-expense { color: var(--expense); }

/* Actions */
.tx-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.tx-action-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-card-2);
}

.tx-action-edit { color: var(--primary-light); }
.tx-action-edit:hover { background: rgba(124,58,237,0.1); color: var(--primary-light); border-color: rgba(124,58,237,0.2); }

.tx-action-delete { color: var(--expense); }
.tx-action-delete:hover { background: rgba(239,68,68,0.1); color: var(--expense); border-color: rgba(239,68,68,0.2); }

/* ── Pagination ──────────────────────────────────────────────── */
.tx-pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-card-2);
  flex-wrap: wrap;
  gap: 16px;
}

.tx-pagination-info {
  font-size: 13px;
  color: var(--text-muted);
}

.tx-pagination-info strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Empty State */
.tx-empty-icon {
  width: 70px; height: 70px;
  border-radius: var(--radius-lg);
  background: rgba(124,58,237,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--primary-light);
  margin-bottom: 20px;
}

/* Print Utilities */
@media print {
  body { background: #fff; color: #000; }
  .sidebar, .topbar, .tx-no-print { display: none !important; }
  .main-content { margin-left: 0 !important; padding: 0 !important; }
  .tx-card { border: none; box-shadow: none; }
  .tx-table th, .tx-table td { border-bottom: 1px solid #ddd; }
  .tx-cat-badge, .tx-status-badge { border: 1px solid #ccc; background: transparent !important; }
}

/* ════════════════════════════════════════════════════════════
   CATEGORIES MANAGEMENT (CARD UI)
   ════════════════════════════════════════════════════════════ */

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

@media (max-width: 1200px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

@media (max-width: 576px) {
  .cat-grid { grid-template-columns: 1fr; }
}

/* Card Container */
.cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

/* Header Section */
.cat-card-header {
  display: flex;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.cat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-right: 16px;
  flex-shrink: 0;
}

.cat-title-wrap {
  flex-grow: 1;
  min-width: 0; /* Prevents overflow */
}

.cat-title {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-type-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 6px;
}

.cat-type-badge.expense { background: var(--expense-light); color: var(--expense); }
.cat-type-badge.income { background: var(--income-light); color: var(--income); }

.cat-actions-menu {
  margin-left: 8px;
}

.cat-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.cat-action-btn:hover, .cat-action-btn:focus {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Body Section */
.cat-card-body {
  padding: 20px;
  flex-grow: 1;
}

/* Circular Progress Container */
.cat-progress-container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.cat-progress-circle {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.cat-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg); /* Start at top */
}

.cat-bg-circle {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}

.cat-fg-circle {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-out, stroke 0.3s ease;
}

.cat-progress-text {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.cat-progress-text span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 2px;
}

/* Status Colors for Progress */
.cat-fg-circle.status-success { stroke: #22C55E; }
.cat-fg-circle.status-warning { stroke: #F59E0B; }
.cat-fg-circle.status-danger  { stroke: #EF4444; }
.cat-fg-circle.status-danger-dark { stroke: #991B1B; } /* Dark red for over 100% */

.cat-progress-text.status-success { color: #22C55E; }
.cat-progress-text.status-warning { color: #F59E0B; }
.cat-progress-text.status-danger  { color: #EF4444; }
.cat-progress-text.status-danger-dark { color: #991B1B; }

/* Stats Display */
.cat-stats {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.cat-stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

.cat-stat-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

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

.text-expense { color: var(--expense) !important; }
.text-income { color: var(--income) !important; }

/* Overbudget Alert */
.cat-overbudget-alert {
  background: rgba(153, 27, 27, 0.1);
  color: #991B1B;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(153, 27, 27, 0.2);
}

/* Income layout simpler stats */
.cat-income-stats {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

/* ════════════════════════════════════════════════════════════
   SAVINGS GOALS MANAGEMENT (CARD UI)
   ════════════════════════════════════════════════════════════ */

.goal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 1200px) {
  .goal-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.goal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.goal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.goal-card-header {
  display: flex;
  align-items: center;
  padding: 20px;
}

.goal-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-right: 16px;
  flex-shrink: 0;
}

.goal-title-wrap {
  flex-grow: 1;
  min-width: 0;
}

.goal-title {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.goal-deadline {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.goal-actions-menu {
  margin-left: 8px;
}

.goal-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

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

.goal-card-body {
  padding: 0 20px 20px 20px;
  flex-grow: 1;
}

.goal-notes {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.goal-stats {
  margin-top: auto;
}

/* ════════════════════════════════════════════════════════════
   ENTERPRISE REPORTS MODULE
   ════════════════════════════════════════════════════════════ */

.report-tabs {
  border-bottom: 2px solid var(--border);
}

.report-tabs .nav-link {
  color: var(--text-muted);
  font-weight: 600;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 20px;
  transition: all 0.2s ease;
}

.report-tabs .nav-link:hover {
  color: var(--text-primary);
  border-bottom-color: var(--border);
}

.report-tabs .nav-link.active {
  color: var(--primary);
  background: transparent;
  border-bottom-color: var(--primary);
}

.report-data-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
}

.report-data-table td {
  padding: 12px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

/* Print optimizations for PDF Generation */
@media print {
  body * {
    visibility: hidden;
  }
  #reportContentArea, #reportContentArea * {
    visibility: visible;
  }
  #reportContentArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
}

/* ════════════════════════════════════════════════════════════
   FINANCIAL INSIGHTS ENGINE
   ════════════════════════════════════════════════════════════ */

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

@media (max-width: 992px) {
  .insight-grid { grid-template-columns: 1fr; }
}

.insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  gap: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.insight-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.06);
}

.insight-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  background: var(--bg-body);
}

.insight-content {
  flex-grow: 1;
}

.insight-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 700;
}

.insight-body {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.insight-body strong {
  color: var(--text-primary);
  font-weight: 700;
}
