:root {
  --bg: #e8eef3;
  --bg-2: #d8e0e8;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #cbd5e1;
  --sea: #1d4ed8;
  --sea-dark: #1e3a8a;
  --sea-soft: #dbeafe;
  --coral: #b91c1c;
  --coral-soft: #fee2e2;
  --card: #f8fafc;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
  --radius: 10px;
  --font-ui: "DM Sans", system-ui, sans-serif;
  --font-display: "DM Sans", system-ui, sans-serif;
  --font-num: "IBM Plex Mono", ui-monospace, monospace;
  --navy: #0b1f33;
  --sidebar: #0b1f33;
  --sidebar-text: #e8eef2;
  --sidebar-hover: #0f2a42;
  --brand-mark: #1d4ed8;
  --body-grad-1: rgba(15, 118, 110, .18);
  --body-grad-2: rgba(29, 78, 137, .12);
  --body-base-1: #d5e0e7;
  --body-base-2: #c7d3dc;
  --body-base-3: #bcc9d3;
  --opening-border: #1d4ed8;
  --opening-bg: linear-gradient(180deg, #eff6ff 0%, #f8fafc 55%);
  --row-primary: linear-gradient(90deg, rgba(29, 78, 216, .06), transparent);
}

html[data-theme="cedar"] {
  --bg: #e6eeea;
  --bg-2: #d4e0da;
  --ink: #14201c;
  --muted: #5f726b;
  --line: #c5d4cd;
  --sea: #0f766e;
  --sea-dark: #115e59;
  --sea-soft: #ccfbf1;
  --coral: #b91c1c;
  --coral-soft: #fee2e2;
  --card: #f7fbf9;
  --navy: #1a2f28;
  --sidebar: #1a2f28;
  --sidebar-text: #e7f0ec;
  --sidebar-hover: #243d34;
  --brand-mark: #0f766e;
  --body-grad-1: rgba(15, 118, 110, .22);
  --body-grad-2: rgba(20, 83, 45, .10);
  --body-base-1: #d7e4de;
  --body-base-2: #c8d7d0;
  --body-base-3: #b9cbc2;
  --opening-border: #0f766e;
  --opening-bg: linear-gradient(180deg, #ecfdf8 0%, #f7fbf9 55%);
  --row-primary: linear-gradient(90deg, rgba(15, 118, 110, .08), transparent);
}

html[data-theme="grafit"] {
  --bg: #ebe8e4;
  --bg-2: #ddd8d2;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #d6d0c8;
  --sea: #b45309;
  --sea-dark: #92400e;
  --sea-soft: #ffedd5;
  --coral: #b91c1c;
  --coral-soft: #fee2e2;
  --card: #faf8f5;
  --navy: #1c1917;
  --sidebar: #1c1917;
  --sidebar-text: #f5f5f4;
  --sidebar-hover: #292524;
  --brand-mark: #b45309;
  --body-grad-1: rgba(180, 83, 9, .14);
  --body-grad-2: rgba(28, 25, 23, .10);
  --body-base-1: #e4dfd8;
  --body-base-2: #d8d2ca;
  --body-base-3: #cdc6bc;
  --opening-border: #b45309;
  --opening-bg: linear-gradient(180deg, #fff7ed 0%, #faf8f5 55%);
  --row-primary: linear-gradient(90deg, rgba(180, 83, 9, .08), transparent);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 8% -8%, var(--body-grad-1) 0%, transparent 55%),
    radial-gradient(800px 380px at 92% 12%, var(--body-grad-2) 0%, transparent 50%),
    linear-gradient(180deg, var(--body-base-1) 0%, var(--body-base-2) 55%, var(--body-base-3) 100%);
}

a { color: var(--sea); text-decoration: none; }
a:hover { color: var(--sea-dark); }

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.mobile-topbar,
.nav-backdrop,
.menu-toggle {
  display: none !important;
}

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 1.5rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 981px) {
  .mobile-topbar,
  .nav-backdrop,
  .menu-toggle {
    display: none !important;
  }

  .sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    overflow-y: auto;
  }
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.2;
  padding: 0 .4rem;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  background: var(--brand-mark);
  color: #fff;
  flex-shrink: 0;
  margin-top: .1rem;
}

.brand span {
  display: block;
  font-family: var(--font-ui);
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #9db0c2;
  margin-top: .35rem;
}

.nav { display: flex; flex-direction: column; gap: .25rem; }
.nav a {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: #c9d6e2;
  padding: .7rem .85rem;
  border-radius: 10px;
  transition: background .2s ease, color .2s ease;
}
.nav a:hover, .nav a.active {
  background: var(--brand-mark);
  color: #fff;
}
.nav-ico {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-foot {
  margin-top: auto;
  padding: .4rem;
  color: #8ea0b2;
  font-size: .85rem;
}
.sidebar-year {
  margin-bottom: .85rem;
  padding: .65rem .7rem;
  border: 1px solid #314354;
  border-radius: 10px;
  background: rgba(255,255,255,.03);
}
.sidebar-year label {
  display: block;
  font-size: .72rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #9db0c2;
  margin-bottom: .4rem;
}
.sidebar-year select {
  width: 100%;
  background: var(--sidebar-hover);
  color: #e8eef2;
  border: 1px solid #3a5166;
  border-radius: 8px;
  padding: .45rem .55rem;
}
.sidebar-user {
  margin-bottom: .55rem;
  font-size: .78rem;
  color: #9db0c2;
}

.main {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.75rem 0;
  min-height: 100vh;
}
.main-content { flex: 1; padding-bottom: 2rem; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.topbar h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .65rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
}
.badge-open {
  background: #dcfce7;
  color: #166534;
}
.badge-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}
.badge-locked { background: var(--coral-soft); color: var(--coral); }
.badge-primary {
  display: inline-block;
  margin-left: .35rem;
  padding: .12rem .4rem;
  border-radius: 4px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  vertical-align: middle;
  background: #dbeafe;
  color: #1e40af;
}

.flash {
  padding: .85rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}
.flash-success { background: var(--sea-soft); color: var(--sea-dark); }
.flash-error { background: var(--coral-soft); color: var(--coral); }

.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.stat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .45rem;
}
.stat .label {
  color: var(--muted);
  font-size: .82rem;
  margin: 0;
}
.stat-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  flex-shrink: 0;
}
.stat-ico svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stat-ico-blue { background: var(--sea-soft); color: var(--sea); }
.stat-ico-green { background: #dcfce7; color: #15803d; }
.stat-ico-red { background: #fee2e2; color: #b91c1c; }
.stat .value {
  font-family: var(--font-num);
  font-size: 1.35rem;
  font-weight: 500;
}
.stat .value.positive { color: #15803d; }
.stat .value.negative { color: var(--coral); }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.1rem;
}

.panel h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.banks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}
.banks-head h2 { margin: 0; }
.btn-sm {
  padding: .45rem .75rem;
  font-size: .85rem;
}

.banks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.bank-col {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .9rem 1rem;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
}
.bank-col-head {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .85rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--line);
}
.bank-col h3 {
  margin: 0;
  font-size: .95rem;
  letter-spacing: .02em;
  text-transform: none;
  color: var(--navy, #0b1f33);
  font-weight: 600;
}
.bank-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
  flex-shrink: 0;
  padding: 2px;
}
.bank-logo-mono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--navy);
  color: #e2e8f0;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  flex-shrink: 0;
}
.settings-bank-head {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: 1rem 0 .4rem;
}
.settings-bank-head h3 { margin: 0; }
.bank-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .35rem .75rem;
  align-items: center;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
}
.bank-row:last-child { border-bottom: 0; }
.bank-row-primary {
  background: var(--row-primary);
  margin: 0 -.35rem;
  padding-left: .35rem;
  padding-right: .35rem;
  border-radius: 6px;
}
.bank-label {
  font-size: .9rem;
  color: var(--ink);
  margin: 0;
}
.bank-amount {
  font-family: var(--font-num);
  font-size: 1.05rem;
  font-weight: 600;
  text-align: right;
}
.bank-amount.positive { color: var(--sea); }
.bank-amount.negative { color: var(--coral); }
.bank-currency {
  display: inline-block;
  margin-left: .35rem;
  padding: .1rem .4rem;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  vertical-align: middle;
  background: var(--navy);
  color: #e2e8f0;
  font-family: var(--font-num);
}
.opening-panel {
  border: 2px solid var(--opening-border);
  background: var(--opening-bg);
}
.opening-panel h2 { color: var(--sea-dark); }
.opening-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .85rem;
}
.opening-row input[type="number"] {
  min-width: 12rem;
  font-size: 1.15rem;
  font-family: var(--font-num);
  font-weight: 600;
  padding: .65rem .75rem;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}
.theme-option {
  position: relative;
  display: block;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: .85rem .75rem .75rem;
  background: var(--card);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.theme-option:hover { border-color: var(--sea); }
.theme-option.is-active,
.theme-option:has(input:checked) {
  border-color: var(--sea);
  box-shadow: 0 0 0 3px var(--sea-soft);
}
.theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.theme-swatch {
  display: flex;
  height: 2.4rem;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: .55rem;
  border: 1px solid var(--line);
}
.theme-swatch span { flex: 1; }
.theme-option strong { display: block; font-size: .95rem; color: var(--ink); }
.theme-option small { display: block; margin-top: .25rem; color: var(--muted); font-size: .78rem; line-height: 1.35; }
@media (max-width: 900px) {
  .theme-grid { grid-template-columns: 1fr; }
}

.bank-note {
  grid-column: 1 / -1;
  font-size: .75rem;
  color: var(--muted);
  margin-top: -.25rem;
}
.bank-row-input input {
  width: 9.5rem;
  max-width: 100%;
  text-align: right;
  font-family: var(--font-num);
}
.banks-add {
  margin-top: 1rem;
  text-align: center;
  padding-top: .75rem;
  border-top: 1px dashed var(--line);
}
.banks-add a {
  font-weight: 600;
  font-size: .95rem;
}
.bank-manual-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: -.15rem;
}
.bank-inline-edit {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  margin-top: .15rem;
}
.bank-inline-edit input[type="number"] {
  width: 8.5rem;
  max-width: 100%;
  text-align: right;
  font-family: var(--font-num);
  padding: .35rem .45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.btn-mini {
  display: inline-flex;
  align-items: center;
  padding: .22rem .55rem;
  font-size: .72rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.2;
}
.btn-mini:hover { border-color: var(--sea); color: var(--sea); }
.btn-mini-primary {
  background: var(--sea);
  border-color: var(--sea);
  color: #fff;
}
.btn-mini-primary:hover { background: var(--sea-dark); border-color: var(--sea-dark); color: #fff; }
.guide-panel h2 { margin-bottom: .65rem; }
.guide-list {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.55;
  color: #334155;
}
.guide-list li { margin: .35rem 0; }
.ledger-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  margin: 1rem 0;
  background: #fff;
}
.ledger-card h3 {
  margin: 0 0 .75rem;
  font-size: 1rem;
}
.ledger-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.ledger-grid .check {
  display: flex;
  gap: .45rem;
  align-items: flex-start;
  margin: .35rem 0;
  font-size: .92rem;
}
@media (max-width: 700px) {
  .ledger-grid { grid-template-columns: 1fr; }
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--sea);
}
.group-header h2 { margin: 0; }
.group-total {
  font-family: var(--font-num);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--sea-dark);
}

.income-groups {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.income-table-block {
  margin-bottom: 0;
}
.income-table-block table tfoot td {
  border-top: 2px solid var(--line);
  padding-top: .85rem;
  background: var(--sea-soft);
}

.subcat-block {
  margin-top: 1.15rem;
  padding: .85rem 1rem 1rem;
  border-radius: 12px;
  border: 1px solid #c5ddd9;
  border-left: 5px solid var(--sea);
  background: #f3faf9;
}
.subcat-block:first-of-type {
  margin-top: .35rem;
}
.subcat-title {
  margin: 0 0 .75rem;
  padding: .55rem .75rem;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: #083832;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: #cfe8e4;
}
.subcat-label {
  text-transform: none;
}
.subcat-title .num {
  color: var(--sea-dark);
  font-family: var(--font-num);
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
}
.subcat-block table {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(15, 118, 110, .12);
}

/* Distinct tones so each credit subcategory stands out */
.subcat-tone-1 {
  border-left-color: #0f766e;
  background: #eef8f6;
}
.subcat-tone-1 .subcat-title { background: #bfe3de; color: #064e48; }

.subcat-tone-2 {
  border-left-color: #1d4e89;
  background: #eef3f9;
}
.subcat-tone-2 .subcat-title { background: #c9daf0; color: #12355f; }
.subcat-tone-2 .subcat-title .num { color: #1d4e89; }

.subcat-tone-3 {
  border-left-color: #8a5a2b;
  background: #f9f4ee;
}
.subcat-tone-3 .subcat-title { background: #ead7c2; color: #5a3a18; }
.subcat-tone-3 .subcat-title .num { color: #8a5a2b; }

.subcat-tone-4 {
  border-left-color: #5b4b8a;
  background: #f4f1f9;
}
.subcat-tone-4 .subcat-title { background: #d9d0eb; color: #3a2f5c; }
.subcat-tone-4 .subcat-title .num { color: #5b4b8a; }

.subcat-tone-5 {
  border-left-color: #a64545;
  background: #faf0f0;
}
.subcat-tone-5 .subcat-title { background: #ebc8c8; color: #6b2424; }
.subcat-tone-5 .subcat-title .num { color: #a64545; }

.cat-footer {
  margin-top: 1rem;
  padding: .75rem .9rem;
  background: var(--sea-soft);
  border-radius: 10px;
  text-align: right;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 960px) {
  .charts-grid {
    grid-template-columns: 1fr 1fr;
  }
  .charts-grid .chart-wide {
    grid-column: 1 / -1;
  }
}
.chart-wrap {
  position: relative;
  height: 320px;
}
.chart-wrap.tall { height: 380px; }

.toolbar {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
}
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-group { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .9rem; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: .85rem; color: var(--muted); font-weight: 600; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .7rem .8rem;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: none;
  border-radius: 10px;
  padding: .7rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--sea); color: #fff; }
.btn-primary:hover { background: var(--sea-dark); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-danger { background: var(--coral); color: #fff; }
.btn-sm { padding: .4rem .7rem; font-size: .85rem; }

table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: .75rem .5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
td.num, th.num {
  font-family: var(--font-num);
  text-align: right;
  white-space: nowrap;
}

.actions { display: flex; gap: .4rem; flex-wrap: wrap; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.75rem;
}
.login-card h1 {
  font-family: var(--font-display);
  margin: 0 0 .35rem;
}
.login-card p {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.muted { color: var(--muted); }

.choose-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.choose-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.4rem;
  color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.choose-card:hover {
  border-color: var(--sea);
  transform: translateY(-2px);
  color: inherit;
}
.choose-card-accent {
  border-color: #9ecfc8;
  background: linear-gradient(180deg, #f3fbfa 0%, #fff 70%);
}
.choose-card h2 {
  margin: 0 0 .5rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}
.choose-card p {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.45;
}
.choose-cta {
  font-weight: 700;
  color: var(--sea-dark);
}

.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}
.cat-tab {
  padding: .55rem 1rem;
  border-radius: 999px;
  border: 2px solid #0f766e;
  color: #083832;
  background: linear-gradient(180deg, #dff3ef 0%, #c5e8e2 100%);
  font-size: .92rem;
  font-weight: 700;
  box-shadow: 0 2px 0 rgba(11, 91, 85, .25);
}
.cat-tab:hover {
  border-color: var(--sea-dark);
  background: linear-gradient(180deg, #cfeee9 0%, #a9ddd5 100%);
  color: #042f2b;
}
.cat-tab.active {
  background: var(--sea);
  border-color: var(--sea-dark);
  color: #fff;
  box-shadow: none;
}
.cat-tab-sub {
  font-size: .84rem;
  padding: .4rem .8rem;
  border-width: 1.5px;
  border-color: #1d4e89;
  background: linear-gradient(180deg, #e8f0fa 0%, #d0dff2 100%);
  color: #12355f;
  box-shadow: 0 2px 0 rgba(29, 78, 137, .2);
}
.cat-tab-sub:hover {
  background: linear-gradient(180deg, #d9e7f7 0%, #b9ceea 100%);
  color: #0c2748;
}
.jump-panel {
  position: sticky;
  top: .5rem;
  z-index: 5;
  background: linear-gradient(180deg, #1a2b38 0%, #14202b 100%);
  border: 1px solid #314354;
  box-shadow: 0 12px 28px rgba(12, 20, 28, .28);
}
.jump-panel .jump-label { color: #9db0c2; }
.jump-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: .55rem;
}
.jump-subs {
  margin: 0 0 1rem;
  padding: .75rem .85rem;
  background: #e4ecef;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.income-table-block,
.subcat-block {
  scroll-margin-top: 5.5rem;
}

.app-footer {
  margin-top: auto;
  padding: 1.1rem 1.5rem 1.35rem;
  color: #6a7f91;
  font-size: .82rem;
  text-align: center;
  border-top: 1px solid rgba(49, 67, 84, .28);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .35rem .85rem;
}
.app-footer .footer-credit {
  color: #94a3b8;
  font-size: .78rem;
}

.quick-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) auto;
  gap: .55rem;
  align-items: center;
}
.batch-table-wrap { overflow-x: auto; }
.batch-table input,
.batch-table select {
  min-width: 110px;
}
.batch-table td { padding: .4rem .35rem; }

.batch-details {
  margin-top: 1rem;
  padding: .65rem .85rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fafcfd;
}
.batch-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--sea-dark);
}

.stack { display: flex; flex-direction: column; gap: .75rem; }
.cat-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: .85rem;
}
.sub-list { margin: .75rem 0 0; padding-left: 0; list-style: none; }
.sub-list li {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .45rem 0;
  border-top: 1px dashed var(--line);
  align-items: center;
}

@media (max-width: 980px) {
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row, .form-row.three { grid-template-columns: 1fr; }
  .choose-grid { grid-template-columns: 1fr; }
  .banks-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .grid-stats { grid-template-columns: 1fr; }
  .main { padding: 1rem; }
  .bank-row-input {
    grid-template-columns: 1fr;
  }
  .bank-row-input input {
    width: 100%;
    text-align: left;
  }
}
