/* Moneytrak · Advanced Indian Financial Tracker */
/* Production build · 2026-04-18 */

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

:root {
  --primary: #7C3AED;
  --primary-dark: #6D28D9;
  --primary-light: #A78BFA;
  --primary-softer: #EDE9FE;
  --primary-soft: #F5F3FF;
  --accent-grad: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
  --bg: #FAFAFB;
  --surface: #FFFFFF;
  --surface-2: #F9FAFB;
  --border: #ECECF0;
  --border-strong: #D1D5DB;
  --text: #111827;
  --text-muted: #6B7280;
  --text-soft: #9CA3AF;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  --shadow-sm: 0 1px 2px rgba(17,24,39,.04);
  --shadow: 0 4px 12px rgba(17,24,39,.06);
  --shadow-lg: 0 12px 32px rgba(124,58,237,.12);
  --shadow-xl: 0 20px 48px rgba(17,24,39,.14);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

[data-theme="dark"] {
  --bg: #0B0B0F;
  --surface: #16161D;
  --surface-2: #1E1E28;
  --border: #2A2A36;
  --border-strong: #3A3A48;
  --text: #F9FAFB;
  --text-muted: #9CA3AF;
  --text-soft: #6B7280;
  --primary-softer: #2E1F5E;
  --primary-soft: #1F1938;
  --shadow: 0 4px 12px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 32px rgba(124,58,237,.3);
  --shadow-xl: 0 20px 48px rgba(0,0,0,.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s, color .2s;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }

/* ----- Navbar — two-row layout: logo + actions on top, nav links below ----- */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 32px 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "logo  .    right"
    "nav   nav  nav";
  column-gap: 16px;
  row-gap: 8px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 80;
  backdrop-filter: blur(10px);
}
.nav-logo  { grid-area: logo; flex-shrink: 0; min-width: 0; }
.nav-right { grid-area: right; flex-shrink: 0; }
.nav-links { grid-area: nav; }
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 20px; letter-spacing: -0.02em;
  color: var(--text);
}
.nav-logo-icon {
  width: 36px; height: 36px;
  background: var(--accent-grad);
  border-radius: 10px;
  display: grid; place-items: center;
  color: #fff; font-size: 20px;
  box-shadow: 0 4px 12px rgba(124,58,237,.3);
  overflow: hidden;
  flex-shrink: 0;
}
.nav-logo-icon img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.nav-logo-text span { color: var(--primary); }
.nav-logo-tag {
  font-size: 10px; background: var(--primary-softer); color: var(--primary-dark);
  padding: 2px 6px; border-radius: 4px; font-weight: 600; margin-left: 4px;
}
.nav-links {
  display: flex; gap: 4px; justify-content: center;
  padding: 4px 0 8px;
  border-top: 1px solid transparent;
  flex-wrap: wrap;
}
.nav-links a {
  padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  transition: all .15s; cursor: pointer;
  position: relative;
}
.nav-links a:hover { color: var(--text); background: var(--bg); }
.nav-links a.active {
  color: var(--primary);
  background: var(--primary-softer);
  font-weight: 600;
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: -8px;
  height: 2px; border-radius: 2px;
  background: var(--primary);
}

.nav-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

/* ----- Sun/Moon toggle switch (replaces 🌗 emoji) ----- */
.theme-switch {
  position: relative;
  width: 56px; height: 28px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  justify-content: space-between;
  transition: background .25s, border-color .25s;
  flex-shrink: 0;
}
.theme-switch:hover { border-color: var(--primary-light); }
.theme-switch .ts-icon {
  width: 14px; height: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  z-index: 1; color: var(--text-muted);
  transition: color .25s, opacity .25s;
}
.theme-switch .ts-sun  { color: #F59E0B; }
.theme-switch .ts-moon { color: #94A3B8; }
.theme-switch .ts-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  transition: transform .25s ease, background .25s;
  pointer-events: none;
}
[data-theme="dark"] .theme-switch { background: rgba(124,58,237,.25); border-color: var(--primary); }
[data-theme="dark"] .theme-switch .ts-sun  { opacity: .35; }
[data-theme="dark"] .theme-switch .ts-moon { color: #FBBF24; opacity: 1; }
[data-theme="dark"] .theme-switch .ts-thumb { transform: translateX(28px); background: var(--primary); }
[data-theme="dark"] .theme-switch:hover { background: rgba(124,58,237,.35); }
:not([data-theme="dark"]) .theme-switch .ts-moon { opacity: .35; }
:not([data-theme="dark"]) .theme-switch .ts-sun  { opacity: 1; }
.nav-icon-btn {
  width: 38px; height: 38px; border-radius: 999px;
  background: var(--bg);
  display: grid; place-items: center;
  font-size: 16px; color: var(--text-muted);
  position: relative; transition: all .2s;
}
.nav-icon-btn:hover { background: var(--primary-softer); color: var(--primary); }
.nav-icon-btn[aria-pressed="true"] { background: var(--primary); color: #fff; }

/* ==========================================================
   Privacy mode — `body.mt-private` blurs every monetary value
   so a glance over the shoulder reveals nothing. Toggle with
   the eye icon in the navbar or ⌘.  /  Ctrl+. shortcut.
   ========================================================== */
body.mt-private .amount,
body.mt-private .kpi-value,
body.mt-private .nw-hero .amount,
body.mt-private .goal-amount,
body.mt-private [data-amount],
body.mt-private .tx-amount,
body.mt-private .asset-amount,
body.mt-private .tax-result .amount,
body.mt-private .price-pill,
body.mt-private td.amount-cell,
body.mt-private .matrix-num,
body.mt-private .num-strong,
body.mt-private .stat-card .num {
  filter: blur(8px);
  transition: filter .15s;
  user-select: none;
  cursor: help;
}
body.mt-private .amount:hover,
body.mt-private .kpi-value:hover,
body.mt-private [data-amount]:hover { filter: blur(0); }
body.mt-private .privacy-banner {
  background: rgba(124,58,237,.1);
  border-color: rgba(124,58,237,.3);
}
.nav-icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%;
  border: 2px solid var(--surface);
}

.profile-badge {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 4px 14px; background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px; cursor: pointer; transition: all .2s;
  position: relative;
}
.profile-badge:hover { background: var(--primary-softer); border-color: var(--primary-light); }
.profile-badge:hover .avatar { box-shadow: 0 0 0 3px var(--primary-softer); }
.profile-badge .meta { text-align: right; }
.profile-badge .name { font-size: 13px; font-weight: 600; color: var(--text); }
.profile-badge .role { font-size: 11px; color: var(--text-muted); }
/* Subtle caret to indicate dropdown */
.profile-badge::after {
  content: "▾";
  font-size: 10px; color: var(--text-muted);
  margin-left: 2px;
  transition: transform .2s;
}
.profile-badge:hover::after { color: var(--primary); transform: translateY(1px); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-grad);
  color: #fff; font-size: 13px; font-weight: 700;
  display: grid; place-items: center;
  transition: box-shadow .2s;
  flex-shrink: 0;
}

/* ----- Layout ----- */
.container { max-width: 1440px; margin: 0 auto; padding: 24px 32px 48px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.page-head p { color: var(--text-muted); font-size: 14px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.dashboard { display: grid; grid-template-columns: 65% 35%; gap: 24px; }
@media (max-width: 1100px) { .dashboard { grid-template-columns: 1fr; } }
.left-col, .right-col { display: flex; flex-direction: column; gap: 20px; }

/* ----- Cards ----- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all .25s;
}
.card:hover { box-shadow: var(--shadow); }
.card-title {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; gap: 12px;
}
.card-title h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.card-title .meta { font-size: 12px; color: var(--text-muted); }

/* ----- KPI ----- */
.kpi-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
@media (max-width: 900px) { .kpi-row { grid-template-columns: repeat(2,1fr); } }

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  position: relative; overflow: hidden;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  transform-style: preserve-3d;
}
.kpi-card:hover { transform: translateY(-4px) rotateX(2deg); box-shadow: var(--shadow-lg); }
.kpi-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--primary-soft) 0%, transparent 50%);
  opacity: 0; transition: opacity .25s;
}
.kpi-card:hover::before { opacity: 1; }
.kpi-card > * { position: relative; z-index: 1; }
.kpi-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--primary-softer); color: var(--primary);
  display: grid; place-items: center;
  font-size: 16px; margin-bottom: 12px;
}
.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.kpi-value {
  font-size: 24px; font-weight: 800; letter-spacing: -0.03em;
  margin-bottom: 6px; font-variant-numeric: tabular-nums;
}
.kpi-delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px;
}
.kpi-delta.up { background: rgba(16,185,129,.1); color: var(--success); }
.kpi-delta.down { background: rgba(239,68,68,.1); color: var(--danger); }
.kpi-delta.neutral { background: var(--bg); color: var(--text-muted); }

/* ----- Budget grid ----- */
.budget-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .budget-grid { grid-template-columns: 1fr; } }
.budget-cell {
  padding: 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2);
  transition: all .2s; cursor: pointer;
}
.budget-cell:hover { background: var(--primary-soft); border-color: var(--primary-light); }
.budget-cell-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.budget-cell-head .label { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.budget-cell-head .icon { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; }
.budget-cell-head .val { font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 600; }
.budget-cell-head .val span { color: var(--text-muted); font-weight: 400; }

.progress-bar { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; border-radius: 999px; transition: width .6s cubic-bezier(.4,0,.2,1); background: var(--primary); }
.progress-fill.green { background: var(--success); }
.progress-fill.amber { background: var(--warning); }
.progress-fill.red { background: var(--danger); }
.progress-fill.purple { background: var(--primary); }
.budget-insight { font-size: 11px; color: var(--text-muted); }
.budget-insight.warn { color: var(--warning); }
.budget-insight.good { color: var(--success); }
.budget-insight.bad { color: var(--danger); }

/* ----- Chart wrap ----- */
.chart-wrap { position: relative; height: 240px; margin-top: 8px; }
.chart-wrap canvas { width: 100% !important; height: 100% !important; }
.chart-wrap.sm { height: 180px; }
.chart-wrap.lg { height: 320px; }
.chart-legend { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

.insight-callout {
  position: absolute; top: 16px; right: 16px;
  background: var(--surface);
  border: 1px solid var(--primary-softer);
  border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 12px; max-width: 220px;
  box-shadow: var(--shadow); z-index: 2;
  animation: floatIn .6s ease;
}
@keyframes floatIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.insight-callout .head { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--primary); margin-bottom: 4px; font-size: 11px; }
.insight-callout .body { color: var(--text-muted); line-height: 1.4; }

/* ----- Forecast row ----- */
.forecast-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
@media (max-width: 700px) { .forecast-row { grid-template-columns: 1fr; } }
.forecast-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px; background: var(--surface);
  transition: all .25s; cursor: pointer;
}
.forecast-card:hover { border-color: var(--primary-light); transform: translateY(-2px); box-shadow: var(--shadow); }
.forecast-card .thumb {
  height: 60px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary-soft) 0%, var(--primary-softer) 100%);
  margin-bottom: 10px; position: relative; overflow: hidden;
}
.forecast-card .thumb svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.forecast-card .title { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.forecast-card .sub { font-size: 11px; color: var(--text-muted); }
.forecast-card .badge {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; margin-top: 6px;
  background: var(--primary-softer); color: var(--primary-dark);
}

/* ----- Forms ----- */
.form-row { display: flex; flex-direction: column; gap: 12px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.form-group .hint { font-size: 11px; color: var(--text-soft); margin-top: 2px; }
.form-group input, .form-group select, .form-group textarea {
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; background: var(--surface); transition: all .2s; color: var(--text);
  width: 100%;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-softer);
}
.form-group input:invalid:not(:placeholder-shown) { border-color: var(--danger); }
.form-group .input-icon { position: relative; }
.form-group .input-icon input { padding-left: 32px; }
.form-group .input-icon .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; }

/* ----- Buttons ----- */
.btn {
  padding: 10px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; white-space: nowrap;
}
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 4px 12px rgba(124,58,237,.25); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(124,58,237,.35); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); border-color: var(--primary-light); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--primary); padding: 6px 10px; font-size: 12px; }
.btn-ghost:hover { background: var(--primary-softer); }
.btn-full { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; }
.btn-success { background: var(--success); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ----- Goals ----- */
.goal-item {
  padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 10px; transition: all .2s;
}
.goal-item:hover { border-color: var(--primary-light); background: var(--primary-soft); }
.goal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.goal-head .title { font-size: 13px; font-weight: 600; }
.goal-head .title .emoji { margin-right: 6px; }
.goal-amount { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.goal-amount strong { color: var(--text); font-weight: 600; }
.goal-actions { display: flex; gap: 8px; margin-top: 8px; }
.goal-actions a { font-size: 11px; color: var(--primary); font-weight: 500; cursor: pointer; }
.goal-actions a:hover { text-decoration: underline; }
.goal-actions a.danger { color: var(--text-muted); }
.goal-actions a.danger:hover { color: var(--danger); }

/* ----- Slider / Simulator ----- */
.simulator { background: linear-gradient(135deg, var(--primary-soft) 0%, var(--surface) 100%); }
.slider-wrap { margin: 14px 0; }
.slider-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 8px; }
.slider-head .val { font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }

/* Calculator input: editable number + slider + range hints */
.calc-input-wrap {
  margin: 16px 0 18px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid transparent;
  transition: border-color .15s, background .15s;
}
.calc-input-wrap:focus-within {
  border-color: var(--primary-light);
  background: var(--primary-softer);
}
.calc-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 10px;
}
.calc-label {
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  flex: 1; min-width: 0;
}
.calc-num-wrap {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 10px;
  transition: border-color .15s, box-shadow .15s;
  min-width: 110px;
  justify-content: flex-end;
}
.calc-num-wrap:has(.calc-num:focus) {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-softer);
}
.calc-prefix, .calc-suffix {
  font-size: 13px; color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}
.calc-num {
  border: none; background: transparent; outline: none;
  font-size: 14px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
  padding: 6px 0;
  width: 100%;
  min-width: 60px; max-width: 140px;
  text-align: right;
  -moz-appearance: textfield;
}
.calc-num::-webkit-outer-spin-button,
.calc-num::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.calc-slider-row {
  display: flex; align-items: center; gap: 10px;
}
.calc-slider {
  flex: 1;
  -webkit-appearance: none; height: 6px;
  background: var(--border); border-radius: 999px; outline: none;
}
.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px;
  background: var(--primary); border-radius: 50%;
  cursor: pointer; box-shadow: 0 2px 8px rgba(124,58,237,.4);
  border: 3px solid var(--surface); transition: all .15s;
}
.calc-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.calc-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--primary); border-radius: 50%;
  cursor: pointer; box-shadow: 0 2px 8px rgba(124,58,237,.4);
  border: 3px solid var(--surface);
}
.calc-range-min, .calc-range-max {
  font-size: 10px; font-weight: 500; color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 40px;
}
.calc-range-max { text-align: right; }
@media (max-width: 640px) {
  .calc-head { flex-direction: column; align-items: stretch; gap: 6px; }
  .calc-num-wrap { min-width: 100%; justify-content: space-between; }
}
input[type="range"] {
  -webkit-appearance: none; width: 100%; height: 6px;
  background: var(--border); border-radius: 999px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px;
  background: var(--primary); border-radius: 50%;
  cursor: pointer; box-shadow: 0 2px 8px rgba(124,58,237,.4);
  border: 3px solid #fff; transition: all .15s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; background: var(--primary); border-radius: 50%; border: 3px solid #fff; }

.sim-output {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 14px; padding: 12px;
  background: var(--surface); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.sim-output.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.sim-output .stat { text-align: center; }
.sim-output .stat .lbl { font-size: 10px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.sim-output .stat .val { font-size: 16px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }

/* ----- Fund cards ----- */
.fund-list { display: flex; flex-direction: column; gap: 10px; }
.fund-card {
  padding: 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 12px;
  transition: all .2s;
}
.fund-card:hover { border-color: var(--primary-light); background: var(--primary-soft); transform: translateX(2px); }
.fund-logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--primary-softer); color: var(--primary-dark);
  font-size: 14px; font-weight: 700;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.fund-body { flex: 1; min-width: 0; }
.fund-body .name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.fund-body .meta { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fund-body .meta .ret { color: var(--success); font-weight: 600; }
.fund-body .meta .risk { padding: 1px 6px; border-radius: 4px; font-size: 10px; }
.fund-body .meta .risk.low { background: rgba(16,185,129,.1); color: var(--success); }
.fund-body .meta .risk.med { background: rgba(245,158,11,.1); color: var(--warning); }
.fund-body .meta .risk.high { background: rgba(239,68,68,.1); color: var(--danger); }

/* ----- Privacy banner ----- */
.privacy-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.2);
  border-radius: var(--radius-sm); font-size: 12px; color: var(--success);
  margin-bottom: 16px; font-weight: 500;
}
.privacy-banner .icon {
  width: 22px; height: 22px;
  background: var(--success); color: #fff;
  border-radius: 50%; display: grid; place-items: center; font-size: 12px;
}

/* ----- Auth ----- */
.auth-page {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary-soft) 0%, var(--bg) 100%);
  padding: 24px;
}
.auth-card {
  background: var(--surface); border-radius: 20px; padding: 36px;
  max-width: 420px; width: 100%;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.auth-card h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.auth-card .sub { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.auth-card .logo-hero {
  width: 72px; height: 72px; border-radius: 20px;
  background: var(--accent-grad);
  display: grid; place-items: center;
  color: #fff; font-size: 28px; margin-bottom: 16px;
  box-shadow: 0 12px 24px rgba(124,58,237,.3);
  animation: float3d 4s ease-in-out infinite;
  overflow: hidden;
}
.auth-card .logo-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
@keyframes float3d {
  0%, 100% { transform: rotateY(0deg) translateY(0); }
  50% { transform: rotateY(20deg) translateY(-6px); }
}
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 600; cursor: pointer; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-soft); font-size: 12px; margin: 16px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ----- Tax ----- */
.tax-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 1000px) { .tax-layout { grid-template-columns: 1fr; } }

.regime-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--bg); padding: 4px; border-radius: 999px;
  margin-bottom: 16px;
}
.regime-toggle button {
  padding: 9px 14px; border-radius: 999px;
  background: transparent; color: var(--text-muted);
  font-weight: 600; font-size: 13px; transition: all .2s;
}
.regime-toggle button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

.tax-result {
  background: var(--accent-grad); color: #fff;
  padding: 24px; border-radius: var(--radius-lg);
  margin-bottom: 16px; box-shadow: var(--shadow-lg);
}
.tax-result .label { font-size: 12px; opacity: .85; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.tax-result .amount { font-size: 36px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.tax-result .sub { font-size: 13px; opacity: .9; }

.tax-breakdown .row {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.tax-breakdown .row:last-child { border-bottom: none; font-weight: 700; padding-top: 12px; }
.tax-breakdown .label { color: var(--text-muted); }
.tax-breakdown .val { font-variant-numeric: tabular-nums; }

.slab-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.slab-table th, .slab-table td { padding: 8px 10px; text-align: left; }
.slab-table th { font-weight: 600; color: var(--text-muted); background: var(--bg); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.slab-table tr { border-bottom: 1px solid var(--border); }

/* ----- Admin ----- */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
@media (max-width: 900px) { .admin-layout { grid-template-columns: 1fr; } }
.admin-nav {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; height: fit-content;
  position: sticky; top: 90px;
}
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); border-radius: var(--radius-sm);
  margin-bottom: 4px; cursor: pointer; transition: all .2s;
}
.admin-nav a:hover { background: var(--primary-soft); color: var(--primary); }
.admin-nav a.active { background: var(--primary-softer); color: var(--primary-dark); font-weight: 600; }

/* ----- Table ----- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; background: var(--bg); }
.table tr.clickable { cursor: pointer; transition: background .15s; }
.table tr.clickable:hover { background: var(--primary-soft); }
.table td .pill { font-size: 11px; padding: 3px 8px; border-radius: 999px; font-weight: 600; }
.pill { display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 999px; font-weight: 600; }
.pill-success { background: rgba(16,185,129,.1); color: var(--success); }
.pill-warning { background: rgba(245,158,11,.1); color: var(--warning); }
.pill-danger { background: rgba(239,68,68,.1); color: var(--danger); }
.pill-info { background: rgba(59,130,246,.1); color: var(--info); }
.pill-muted { background: var(--bg); color: var(--text-muted); }
.pill-primary { background: var(--primary-softer); color: var(--primary-dark); }

/* ----- Toast ----- */
.toast-ok {
  position: fixed; top: 20px; right: 20px;
  background: var(--success); color: #fff;
  padding: 12px 20px; border-radius: 999px;
  font-size: 13px; font-weight: 500;
  z-index: 9999; box-shadow: 0 8px 24px rgba(16,185,129,.3);
  animation: slideIn .3s ease, fadeOut .3s ease 2.6s forwards;
  display: flex; align-items: center; gap: 8px;
  max-width: 360px;
}
.toast-ok.danger { background: var(--danger); box-shadow: 0 8px 24px rgba(239,68,68,.3); }
.toast-ok.info { background: var(--info); box-shadow: 0 8px 24px rgba(59,130,246,.3); }
.toast-ok.warn { background: var(--warning); box-shadow: 0 8px 24px rgba(245,158,11,.3); }
@keyframes slideIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { transform: translateX(110%); opacity: 0; } }

/* ----- Transaction tag pills + active filter bar ----- */
.tag-pill {
  display: inline-block;
  font-size: 10.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(124,58,237,.1); color: var(--primary);
  margin-right: 4px; cursor: pointer;
  transition: background .15s, transform .1s;
  user-select: none;
}
.tag-pill:hover { background: var(--primary); color: #fff; transform: translateY(-1px); }
.tag-pill.active { background: var(--primary); color: #fff; }
.active-tag-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--primary-softer);
  border: 1px solid var(--primary-light);
  border-radius: 10px;
}

/* ============================================================
   News — list and single-article views
   ============================================================ */
.news-list { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
.news-item { padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); transition: transform .15s, border-color .15s, box-shadow .15s; }
.news-item .m { font-size: 11.5px; color: var(--text-muted); margin-left: 8px; }
.news-item .t { font-size: 15px; font-weight: 700; color: var(--text); margin: 6px 0 4px; line-height: 1.4; }
.news-item .s { font-size: 13px; color: var(--text-muted); line-height: 1.55; }

.news-clickable { cursor: pointer; }
.news-clickable:hover { transform: translateX(2px); border-color: var(--primary-light); box-shadow: 0 6px 16px -8px rgba(124,58,237,.18); }
.news-clickable:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.news-item-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
}
.news-read-btn { color: var(--primary); font-weight: 700; }
.news-src-count {
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 10px; border-radius: 999px;
  font-size: 11px;
}

/* Category pills (consistent across list + article) */
.news-cat {
  display: inline-block;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 9px; border-radius: 4px;
  background: rgba(124,58,237,.14); color: #7C3AED;
}
.news-cat.policy    { background: rgba(16,185,129,.14); color: #10B981; }
.news-cat.tax       { background: rgba(245,158,11,.14); color: #F59E0B; }
.news-cat.mf        { background: rgba(20,184,166,.14); color: #14B8A6; }
.news-cat.gold      { background: rgba(234,179,8,.14);  color: #CA8A04; }
.news-cat.startups  { background: rgba(236,72,153,.14); color: #EC4899; }
.news-cat.insurance { background: rgba(14,165,233,.14); color: #0EA5E9; }
.news-cat.markets   { background: rgba(124,58,237,.14); color: #7C3AED; }

/* Single-article view */
.news-article {
  max-width: 760px; margin: 0 auto;
  padding: 20px 24px 32px;
}
.news-back {
  background: transparent; border: 0;
  color: var(--primary); font-weight: 600; font-size: 13.5px;
  padding: 6px 0; margin-bottom: 16px;
  cursor: pointer;
}
.news-back:hover { text-decoration: underline; }
.news-article .news-cat { margin-bottom: 12px; }
.news-title {
  font-size: 30px; font-weight: 800; letter-spacing: -.02em;
  margin: 6px 0 14px; line-height: 1.2; color: var(--text);
}
.news-byline {
  display: flex; gap: 16px; flex-wrap: wrap;
  color: var(--text-muted); font-size: 12.5px;
  padding-bottom: 18px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.news-lead {
  font-size: 17px; line-height: 1.65;
  color: var(--text); font-weight: 500;
  margin-bottom: 18px;
  padding-left: 14px; border-left: 3px solid var(--primary);
}
.news-body p {
  font-size: 15px; line-height: 1.75; color: var(--text);
  margin-bottom: 14px;
  white-space: pre-wrap;     /* allow line breaks within paragraphs */
}

.news-sources {
  margin-top: 28px; padding: 22px 24px;
  background: var(--primary-softer);
  border: 1px solid var(--primary-light);
  border-radius: 14px;
}
.news-sources h4 {
  font-size: 14px; font-weight: 700; margin-bottom: 4px;
  color: var(--primary);
}
.news-sources-hint { font-size: 11.5px; color: var(--text-muted); margin-bottom: 12px; }
.news-sources ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.news-sources a {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color .15s, transform .1s;
}
.news-sources a:hover {
  border-color: var(--primary);
  transform: translateX(2px);
}
.news-sources .src-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.news-sources .src-host {
  font-size: 11.5px; color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.news-sources .src-arrow {
  font-size: 14px; color: var(--primary); font-weight: 700;
}

.news-disclaimer-strip {
  margin-top: 24px; padding: 14px 18px;
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: 10px;
  font-size: 12.5px; color: var(--text-muted);
  line-height: 1.6;
}
[data-theme="dark"] .news-disclaimer-strip { background: rgba(245,158,11,.1); }
.news-disclaimer-strip strong { color: #B45309; }
[data-theme="dark"] .news-disclaimer-strip strong { color: #FBBF24; }

@media (max-width: 600px) {
  .news-article { padding: 14px 16px 24px; }
  .news-title { font-size: 24px; }
  .news-lead { font-size: 15px; }
  .news-body p { font-size: 14.5px; }
  .news-sources { padding: 16px 14px; }
  .news-sources a { grid-template-columns: 1fr auto; }
  .news-sources .src-host { display: none; }
}

/* ============================================================
   PWA install — floating FAB (visible on mobile until installed)
   ============================================================ */
.install-fab {
  display: none;
  position: fixed;
  right: 16px; bottom: 18px;
  z-index: 90;
  background: linear-gradient(135deg, #7C3AED, #A855F7);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px 12px 14px;
  font-size: 13.5px; font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 14px 32px -6px rgba(124,58,237,.45), 0 4px 12px rgba(124,58,237,.25);
  align-items: center; gap: 8px;
  transition: transform .15s, box-shadow .15s;
  animation: fabPulse 3s ease-in-out infinite;
}
.install-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -6px rgba(124,58,237,.55);
}
.install-fab svg { flex: 0 0 auto; }
@keyframes fabPulse {
  0%, 100% { box-shadow: 0 14px 32px -6px rgba(124,58,237,.45), 0 4px 12px rgba(124,58,237,.25); }
  50%      { box-shadow: 0 14px 32px -6px rgba(124,58,237,.65), 0 0 0 6px rgba(124,58,237,.15); }
}
@media (max-width: 880px) {
  .install-fab { display: inline-flex; bottom: 14px; }
}
@media (display-mode: standalone) {
  .install-fab { display: none !important; }
}

/* Install-instructions modal */
.ins-steps {
  margin: 14px 0;
  padding-left: 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.ins-steps li { font-size: 14px; color: var(--text); line-height: 1.55; }
.ins-steps strong { color: var(--primary); }
.ios-icon {
  display: inline-block;
  width: 22px; height: 22px;
  background: var(--bg);
  border-radius: 5px;
  text-align: center;
  font-family: ui-monospace, Menlo, monospace;
  vertical-align: middle;
  margin: 0 2px;
}
.ins-note {
  margin: 12px 0 4px;
  padding: 10px 14px;
  background: var(--primary-softer);
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
}
.install-perks {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.install-perks > div {
  display: flex; gap: 10px;
  padding: 12px;
  background: var(--bg);
  border-radius: 10px;
  align-items: flex-start;
}
.install-perks > div > span:first-child { font-size: 22px; flex: 0 0 auto; line-height: 1; }
.install-perks > div > div { display: flex; flex-direction: column; gap: 2px; }
.install-perks strong { font-size: 12.5px; color: var(--text); }
.install-perks span:nth-child(2) { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
@media (max-width: 600px) {
  .install-perks { grid-template-columns: 1fr; }
}

/* ----- Tax-calculator auto-fill bar ----- */
.autofill-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  margin: 14px 0 10px;
  background: linear-gradient(135deg, rgba(124,58,237,.08), rgba(168,85,247,.08));
  border: 1px solid var(--primary-light);
  border-radius: 14px;
  flex-wrap: wrap;
}
.autofill-bar-text { font-size: 13.5px; color: var(--text); flex: 1; min-width: 220px; }
.autofill-bar-text strong { color: var(--primary); }
.autofill-note {
  padding: 12px 16px;
  margin-bottom: 14px;
  background: var(--primary-softer);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.6;
}
.autofill-note strong { color: var(--primary); }

/* ----- Money Accounts grid ----- */
.acct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding: 14px;
}
.acct-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 18px 14px;
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.acct-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px rgba(124,58,237,.15);
}
.acct-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.acct-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.acct-meta .name { font-size: 14.5px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.acct-meta .sub { font-size: 11.5px; color: var(--text-muted); }
.acct-bal { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.acct-bal .lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.acct-bal .amt { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.acct-bal .amt.up   { color: var(--success); }
.acct-bal .amt.down { color: var(--danger); }
.acct-due { font-size: 11.5px; color: var(--warning); margin-bottom: 8px; font-weight: 600; }
.acct-actions { display: flex; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border); }

/* ----- Pricing health card on assets page ----- */
.pricing-health {
  margin: 12px 0 10px;
  padding: 10px 14px;
  background: var(--primary-softer);
  border: 1px solid var(--primary-light);
  border-radius: 10px;
}
.pricing-health .ph-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 12.5px;
}
.pricing-health .ph-stat {
  font-weight: 700; color: var(--primary);
  padding: 3px 10px; border-radius: 999px;
  background: var(--surface);
}
.pricing-health .ph-stat.warn { color: #B45309; background: rgba(245,158,11,.15); }
.pricing-health .ph-stat.ok   { color: #059669; background: rgba(16,185,129,.15); }
.pricing-health .ph-meta { color: var(--text-muted); flex: 1; min-width: 180px; }

/* ----- Group-by-stock toggle (uses .filter-chip + .group-toggle) ----- */
.filter-chip.group-toggle { margin-left: 6px; }
.filter-chip.group-toggle.active {
  background: var(--success);
  color: #fff; border-color: var(--success);
}
.group-badge {
  font-size: 10.5px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px;
  background: var(--primary); color: #fff;
  margin-left: 4px;
}

/* ----- Undo-delete toast ----- */
.toast-undo {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--surface);
  padding: 10px 14px 10px 18px;
  border-radius: 12px; font-size: 13.5px; font-weight: 500;
  z-index: 9999; box-shadow: 0 12px 32px rgba(0,0,0,.25);
  display: flex; align-items: center; gap: 14px;
  max-width: 420px;
  animation: slideUp .25s ease;
  overflow: hidden;
}
.toast-undo .tu-msg { flex: 1; }
.toast-undo .tu-undo {
  background: var(--primary); color: #fff;
  padding: 6px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; cursor: pointer; border: 0;
  text-transform: uppercase; letter-spacing: .04em;
}
.toast-undo .tu-undo:hover { background: var(--primary-dark); }
.toast-undo .tu-bar {
  position: absolute; left: 0; bottom: 0; height: 3px;
  width: 100%; background: var(--primary);
  animation: tuShrink 5s linear forwards;
  transform-origin: left;
}
@keyframes slideUp { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes tuShrink { to { transform: scaleX(0); } }

/* New toast API (.toast + variant + .show) used by admin/auth */
.toast-mount {
  position: fixed; top: 20px; right: 20px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--success); color: #fff;
  padding: 12px 20px; border-radius: 999px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(16,185,129,.3);
  display: flex; align-items: center; gap: 8px;
  max-width: 360px;
  opacity: 0;
  transform: translateX(110%);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: auto;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-ok { background: var(--success); box-shadow: 0 8px 24px rgba(16,185,129,.3); }
.toast-danger { background: var(--danger); box-shadow: 0 8px 24px rgba(239,68,68,.3); }
.toast-info { background: var(--info); box-shadow: 0 8px 24px rgba(59,130,246,.3); }
.toast-warn { background: var(--warning); box-shadow: 0 8px 24px rgba(245,158,11,.3); }

/* Alias for modal-header (new API) — .modal has padding, so header stays flat */
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px;
  margin: -4px -4px 12px;
  padding: 0 4px 12px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }

/* ----- Modal ----- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn .2s ease;
  backdrop-filter: blur(4px);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  max-width: 520px; width: 100%;
  padding: 24px; box-shadow: var(--shadow-xl);
  max-height: 90vh; overflow-y: auto;
  animation: modalIn .3s cubic-bezier(.4,0,.2,1);
  border: 1px solid var(--border);
}
.modal.lg { max-width: 720px; }
.modal.sm { max-width: 400px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.modal-close {
  width: 30px; height: 30px; border-radius: 999px;
  background: var(--bg);
  display: grid; place-items: center;
  font-size: 16px; color: var(--text-muted);
  transition: all .15s;
}
.modal-close:hover { background: var(--danger); color: #fff; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ----- Filters ----- */
.filters {
  display: flex; gap: 10px; flex-wrap: wrap;
  align-items: center; margin-bottom: 16px;
}
.filter-chip {
  padding: 6px 12px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 12px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  transition: all .15s;
}
.filter-chip:hover { color: var(--primary); border-color: var(--primary-light); }
.filter-chip.active { background: var(--primary-softer); color: var(--primary-dark); border-color: var(--primary-light); }

.search-box {
  position: relative; flex: 1; min-width: 220px;
}
.search-box input {
  width: 100%; padding: 10px 14px 10px 36px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); font-size: 13px;
  transition: all .2s; color: var(--text);
}
.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-softer); }
.search-box .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; }

/* ----- Empty state ----- */
.empty-state {
  text-align: center; padding: 36px 20px;
  color: var(--text-muted);
}
.empty-state .icon {
  width: 60px; height: 60px; border-radius: 16px;
  background: var(--primary-softer); color: var(--primary);
  display: grid; place-items: center;
  font-size: 28px; margin: 0 auto 16px;
  animation: float3d 4s ease-in-out infinite;
}
.empty-state h3 { color: var(--text); font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.empty-state p { font-size: 13px; max-width: 320px; margin: 0 auto 16px; line-height: 1.5; }

/* ----- Tabs ----- */
.tab-nav {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px; overflow-x: auto;
}
.tab-nav button {
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  transition: all .2s; white-space: nowrap;
}
.tab-nav button:hover { color: var(--text); }
.tab-nav button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ----- Side drawer ----- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 400; animation: fadeIn .2s;
  backdrop-filter: blur(2px);
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 100%;
  background: var(--surface); z-index: 450;
  padding: 24px; overflow-y: auto;
  animation: drawerIn .3s cubic-bezier(.4,0,.2,1);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
}
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ----- Transactions list ----- */
.txn-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 12px; padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  align-items: center; transition: background .15s;
}
.txn-row:hover { background: var(--primary-soft); }
.txn-row:last-child { border-bottom: none; }
.txn-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; font-size: 16px;
  background: var(--primary-softer); color: var(--primary-dark);
}
.txn-icon.income { background: rgba(16,185,129,.1); color: var(--success); }
.txn-icon.expense { background: rgba(239,68,68,.1); color: var(--danger); }
.txn-body .name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.txn-body .meta { font-size: 11px; color: var(--text-muted); }
.txn-amount { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.txn-amount.income { color: var(--success); }
.txn-amount.expense { color: var(--danger); }
.txn-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.txn-row:hover .txn-actions { opacity: 1; }
.txn-actions button {
  width: 28px; height: 28px; border-radius: 6px;
  display: grid; place-items: center;
  background: var(--bg); color: var(--text-muted);
  font-size: 12px; transition: all .15s;
}
.txn-actions button:hover { background: var(--primary-softer); color: var(--primary); }
.txn-actions button.del:hover { background: rgba(239,68,68,.1); color: var(--danger); }

/* ----- Asset cards ----- */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.asset-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  transition: all .2s; cursor: pointer;
  position: relative;
}
.asset-card:hover { border-color: var(--primary-light); transform: translateY(-2px); box-shadow: var(--shadow); }
.asset-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.asset-card .type-badge { font-size: 10px; padding: 3px 8px; border-radius: 999px; font-weight: 600; }
.asset-card .name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.asset-card .sub { font-size: 11px; color: var(--text-muted); }
.asset-card .amount { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.asset-card .gain { font-size: 11px; font-weight: 600; }
.asset-card .gain.up { color: var(--success); }
.asset-card .gain.down { color: var(--danger); }

/* ----- 3D Hero ----- */
.hero-3d {
  perspective: 1000px;
  width: 80px; height: 80px;
  margin: 0 auto;
}
.hero-3d-inner {
  width: 100%; height: 100%; position: relative;
  transform-style: preserve-3d;
  animation: rotate3d 8s linear infinite;
}
@keyframes rotate3d {
  0% { transform: rotateY(0deg) rotateX(15deg); }
  100% { transform: rotateY(360deg) rotateX(15deg); }
}
.hero-3d .face {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 40px;
  background: var(--accent-grad);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}
.hero-3d .face.front { transform: translateZ(40px); }
.hero-3d .face.back { transform: translateZ(-40px) rotateY(180deg); }
.hero-3d .face.right { transform: rotateY(90deg) translateZ(40px); }
.hero-3d .face.left { transform: rotateY(-90deg) translateZ(40px); }
.hero-3d .face.top { transform: rotateX(90deg) translateZ(40px); }
.hero-3d .face.bottom { transform: rotateX(-90deg) translateZ(40px); }

/* ----- Sparkline ----- */
.sparkline { width: 100%; height: 30px; }

/* ----- View switcher ----- */
.view { display: none; }
.view.active { display: block; animation: fadePage .25s ease; }
@keyframes fadePage { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ----- Donut ----- */
.donut-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.donut-center {
  position: absolute; text-align: center;
  pointer-events: none;
}
.donut-center .lbl { font-size: 11px; color: var(--text-muted); }
.donut-center .val { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ----- Mobile nav drawer ----- */
.mobile-nav-btn {
  display: none;
  width: 38px; height: 38px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

/* ----- Responsive ----- */

/* Tablet — keep two-row layout but tighten spacing */
@media (max-width: 1080px) {
  .navbar { padding: 10px 18px 0; gap: 10px; }
  .nav-links { gap: 2px; font-size: 12.5px; }
  .nav-links a { padding: 7px 11px; }
  .profile-badge .meta { display: none; }
  .nav-right { gap: 6px; }
}

/* Mobile — collapse nav into a drawer, keep profile + theme always visible */
@media (max-width: 880px) {
  .navbar {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo . right";  /* override desktop two-row */
    padding: 10px 14px; gap: 8px;
    position: sticky; top: 0;
  }
  .nav-links a.active::after { display: none; }
  .nav-logo { font-size: 17px; gap: 8px; }
  .nav-logo-icon { width: 30px; height: 30px; }
  .mobile-nav-btn { display: inline-grid; place-items: center; justify-self: end; }

  /* Drawer-style nav-links — slides down from below the navbar */
  .nav-links {
    position: fixed;
    top: 56px; left: 0; right: 0;
    flex-direction: column;
    background: var(--surface);
    padding: 14px;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px -8px rgba(0,0,0,.15);
    transform: translateY(-130%);
    transition: transform .25s ease;
    z-index: 95;
    align-items: stretch;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a {
    padding: 12px 14px; border-radius: 10px;
    font-size: 14px; color: var(--text);
  }
  .nav-links a.active { background: var(--primary-softer); color: var(--primary); }

  /* nav-right: hide low-priority icons, keep theme + notif + profile */
  .nav-right { gap: 4px; }
  .nav-icon-btn { width: 36px; height: 36px; font-size: 14px; }
  .nav-right #btnSearch, .nav-right #btnQuickAdd { display: none; }
  .profile-badge { padding: 6px; gap: 0; }
  .profile-badge .meta { display: none; }
  .profile-badge .avatar { width: 30px; height: 30px; font-size: 12px; }

  .container { padding: 14px; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .forecast-row { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .nav-right .nav-icon-btn { width: 32px; height: 32px; font-size: 13px; }
  .navbar { padding: 8px 10px; }
}

/* ----- Scrollbar ----- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ----- Loaders ----- */
.skeleton { background: linear-gradient(90deg, var(--border) 0%, var(--surface-2) 50%, var(--border) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- Badge dot ----- */
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; }
.status-dot.active { background: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,.2); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); opacity: .6; } }

/* ----- Onboarding ----- */
.onboard-step {
  padding: 20px; border: 1px dashed var(--primary-light);
  border-radius: var(--radius); background: var(--primary-soft);
  margin-bottom: 16px;
}
.onboard-step h4 { font-size: 14px; font-weight: 700; color: var(--primary-dark); margin-bottom: 6px; }
.onboard-step p { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }

/* ----- Settings ----- */
.settings-section { margin-bottom: 28px; }
.settings-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row .label { font-size: 14px; font-weight: 500; }
.settings-row .hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ----- Toggle switch ----- */
.toggle {
  position: relative; width: 44px; height: 24px;
  background: var(--border); border-radius: 999px;
  cursor: pointer; transition: background .2s;
}
.toggle.on { background: var(--primary); }
.toggle::after {
  content: ''; position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #fff; border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle.on::after { transform: translateX(20px); }

/* ----- Net worth hero ----- */
.nw-hero {
  background: var(--accent-grad);
  color: #fff;
  padding: 28px; border-radius: var(--radius-lg);
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.nw-hero::before {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.nw-hero::after {
  content: ''; position: absolute; right: 40px; bottom: -60px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.nw-hero > * { position: relative; z-index: 1; }
.nw-hero .label { font-size: 12px; opacity: .85; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.nw-hero .amount { font-size: 38px; font-weight: 900; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.nw-hero .sub { font-size: 13px; opacity: .9; margin-top: 4px; }

/* ----- Utility ----- */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-gap { display: flex; gap: 10px; align-items: center; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; }

/* ----- Context menu ----- */
.ctx-menu {
  position: absolute; z-index: 600;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px; min-width: 160px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .15s ease;
}
.ctx-menu button {
  display: flex; width: 100%; align-items: center; gap: 8px;
  padding: 8px 12px; font-size: 13px; color: var(--text);
  border-radius: 6px; text-align: left;
}
.ctx-menu button:hover { background: var(--primary-soft); color: var(--primary); }
.ctx-menu button.danger:hover { background: rgba(239,68,68,.1); color: var(--danger); }
.ctx-menu hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ----- Command palette ----- */
.cmd-palette { max-width: 540px; padding: 0 !important; }
.cmd-palette .search-input {
  width: 100%; padding: 18px 20px;
  font-size: 15px; border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
}
.cmd-palette .search-input:focus { outline: none; }
.cmd-results { max-height: 400px; overflow-y: auto; padding: 8px; }
.cmd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  font-size: 13px; cursor: pointer;
}
.cmd-item:hover, .cmd-item.active { background: var(--primary-soft); color: var(--primary); }
.cmd-item .kbd { margin-left: auto; font-size: 10px; padding: 2px 6px; background: var(--border); border-radius: 4px; color: var(--text-muted); }

/* ===== Info hints (shown at top of each SPA view) ===== */
.info-hint {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  margin: 0 0 18px;
  background: var(--primary-softer);
  border: 1px solid var(--primary-light);
  border-radius: 12px;
  color: var(--text);
  font-size: 12.5px; line-height: 1.6;
}
.info-hint .hint-icon {
  flex-shrink: 0; width: 28px; height: 28px;
  background: var(--primary); color: #fff;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 14px;
}
.info-hint strong { color: var(--primary-dark); }
.info-hint code { background: rgba(124,58,237,0.12); padding: 1px 6px; border-radius: 4px; font-size: 11.5px; color: var(--primary-dark); }

/* ===== SEBI / financial-advisor disclaimer banner ===== */
.sebi-disc {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  margin: 16px 0;
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 10px;
  color: var(--text);
  font-size: 11.5px; line-height: 1.55;
}
.sebi-disc .disc-icon {
  flex-shrink: 0; font-size: 14px;
}
.sebi-disc strong { color: #B45309; }

/* -----------------------------------------------------------
   Required-field asterisks — auto-added to any label that is
   immediately followed by a required input/select/textarea.
   Uses :has() (supported in all modern browsers as of 2024).
   For labels that already contain `.req` we skip.
   ----------------------------------------------------------- */
.form-group label:has(+ input[required])::after,
.form-group label:has(+ select[required])::after,
.form-group label:has(+ textarea[required])::after {
  content: " *";
  color: #EF4444;
  font-weight: 700;
  margin-left: 2px;
}
/* Don't double-mark labels that already have an explicit .req span */
.form-group label:has(.req):has(+ input[required])::after,
.form-group label:has(.req):has(+ select[required])::after,
.form-group label:has(.req):has(+ textarea[required])::after {
  content: "";
}

/* Hint text under inputs (used across login, signup, calculators) */
.form-group small.hint,
.calc-input-wrap small.hint,
.hint {
  display: block;
  margin-top: 4px;
  color: var(--text-soft, var(--text-muted));
  font-size: 11.5px;
  line-height: 1.5;
}

/* ============================================================
   v4 additions — dashboard pies, health score, recurring,
   needs/wants bar, install banner, notifications dropdown,
   reviews grid, pricing matrix, screenshots.
   ============================================================ */

/* Two-pie dashboard row */
.dashboard-pies { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .dashboard-pies { grid-template-columns: 1fr; } }

/* Health ring */
.health-card .health-ring-wrap { display: flex; align-items: center; justify-content: center; padding: 8px 0 2px; }
.health-ring { width: 150px; height: 150px; transform: rotate(-90deg); }
.health-ring .bg { fill: none; stroke: var(--border); stroke-width: 8; }
.health-ring .fg { fill: none; stroke: var(--primary, #7C3AED); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .8s cubic-bezier(.2,.9,.3,1); }
.health-ring .score { fill: var(--text); font-size: 28px; font-weight: 800; transform: rotate(90deg); transform-origin: 60px 60px; font-family: Inter, system-ui, sans-serif; }
.health-breakdown { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.health-breakdown .row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.health-breakdown .row .bar { flex: 1; height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; }
.health-breakdown .row .bar span { display: block; height: 100%; background: var(--primary, #7C3AED); border-radius: inherit; }
.health-breakdown .row .lbl { flex: 0 0 120px; color: var(--text-muted); }
.health-breakdown .row .val { flex: 0 0 40px; text-align: right; font-weight: 600; color: var(--text); }

/* Suggested allocation */
#suggestedAllocation .row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
#suggestedAllocation .row .sw { width: 14px; height: 14px; border-radius: 4px; flex: 0 0 14px; }
#suggestedAllocation .row .lbl { flex: 1; color: var(--text); font-weight: 500; }
#suggestedAllocation .row .val { font-weight: 700; color: var(--text); }

/* Recurring summary card */
#recurringSummary { display: flex; flex-direction: column; gap: 8px; }
#recurringSummary .ring { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
#recurringSummary .ring .name { font-weight: 600; color: var(--text); }
#recurringSummary .ring .meta { color: var(--text-muted); font-size: 11.5px; }
#recurringSummary .ring .amt { font-weight: 700; color: var(--text); }
#recurringSummary .total { padding: 10px 12px; background: var(--primary-soft, #F3E8FF); color: var(--primary, #7C3AED); border-radius: 10px; font-weight: 700; font-size: 13.5px; display: flex; justify-content: space-between; }

/* Needs vs Wants bar */
.nw-bar { display: flex; height: 34px; border-radius: 10px; overflow: hidden; background: var(--border); margin-bottom: 10px; }
.nw-bar-fill { display: flex; align-items: center; justify-content: center; font-weight: 600; color: #fff; font-size: 12.5px; transition: width .5s ease; overflow: hidden; white-space: nowrap; }
.nw-bar-fill.need { background: linear-gradient(90deg, #10B981, #059669); }
.nw-bar-fill.want { background: linear-gradient(90deg, #F59E0B, #DC2626); }
.nw-legend { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 10px; }
.nw-insight { font-size: 12.5px; color: var(--text-muted); padding: 10px 12px; background: var(--bg-alt, var(--surface)); border-left: 3px solid var(--primary, #7C3AED); border-radius: 6px; }

/* Install banner */
.install-banner { background: linear-gradient(135deg, #7C3AED 0%, #5B21B6 100%); color: #fff; padding: 12px 18px; border-radius: 12px; display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 14px; }
.install-banner .icon { font-size: 18px; }
.install-banner .modal-close { color: #fff; opacity: .7; margin-left: 6px; }
.install-banner .btn { background: #fff; color: #7C3AED; }
.install-banner .btn:hover { background: rgba(255,255,255,.9); }

/* Notifications dropdown */
.notif-dropdown { position: absolute; top: calc(100% + 8px); right: 0; width: 380px; max-width: 92vw; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 20px 40px -10px rgba(0,0,0,.15); z-index: 120; overflow: hidden; }
.notif-dropdown .head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.notif-dropdown .list { max-height: 440px; overflow: auto; }
.notif-dropdown .item { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: default; }
.notif-dropdown .item:last-child { border-bottom: 0; }
.notif-dropdown .item .t { font-weight: 600; color: var(--text); margin-bottom: 2px; }
.notif-dropdown .item .d { color: var(--text-muted); font-size: 11.5px; }
.notif-dropdown .item.unread { background: var(--primary-soft, #F3E8FF); }
.notif-dropdown .empty { padding: 30px 14px; text-align: center; color: var(--text-muted); font-size: 13px; }
.nav-icon-btn .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #EF4444; border: 2px solid var(--surface); }
.nav-icon-btn { position: relative; }

/* Profile menu (for switcher) */
.profile-menu { position: absolute; top: calc(100% + 8px); right: 0; width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 20px 40px -10px rgba(0,0,0,.15); z-index: 120; overflow: hidden; }
.profile-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 13px; color: var(--text); cursor: pointer; border-bottom: 1px solid var(--border); }
.profile-menu a:last-child { border-bottom: 0; }
.profile-menu a:hover { background: var(--bg-alt, var(--border)); }
.profile-menu .email { font-size: 11.5px; color: var(--text-muted); }
.profile-badge { position: relative; cursor: pointer; }

/* Reviews grid */
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 18px; }
.review-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--surface); }
.review-card .stars { color: #F59E0B; font-size: 14px; margin-bottom: 6px; }
.review-card .text { font-size: 13.5px; line-height: 1.55; color: var(--text); }
.review-card .who { display: flex; gap: 10px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.review-card .who .avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,#7C3AED,#DB2777); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }

/* Pricing matrix */
.pricing-matrix { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; font-size: 13.5px; }
.pricing-matrix table { width: 100%; border-collapse: collapse; }
.pricing-matrix th, .pricing-matrix td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.pricing-matrix thead th { background: var(--bg-alt, var(--surface)); font-weight: 700; }
.pricing-matrix tbody tr:last-child td { border-bottom: 0; }
.pricing-matrix .y { color: #10B981; font-weight: 700; }
.pricing-matrix .n { color: var(--text-muted); }
.pricing-matrix .section-row td { font-weight: 700; background: var(--bg-alt, var(--surface)); color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }

/* News list */
.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-item { padding: 14px; border: 1px solid var(--border); border-radius: 10px; }
.news-item .t { font-weight: 700; color: var(--text); margin-bottom: 4px; font-size: 14.5px; }
.news-item .s { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin-bottom: 6px; }
.news-item .m { font-size: 11.5px; color: var(--text-muted); }
.news-item .tag { display: inline-block; padding: 2px 8px; border-radius: 99px; background: var(--primary-soft, #F3E8FF); color: var(--primary, #7C3AED); font-size: 10.5px; font-weight: 700; margin-right: 8px; }

/* Recurring rows */
.rec-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.rec-row .ico { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--primary-soft, #F3E8FF); color: var(--primary, #7C3AED); }
.rec-row .body { flex: 1; }
.rec-row .body .name { font-weight: 600; font-size: 13.5px; }
.rec-row .body .meta { color: var(--text-muted); font-size: 11.5px; }
.rec-row .amt { font-weight: 700; font-size: 14px; }
.rec-row .actions { display: flex; gap: 4px; }
.rec-row .actions button { border: 1px solid var(--border); background: transparent; width: 30px; height: 30px; border-radius: 6px; cursor: pointer; }

/* Screenshots strip */
.screenshots-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 28px; }
.screenshot-card { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface); }
.screenshot-card .frame { aspect-ratio: 16/10; background: linear-gradient(135deg, #F3E8FF 0%, #FEE2E2 100%); display: flex; align-items: center; justify-content: center; font-size: 60px; }
.screenshot-card .cap { padding: 14px; font-size: 13px; color: var(--text-muted); border-top: 1px solid var(--border); }
.screenshot-card .cap strong { color: var(--text); display: block; margin-bottom: 2px; }

/* Feature/bug tabs */
.feedback-tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.feedback-tabs button { padding: 10px 16px; border: 0; background: transparent; cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; font-weight: 600; font-size: 13px; }
.feedback-tabs button.active { color: var(--primary, #7C3AED); border-bottom-color: var(--primary, #7C3AED); }

/* ─────────────────────────────────────────────────────────────
   Floating "Back to home" pill — used across legal pages, blog
   posts, marketing sub-pages, and the maintenance screen.
   Mirrors .auth-back-home from login.html for visual consistency.
   ───────────────────────────────────────────────────────────── */
.global-back-pill {
  position: fixed;
  top: 18px;
  left: 22px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(17, 24, 39, .06);
  transition: transform .15s, border-color .15s, box-shadow .15s, color .15s;
  -webkit-backdrop-filter: saturate(140%) blur(8px);
          backdrop-filter: saturate(140%) blur(8px);
}
.global-back-pill:hover,
.global-back-pill:focus-visible {
  transform: translateX(-2px);
  border-color: var(--primary, #7C3AED);
  color: var(--primary, #7C3AED);
  box-shadow: 0 6px 16px -4px rgba(124, 58, 237, .2);
  outline: none;
}
.global-back-pill svg { flex-shrink: 0; }

[data-theme="dark"] .global-back-pill {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}
[data-theme="dark"] .global-back-pill:hover,
[data-theme="dark"] .global-back-pill:focus-visible {
  border-color: var(--primary, #A78BFA);
  color: var(--primary, #A78BFA);
  box-shadow: 0 6px 16px -4px rgba(167, 139, 250, .35);
}

/* Hide pill while it would clash with the sticky landing nav */
.landing .global-back-pill { top: 14px; }

@media (max-width: 720px) {
  .global-back-pill { top: 12px; left: 12px; padding: 7px 12px 7px 10px; font-size: 12px; }
}
@media (max-width: 480px) {
  .global-back-pill span { display: none; } /* icon-only on tiny screens */
  .global-back-pill { padding: 8px; }
}

/* ─────────────────────────────────────────────────────────────
   Snapshot rows — download / delete actions on each row, plus
   the "Compare snapshots" button beneath the list.
   ───────────────────────────────────────────────────────────── */
.snap-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.snap-row:last-child { border-bottom: 0; }
.snap-row-main { flex: 1; min-width: 0; }
.snap-row-head { display: flex; justify-content: space-between; font-size: 12px; gap: 8px; }
.snap-row-head .snap-date { color: var(--text-muted); }
.snap-row-head .snap-net  { font-weight: 700; font-variant-numeric: tabular-nums; }
.snap-label { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.snap-row-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.snap-act {
  width: 28px; height: 28px; border-radius: 6px;
  background: transparent; border: 1px solid var(--border);
  cursor: pointer; font-size: 12px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s, color .12s;
}
.snap-act:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.snap-act.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ─────────────────────────────────────────────────────────────
   Bulk edit modal — uniform grid for select-all and rows.
   Fixes the alignment issue where checkbox / name / category /
   amount / date columns drifted out of line.
   ───────────────────────────────────────────────────────────── */
.bulk-toolbar {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.bulk-toolbar .bulk-all-label {
  grid-column: 1 / span 2;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  font-size: 13px;
}
.bulk-toolbar .bulk-all-label input[type="checkbox"] { margin: 0; flex: 0 0 auto; }
.bulk-toolbar .bulk-count { font-size: 12px; text-align: right; }

.bulk-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-top: 8px;
}
.bulk-list .bulk-row {
  display: grid;
  grid-template-columns: 24px minmax(140px, 2fr) minmax(110px, 1fr) 96px 80px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: background-color .12s;
}
.bulk-list .bulk-row:hover { background: var(--bg); }
.bulk-list .bulk-row > input[type="checkbox"] { margin: 0; }
.bulk-list .bulk-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-list .bulk-row-cat  { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-list .bulk-row-amt  { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.bulk-list .bulk-row-date { font-size: 11.5px; text-align: right; }

@media (max-width: 600px) {
  .bulk-list .bulk-row {
    grid-template-columns: 24px 1fr 100px;
    grid-template-rows: auto auto;
    row-gap: 2px;
  }
  .bulk-list .bulk-row-name { grid-column: 2; grid-row: 1; }
  .bulk-list .bulk-row-amt  { grid-column: 3; grid-row: 1; }
  .bulk-list .bulk-row-cat  { grid-column: 2; grid-row: 2; font-size: 11px; }
  .bulk-list .bulk-row-date { grid-column: 3; grid-row: 2; font-size: 11px; }
}

/* ─────────────────────────────────────────────────────────────
   Account-lifecycle banner (60-day reminder · 90-day deletion)
   Shown on dashboard when a paid plan is in grace / about-to-be-purged.
   ───────────────────────────────────────────────────────────── */
.lifecycle-banner {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px;
  margin: 0 0 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(17,24,39,.04);
  font-size: 13.5px; line-height: 1.55;
}
.lifecycle-banner.warn   { background:#FFFBEB; border-color:#FDE68A; color:#7C2D12; }
.lifecycle-banner.danger { background:#FEF2F2; border-color:#FCA5A5; color:#991B1B; }
.lifecycle-banner .lb-icon { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.lifecycle-banner .lb-body { flex: 1 1 auto; }
.lifecycle-banner .lb-body strong { display: block; font-size: 14.5px; margin-bottom: 4px; color: inherit; }
.lifecycle-banner .lb-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.lifecycle-banner .lb-actions .btn { font-size: 12.5px; padding: 6px 12px; }
[data-theme="dark"] .lifecycle-banner.warn   { background:rgba(120,53,15,.18); border-color:rgba(252,211,77,.45); color:#FDE68A; }
[data-theme="dark"] .lifecycle-banner.danger { background:rgba(127,29,29,.20); border-color:rgba(239,68,68,.55); color:#FECACA; }

/* In-app inline back link (used inside SPA subviews) */
.inline-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 8px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color .15s, border-color .15s, transform .15s;
}
.inline-back:hover,
.inline-back:focus-visible {
  color: var(--primary, #7C3AED);
  border-color: var(--primary, #7C3AED);
  transform: translateX(-2px);
  outline: none;
}
.inline-back svg { flex-shrink: 0; }
