﻿/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   MULGA â€” app.css
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
:root {
  --bg-deepest:   #0d0b14;
  --bg-dark:      #12101c;
  --bg-mid:       #18152a;
  --bg-light:     #201c32;
  --bg-hover:     #272340;
  --border:       #2a2540;
  --border-light: #352f52;
  --purple-primary: #7c5cbf;
  --purple-bright:  #9b7de0;
  --purple-muted:   #4e3a87;
  --purple-glow:    rgba(124,92,191,0.15);
  --purple-dim:     rgba(124,92,191,0.08);
  --accent-green: #3ecf8e;
  --text-primary:   #e8e4f0;
  --text-secondary: #9b95b0;
  --text-muted:     #5c5678;
  --text-link:      #9b7de0;
  --green:        #3ecf8e;
  --green-dim:    rgba(62,207,142,0.1);
  --red:          #f05365;
  --red-dim:      rgba(240,83,101,0.1);
  --sidebar-w:    220px;
  --radius:       8px;
  --radius-lg:    12px;
  --radius-sm:    5px;
  --t:            150ms ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg-deepest);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow: hidden;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; color: inherit; }
input, select { font-family: inherit; font-size: inherit; }
a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* â”€â”€â”€ SCREENS â”€â”€â”€ */
.screen { display: none; width: 100%; min-height: 100dvh; }
.screen.active { display: flex; }

/* â•â•â• AUTH â•â•â• */
.auth-shell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; min-height: 100dvh; padding: 24px 16px;
  background: var(--bg-deepest);
  background-image: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(124,92,191,0.1) 0%, transparent 70%);
}
.auth-logo { margin-bottom: 32px; }
.logo-text { font-family: 'DM Sans', system-ui, sans-serif; font-size: 26px; font-weight: 500; letter-spacing: -0.5px; color: var(--text-primary); }
.logo-a { color: var(--accent-green); }
.auth-card {
  background: var(--bg-mid); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px 26px 22px; width: 100%; max-width: 400px;
}
.auth-title { font-size: 16px; font-weight: 600; margin-bottom: 18px; }
.auth-hint { font-size: 12.5px; color: var(--text-secondary); margin-top: -12px; margin-bottom: 16px; line-height: 1.5; }
.auth-error {
  font-size: 12px; color: var(--red); margin-bottom: 10px;
  padding: 8px 10px; background: var(--red-dim); border-radius: var(--radius-sm);
}
.auth-sub { margin-top: 14px; font-size: 12.5px; color: var(--text-muted); text-align: center; }
.link-btn { color: var(--text-link); font-size: inherit; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.link-ext { color: var(--text-link); }

/* â”€â”€â”€ WIZARD â”€â”€â”€ */
.wizard-steps { display: flex; align-items: center; margin-bottom: 22px; }
.wizard-step {
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border-light);
  color: var(--text-muted); font-size: 11px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all var(--t);
}
.wizard-step.active { border-color: var(--purple-primary); background: var(--purple-glow); color: var(--purple-bright); }
.wizard-step.done { border-color: var(--green); background: var(--green-dim); color: var(--green); }
.wizard-step-line { flex: 1; height: 1px; background: var(--border); margin: 0 6px; }
.wizard-panel { display: none; }
.wizard-panel.active { display: block; }

.setup-accounts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; max-height: 220px; overflow-y: auto; }
.setup-account-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--bg-light); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.setup-account-badge {
  width: 34px; height: 34px; border-radius: 6px; background: var(--purple-glow);
  border: 1px solid var(--purple-muted); display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--purple-bright); font-family: 'DM Sans', system-ui, sans-serif; flex-shrink: 0;
}
.setup-account-name { font-size: 13px; font-weight: 500; }
.setup-account-sub { font-size: 11px; color: var(--text-muted); }

/* â•â•â• APP LAYOUT â•â•â• */
#screen-app { flex-direction: row; overflow: hidden; }

/* â”€â”€â”€ SIDEBAR â”€â”€â”€ */
.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w); height: 100dvh;
  background: var(--bg-dark); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto; flex-shrink: 0; z-index: 100;
}
.sidebar-logo { padding: 18px 16px 14px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.sidebar-section { padding: 6px 0; }
.sidebar-label { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); padding: 6px 16px 3px; }
.sidebar-item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 16px;
  font-size: 13px; color: var(--text-secondary); transition: background var(--t), color var(--t);
  white-space: nowrap; overflow: hidden;
}
.sidebar-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-item.active { background: var(--purple-dim); color: var(--purple-bright); }
.sidebar-icon { width: 15px; height: 15px; flex-shrink: 0; }
.sidebar-acct-item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 5px 16px;
  font-size: 12px; color: var(--text-secondary); cursor: pointer; transition: background var(--t);
}
.sidebar-acct-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-acct-item.active { background: var(--purple-dim); color: var(--purple-bright); }
.sidebar-acct-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--purple-muted); flex-shrink: 0; }
.sidebar-acct-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sidebar-acct-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.sidebar-acct-real {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 10px; color: var(--text-muted); line-height: 1.2;
}
.sidebar-acct-bal { font-family: 'DM Sans', system-ui, sans-serif; font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--border); padding: 6px 0; }

@keyframes spin { to { transform: rotate(360deg); } }
.syncing .sync-icon-svg { animation: spin 1s linear infinite; }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 99; }
.mobile-menu-btn {
  display: none; position: fixed; top: 11px; left: 11px; z-index: 101;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--bg-mid); border: 1px solid var(--border);
  align-items: center; justify-content: center; color: var(--text-primary);
}
.mobile-menu-btn svg { width: 18px; height: 18px; }
.mobile-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; height: 58px;
  background: var(--bg-dark); border-top: 1px solid var(--border); z-index: 98;
}
.mobile-nav-item {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; width: 25%; height: 100%; font-size: 10px; color: var(--text-muted); transition: color var(--t);
}
.mobile-nav-item svg { width: 20px; height: 20px; }
.mobile-nav-item.active { color: var(--purple-bright); }

/* â”€â”€â”€ MAIN CONTENT â”€â”€â”€ */
.main-content { flex: 1; overflow-y: auto; overflow-x: hidden; height: 100dvh; background: var(--bg-deepest); }
.view { display: none; padding-bottom: 60px; }
.view.active { display: block; }

/* â”€â”€â”€ VIEW HEADER â”€â”€â”€ */
.view-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px 13px; border-bottom: 1px solid var(--border);
  gap: 10px; flex-wrap: wrap; position: sticky; top: 0;
  background: var(--bg-deepest); z-index: 10;
}
.view-title { font-size: 17px; font-weight: 600; }
.month-nav { display: flex; align-items: center; gap: 10px; }
.month-title { font-size: 17px; font-weight: 600; min-width: 130px; text-align: center; }
.month-btn {
  width: 28px; height: 28px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  color: var(--text-secondary); display: flex; align-items: center; justify-content: center; transition: all var(--t);
}
.month-btn:hover { border-color: var(--border-light); background: var(--bg-hover); color: var(--text-primary); }
.month-btn svg { width: 15px; height: 15px; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.last-sync-label { font-size: 11px; color: var(--text-muted); }

/* â•â•â• DASHBOARD â•â•â• */
.dash-grid { padding: 18px 24px 24px; display: flex; flex-direction: column; gap: 12px; }
.dash-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dash-panels-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dash-card {
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
}
.dash-stat-card { min-height: 114px; display: flex; flex-direction: column; gap: 5px; }
.dash-card-title {
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary);
}
.dash-card-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.dash-stat-value {
  font-family: 'DM Sans', system-ui, sans-serif; font-size: 33px; line-height: 1.1; margin-top: auto; color: var(--text-primary);
}
.dash-stat-value.positive { color: var(--green); }
.dash-stat-value.negative { color: var(--red); }
.dash-cashflow-bars {
  margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: end;
}
.dash-flow-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dash-flow-bar-wrap {
  width: 100%; max-width: 140px; height: 140px; border-radius: 8px;
  border: 1px solid var(--border-light); background: var(--bg-dark); padding: 8px;
  display: flex; align-items: flex-end;
}
.dash-flow-bar {
  width: 100%; border-radius: 5px 5px 3px 3px; min-height: 4px; transition: height var(--t);
}
.dash-flow-bar.income { background: linear-gradient(180deg, #61e4ab 0%, #2ea270 100%); }
.dash-flow-bar.expense { background: linear-gradient(180deg, #f38595 0%, #bf4053 100%); }
.dash-flow-label { font-size: 11px; color: var(--text-muted); }
.dash-flow-value { font-family: 'DM Sans', system-ui, sans-serif; font-size: 12px; }
.dash-flow-value.positive { color: var(--green); }
.dash-flow-value.negative { color: var(--red); }
.dash-line-wrap {
  margin-top: 12px; height: 180px; border-radius: 8px; border: 1px solid var(--border-light);
  background: var(--bg-dark); padding: 6px 8px;
}
.dash-line-svg { width: 100%; height: 100%; display: block; }
.dash-line-path { stroke: #61e4ab; stroke-width: 2; }
.dash-line-dot { fill: #61e4ab; }
.dash-line-value { fill: #61e4ab; font-size: 12px; font-family: 'DM Sans', system-ui, sans-serif; }
.dash-calendar-dow {
  margin-top: 10px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.dash-calendar-dow span {
  text-align: center; font-size: 10px; font-weight: 600; letter-spacing: 0.04em; color: var(--text-muted);
}
.dash-calendar-grid { margin-top: 4px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dash-cal-cell {
  min-height: 58px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--bg-dark); padding: 5px 6px; display: flex; flex-direction: column; justify-content: space-between;
}
.dash-cal-cell.muted { opacity: 0.24; }
.dash-cal-cell.has-spend {
  background: var(--dash-spend-bg);
  border-color: var(--dash-spend-border);
}
.dash-cal-day { font-size: 11px; color: var(--text-secondary); }
.dash-cal-amt {
  font-family: 'DM Sans', system-ui, sans-serif; font-size: 10px; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-budget-list { margin-top: 10px; display: flex; flex-direction: column; gap: 9px; }
.dash-budget-row { display: flex; flex-direction: column; gap: 5px; }
.dash-budget-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.dash-budget-name { font-size: 12px; color: var(--text-primary); }
.dash-budget-meta { font-size: 10px; color: var(--text-muted); font-family: 'DM Sans', system-ui, sans-serif; }
.dash-budget-track { height: 8px; border-radius: 999px; border: 1px solid var(--border-light); background: var(--bg-dark); overflow: hidden; }
.dash-budget-fill {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #61e4ab 0%, #44c28d 100%);
}
.dash-budget-row.over .dash-budget-fill {
  background: linear-gradient(90deg, #f38595 0%, #bf4053 100%);
}
.dash-empty-note { padding: 16px 0; font-size: 12px; color: var(--text-muted); }

/* Budget Planner View */
.plan-summary-card {
  margin: 14px 24px 12px; background: var(--bg-mid); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.plan-summary-head {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-size: 18px; font-weight: 600; text-align: center;
}
.plan-summary-grid { padding: 10px 16px; background: rgba(255,255,255,0.02); }
.plan-summary-row {
  display: flex; justify-content: space-between; align-items: center; padding: 2px 0;
  font-size: 13px; color: var(--text-secondary);
}
.plan-summary-row strong { color: var(--text-primary); font-weight: 600; }
.plan-summary-main {
  padding: 14px 16px 16px; text-align: center; display: flex; flex-direction: column; gap: 4px;
}
.plan-summary-main span { font-size: 13px; color: var(--text-secondary); }
.plan-summary-main strong { font-size: 46px; font-weight: 600; color: var(--green); line-height: 1; }
.plan-table-wrap {
  margin: 0 24px 12px; background: var(--bg-mid); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden;
}
.plan-table-head,
.plan-group-head,
.plan-row {
  display: grid; grid-template-columns: 1.4fr 120px 120px 120px; gap: 10px; align-items: center;
}
.plan-table-head {
  padding: 10px 14px; background: var(--bg-dark); border-bottom: 1px solid var(--border);
  font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); font-weight: 600;
}
.plan-group-head {
  width: 100%; text-align: left; background: rgba(255,255,255,0.03);
  padding: 9px 14px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.plan-group-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.plan-group-num,
.plan-row-num {
  text-align: right; font-size: 13px; color: var(--text-primary);
}
.plan-row {
  padding: 8px 14px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.plan-row:last-child { border-bottom: none; }
.plan-row-name { font-size: 13px; color: var(--text-secondary); }
.plan-group.collapsed .plan-group-body { display: none; }
.plan-row-num.positive, .plan-group-num.positive { color: var(--green); }
.plan-row-num.negative, .plan-group-num.negative { color: var(--red); }
.plan-income-wrap {
  margin: 0 24px 24px; background: var(--bg-mid); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden;
}
.plan-income-title {
  padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary);
}
.plan-income-row {
  display: flex; justify-content: space-between; gap: 10px; padding: 9px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 13px;
}
.plan-income-row:last-child { border-bottom: none; }
.plan-income-row strong { color: var(--green); font-weight: 600; }

/* â•â•â• TO BUDGET BANNER â•â•â• */
.to-budget-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: var(--bg-mid); border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 10px;
}
.to-budget-main { display: flex; align-items: baseline; gap: 10px; }
.to-budget-label { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.to-budget-amount { font-family: 'DM Sans', system-ui, sans-serif; font-size: 22px; font-weight: 500; color: var(--green); transition: color var(--t); }
.to-budget-amount.negative { color: var(--red); }
.to-budget-amount.zero { color: var(--text-secondary); }
.to-budget-breakdown { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.tbb-item strong { color: var(--text-secondary); font-weight: 500; }
.tbb-sep { color: var(--text-muted); }
.tbb-result { font-family: 'DM Sans', system-ui, sans-serif; font-weight: 500; color: var(--text-secondary); }

/* â•â•â• BUDGET TABLE â•â•â• */
.budget-table-header {
  display: grid; grid-template-columns: 1fr 110px 110px 110px 120px;
  padding: 7px 24px; border-bottom: 1px solid var(--border); background: var(--bg-dark);
  font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-muted); position: sticky; top: 54px; z-index: 9;
}
.col-budgeted, .col-spent, .col-balance, .col-current { text-align: right; }

.cat-group { border-bottom: 1px solid var(--border); }
.cat-group-header {
  display: grid; grid-template-columns: 1fr 110px 110px 110px 120px;
  padding: 8px 24px; background: var(--bg-mid); cursor: pointer; user-select: none;
  align-items: center; transition: background var(--t);
}
.cat-group-header:hover { background: var(--bg-hover); }
.cat-group-name { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: var(--text-secondary); }
.cat-chevron { width: 13px; height: 13px; transition: transform 200ms; flex-shrink: 0; }
.cat-group.collapsed .cat-chevron { transform: rotate(-90deg); }
.cat-group.collapsed .cat-group-rows { display: none; }
.cat-group-total { font-family: 'DM Sans', system-ui, sans-serif; font-size: 11.5px; color: var(--text-muted); text-align: right; }
.cat-group-actions { display: flex; gap: 2px; opacity: 0; transition: opacity var(--t); margin-left: 4px; }
.cat-group-header:hover .cat-group-actions { opacity: 1; }

.cat-row {
  display: grid; grid-template-columns: 1fr 110px 110px 110px 120px;
  padding: 0 24px; align-items: center; border-bottom: 1px solid var(--border);
  min-height: 38px; transition: background var(--t); position: relative;
}
.cat-row:last-child { border-bottom: none; }
.cat-row:hover { background: var(--bg-hover); }
.cat-row:hover .cat-row-actions { opacity: 1; }
.cat-row.overspent { background: rgba(240,83,101,0.04); }
.cat-row.overspent:hover { background: rgba(240,83,101,0.07); }

.cat-name-cell { display: flex; align-items: center; gap: 7px; min-width: 0; }
.cat-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-row-actions { display: flex; gap: 1px; opacity: 0; transition: opacity var(--t); flex-shrink: 0; }
.cat-action-btn {
  width: 20px; height: 20px; border-radius: 3px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; font-size: 12px; transition: all var(--t);
}
.cat-action-btn:hover { background: var(--bg-light); color: var(--text-primary); }
.cat-action-btn.delete:hover { background: var(--red-dim); color: var(--red); }

.cat-budgeted-cell { display: flex; justify-content: flex-end; }
.budgeted-input {
  background: transparent; border: none; border-bottom: 1px solid transparent;
  text-align: right; font-family: 'DM Sans', system-ui, sans-serif; font-size: 13px;
  color: var(--text-primary); width: 104px; padding: 2px 0; outline: none; transition: border-color var(--t);
}
.budgeted-input:hover { border-bottom-color: var(--border-light); }
.budgeted-input:focus { border-bottom-color: var(--purple-primary); background: var(--purple-dim); border-radius: 3px 3px 0 0; padding: 2px 4px; }

.cat-spent, .cat-current { font-family: 'DM Sans', system-ui, sans-serif; font-size: 13px; color: var(--text-secondary); text-align: right; }
.cat-current { color: var(--text-muted); font-size: 12px; }
.cat-current.loaded { color: var(--purple-bright); }

.cat-balance {
  font-family: 'DM Sans', system-ui, sans-serif; font-size: 13px; text-align: right;
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
}
.cat-balance.positive { color: var(--green); }
.cat-balance.negative { color: var(--red); }
.cat-balance.zero { color: var(--text-muted); }
.cover-btn {
  font-size: 10px; padding: 2px 6px; border-radius: 3px;
  border: 1px solid var(--red); color: var(--red); transition: all var(--t);
}
.cover-btn:hover { background: var(--red); color: white; }

/* â•â•â• ACCOUNTS â•â•â• */
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 18px 24px; }
.account-card {
  background: var(--bg-mid); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 15px; cursor: pointer; transition: all var(--t);
}
.account-card:hover { border-color: var(--purple-muted); background: var(--bg-light); }
.account-card.selected { border-color: var(--purple-primary); background: var(--purple-dim); }
.acct-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.acct-card-head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.acct-card-badge {
  width: 34px; height: 34px; border-radius: 7px; background: var(--purple-glow);
  border: 1px solid var(--purple-muted); display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--purple-bright); font-family: 'DM Sans', system-ui, sans-serif;
}
.acct-card-type {
  font-size: 9.5px; padding: 2px 6px; border-radius: 100px;
  background: var(--bg-light); border: 1px solid var(--border); color: var(--text-muted); text-transform: capitalize;
}
.acct-rename-btn {
  font-size: 10px; padding: 2px 7px; border-radius: 100px;
  border: 1px solid var(--border); color: var(--text-muted); transition: all var(--t);
}
.acct-rename-btn:hover { border-color: var(--purple-muted); color: var(--text-primary); background: var(--bg-hover); }
.acct-card-name { font-size: 13px; font-weight: 500; margin-bottom: 1px; }
.acct-card-real-name {
  font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 6px;
}
.acct-card-number { font-size: 11px; color: var(--text-muted); font-family: 'DM Sans', system-ui, sans-serif; margin-bottom: 10px; }
.acct-card-balance { font-family: 'DM Sans', system-ui, sans-serif; font-size: 19px; font-weight: 500; }
.acct-card-balance.negative { color: var(--red); }
.acct-card-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* â”€â”€â”€ TRANSACTIONS â”€â”€â”€ */
.txn-section { padding: 0 24px 24px; }
.txn-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 10px; gap: 10px; flex-wrap: wrap; }
.txn-title { font-size: 14px; font-weight: 600; }
.txn-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.txn-wizard {
  margin-bottom: 10px;
}
.txn-wizard-card {
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.txn-wizard-card.collapsed { padding: 10px 12px; }
.txn-wizard-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.txn-wizard-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.txn-wizard-progress {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.txn-wizard-merchant {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}
.txn-wizard-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.txn-wizard-controls {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr auto;
  gap: 8px;
  align-items: center;
}
.txn-wizard-controls .field-select {
  min-width: 0;
}
.txn-wizard-controls .btn-secondary,
.txn-wizard-controls .btn-ghost {
  white-space: nowrap;
}
.txn-wizard-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.txn-wizard-row {
  display: grid;
  grid-template-columns: 95px 1fr 120px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.txn-wizard-row:last-child {
  border-bottom: none;
}
.txn-wizard-row > span:first-child {
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--text-muted);
}
.txn-wizard-row > span:nth-child(2) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.txn-wizard-row > span:last-child {
  font-family: 'DM Sans', system-ui, sans-serif;
  text-align: right;
}
.txn-wizard-row .credit { color: var(--green); }
.txn-wizard-row .debit { color: var(--red); }
.txn-table-wrap { background: var(--bg-mid); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.txn-table-header {
  display: grid; grid-template-columns: 88px 1fr 130px 130px 100px;
  padding: 8px 16px; background: var(--bg-dark); border-bottom: 1px solid var(--border);
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
}
.txn-col-amt { text-align: right; }
.txn-row {
  display: grid; grid-template-columns: 88px 1fr 130px 130px 100px;
  padding: 9px 16px; border-bottom: 1px solid var(--border); align-items: center;
  transition: background var(--t); font-size: 13px;
}
.txn-row:last-child { border-bottom: none; }
.txn-row:hover { background: var(--bg-hover); }
.txn-date { font-family: 'DM Sans', system-ui, sans-serif; font-size: 11.5px; color: var(--text-muted); }
.txn-payee { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-account { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.txn-account-name {
  font-size: 12px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.txn-account-real {
  font-size: 10px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.txn-category {
  font-size: 11px; color: var(--text-muted); background: var(--bg-light);
  border-radius: 100px; padding: 2px 7px; display: inline-block; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.txn-cat-select {
  width: 100%;
  min-width: 0;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 2px 22px 2px 8px;
  color: var(--text-primary);
  font-size: 11px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 8l5 5 5-5' stroke='%235c5678' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.txn-cat-select:focus { border-color: var(--purple-primary); }
.txn-amount { font-family: 'DM Sans', system-ui, sans-serif; font-size: 13px; text-align: right; font-weight: 500; }
.txn-amount.credit { color: var(--green); }
.txn-empty { padding: 40px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* â•â•â• CALENDAR â•â•â• */
.cal-summary { display: flex; gap: 20px; padding: 14px 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cal-sum-item { display: flex; flex-direction: column; gap: 3px; }
.cal-sum-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; }
.cal-sum-value { font-family: 'DM Sans', system-ui, sans-serif; font-size: 15px; }
.cal-grid-wrap { padding: 14px 24px; }
.cal-dow-header { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; margin-bottom: 5px; }
.cal-dow-header span { font-size: 10px; font-weight: 600; text-align: center; color: var(--text-muted); letter-spacing: 0.04em; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.cal-cell {
  min-height: 62px; background: var(--bg-mid); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px; display: flex; flex-direction: column; gap: 2px;
  transition: border-color var(--t);
}
.cal-cell:hover { border-color: var(--border-light); }
.cal-cell.other-month { opacity: 0.3; }
.cal-cell.today { border-color: var(--purple-primary); background: var(--purple-dim); }
.cal-cell.payday { border-color: var(--green); background: var(--green-dim); }
.cal-day-num { font-size: 11px; font-weight: 500; color: var(--text-muted); line-height: 1; }
.cal-cell.today .cal-day-num { color: var(--purple-bright); }
.cal-cell.payday .cal-day-num { color: var(--green); }
.cal-payday-badge { font-size: 9px; font-weight: 600; text-transform: uppercase; color: var(--green); line-height: 1; }
.cal-day-amount { font-family: 'DM Sans', system-ui, sans-serif; font-size: 10px; color: var(--text-muted); margin-top: auto; }
.cal-day-amount.has-spend { color: var(--red); }

.payday-list-section { padding: 0 24px 24px; }
.section-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.payday-list { display: flex; flex-direction: column; gap: 6px; }
.payday-item {
  display: flex; align-items: center; justify-content: space-between; padding: 9px 14px;
  background: var(--bg-mid); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.payday-item.next { border-color: var(--green); background: var(--green-dim); }
.payday-date { font-family: 'DM Sans', system-ui, sans-serif; font-size: 13px; }
.payday-label { font-size: 12px; color: var(--text-muted); }
.payday-countdown { font-size: 11px; color: var(--green); font-weight: 500; }

/* â•â•â• SETTINGS â•â•â• */
.settings-sections { display: flex; flex-direction: column; gap: 14px; padding: 18px 24px; max-width: 500px; }
.settings-card { background: var(--bg-mid); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 11px; }
.settings-card-title { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.settings-hint { font-size: 12px; color: var(--text-muted); }
.danger-card { border-color: rgba(240,83,101,0.2); }

/* â•â•â• FORMS â•â•â• */
.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 11.5px; font-weight: 500; color: var(--text-secondary); }
.field-input {
  background: var(--bg-dark); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 11px; color: var(--text-primary); outline: none; width: 100%;
  transition: border-color var(--t), box-shadow var(--t); -webkit-appearance: none;
}
.field-input:focus { border-color: var(--purple-primary); box-shadow: 0 0 0 3px var(--purple-glow); }
.field-input::placeholder { color: var(--text-muted); }
.field-select {
  background: var(--bg-dark); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 28px 8px 11px; color: var(--text-primary); outline: none; width: 100%;
  transition: border-color var(--t); cursor: pointer; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 8l5 5 5-5' stroke='%235c5678' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.field-select:focus { border-color: var(--purple-primary); }
.field-sm { width: auto; min-width: 110px; }
.field-row { display: flex; gap: 8px; align-items: center; }
.field-row .field-input { flex: 1; }

/* â”€â”€â”€ BUTTONS â”€â”€â”€ */
.btn-primary {
  background: var(--purple-primary); color: white; border-radius: var(--radius-sm);
  padding: 9px 17px; font-size: 13px; font-weight: 500; transition: background var(--t), transform 80ms;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover { background: var(--purple-bright); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.btn-full { width: 100%; margin-top: 4px; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: var(--bg-light); border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  padding: 8px 15px; font-size: 13px; color: var(--text-primary); transition: all var(--t); align-self: flex-start;
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--purple-muted); }
.btn-ghost {
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 5px 11px; font-size: 12.5px; color: var(--text-secondary); transition: all var(--t);
}
.btn-ghost:hover { background: var(--bg-hover); border-color: var(--border-light); color: var(--text-primary); }
.btn-ghost.active { background: var(--purple-dim); border-color: var(--purple-muted); color: var(--purple-bright); }
.btn-danger {
  background: var(--red-dim); border: 1px solid var(--red); border-radius: var(--radius-sm);
  padding: 8px 15px; font-size: 13px; color: var(--red); transition: all var(--t); align-self: flex-start;
}
.btn-danger:hover { background: var(--red); color: white; }

.btn-spinner {
  width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white;
  border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block;
}

/* â•â•â• MODALS â•â•â• */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center; z-index: 200;
  padding: 16px; backdrop-filter: blur(2px);
}
.modal {
  background: var(--bg-mid); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modal-in 140ms ease;
}
@keyframes modal-in { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 19px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 13.5px; font-weight: 600; }
.modal-close { color: var(--text-muted); font-size: 14px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 4px; transition: all var(--t); }
.modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }
.modal-body { padding: 18px; display: flex; flex-direction: column; gap: 13px; }
.modal-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--border); }

/* â•â•â• TOASTS â•â•â• */
.toast-container { position: fixed; bottom: 22px; right: 18px; z-index: 300; display: flex; flex-direction: column; gap: 7px; pointer-events: none; }
.toast {
  background: var(--bg-light); border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  padding: 9px 13px; font-size: 13px; box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  pointer-events: auto; max-width: 280px; animation: toast-in 180ms ease;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* â•â•â• MISC â•â•â• */
.hidden { display: none !important; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 80px 24px; color: var(--text-muted); font-size: 13px; }
.empty-icon { width: 56px; height: 56px; opacity: 0.5; }
.loading-row { padding: 20px; color: var(--text-muted); font-size: 13px; text-align: center; }

/* â•â•â• RESPONSIVE â•â•â• */
@media (max-width: 768px) {
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; transform: translateX(-100%); transition: transform 240ms ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu-btn { display: flex; }
  .mobile-nav { display: flex; }
  .main-content { padding-bottom: 58px; }
  .view-header { padding: 11px 16px 10px; padding-left: 54px; }
  .dash-grid { padding: 12px 16px 16px; gap: 10px; }
  .dash-stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dash-panels-two { grid-template-columns: 1fr; gap: 10px; }
  .dash-card { padding: 12px; }
  .dash-stat-value { font-size: 25px; }
  .dash-flow-bar-wrap { height: 120px; }
  .dash-cal-cell { min-height: 52px; padding: 4px 5px; }
  .dash-cal-day { font-size: 10px; }
  .dash-cal-amt { font-size: 9px; }
  .dash-budget-meta { font-size: 9px; }
  .plan-summary-card { margin: 10px 16px; }
  .plan-summary-main strong { font-size: 34px; }
  .plan-table-wrap, .plan-income-wrap { margin: 0 16px 10px; }
  .plan-table-head,
  .plan-group-head,
  .plan-row { grid-template-columns: 1.1fr 88px 88px 88px; gap: 8px; }
  .plan-group-name, .plan-row-name { font-size: 12px; }
  .plan-group-num, .plan-row-num { font-size: 12px; }
  .to-budget-banner { padding: 10px 16px; }
  .budget-table-header { grid-template-columns: 1fr 85px 85px 85px; padding: 6px 16px; }
  .col-current { display: none; }
  .cat-group-header { grid-template-columns: 1fr 85px 85px 85px; padding: 7px 16px; }
  .cat-row { grid-template-columns: 1fr 85px 85px 85px; padding: 0 16px; }
  .cat-current { display: none; }
  .budgeted-input { width: 79px; }
  .accounts-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); padding: 13px 16px; gap: 9px; }
  .txn-section { padding: 0 16px 16px; }
  .txn-wizard-card {
    padding: 10px;
  }
  .txn-wizard-controls {
    grid-template-columns: 1fr;
  }
  .txn-wizard-controls .btn-secondary,
  .txn-wizard-controls .btn-ghost {
    width: 100%;
  }
  .txn-wizard-row {
    grid-template-columns: 82px 1fr 84px;
    gap: 8px;
    padding: 7px 8px;
    font-size: 11.5px;
  }
  .txn-table-header { grid-template-columns: 82px 1fr 90px; }
  .txn-row { grid-template-columns: 82px 1fr 90px; }
  .txn-col-acct, .txn-col-cat, .txn-account, .txn-category { display: none; }
  .cal-grid-wrap { padding: 10px 16px; }
  .cal-summary { padding: 10px 16px; gap: 14px; }
  .cal-cell { min-height: 50px; padding: 4px; }
  .cal-day-num { font-size: 10px; }
  .settings-sections { padding: 13px 16px; }
  .toast-container { bottom: 72px; right: 10px; left: 10px; }
  .toast { max-width: 100%; }
}
@media (max-width: 380px) {
  .dash-stat-grid { grid-template-columns: 1fr; }
  .plan-table-head,
  .plan-group-head,
  .plan-row { grid-template-columns: 1fr 72px 72px 72px; gap: 6px; }
  .budget-table-header { grid-template-columns: 1fr 78px 78px; }
  .col-balance { display: none; }
  .cat-group-header { grid-template-columns: 1fr 78px 78px; }
  .cat-row { grid-template-columns: 1fr 78px 78px; }
  .cat-balance { display: none; }
  .budgeted-input { width: 72px; }
}

