:root {
  --bg: #F4F1EB;
  --card: #FFFFFF;
  --border: #ECE7DD;
  --input-bg: #FAF8F3;
  --ink-new-line: #b3b2b4;
  --ink: #26242E;
  --muted: #9A968D;
  --muted-2: #A8A49B;
  --muted-3: #B4B0A7;
  --primary: #5B5BD6;
  --primary-bg: #F1F1FB;
  --income: #1FA971;
  --expense: #E8634F;
  --invest: #2FB17A;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 11px;
}

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

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

input, select, button, textarea { font-family: inherit; color: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #dcd8cf; border-radius: 8px; border: 2px solid var(--bg); }

/* ---------- layout ---------- */
.app-shell { display: flex; min-height: 100vh; width: 100%; }

.sidebar {
  width: 248px; flex: none; background: var(--card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 26px 18px;
  position: sticky; top: 0; height: 100vh;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 26px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 19px;
}
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -.2px; }
.brand-sub { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: none; border-radius: 13px; cursor: pointer; font-size: 14.5px; font-weight: 600;
  text-align: left; background: transparent; color: #6B6770; width: 100%;
}
.nav-item .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.nav-item.active { background: var(--primary-bg); color: var(--primary); }

.btn-new {
  margin-top: 18px; padding: 13px; border: none; border-radius: 14px;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 14.5px;
  cursor: pointer; box-shadow: 0 6px 16px rgba(91,91,214,.28); display: block; text-align: center;
}

.sidebar-saldo { margin-top: auto; padding: 16px 12px 4px; border-top: 1px solid #F0ECE3; }
.sidebar-saldo .caption { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.sidebar-saldo .value { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.value.negative { color: var(--expense); }
.value.positive { color: var(--income); }

.sidebar-user {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid #F0ECE3;
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex: none;
}
.user-name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-status { font-size: 11.5px; color: var(--muted-2); font-weight: 500; }
.btn-logout {
  padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 10px; background: #fff;
  cursor: pointer; color: var(--expense); font-size: 12.5px; font-weight: 700; flex: none;
}

.main { flex: 1; min-width: 0; padding: 30px 38px 60px; max-width: 1180px; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; gap: 14px; }
.page-kicker { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.page-title { font-size: 27px; font-weight: 800; letter-spacing: -.6px; }

.header-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.period-tabs { display: flex; gap: 3px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 5px; }
.period-tabs button { padding: 8px 15px; border: none; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 13px; background: transparent; color: #67636E; }
.period-tabs button.active { background: var(--primary); color: #fff; }

.month-nav { display: flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 6px; }
.month-nav button { width: 34px; height: 34px; border: none; border-radius: 10px; background: var(--bg); cursor: pointer; font-size: 17px; color: #67636E; font-weight: 700; }
.month-nav .label { min-width: 158px; text-align: center; font-weight: 700; font-size: 15px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.card-title { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.card-sub { font-size: 12.5px; color: var(--muted-2); margin-bottom: 18px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.kpi-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.kpi-head .dot { width: 9px; height: 9px; border-radius: 50%; }
.kpi-head span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 25px; font-weight: 800; letter-spacing: -.6px; }

.grid-2 { display: grid; grid-template-columns: 1.05fr 1fr; gap: 16px; margin-bottom: 18px; }
.grid-2-even { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* donut */
.donut-wrap { display: flex; align-items: center; gap: 26px; }
.donut { position: relative; width: 158px; height: 158px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center .label { font-size: 11px; color: var(--muted-2); font-weight: 600; }
.donut-center .value { font-size: 18px; font-weight: 800; letter-spacing: -.4px; }
.cat-legend { flex: 1; display: flex; flex-direction: column; gap: 11px; }
.cat-legend-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.cat-legend-row .name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.cat-legend-row .name .dot { width: 9px; height: 9px; border-radius: 50%; }
.cat-legend-row .pct { font-size: 13px; font-weight: 700; color: #67636E; }
.bar-track { height: 7px; border-radius: 6px; background: #F1EEE7; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; }
.empty-state { padding: 30px 0; text-align: center; color: var(--muted-3); font-size: 14px; }

/* comparison chart */
.compare-legend { font-size: 12px; color: var(--muted-2); margin-bottom: 16px; }
.compare-legend .dot { font-weight: 700; }
.compare-chart { display: flex; gap: 10px; align-items: flex-start; }
.compare-axis { display: flex; flex-direction: column; justify-content: space-between; height: 108px; min-width: 42px; text-align: right; font-size: 10px; font-weight: 600; color: var(--muted-3); }
.compare-plot { flex: 1; position: relative; height: 108px; }
.compare-grid-line { position: absolute; left: 0; right: 0; border-top: 1px dashed #EFEBE3; }
.compare-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.compare-bar-group { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 6px; height: 100%; }
.compare-stack { width: 14px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.compare-inv { width: 14px; border-radius: 5px 5px 0 0; background: #4F86E8; }
.compare-exp { width: 14px; background: var(--expense); }
.compare-inc { width: 14px; border-radius: 5px 5px 0 0; background: var(--income); }
.compare-labels { display: flex; gap: 10px; margin-top: 7px; }
.compare-labels .spacer { min-width: 42px; }
.compare-labels-row { flex: 1; display: flex; justify-content: space-between; gap: 8px; }
.compare-labels-row span { flex: 1; text-align: center; font-size: 11px; color: var(--muted-3); font-weight: 600; }
.compare-labels-row span.current { color: var(--ink); font-weight: 700; }

/* goals */
.goal-row { margin-bottom: 14px; }
.goal-row-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.goal-row-head .label { font-size: 13.5px; font-weight: 600; }
.goal-row-head .value { font-size: 13px; font-weight: 600; }
.goal-row-head .value .goal-of { color: var(--muted-3); font-weight: 500; }
.goal-bar-track { height: 9px; border-radius: 6px; background: #F1EEE7; overflow: hidden; }
.goal-note { font-size: 11.5px; font-weight: 600; margin-top: 5px; }

/* lists */
.list-row { display: flex; align-items: center; gap: 13px; padding: 13px; border-radius: 15px; background: var(--input-bg); margin-bottom: 12px; }
.list-row:last-child { margin-bottom: 0; }
.card-mini { width: 42px; height: 30px; border-radius: 7px; flex: none; }
.list-row-title { font-weight: 700; font-size: 14px; }
.list-row-meta { font-size: 12px; color: var(--muted-2); font-weight: 500; }
.list-row-right { text-align: right; }
.list-row-right .amt { font-weight: 800; font-size: 15.5px; }
.list-row-right .sub { font-size: 11.5px; color: var(--muted-2); font-weight: 600; }

.future-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; }
.future-row .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.future-row .desc { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.future-row .when { font-size: 11.5px; color: var(--muted-2); font-weight: 500; }
.future-row .portion { font-weight: 700; font-size: 14px; }

.insight-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.insight { display: flex; gap: 12px; padding: 15px 16px; border-radius: 15px; }
.insight-icon { width: 30px; height: 30px; border-radius: 9px; flex: none; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }
.insight-text { font-size: 13.5px; line-height: 1.45; font-weight: 500; color: #3C3A45; align-self: center; }

/* buttons & forms */
.btn { padding: 12px 20px; border: none; border-radius: 14px; font-weight: 700; font-size: 14.5px; cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(91,91,214,.18); }
.btn-success { background: var(--income); color: #fff; }
.btn-outline { background: #fff; border: 1.5px solid var(--border); color: #67636E; }
.btn-outline-danger { background: #fff; border: 1.5px solid #2FB17A; color: #1E8A5E; }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 13.5px; border-radius: 12px; }

.field { margin-bottom: 20px; min-width: 0; }
.field label { display: block; font-size: 13px; font-weight: 700; color: #67636E; margin-bottom: 8px; }
.input, select.input {
  width: 100%; min-width: 0; border: 1.5px solid var(--border); background: var(--input-bg);
  border-radius: var(--radius-md); padding: 14px 16px; font-size: 14.5px; font-weight: 600;
}
input.input[type="date"] { -webkit-appearance: none; appearance: none; }
.input-amount { display: flex; align-items: center; background: var(--input-bg); border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 0 16px; }
.input-amount span { font-size: 19px; font-weight: 700; color: var(--muted-2); }
.input-amount input { flex: 1; border: none; background: none; padding: 15px 10px; font-size: 22px; font-weight: 800; letter-spacing: -.4px; }

.pill-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: var(--bg); border-radius: 15px; padding: 6px; margin-bottom: 24px; }
.pill-toggle label { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; border-radius: 11px; cursor: pointer; font-weight: 700; font-size: 14.5px; color: var(--muted); }
.pill-toggle input { display: none; }
.pill-toggle input:checked + label { background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.pill-toggle input[value="expense"]:checked + label { color: var(--expense); }
.pill-toggle input[value="income"]:checked + label { color: var(--income); }

.method-toggle { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.method-toggle label { display: block; text-align: center; padding: 12px; border: 1.5px solid var(--border); border-radius: 13px; cursor: pointer; font-weight: 700; font-size: 13.5px; color: #67636E; background: #fff; }
.method-toggle input { display: none; }
.method-toggle input:checked + label { border-color: var(--primary); background: var(--primary-bg); color: var(--primary); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row label { display: flex; align-items: center; gap: 7px; padding: 9px 14px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; font-weight: 600; font-size: 13px; background: #fff; color: #3C3A45; }
.chip-row input { display: none; }
.chip-row input:checked + label { background: var(--chip-color, var(--primary)); border-color: var(--chip-color, var(--primary)); color: #fff; }
.chip-row .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--chip-color, currentColor); }
.chip-row input:checked + label .dot { background: #fff; }
.chip-add { display: flex; align-items: center; gap: 6px; padding: 9px 14px; border: 1.5px dashed #C9C4B8; border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 13px; background: #fff; color: #67636E; margin-top: 10px;}

.toggle-card { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border: 1.5px solid var(--border); background: #fff; border-radius: 14px; margin-bottom: 22px; cursor: pointer; }
.toggle-card input { display: none; }
.toggle-card .box { width: 23px; height: 23px; border-radius: 7px; border: 2px solid #C9C4B8; display: flex; align-items: center; justify-content: center; flex: none; color: #fff; font-size: 14px; font-weight: 800; }
.toggle-card input:checked ~ .box { background: var(--primary); border-color: var(--primary); }
.toggle-card input:checked ~ .box::after { content: '✓'; }
.toggle-card .title { font-weight: 700; font-size: 14px; }
.toggle-card .sub { font-size: 12.5px; color: var(--muted-2); font-weight: 500; }

.form-row { display: grid; gap: 14px; margin-bottom: 20px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-1-1_4 { grid-template-columns: 1fr 1.4fr; }

.error-text { font-size: 13px; color: var(--expense); font-weight: 600; margin: -6px 0 14px; }

/* tables / extrato */
.view-toggle { display: flex; gap: 3px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 5px; width: fit-content; margin-bottom: 14px; }
.view-toggle button { padding: 8px 15px; border: none; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 13px; background: transparent; color: #67636E; }
.view-toggle button.active { background: var(--primary); color: #fff; }

.filter-row { display: flex; gap: 8px; margin-bottom: 18px; align-items: center; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.filter-row .chip-link { padding: 8px 16px; border: 1.5px solid var(--border); border-radius: 11px; cursor: pointer; font-weight: 600; font-size: 13px; background: #fff; color: #67636E; flex: none; }
.filter-row .chip-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.cat-select {
  padding: 8px 14px; border: 1.5px solid var(--border); border-radius: 11px; cursor: pointer;
  font-weight: 600; font-size: 13px; background: #fff; color: #67636E; flex: none; max-width: 160px;
}
.filter-excel { margin-left: auto; flex: none; }

.cal-month { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; }
.cal-month-label { font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-weekday { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding-bottom: 6px; }
.cal-day {
  aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--border); background: var(--bg);
  display: flex; flex-direction: column; justify-content: space-between; padding: 6px;
}
.cal-day-empty { border-color: transparent; background: transparent; }
.cal-day-num { font-size: 11px; font-weight: 600; color: var(--muted-2); }
.cal-day-amt { font-size: 10.5px; font-weight: 800; color: var(--ink); line-height: 1.15; word-break: break-word; }
.cal-day-today { border-color: var(--primary); border-width: 1.5px; }
.cal-day-today .cal-day-num { color: var(--primary); }

.txn-table { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.txn-row { display: flex; align-items: center; gap: 14px; padding: 15px 22px; border-bottom: 1px solid #F3EFE7; }
.txn-row:last-child { border-bottom: none; }
.txn-row-new-day { border-top: 2px solid var(--ink-new-line); }
.txn-icon { width: 40px; height: 40px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; }
.txn-icon .dot { width: 11px; height: 11px; border-radius: 50%; }
.txn-main { flex: 1; min-width: 0; }
.txn-title-row { display: flex; align-items: center; gap: 8px; }
.txn-title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 7px; flex: none; }
.badge-inst { color: var(--primary); background: var(--primary-bg); }
.badge-recurring { color: #1E8A5E; background: #E7F5EE; }
.txn-meta { font-size: 12.5px; color: var(--muted-2); font-weight: 500; margin-top: 2px; }
.txn-right { text-align: right; }
.txn-right .amount { font-weight: 800; font-size: 15px; }
.txn-right .date { font-size: 11.5px; color: var(--muted-3); font-weight: 600; }
.txn-actions { display: flex; gap: 4px; flex: none; }
.icon-btn { width: 32px; height: 32px; border: none; border-radius: 9px; background: var(--bg); cursor: pointer; font-size: 14px; color: #67636E; display: flex; align-items: center; justify-content: center; }
.icon-btn.danger { color: var(--expense); }

/* cards screen */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 28px; }
.credit-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.credit-card-head { padding: 20px 22px; color: #fff; }
.credit-card-head .top { display: flex; justify-content: space-between; align-items: flex-start; }
.credit-card-head .name { font-weight: 700; font-size: 16px; }
.credit-card-head .sub { font-size: 12.5px; opacity: .85; font-weight: 500; margin-top: 2px; }
.credit-card-head .figures { margin-top: 26px; display: flex; justify-content: space-between; align-items: flex-end; }
.credit-card-head .figures .amount { font-size: 24px; font-weight: 800; letter-spacing: -.5px; margin-top: 2px; }
.credit-card-body { padding: 18px 22px; }
.credit-card-body .limit-row { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: #67636E; margin-bottom: 7px; }
.credit-card-body .limit-bar { height: 8px; border-radius: 6px; background: #F1EEE7; overflow: hidden; margin-bottom: 18px; }
.btn-icon-circle { width: 28px; height: 28px; border: none; border-radius: 8px; background: rgba(255,255,255,.25); color: #fff; cursor: pointer; font-size: 16px; font-weight: 700; }

.debit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.debit-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.debit-card-head { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.debit-card-head .mini { width: 40px; height: 28px; border-radius: 7px; flex: none; }
.debit-card .spent { font-size: 22px; font-weight: 800; letter-spacing: -.5px; color: var(--expense); }

.swatch-row { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border: none; border-radius: 9px; cursor: pointer; }

/* metas */
.metas-tip { background: var(--primary-bg); border-radius: 18px; padding: 20px 24px; font-size: 13.5px; color: #4A4A8A; font-weight: 600; line-height: 1.5; }

/* auth screens */
.auth-shell { min-height: 100vh; width: 100%; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 410px; background: #fff; border: 1px solid var(--border); border-radius: 24px; padding: 38px 34px; box-shadow: 0 20px 60px rgba(38,36,46,.10); }
.auth-title { font-size: 22px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 5px; }
.auth-sub { font-size: 13.5px; color: var(--muted-2); font-weight: 500; margin-bottom: 24px; }
.auth-foot { margin-top: 20px; padding-top: 18px; border-top: 1px solid #F0ECE3; font-size: 13px; color: var(--muted-3); font-weight: 500; text-align: center; }

.messages { margin-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.message { padding: 12px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 600; }
.message.success { background: #EBF7F1; color: #1E8A5E; }
.message.error { background: #FDF0EE; color: #C24732; }

/* ---------- mobile nav (hidden on desktop) ---------- */
.mobile-topbar { display: none; }
.mobile-tabbar { display: none; }

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar { display: none; }

  .mobile-topbar {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    background: var(--card); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 30;
  }
  .mobile-topbar-saldo { flex: 1; min-width: 0; }
  .mobile-topbar-saldo .caption { font-size: 10.5px; color: var(--muted); font-weight: 600; }
  .mobile-topbar-saldo .value { font-size: 16px; font-weight: 800; letter-spacing: -.3px; }

  .main { padding: 16px 16px 88px; max-width: 100%; }

  .mobile-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--card); border-top: 1px solid var(--border);
    padding: 6px 4px max(6px, env(safe-area-inset-bottom));
  }
  .tab-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 6px 2px; color: #9A968D; font-size: 10.5px; font-weight: 700; text-align: center;
  }
  .tab-item .tab-dot { width: 8px; height: 8px; border-radius: 50%; }
  .tab-item.active { color: var(--primary); }
  .tab-item.active .tab-dot { box-shadow: 0 0 0 3px var(--primary-bg); }

  .page-header { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 18px; }
  .header-controls { width: 100%; flex-direction: column; align-items: stretch; }
  .period-tabs { flex: 1; justify-content: space-between; }
  .month-nav { flex: 1; justify-content: space-between; }
  .month-nav .label { min-width: 0; flex: 1; }

  .grid-2, .grid-2-even { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .form-row.cols-2, .form-row.cols-1-1_4 { grid-template-columns: 1fr; }
  .cards-grid, .debit-grid { grid-template-columns: 1fr; }

  .card { padding: 18px; }
  .donut-wrap { flex-wrap: wrap; justify-content: center; }

  .filter-row { flex-wrap: wrap; }
  .filter-chips {
    flex: 1 1 auto; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 2px;
  }
  .filter-chips::-webkit-scrollbar { display: none; }
  .filter-row .chip-link { white-space: nowrap; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .insight-grid { grid-template-columns: 1fr; }
  .method-toggle { grid-template-columns: 1fr; gap: 6px; }
  .tab-item span:last-child { font-size: 10px; }
  .txn-row { padding: 13px 14px; gap: 10px; }
  .txn-icon { display: none; }

  .cal-month { padding: 12px; }
  .cal-weekdays, .cal-grid { gap: 4px; }
  .cal-day { padding: 4px; border-radius: 8px; }
  .cal-day-num { font-size: 9.5px; }
  .cal-day-amt { font-size: 8.5px; }
}
