/* Unified product typography, surfaces and transaction rows. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

#app .brand-lockup .brand-name { display: block; color: #c6a253; }
#app .brand-lockup .brand-mark {
  color: #c6a253;
  background: transparent;
  border: 0;
  padding: 0;
}
#app .brand-lockup .brand-mark-accent { stroke: #c6a253; }

#app {
  --app-font: Inter, system-ui, sans-serif;
  --dashboard-wash: #f6f7f8;
  --bg: #f6f7f8;
  --bg2: #edf0f2;
  --surface: #fff;
  --glass: #fff;
  --text: #25313b;
  --text2: #53606b;
  --muted: #66737e;
  --surface-edge: #e5e9ec;
  --section-edge: #dce2e6;
  --border: var(--surface-edge);
  --border2: var(--surface-edge);
  --radius: 12px;
  --radius-sm: 8px;
  background: var(--bg);
  font-family: var(--app-font);
}
[data-theme='dark'] #app {
  --dashboard-wash: #15191e;
  --bg: #15191e;
  --bg2: #21272e;
  --surface: #1d232a;
  --glass: #1d232a;
  --text: #e3e8ec;
  --text2: #b4bfc8;
  --muted: #a0adb8;
  --surface-edge: #2c343d;
  --section-edge: #333d47;
  --gold: #81cbb1;
  --gold-bg: #81cbb114;
}
#app :is(button, input, select, textarea, .section-title, .chart-title, .streak-title, .w52-title, .modal-title, .tx-name) {
  font-family: var(--app-font);
}
#app :is(.section-title, .chart-title, .streak-title) {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -.025em;
}
#app .section-title { font-size: 20px; }
#app .chart-title { font-size: 16px; }
#app :is(.balance-card, .mini-card, .ov-card, .chart-card, .goal-card, .debt-card, .inv-card, .budget-card, .streak-card, .w52-card) {
  background: var(--surface);
  border: 1px solid var(--surface-edge);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px #00000003;
}
#app .bottom-nav { background: var(--bg); }
#app .main-nav-links .nav-icon,
#app .main-nav-links .market-shortcut .nav-icon,
#app .main-nav-links .nav-btn.active .nav-icon {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
  background: transparent;
  border: 0;
  color: var(--text2);
}
#app .main-nav-links .nav-btn.active .nav-icon { color: var(--gold); }
#app .main-nav-links .nav-label { color: var(--text2); font-size: 12px; font-weight: 500; }
#app .main-nav-links .nav-btn.active { background: var(--gold-bg); }
#app .main-nav-links .nav-btn.active .nav-label { color: var(--gold); font-weight: 600; }
#app .header { background: var(--bg); border-bottom-color: var(--section-edge); }
#app .header-progress :is(summary, .header-streak) { background: transparent; }
#app .month-bar { display: none; }
#app .period-summary { padding-block: 14px; }
#app .period-summary > div:not(.period-picker) { display: none; }
.period-picker { display: flex; align-items: center; gap: 4px; min-width: 0; }
#app .period-picker button {
  width: 30px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 0;
  font-size: 20px;
}
#app .period-picker button:disabled { opacity: .3; cursor: default; }
#app .period-picker input {
  width: auto;
  min-width: 0;
  max-width: 220px;
  padding: 7px 26px 7px 9px;
  border: 1px solid var(--surface-edge);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px !important;
}
#app .tx-list { border: 1px solid var(--surface-edge); border-radius: 12px; background: var(--surface); }
#app .tx-wrap { border-radius: 0; }
#app .tx {
  padding: 14px 18px;
  min-height: 72px;
  gap: 12px;
  border-radius: 0;
  border-bottom: 1px solid var(--surface-edge);
  background: var(--surface);
}
#app .tx-wrap:last-child .tx { border-bottom: 0; }
#app .tx-icon { background: var(--bg2) !important; color: var(--text2); width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; }
#app .tx-name { font-weight: 500; font-size: 13px; color: var(--text); }
#app .tx-info { min-width: 0; }
#app :is(.tx-cat, .tx-date) { color: var(--muted); font-size: 11px; }
#app .tx-amt { font-size: 13px; font-weight: 600; white-space: nowrap; }
.transaction-actions { display: flex; gap: 4px; flex-shrink: 0; }
.category-hint { margin: 0 0 18px; color: var(--text2); font-size: 12px; line-height: 1.6; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
#app .category-tile {
  display: grid;
  gap: 15px;
  padding: 19px;
  text-align: left;
  border: 1px solid var(--surface-edge);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
}
.category-tile strong { font-size: 14px; font-weight: 600; }
.category-tile > span { display: grid; gap: 7px; color: var(--text2); font-size: 13px; }
.category-tile small { color: var(--muted); font-size: 11px; }
#app .category-tile[aria-pressed='true'] { border-color: var(--gold); }
.category-details { margin-top: 24px; }
.category-details h3 { font-size: 16px; margin-bottom: 12px; }
.backup-panel p, .obligations-panel p { color: var(--text2); font-size: 12px; line-height: 1.6; margin-block: 10px; }
.backup-panel button { border: 1px solid var(--border); border-radius: 7px; padding: 8px 11px; color: var(--text); background: var(--bg2); cursor: pointer; }
.obligation-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.obligation-totals small { display: block; color: var(--text2); font-size: 11px; margin-bottom: 7px; }
.obligation-totals strong { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.obligations-panel.has-overdue p { color: var(--red); }
@media (min-width: 1000px) { #app #pageDash > .obligations-panel { grid-column: 1 / -1; order: 3; } }
@media (max-width: 600px) { .obligation-totals { grid-template-columns: 1fr 1fr; } }
#app .transaction-actions button { padding: 6px; font-size: 11px; color: var(--text2); border: 0; background: transparent; border-radius: 5px; cursor: pointer; }
#app .transaction-actions button:hover { background: var(--bg2); }
#app .transaction-actions .transaction-delete:hover { color: var(--red); }
#app .swipe-hint { display: none; }

/* Dashboard hierarchy inspired by the supplied overview reference. */
[data-theme='dark'] #app {
  --bg: #09090b;
  --dashboard-wash: #09090b;
  --bg2: #1b1b20;
  --surface: #121215;
  --glass: #121215;
  --surface-edge: #29292e;
  --section-edge: #29292e;
  --text: #eeeeef;
  --text2: #b4b4bd;
  --muted: #9999a5;
}
#app .bal-value,
#app .mini-value,
#app .ov-val {
  font-family: var(--app-font);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -.045em;
}
#app #pageDash > .balance-card {
  background: #17483c;
  border-color: #285d4f;
  color: #edf7f0;
  box-shadow: none;
}
#app #pageDash .balance-card::before,
#app #pageDash .balance-card::after { display: none; }
#app #pageDash .balance-card .bal-value { color: #edf7f0 !important; }
#app #pageDash .balance-card :is(.bal-label, .currency, .bal-item-label) { color: #c2d9cd; }
#app #pageDash .balance-card .bal-sub {
  padding: 16px;
  border: 0;
  border-radius: 10px;
  background: #0c2c2459;
}
#app #pageDash .balance-card .bal-item + .bal-item { border-color: #ffffff20; }
#app #pageDash .balance-card .c-green { color: #a5e3bd; }
#app #pageDash .balance-card .c-red { color: #ffb4b9; }
#app #pageDash .balance-card .c-gold { color: #ebcd89; }
@media (min-width: 1000px) {
  #app .bottom-nav { background: var(--surface); }
  #app .header { background: var(--surface); }
  #app #pageDash.active {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 16px;
  }
  #app #pageDash > .balance-card { min-height: 220px; padding: 24px; }
  #app #pageDash .bal-value { font-size: clamp(38px, 3.5vw, 56px); }
  #app #pageDash .mini-card { padding: 20px; }
  #app #pageDash .chart-card { min-height: 220px; padding: 20px; }
  #app #pageDash .streak-card { padding: 20px; }
}
@media (min-width: 1000px) {
  #app .main-nav-links .nav-btn { gap: 11px; padding: 9px 12px; }
  #app .bottom-nav > .sidebar-welcome { padding-inline: 26px; }
}
@media (max-width: 600px) {
  #app .period-summary { gap: 6px; }
  #app .period-picker input { max-width: 170px; font-size: 12px !important; }
  #app .period-picker button { width: 22px; }
  #app .period-summary > button { padding: 7px; font-size: 10px; }
  #app .tx { flex-wrap: wrap; padding: 13px; gap: 9px; }
  .transaction-actions { flex-basis: 100%; justify-content: flex-end; margin-top: -6px; }
}
#app .main-nav-links .mobile-more { display: none; }
@media (max-width: 999px) {
  #app .bottom-nav { display: block; padding: 4px 8px max(4px, env(safe-area-inset-bottom)); }
  #app .main-nav-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; overflow: visible; }
  #app .main-nav-links .nav-btn { min-width: 0; min-height: 52px; padding: 5px 1px; gap: 4px; display: none; flex-direction: column; justify-content: center; align-items: center; }
  #app .main-nav-links .nav-icon, #app .main-nav-links .nav-icon svg { width: 21px; height: 21px; }
  #app .main-nav-links .nav-label { font-size: 10px; letter-spacing: 0; text-transform: none; white-space: nowrap; }
  #app .main-nav-links :is(.mobile-primary, .mobile-more) { display: flex; order: -1; }
  #app .bottom-nav :is(.market-divider, .nav-shortcuts) { display: none; }
  #app .mobile-menu-open .main-nav-links .nav-btn:not([hidden]) { display: flex; }
  #app .mobile-menu-open .main-nav-links [onclick="toggleSidebar()"] { display: none; }
  #app .mobile-menu-open .nav-shortcuts { display: flex; }
  #app #fabWrap { bottom: calc(70px + env(safe-area-inset-bottom)); right: 16px; }
}
