:root {
  /* Brand kit (Oct 2026): forest #063C2C, deep forest #03291F, silver #C9CDD3,
     soft white #F8FAF8, signature purple #835EEC */
  --forest-900: #03291f;
  --forest-800: #063c2c;
  --forest-700: #0e4f3a;
  --forest-600: #176148;
  --forest-500: #2c7a51;
  --silver-100: #f8faf8;
  --silver-200: #eceeef;
  --silver-300: #c9cdd3;
  --silver-400: #b3b9bf;
  --silver-600: #7c848a;
  --silver-800: #454b4f;
  --purple-500: #835eec;
  --purple-600: #6c46d4;
  --purple-100: #f1edfd;
  --warn: #b8712f;
  --danger: #a8452f;
  --success: #2c7a51;
  --surface: #ffffff;
  --bg: var(--silver-100);
  --text: #16211c;
  --text-muted: var(--silver-800);
  --radius: 20px;
  --shadow: 0 6px 24px rgba(6, 60, 44, 0.07);
  --topbar-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100vh; display: flex; flex-direction: column; }

a { color: inherit; }

h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.2; }
p { margin: 0 0 12px; line-height: 1.5; }

button {
  font-family: inherit;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 14px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--forest-700); color: #fff; }
.btn-primary:hover { background: var(--forest-600); }
.btn-accent { background: var(--purple-500); color: #fff; }
.btn-accent:hover { background: var(--purple-600); }
.btn-ghost { background: transparent; color: var(--forest-700); border: 1.5px solid var(--silver-400); }
.btn-ghost:hover { border-color: var(--forest-600); color: var(--forest-800); }
.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 999px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  border: 1px solid var(--silver-200);
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; width: 100%; }
.container-narrow { max-width: 480px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* Top bar: full-width forest-green header, as in the original design */
.topbar {
  background: var(--forest-800);
  color: #fff;
  height: var(--topbar-h);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
}
.brand {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-dot { color: var(--purple-500); }
.brand-emblem { width: 38px; height: 38px; border-radius: 11px; display: block; box-shadow: 0 2px 8px rgba(0,0,0,0.35); }
.brand-tagline {
  color: var(--silver-300);
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
  border-left: 1px solid rgba(255,255,255,0.25);
  padding-left: 12px;
  margin-left: 2px;
}
.topbar-spacer { flex: 1; }
.lang-select {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  padding: 5px 6px;
  font-size: 12.5px;
  width: 92px;
  flex-shrink: 0;
}
.lang-select option { color: #16211c; }
.topbar-greeting { display: flex; align-items: center; gap: 10px; }
.greeting-text { font-weight: 700; color: #fff; font-size: 14.5px; white-space: nowrap; }

/* App shell: left sidebar + right column (page content), below the top bar */
.app-shell { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--forest-800);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 40;
  transition: width 0.2s ease, transform 0.22s ease;
}
.sidebar.empty { display: none; }
@media (min-width: 761px) {
  .sidebar.collapsed { width: 0; }
  .sidebar.collapsed .sidebar-links,
  .sidebar.collapsed .sidebar-footer { opacity: 0; pointer-events: none; }
}
.sidebar-links { display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; flex: 1; }
.sidebar-link {
  color: var(--silver-300);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid transparent;
  white-space: nowrap;
}
.sidebar-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-link.active { background: rgba(138,92,246,0.22); color: #fff; border-left-color: var(--purple-500); }
.sidebar-footer { padding: 14px 12px 20px; }
.sidebar-overlay { display: none; }

.badge-count {
  background: var(--purple-500);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 4px;
}
.hamburger { display: block; background: none; border: none; color: #fff; font-size: 22px; padding: 4px 8px; flex-shrink: 0; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--purple-100); border: 2px solid var(--purple-500);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initial { font-weight: 800; color: var(--purple-600); font-size: 15px; }

.page { flex: 1; padding: 32px 24px 64px; }

/* Landing */
.hero {
  background: linear-gradient(135deg, var(--forest-900), var(--forest-700) 60%, var(--purple-600));
  color: #fff;
  padding: 88px 20px 96px;
  text-align: center;
}
.hero h1 { font-size: 42px; max-width: 720px; margin: 0 auto 16px; letter-spacing: -0.02em; }
.hero p { font-size: 18px; max-width: 620px; margin: 0 auto 32px; color: var(--silver-200); }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.5); }
.hero .btn-ghost:hover { border-color: #fff; }
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 56px auto 0;
  max-width: 1080px;
  padding: 0 20px;
}
.feature-card { text-align: left; }
.feature-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--purple-100); color: var(--purple-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 12px;
}
.privacy-strip {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  max-width: 640px;
  margin: 48px auto 0;
  padding: 0 20px;
}

/* Auth */
.auth-card { margin-top: 40px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-muted); }
.auth-switch a { color: var(--purple-600); font-weight: 600; text-decoration: none; }
.form-error {
  background: #fbeee9;
  color: var(--danger);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 14px;
}
.form-note { font-size: 12.5px; color: var(--text-muted); margin-top: -6px; margin-bottom: 16px; }

label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--forest-800); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--silver-300);
  border-radius: 9px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  margin-bottom: 16px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--forest-600);
  box-shadow: 0 0 0 3px rgba(31,92,61,0.15);
}
.field-help { font-size: 12.5px; color: var(--text-muted); margin: -10px 0 16px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 14px; }
.checkbox-row input { width: auto; margin: 0; }
.radio-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.radio-card {
  border: 1.5px solid var(--silver-300);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
}
.radio-card.selected { border-color: var(--purple-500); background: var(--purple-100); }
.radio-card input { margin: 0; }

/* Dashboard grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 780px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
.stack { display: flex; flex-direction: column; gap: 20px; }
.card-title { font-size: 15px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 700; margin-bottom: 14px; }
.stat-value { font-size: 30px; font-weight: 800; color: var(--forest-800); }
.stat-sub { font-size: 13px; color: var(--text-muted); }

.progress-track { width: 100%; background: var(--silver-200); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; transition: width 0.3s ease; }
.budget-row { margin-bottom: 16px; }
.budget-row:last-child { margin-bottom: 0; }
.budget-row-head { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 6px; }
.budget-label { font-weight: 700; color: var(--forest-800); }
.budget-figures { color: var(--text-muted); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state h3 { color: var(--text); }

/* Alert cards */
.alert-item {
  border-left: 4px solid var(--purple-500);
  background: var(--silver-100);
  border-radius: 0 10px 10px 0;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.alert-item.unread { border-left-color: var(--warn); background: #fdf6ee; }
.alert-item-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.alert-type-tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--forest-700); color: #fff; padding: 2px 8px; border-radius: 999px; font-weight: 700;
}
.alert-time { font-size: 12px; color: var(--text-muted); }
.alert-message { font-weight: 600; margin-bottom: 6px; }
.alert-why, .alert-suggestion { font-size: 13.5px; color: var(--text-muted); margin-bottom: 4px; }
.alert-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Tables / lists */
.entry-list { list-style: none; margin: 0; padding: 0; }
.entry-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--silver-200);
  gap: 12px;
}
.entry-row:last-child { border-bottom: none; }
.entry-main { display: flex; flex-direction: column; }
.entry-cat { font-weight: 600; }
.entry-meta { font-size: 12.5px; color: var(--text-muted); }
.entry-amount { font-weight: 800; font-size: 15px; white-space: nowrap; }
.entry-amount.income { color: var(--success); }
.entry-amount.expense { color: var(--forest-800); }
.tag-pill {
  font-size: 11px; background: var(--silver-200); color: var(--text-muted);
  padding: 1px 7px; border-radius: 999px; margin-left: 6px;
}

.tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn {
  background: var(--silver-200); border: none; padding: 9px 16px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700; color: var(--text-muted);
}
.tab-btn.active { background: var(--forest-700); color: #fff; }

.chart-axis-label { font-size: 10px; fill: var(--silver-600); font-family: var(--font); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; }

.sentiment-card { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--silver-200); }
.sentiment-card:last-child { border-bottom: none; }
.sentiment-badge { padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.sentiment-bullish { background: #e6f4ec; color: var(--success); }
.sentiment-neutral { background: var(--silver-200); color: var(--text-muted); }
.sentiment-bearish { background: #f6e9e5; color: var(--danger); }

.tooltip-term { border-bottom: 1.5px dotted var(--silver-600); cursor: help; }

.form-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

footer.site-footer {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 24px 20px 40px;
}

.step-indicator { display: flex; gap: 6px; margin-bottom: 24px; }
.step-dot { flex: 1; height: 5px; border-radius: 999px; background: var(--silver-300); }
.step-dot.done { background: var(--purple-500); }

.notice-box {
  background: var(--purple-100);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--forest-800);
  margin-bottom: 20px;
}

/* Dashboard income header */
.income-header-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.income-header-cycle { display: flex; flex-direction: column; margin-left: auto; min-width: 160px; }
.income-header-cycle select { margin-bottom: 0; }
.btn-round {
  width: 44px; height: 44px; border-radius: 50%; font-size: 22px; font-weight: 700;
  padding: 0; line-height: 1; flex-shrink: 0;
}
.over-budget { color: var(--danger); font-weight: 700; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10,42,28,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 60; padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal { max-width: 460px; width: 100%; max-height: 90vh; overflow-y: auto; }
.allocation-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.allocation-row { display: flex; align-items: center; gap: 10px; }
.allocation-row span:first-child { flex: 1; font-size: 14px; font-weight: 600; color: var(--forest-800); }
.alloc-input { width: 80px; margin-bottom: 0; }

/* Transactions / report table */
.report-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.report-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); padding: 8px 6px; border-bottom: 2px solid var(--silver-300); }
.report-table td { padding: 10px 6px; border-bottom: 1px solid var(--silver-200); }
.amount-income { color: var(--success); font-weight: 700; }
.amount-expense { color: var(--forest-800); font-weight: 700; }
.print-title { display: none; }

@media print {
  .no-print, .sidebar, .topbar { display: none !important; }
  .print-title { display: block; }
  body, .page { padding: 0; background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

@media (max-width: 900px) {
  .brand-tagline { display: none; }
}

@media (max-width: 760px) {
  .sidebar:not(.empty) { position: fixed; left: 0; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); transform: translateX(-100%); box-shadow: 4px 0 24px rgba(0,0,0,0.25); }
  .sidebar:not(.empty).open { transform: translateX(0); }
  .sidebar-overlay:not([hidden]) { display: block; position: fixed; top: var(--topbar-h); left: 0; right: 0; bottom: 0; background: rgba(10,42,28,0.5); z-index: 35; }
  .hamburger { display: block; }
  .topbar { padding: 0 14px; gap: 10px; }
  .greeting-text { display: none; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 16px; }
  .page { padding: 20px 16px 48px; }
  .container, .container-narrow { padding: 0; }
}

.forgot-row { text-align: right; margin: -8px 0 14px; font-size: 13.5px; }
.forgot-row a { color: var(--purple-600); font-weight: 600; text-decoration: none; }
.forgot-row a:hover { text-decoration: underline; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200;
  max-width: min(92vw, 460px); padding: 12px 18px; border-radius: 10px;
  background: var(--danger); color: #fff; font-size: 14px; box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}
.budget-total-row { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--silver-300); font-size: 14px; }
.budget-total-row strong { font-size: 20px; color: var(--forest-800); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { margin-bottom: 4px; }
.debt-bar { margin: 4px 0 10px; }
.debt-figures { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13.5px; color: var(--text-muted); }
.debt-figures strong { color: var(--text); }
.switch-row { display: inline-flex; align-items: center; gap: 8px; margin: 0 auto 0 0; font-size: 13.5px; cursor: pointer; }
.switch-row input { width: auto; margin: 0; }
.modal-backdrop[class] { z-index: 120; }
.modal-error { margin-top: 6px; }

/* --- Dashboard: cycle controls and summary tables --- */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.dash-head h2 { margin: 0; }
.cycle-controls { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.cycle-controls label { margin-bottom: 4px; font-size: 12.5px; }
.cycle-controls select, .cycle-controls input { margin-bottom: 0; width: auto; min-width: 150px; }
.cycle-range { display: flex; flex-direction: column; font-weight: 700; color: var(--forest-800); font-size: 14px; padding-bottom: 10px; }
.cycle-range small { font-weight: 500; color: var(--text-muted); font-size: 12px; }
.dash-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; margin-bottom: 20px; }
.dash-tables .card-title { display: flex; justify-content: space-between; align-items: center; }
.btn-round-sm { width: 30px; height: 30px; font-size: 20px; line-height: 1; padding: 0; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin-top: 8px; }
.mini-table td { padding: 8px 0; border-bottom: 1px solid var(--silver-300); vertical-align: top; }
.mini-table td:last-child { text-align: right; font-weight: 700; white-space: nowrap; padding-left: 12px; }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table tr.total td { font-weight: 800; color: var(--forest-800); font-size: 16px; }
.mini-table tr.sub td:first-child { padding-left: 14px; color: var(--text-muted); }
.muted-line { display: block; font-weight: 400; color: var(--text-muted); font-size: 12px; }

/* --- Reports --- */
.report-type-tabs { margin-bottom: 14px; }
.muted { color: var(--text-muted); }
.change-good { color: var(--success); font-weight: 700; }
.change-bad { color: var(--danger); font-weight: 700; }
.ratio-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.ratio-good { background: #dff0e6; color: #14532d; }
.ratio-ok { background: #fdf0d2; color: #7a5200; }
.ratio-watch { background: #f8dcd4; color: #8a2f1a; }

.sync-banner {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 200;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
  max-width: min(94vw, 560px); padding: 10px 16px; border-radius: 10px; font-size: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
}
.sync-banner[hidden] { display: none; }
.sync-saving { background: var(--forest-800); color: #fff; }
.sync-saved { background: var(--forest-600); color: #fff; }
.sync-failed { background: #fff; color: var(--danger); border: 2px solid var(--danger); font-weight: 600; }
.sync-failed .btn { padding: 6px 12px; }

.scope-tag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--silver-200); color: var(--text-muted); font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; text-transform: none; vertical-align: middle; }

.receipt-list { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.link-btn { background: none; border: 0; color: var(--text-muted); cursor: pointer; padding: 0 2px; font-size: 12px; }
.link-btn:hover { color: var(--danger); }

/* ---------- Brand: logo on the landing + auth pages ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hero-logo { display: block; width: min(440px, 88%); height: auto; margin: 0 auto 28px; border-radius: 32px; box-shadow: 0 18px 50px rgba(0,0,0,0.35); }
.auth-emblem { display: block; width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 16px; box-shadow: var(--shadow); }
.auth-card h2 { text-align: center; }

/* ======================= Dashboard (brand refresh) ======================= */
.dash { max-width: 1120px; }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.dash-title h2 { margin: 0; font-size: 30px; letter-spacing: -0.02em; color: var(--forest-800); }
.dash-sub { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; color: var(--text-muted); font-size: 14px; }
.dash-sub .icon { color: var(--purple-500); }
.dash .cycle-controls {
  background: var(--surface); border: 1px solid var(--silver-200); border-radius: 20px;
  padding: 10px 16px; box-shadow: var(--shadow); gap: 16px; align-items: flex-end;
}
.dash .cycle-field label { display: block; margin: 0 0 4px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.dash .cycle-controls select, .dash .cycle-controls input { border-radius: 12px; min-width: 140px; padding: 8px 10px; }
.cycle-end { display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 8px; font-size: 14px; color: var(--forest-800); }
.cycle-end-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.dash-help { margin: 4px 0 18px; }
.dash .notice-box { border-radius: 18px; margin-bottom: 20px; }

.dash-row { display: grid; gap: 20px; margin-bottom: 20px; align-items: stretch; }
.dash-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.dash-card { display: flex; flex-direction: column; padding: 22px 24px; border-radius: 24px; border: 1px solid rgba(6, 60, 44, 0.08); transition: transform 0.18s ease, box-shadow 0.18s ease; }
.dash-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(6, 60, 44, 0.11); }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.card-icon { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; flex-shrink: 0; }
.tone-forest { background: #e2f0e8; color: var(--forest-700); }
.tone-purple { background: var(--purple-100); color: var(--purple-600); }
.tone-danger { background: #f9e7e1; color: var(--danger); }
.card-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.card-heading { margin: 0; font-size: 17px; font-weight: 800; color: var(--forest-800); letter-spacing: -0.01em; }
.dash .scope-tag { margin: 0; }

.mini-table { margin-top: 2px; }
.mini-table td { padding: 10px 0; border-bottom: 1px solid var(--silver-200); }
.mini-table td:last-child, .stat-value, .budget-figures { font-variant-numeric: tabular-nums; }
.mini-table td:first-child { width: 100%; }
.row-label { display: flex; align-items: flex-start; gap: 10px; line-height: 1.35; }
.row-label .icon { margin-top: 2px; color: var(--silver-600); flex-shrink: 0; }
.mini-table tr.total .row-label .icon { color: var(--purple-600); }
.row-text { display: block; line-height: 1.35; }
.mini-table tr.sub td:first-child { padding-left: 0; color: var(--text-muted); }
.is-good { color: var(--success); }
.stat-block { margin-bottom: 10px; }
.dash .stat-value { font-size: 30px; letter-spacing: -0.02em; }
.empty-line { margin: 8px 0 0; }
.card-foot { margin-top: auto; padding-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card-foot .btn .icon { flex-shrink: 0; }
.card-hint { margin: 12px 0 0; }

/* Gauges: thick, soft, rounded */
.gauge-track { width: 100%; height: 14px; background: var(--silver-200); border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(6, 60, 44, 0.08); }
.gauge-fill { height: 100%; min-width: 0; border-radius: 999px; transition: width 0.4s ease; }
.gauge-fill.is-ok { background: linear-gradient(90deg, var(--purple-500), #a58af4); }
.gauge-fill.is-forest { background: linear-gradient(90deg, var(--forest-600), #4aa377); }
.gauge-fill.is-warn { background: linear-gradient(90deg, #d08a3d, #e8b36b); }
.gauge-fill.is-danger { background: linear-gradient(90deg, var(--danger), #d4705a); }
.dash .budget-row { margin-bottom: 18px; }
.dash .budget-row-head { align-items: center; gap: 10px; font-size: 13.5px; margin-bottom: 8px; }
.budget-label { display: inline-flex; align-items: center; gap: 8px; }
.budget-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 9px; background: var(--silver-100); color: var(--forest-700); }
.budget-figures { text-align: right; }
.gauge-note { display: flex; align-items: flex-start; gap: 6px; margin: 4px 0 0; }
.gauge-note .icon { flex-shrink: 0; margin-top: 1px; color: var(--purple-600); }
.dash .budget-total-row { border-radius: 14px; background: var(--silver-100); padding: 10px 14px; border-bottom: 0; margin: 4px 0 18px; }
.dash select#period-select { border-radius: 12px; margin-bottom: 10px; }

.dash-alerts { margin-bottom: 20px; }
.dash .alert-item { border-radius: 0 14px 14px 0; }
.dash-actions { gap: 12px; }

@media (max-width: 1000px) {
  .brand-tagline { display: none; }
  .dash-row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .dash-row-2, .dash-row-3 { grid-template-columns: minmax(0, 1fr); }
  .dash .cycle-controls { width: 100%; }
  .dash-title h2 { font-size: 26px; }
}

a.btn, a.btn:hover { text-decoration: none; }
.dash .budget-row-head { flex-wrap: wrap; row-gap: 4px; }
.budget-figures { white-space: nowrap; margin-left: auto; font-size: 13px; }

/* ---------- Footer ---------- */
footer.site-footer-full {
  background: var(--forest-900); color: var(--silver-300); text-align: left;
  padding: 40px 20px 22px; margin-top: 40px; font-size: 14px;
}
.footer-inner { max-width: 1080px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 28px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { width: 44px; height: 44px; border-radius: 13px; box-shadow: 0 2px 10px rgba(0,0,0,0.4); }
.footer-brand strong { color: #fff; font-size: 18px; letter-spacing: -0.01em; }
.footer-brand p { margin: 2px 0 0; color: var(--silver-300); font-size: 14px; }
.footer-links { display: flex; gap: 8px 24px; flex-wrap: wrap; }
.footer-links a { color: var(--silver-300); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-copy { max-width: 1080px; margin: 24px auto 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.12); color: var(--silver-400); font-size: 12.5px; }
footer.site-footer-slim { display: flex; justify-content: center; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding: 22px 20px 32px; }
.site-footer-slim .footer-links a { color: var(--text-muted); font-weight: 500; font-size: 13px; }
.site-footer-slim .footer-links a:hover { color: var(--forest-800); }
.info-page { max-width: 640px; margin-top: 24px; }
.info-page h2 { color: var(--forest-800); }
.info-lead { font-size: 20px; font-weight: 700; color: var(--purple-600); margin-bottom: 16px; }
.info-list { padding-left: 20px; line-height: 1.7; }
.info-back { margin: 20px 0 0; font-size: 14px; }
.info-back a { color: var(--purple-600); font-weight: 600; text-decoration: none; }

/* ---------- Installable app ---------- */
.net-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 300; background: var(--warn); color: #fff; text-align: center; font-size: 13.5px; font-weight: 600; padding: 6px 12px; }
.net-banner[hidden] { display: none; }
.install-block { background: var(--silver-100); border-radius: 18px; padding: 14px 18px; margin: 14px 0; border: 1px solid transparent; }
.install-block.is-yours { border-color: var(--purple-500); background: var(--purple-100); }
.install-block h3 { margin: 0 0 6px; font-size: 16px; color: var(--forest-800); }
.install-block .info-list { margin: 0; }
@supports (padding: max(0px)) {
  :root { --topbar-h: calc(60px + env(safe-area-inset-top)); }
  .topbar { padding-top: env(safe-area-inset-top); }
  footer.site-footer { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
}

/* ---------- Bank-statement style Transactions page ---------- */
.statement-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 36px; margin: 8px 0 22px; align-items: start; }
.bank-heading { font-size: 18px; font-weight: 600; color: var(--text-muted); margin: 0 0 8px; padding-bottom: 8px; border-bottom: 2px solid var(--silver-300); letter-spacing: 0; }
.bank-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; padding: 9px 0; background: none; border: 0; font: inherit; color: var(--text); text-align: left; }
.bank-row .bank-label { font-weight: 700; color: var(--forest-800); }
.bank-row strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.bank-row-toggle { cursor: pointer; border-radius: 10px; }
.bank-row-toggle:hover { background: var(--silver-100); }
.bank-row-toggle .chev { display: inline-block; vertical-align: middle; transition: transform 0.15s ease; color: var(--purple-600); }
.bank-row-toggle .chev.open { transform: rotate(90deg); }
.bank-sub { margin: 0 0 4px 22px; padding-left: 14px; border-left: 3px solid var(--purple-100); }
.bank-sub .bank-row { padding: 5px 0; font-size: 14px; color: var(--text-muted); }
.bank-note { margin: 6px 0 0; }
.statement-options .bank-link { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 0; font: inherit; font-size: 17px; color: var(--forest-700); text-decoration: underline; cursor: pointer; }
.statement-options .bank-link:hover { color: var(--purple-600); }

.bank-tabs { display: inline-flex; border: 1.5px solid var(--purple-500); border-radius: 16px; overflow: hidden; margin: 4px 0 20px; background: var(--surface); max-width: 100%; }
.bank-tabs button { border: 0; background: transparent; padding: 11px 26px; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--forest-800); cursor: pointer; border-right: 1.5px solid var(--purple-500); }
.bank-tabs button:last-child { border-right: 0; }
.bank-tabs button.active { background: var(--purple-500); color: #fff; }
.bank-tabs button:hover:not(.active) { background: var(--purple-100); }

.bank-filters { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: flex-end; margin-bottom: 4px; }
.bank-filter { display: flex; align-items: center; gap: 10px; }
.bank-filter label { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--forest-700); }
.bank-filter select { margin: 0; min-width: 130px; border: 1.5px solid var(--forest-700); border-radius: 12px; padding: 8px 10px; font-weight: 700; color: var(--forest-800); }
.bank-range { margin: 8px 0 12px; }

.txn-card { padding: 6px 4px; border-radius: 18px; overflow-x: auto; }
.txn-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.txn-table th { text-align: left; color: var(--forest-700); font-weight: 700; padding: 14px 12px; font-size: 15.5px; border-bottom: 1px solid var(--silver-300); }
.txn-table td { padding: 12px 12px; border-bottom: 1px solid var(--silver-200); color: #565c62; vertical-align: top; }
.txn-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.txn-table td.debit { color: var(--danger); }
.txn-table td.credit { color: var(--success); }
.txn-table .col-plus { width: 34px; padding-right: 0; }
.txn-plus { width: 24px; height: 24px; border-radius: 8px; border: 0; background: var(--purple-100); color: var(--purple-600); font-size: 17px; line-height: 1; font-weight: 700; cursor: pointer; padding: 0; }
.txn-plus:hover { background: var(--purple-500); color: #fff; }
.txn-detail td { background: var(--silver-100); font-size: 13.5px; color: var(--text-muted); border-bottom: 1px solid var(--silver-300); }
.bank-pages { display: flex; gap: 6px; justify-content: center; margin: 18px 0 8px; flex-wrap: wrap; }
.bank-pages button { min-width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--silver-300); background: var(--surface); color: var(--forest-700); font-weight: 700; cursor: pointer; }
.bank-pages button.active { background: var(--purple-500); border-color: var(--purple-500); color: #fff; }
.stmt-table .num { text-align: right; }
.stmt-table th.num { text-align: right; }

@media (max-width: 760px) {
  .statement-top { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .bank-tabs { display: flex; width: 100%; }
  .bank-tabs button { flex: 1; padding: 10px 6px; font-size: 13px; }
  .txn-table .col-cat { display: none; }
  .txn-table th, .txn-table td { padding: 10px 8px; font-size: 14px; }
}

.statement-top { grid-template-columns: minmax(0, 1fr); }
.statement-summary { max-width: 720px; }
