/* styles.css — light theme, responsive two-column layout, no external deps. */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --border: #e3e7ef;
  --primary: #3b5bdb;
  --primary-dark: #2f49b0;
  --income: #2e7d32;
  --income-bg: #e7f6e9;
  --expense: #d32f2f;
  --expense-bg: #fdeaea;
  --shadow: 0 1px 3px rgba(20, 30, 60, 0.08), 0 4px 16px rgba(20, 30, 60, 0.06);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  padding: 0 0 48px;
}

h1, h2, h3 { margin: 0; font-weight: 650; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---- Header ---- */
.app-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  background: linear-gradient(120deg, #3b5bdb, #5b73e8);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 4px 16px rgba(20, 28, 50, 0.18);
}
.app-header__brand { display: flex; align-items: center; gap: 12px; }
.app-logo { flex: none; width: 44px; height: 44px; align-self: center; }
.app-header h1 { font-size: 21px; }
.app-header__subtitle { margin: 2px 0 0; opacity: 0.9; font-size: 13px; }
.app-header__period { display: flex; align-items: center; gap: 8px; }
.app-header__period label { font-size: 13px; opacity: 0.9; }
.app-header__period select {
  padding: 8px 36px 8px 12px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--text);
  cursor: pointer;
}

/* ---- Dashboard cards ---- */
.dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 24px 28px 4px;
  max-width: 1100px;
  margin: 0 auto;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 4px solid var(--border);
}
.card__label { font-size: 13px; color: var(--muted); }
.card__value { font-size: 26px; font-weight: 700; }
.card--income { border-left-color: var(--income); }
.card--income .card__value { color: var(--income); }
.card--expense { border-left-color: var(--expense); }
.card--expense .card__value { color: var(--expense); }
.card--balance { border-left-color: var(--primary); }
.balance--positive .card__value { color: var(--primary); }
.balance--negative .card__value { color: var(--expense); }

/* ---- Layout ---- */
.layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  padding: 16px 28px;
  max-width: 1100px;
  margin: 0 auto;
}
.layout__main, .layout__side { display: flex; flex-direction: column; gap: 16px; }

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.panel__title { font-size: 16px; margin-bottom: 14px; }
/* Right-column panels share a quiet header divider for a consistent, structured
   "card section" look (the capital panel keeps its own accent treatment). */
.layout__side .panel:not(.panel--capital) .panel__title {
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
}

/* ---- Inline SVG icons ---- */
.ic { width: 1.1em; height: 1.1em; display: inline-block; vertical-align: -0.16em; flex: none; }
.ic-slot { display: inline-flex; }
.ic-slot .ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
/* icon + text rows keep the two aligned with a small gap */
.with-ic { display: inline-flex; align-items: center; gap: 7px; }

/* ---- Form ---- */
.tx-form { display: flex; flex-direction: column; gap: 14px; }
.tx-form__row { display: flex; gap: 18px; }
.tx-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; font-weight: 550; color: #404858; }
.field__inline { display: flex; gap: 8px; }
.field__inline select { flex: 1; }

input[type="text"],
input[type="number"],
input[type="date"],
select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  width: 100%;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.15);
}
/* Custom dropdown caret so the arrow keeps a comfortable gap from the right edge
   (the native arrow sits right against it). Applies to every <select>. */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a6473' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.radio { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 14px; }
.radio input { width: auto; }

.tx-form__actions { display: flex; gap: 10px; margin-top: 8px; }

/* ---- Buttons ---- */
.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); }
.btn--ghost { background: #f1f3f9; color: #3a4253; border-color: var(--border); }
.btn--ghost:hover { background: #e7eaf3; }
.btn--danger { color: #c0322f; border-color: #f0cdcd; background: #fdf3f3; }
.btn--danger:hover { background: #fbe7e7; }

/* ---- Transaction list ---- */
.tx-list { display: flex; flex-direction: column; }
.tx-item {
  display: grid;
  grid-template-columns: 8px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
}
.tx-item:last-child { border-bottom: none; }
.tx-item__dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
/* Hover the colour dot -> it grows with a soft ring (tooltip shows the category) */
.tx-item__dot:hover {
  transform: scale(1.7);
  box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.18);
}
.tx-item__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tx-item__top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tx-item__cat { font-weight: 600; font-size: 14px; }
.tx-item__date { font-size: 12px; color: var(--muted); }
.tx-item__note { font-size: 13px; color: #555c6b; word-break: break-word; }
.tx-item__amt-wrap { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.tx-item__amount { font-weight: 700; font-size: 15px; white-space: nowrap; }
.tx-item__amount--income { color: var(--income); }
.tx-item__amount--expense { color: var(--expense); }
.tx-item__year { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 1px; }
.tx-item__actions { display: flex; gap: 4px; }
.icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--muted);
}
.icon-btn:hover { background: #f1f3f9; color: var(--text); }

.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 18px 0; }

/* ---- Breakdown (donut pie chart) ---- */
.breakdown { display: flex; justify-content: center; }
.pie { position: relative; width: 100%; }
.pie__svg { width: 100%; height: auto; display: block; overflow: visible; }

.pie__slice {
  cursor: pointer;
  transition: transform 0.13s ease, opacity 0.13s ease;
  stroke: var(--surface); stroke-width: 0.75;
}
/* dim the rest so the hovered slice stands out */
.pie.is-hovering .pie__slice:not(.is-active) { opacity: 0.45; }
.pie__slice.is-active { filter: drop-shadow(0 2px 4px rgba(20, 28, 50, 0.18)); }

.pie__total-lbl {
  font-size: 9.5px; fill: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.pie__total-val { font-size: 19px; font-weight: 700; fill: var(--text); font-variant-numeric: tabular-nums; }
/* static per-slice share labels (slices ≥4%) */
.pie__label {
  font-size: 8px; font-weight: 700; fill: #fff; pointer-events: none;
  dominant-baseline: central; paint-order: stroke;
  stroke: rgba(20, 28, 50, 0.28); stroke-width: 2.4px; stroke-linejoin: round;
}
.pie.is-hovering .pie__label { opacity: 0.25; transition: opacity 0.13s ease; }

.pie__leader-line { fill: none; stroke-width: 1.5; }

.pie__tip {
  position: absolute;
  display: flex; align-items: center; gap: 7px;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: 8px; padding: 5px 9px;
  font-size: 12px; font-weight: 600; color: var(--text);
  white-space: nowrap; pointer-events: none; z-index: 5;
}
.pie__tip[hidden] { display: none; }
.pie__tip-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* ---- Advice / spending tips ---- */
.advice { display: flex; flex-direction: column; gap: 10px; }
.tip {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 10px;
  background: #f7f8fb; border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
}
.tip--good { border-left-color: var(--income); background: #f0faf3; }
.tip--warn { border-left-color: #e0962e; background: #fdf6ec; }
.tip--info { border-left-color: var(--primary); background: #f4f6ff; }
.tip__ic { flex: none; color: var(--muted); margin-top: 1px; }
.tip__ic .ic { width: 1.15em; height: 1.15em; }
.tip--good .tip__ic { color: var(--income); }
.tip--warn .tip__ic { color: #c97e1e; }
.tip--info .tip__ic { color: var(--primary); }
.tip__body { min-width: 0; }
.tip__title { font-weight: 650; font-size: 13px; margin: 0 0 2px; }
.tip__text { font-size: 12.5px; color: #4a5160; line-height: 1.4; margin: 0; }

/* 50/30/20 card — a structured bar set, so it overrides the flex tip layout */
.tip--503020 { display: block; background: #fff; border-left: 1px solid var(--border); }
.tip--503020 .tip__title {
  display: flex; align-items: center; gap: 7px; margin-bottom: 12px; font-size: 13.5px;
}
.tip--503020 .tip__ic { color: var(--primary); }
.ftt { display: flex; flex-direction: column; gap: 14px; }
.ftt__head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.ftt__name { font-weight: 600; }
.ftt__val { font-weight: 600; font-variant-numeric: tabular-nums; }
.ftt__val--bad { color: #e53935; }
.ftt__val--good { color: var(--income); }
.ftt__target { color: var(--muted); font-weight: 500; }
.ftt__bar {
  position: relative; height: 13px; border-radius: 7px;
  background: #eef0f6; overflow: hidden;
}
/* category segments, sized as a share of income (largest = most opaque) */
.ftt__seg {
  position: absolute; top: 0; height: 100%;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.85);
}
/* the part of needs/wants that overshoots the target line */
.ftt__over {
  position: absolute; top: 0; height: 100%;
  background: rgba(229, 57, 53, 0.30);
}
/* the savings shortfall (fill below the target line) */
.ftt__gap {
  position: absolute; top: 0; height: 100%;
  background: rgba(229, 57, 53, 0.12);
}
/* the recommended-target marker — the "red line" to stay under */
.ftt__tick {
  position: absolute; top: -1px; width: 2px; height: 15px;
  background: #e53935; border-radius: 1px; transform: translateX(-1px); z-index: 2;
}
.ftt__delta { color: #e53935; font-weight: 700; margin-left: 2px; }
.ftt__note { font-size: 11px; color: var(--muted); line-height: 1.4; margin: 13px 0 0; }

/* tips carousel */
.advice-deck { display: flex; flex-direction: column; gap: 10px; }
.tip { position: relative; }
.tip__defer {
  flex: none; align-self: flex-start; margin: -2px -4px 0 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.tip__defer:hover { background: rgba(20, 28, 50, 0.07); color: #4a5160; }
.tip__defer .ic { width: 14px; height: 14px; }
.tip--motiv { border-left-color: var(--income); background: #eefaf1; }
.tip--motiv .tip__ic { color: var(--income); }
.advice-nav {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 4px;
}
.advice-nav__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border-radius: 8px;
  border: 1px solid var(--border); background: #fff; color: #4a5160; cursor: pointer;
}
.advice-nav__btn:hover { background: #f4f6ff; border-color: var(--primary); color: var(--primary); }
.advice-nav__btn .ic { width: 16px; height: 16px; }
.advice-nav__count {
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 70px; text-align: center;
}

/* ---- Tools ---- */
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

/* ---- Goals & loans (plans) ---- */
.plan-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.plan-row {
  background: #f7f8fb; border: 1px solid var(--border);
  border-left: 3px solid var(--income); border-radius: 10px; padding: 11px 13px;
}
.plan-row--loan { border-left-color: #e0962e; }
.plan-row.is-done { background: #f0faf3; border-left-color: var(--income); }
.plan-row__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13.5px; margin-bottom: 8px; }
.plan-row__name { font-weight: 650; }
.plan-row__nums { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12.5px; }
.plan-row__bar { height: 9px; border-radius: 6px; background: #e7e9f1; overflow: hidden; }
.plan-row__fill { height: 100%; border-radius: 6px; background: var(--income); min-width: 3px; transition: width 0.25s ease; }
.plan-row__fill--loan { background: #e0962e; }
.plan-row.is-done .plan-row__fill { background: var(--income); }
.plan-row__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.plan-row__meta { font-size: 11.5px; color: var(--muted); }
.plan-row.is-done .plan-row__meta { color: var(--income); font-weight: 600; }
.plan-row__actions { display: flex; gap: 2px; flex: none; }

.set-plan {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-top: 13px; border-top: 1px dashed var(--border);
}
.set-plan select { flex: 1 1 100%; }
.set-plan select.set-plan__month { flex: 1 1 140px; }
.set-plan input[type="number"] { flex: 1 1 88px; min-width: 0; }
.set-plan .btn { flex: 1 1 auto; }

/* compact goal/loan status under a category row in the expenses list */
.tx-plan { margin-top: 7px; }
.tx-plan__bar { height: 5px; border-radius: 4px; background: #eef0f6; overflow: hidden; }
.tx-plan__fill { height: 100%; border-radius: 4px; background: var(--income); min-width: 2px; }
.tx-plan__fill--loan { background: #e0962e; }
.tx-plan__meta { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; }

/* ---- Print report + preview ---- */
.modal__box--wide { max-width: 800px; width: 94%; max-height: 88vh; overflow: auto; }
.print-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.print-toolbar h3 { margin: 0; }
.print-toolbar__actions { display: flex; gap: 8px; }
.report { color: #1a1f2e; }
.report__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  border-bottom: 2px solid var(--primary); padding-bottom: 8px; margin-bottom: 16px; }
.report__head h1 { font-size: 20px; margin: 0; color: var(--primary); }
.report__meta { font-size: 13px; color: #555; }
.report__cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 8px; }
.report__card { border: 1px solid #e3e6ef; border-radius: 8px; padding: 10px 12px; }
.report__card span { display: block; font-size: 11px; color: #666; margin-bottom: 3px; }
.report__card b { font-size: 16px; font-variant-numeric: tabular-nums; }
.report h2 { font-size: 14px; margin: 18px 0 6px; }
.report__tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.report__tbl th, .report__tbl td { text-align: left; padding: 5px 8px; border-bottom: 1px solid #eceef4; }
.report__tbl th { color: #666; font-weight: 600; }
.report__tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.report__tbl tfoot td { font-weight: 700; border-top: 2px solid #d7dbe8; border-bottom: none; }
.report__grp td { font-weight: 700; background: #f5f6fb; }
.report__tbl tfoot .report__subtot td { font-weight: 400; font-style: italic; color: #555; border-top: none; }
.report__sub td:first-child { padding-left: 22px; color: #555; font-weight: 400; }
.report__note { font-size: 11.5px; color: #666; line-height: 1.5; margin: 8px 0 0; }
/* estimated tax block */
.tax-est { margin-top: 16px; padding-top: 14px; border-top: 2px solid #e3e6ef; }
.tax-est__title { font-size: 13px; font-weight: 700; margin: 0 0 10px; }
.tax-est__rate { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.tax-est__rate label { font-size: 12px; color: #555; }
.tax-est__rate select { padding: 4px 8px; border: 1px solid #d7dbe8; border-radius: 6px; font-size: 12.5px; }
.report__tbl.tax-est__tbl tfoot .tax-est__total td { font-weight: 800; font-size: 14px; }
.report__tbl.tax-est__tbl tfoot .tax-est__qtr td { font-weight: 600; color: #2f6f3e; border-top: none; }
.tax-est__note { font-size: 11px; color: #777; line-height: 1.5; margin: 8px 0 0; font-style: italic; }
/* 1099-NEC worksheet (print) */
.f1099 { border: 1.5px solid #2b2f3a; border-radius: 8px; padding: 18px 20px; margin: 0 0 18px; font-size: 13px; }
.f1099 + .f1099 { page-break-before: always; }
.f1099__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  border-bottom: 1.5px solid #2b2f3a; padding-bottom: 8px; margin-bottom: 12px; }
.f1099__title { font-size: 16px; font-weight: 800; }
.f1099__year { font-size: 13px; color: #444; }
.f1099__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.f1099__box { border: 1px solid #c9cedb; border-radius: 6px; padding: 10px 12px; }
.f1099__boxttl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #555; margin-bottom: 8px; }
.f1099__line { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px dotted #dfe3ee; }
.f1099__line:last-child { border-bottom: none; }
.f1099__lbl { color: #666; min-width: 110px; }
.f1099__val { flex: 1; font-weight: 600; }
.f1099__blank { display: inline-block; min-width: 120px; border-bottom: 1px solid #999; height: 1em; vertical-align: bottom; }
.f1099__amount { display: flex; justify-content: space-between; align-items: center;
  background: #f3f5fb; border: 1px solid #c9cedb; border-radius: 6px; padding: 10px 14px; margin-bottom: 10px; }
.f1099__amount span { font-weight: 700; }
.f1099__amount b { font-size: 18px; font-variant-numeric: tabular-nums; }
.f1099__warn { color: #9a3412; font-size: 12px; margin: 6px 0 0; }
.f1099__note { font-size: 11px; color: #777; line-height: 1.5; margin: 10px 0 0; font-style: italic;
  border-top: 1px solid #e3e6ef; padding-top: 8px; }
.wizard__head--row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/* bank-statement import review */
.stmt-pick { display: flex; align-items: center; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.stmt-review { max-height: 52vh; overflow: auto; margin-top: 6px; }
.stmt-tbl { font-size: 12px; }
.stmt-tbl th { position: sticky; top: 0; background: #fff; z-index: 1; }
.stmt-tbl td { vertical-align: middle; }
.stmt-tbl input, .stmt-tbl select { font-size: 12px; padding: 3px 5px; width: auto; }
.stmt-tbl .stmt-desc { width: 100%; min-width: 130px; }
.stmt-tbl .stmt-date { width: 130px; }
.report__note--foot { margin-top: 18px; padding-top: 12px; border-top: 1px solid #e3e6ef; font-style: italic; }

@media print {
  body { background: #fff !important; }
  body > *:not(#print-modal) { display: none !important; }
  #print-modal { position: static !important; display: block !important; }
  #print-modal .modal__backdrop, .no-print { display: none !important; }
  #print-modal .modal__box { position: static; box-shadow: none; max-width: none; width: auto;
    max-height: none; overflow: visible; padding: 0; border-radius: 0; }
  .report__cards { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Modal ---- */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(20, 28, 50, 0.45); }
.modal__box {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  width: min(92vw, 380px);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2430;
  color: #fff;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: var(--shadow);
  z-index: 60;
  max-width: 90vw;
}
.toast--error { background: var(--expense); }

/* ---- Header tools ---- */
.app-header__tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* RU / ENG segmented language switch */
.lang-switch {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.lang-switch__opt {
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: background 0.15s, color 0.15s;
}
.lang-switch__opt:hover { background: rgba(255, 255, 255, 0.15); }
.lang-switch__opt.is-active { background: #fff; color: var(--primary-dark); }
.lang-switch__opt.is-active:hover { background: #fff; }

/* Workspace switch (Personal / Business) — same segmented style as the language
   toggle, sitting where the language toggle used to be. */
.ws-switch {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.ws-switch__opt {
  border: none; background: transparent; color: #fff; cursor: pointer;
  padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 700;
  transition: background 0.15s, color 0.15s;
}
.ws-switch__opt:hover { background: rgba(255, 255, 255, 0.15); }
.ws-switch__opt.is-active { background: #fff; color: var(--primary-dark); }
.ws-switch__opt.is-active:hover { background: #fff; }

/* Smaller, relocated language toggle */
.lang-switch--mini { padding: 1px; background: rgba(255, 255, 255, 0.16); }
.lang-switch--mini .lang-switch__opt { padding: 3px 8px; font-size: 11px; font-weight: 600; }

/* Business workspace layout — mirrors the personal two-column grid */
.biz-layout {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px;
  padding: 16px 28px; max-width: 1100px; margin: 0 auto;
}
/* business type toggle (LLC / S-Corp) */
.biz-entity-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: 1100px; margin: 0 auto; padding: 14px 28px 0;
}
.biz-entity__label { font-weight: 600; font-size: 13px; }
.biz-entity__note { font-size: 12px; color: var(--muted); }
.seg { display: inline-flex; background: #eef1f7; border-radius: 8px; padding: 2px; gap: 2px; }
.seg__opt {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  padding: 5px 13px; border-radius: 6px; font-size: 12.5px; font-weight: 700;
  transition: background 0.15s, color 0.15s;
}
.seg__opt:hover { background: rgba(59, 91, 219, 0.10); }
.seg__opt.is-active { background: var(--primary); color: #fff; }
/* stage-2 business panels (equipment, money out, tax summary) */
.biz-extra { display: flex; flex-direction: column; gap: 16px; max-width: 1100px; margin: 0 auto; padding: 0 28px 16px; }
.biz-total { margin-left: auto; font-weight: 700; color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.field-hint { font-size: 11.5px; color: var(--muted); margin: 5px 0 0; line-height: 1.4; }
/* business add-operation form: more breathing room + a divider so the
   expense-specific block (category, vendor) reads as its own group */
.biz-form { gap: 18px; }
.biz-form #biz-expense-fields {
  display: flex; flex-direction: column; gap: 18px;
  padding-top: 18px; border-top: 1px solid var(--border);
}
.plan-row--out { border-left-color: #7c4dff; }
.plan-row--out .plan-row__nums { color: #7c4dff; font-weight: 700; }
/* owner contribution = money IN (not taxable income) */
.plan-row--in { border-left-color: var(--income); }
.plan-row--in .plan-row__nums { color: var(--income); font-weight: 700; }
.app-header__period--biz { margin-left: auto; }
.app-header__period--biz label { color: var(--muted); opacity: 1; }
/* the header period selector belongs to the personal view only */
body.ws-business .app-header .app-header__period { display: none; }
/* business right column: projects panel + operations list stacked */
.biz-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.plan-row--proj { border-left-color: var(--primary); }
.plan-row--proj .plan-row__nums { color: var(--income); font-weight: 700; font-size: 14px; }
.plan-row--proj .plan-row__nums.is-neg { color: var(--expense); }
.plan-row--oneoff { border-left-color: var(--muted); }
.plan-row--oneoff .plan-row__nums { color: var(--income); font-weight: 700; }
/* project progress (received vs estimate) */
.proj-bar { height: 6px; border-radius: 4px; background: #e9ecf4; overflow: hidden; margin: 6px 0 8px; }
.proj-bar > span { display: block; height: 100%; background: var(--income); border-radius: 4px; }
.proj-owed { color: var(--expense); }
/* receivables banner ("clients owe you") */
.receivable { background: #fff8ec; border: 1px solid #f3dca6; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.receivable__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.receivable__label { font-size: 12.5px; font-weight: 600; color: #8a6d1f; }
.receivable__total { font-size: 22px; font-weight: 800; color: #b4690e; font-variant-numeric: tabular-nums; }
.receivable__sub { font-size: 11.5px; color: #98823f; margin-top: 2px; }
.receivable__list { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.receivable__row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 12.5px; padding-top: 5px; border-top: 1px dotted #ecdcb4; }
.receivable__row b { color: #b4690e; font-variant-numeric: tabular-nums; }
/* license / trial banner */
.lic-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.lic-banner--trial { background: #fff8ec; border: 1px solid #f3dca6; color: #8a6d1f; }
.lic-banner--ended { background: #fdecec; border: 1px solid #f3b6b6; color: #9a2f2f; }
.lic-banner__msg { font-weight: 600; }
.lic-banner__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lic-banner__buy { background: var(--primary); color: #fff; border: none; }
.lic-banner__buy:hover { filter: brightness(1.05); }
/* read-only (trial expired): dim the entry controls; viewing + export stay live */
body.biz-locked #biz-tx-form,
body.biz-locked #biz-equip-add,
body.biz-locked #biz-draw-add,
body.biz-locked #biz-import-btn { opacity: .5; pointer-events: none; }
/* first-launch welcome slideshow (two slides: personal / business) */
.welcome__box { width: min(95vw, 540px); padding: 0; overflow: hidden; gap: 0; }
.welcome__bar { height: 5px; background: linear-gradient(135deg, #3b5bdb 0%, #7c3aed 100%); }
.welcome__slides { position: relative; min-height: 446px; }
.welcome__slide { position: absolute; inset: 0; padding: 28px 30px 8px;
  display: flex; flex-direction: column; align-items: stretch;
  opacity: 0; transform: translateY(8px); transition: opacity .35s ease, transform .35s ease;
  pointer-events: none; }
.welcome__slide.is-active { opacity: 1; transform: none; pointer-events: auto; }
.welcome__title { font-size: 21px; font-weight: 800; margin: 0 0 6px; color: var(--text); letter-spacing: -.01em; }
.welcome__intro { font-size: 13.5px; line-height: 1.5; color: #6a7184; margin: 0 0 18px; }
.welcome__features { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.welcome__feat { display: flex; align-items: center; gap: 12px; }
.welcome__feat-ic { flex: none; width: 34px; height: 34px; border-radius: 9px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 17px; }
.welcome__feat-label { font-size: 14px; color: var(--text); font-weight: 500; }
.welcome__slide--personal .welcome__feat-ic { background: #e8f3ec; color: #2f8a4e; }
.welcome__slide--business .welcome__feat-ic { background: #eef1fd; color: #3b5bdb; }
.welcome__slide--privacy .welcome__feat-ic { background: #f0eefb; color: #7c3aed; }
.welcome__tagline { margin: auto 0 0; padding-top: 13px; border-top: 1px solid #eceef4;
  font-size: 13px; font-weight: 600; font-style: italic; color: var(--primary); }
.welcome__dots { display: flex; justify-content: center; gap: 8px; padding: 14px 0 2px; }
.welcome__dot { width: 8px; height: 8px; border-radius: 50%; border: none; padding: 0; cursor: pointer;
  background: #d3d8e8; transition: background .2s, transform .2s; }
.welcome__dot.is-active { background: var(--primary); transform: scale(1.25); }
.welcome__nav { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 6px 18px 18px; }
.welcome__nav #welcome-back { margin-right: auto; }
/* purchase / pricing window */
.buy__box { width: min(94vw, 420px); padding: 0; overflow: hidden; gap: 0; }
.buy__body { padding: 22px 24px 22px; display: flex; flex-direction: column; gap: 0; }
.buy__body h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; }
.buy__price { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 14px; }
.buy__amount { font-size: 38px; font-weight: 800; color: var(--primary); line-height: 1; letter-spacing: -.02em; }
.buy__per { font-size: 12.5px; color: #6a7184; }
.buy__list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.buy__list li { position: relative; padding-left: 24px; font-size: 13.5px; line-height: 1.4; color: var(--text); }
.buy__list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: #2f8a4e; font-weight: 800; }
.buy__note { font-size: 11.5px; color: #8a90a0; margin: 0 0 16px; }
.buy__actions { display: flex; flex-direction: column; gap: 8px; }
.buy__cta { font-size: 15px; font-weight: 700; padding: 11px; }
/* vendor (1099) cards */
.plan-row--ven { border-left-color: #00897b; }
.plan-row--ven .plan-row__nums { color: var(--text); font-weight: 700; font-size: 13px; }
.ven-1099 { display: inline-block; font-size: 10px; font-weight: 800; color: #fff; background: #00897b;
  border-radius: 5px; padding: 1px 5px; vertical-align: 1px; letter-spacing: .3px; }
.ven-type { display: inline-block; font-size: 10px; font-weight: 700; border-radius: 5px; padding: 1px 6px; vertical-align: 1px; }
.ven-type--sub { color: #00695c; background: #d7f0ea; }
.ven-type--helper { color: #5b4636; background: #ece0d4; }
.set-plan--stack { flex-direction: column; align-items: stretch; }
.set-plan--stack .set-plan__btns { display: flex; gap: 8px; }
#ven-1099-fields { display: flex; flex-direction: column; gap: 8px; }
.ven-form { display: flex; flex-direction: column; gap: 10px; }
/* business-only header button (shown when the Business workspace is active) */
.ws-business-only { display: none; }
body.ws-business .ws-business-only { display: inline-flex; }
/* compact "+" add button next to the vendor field */
.btn--icon { padding: 0; width: 40px; min-width: 40px; justify-content: center; font-size: 20px; font-weight: 700; line-height: 1; }

/* Variant for use on a light surface (e.g. inside the wizard modal) */
.lang-switch--modal { background: #eef1f7; }
.lang-switch--modal .lang-switch__opt { color: var(--muted); }
.lang-switch--modal .lang-switch__opt:hover { background: rgba(59, 91, 219, 0.10); }
.lang-switch--modal .lang-switch__opt.is-active { background: var(--primary); color: #fff; }
.lang-switch--modal .lang-switch__opt.is-active:hover { background: var(--primary); }

/* Add-transaction "file folder" card: title stays white on the panel, the
   colored card wraps the type radios + fields, with a stacked-cards index look.
   Tinted by the selected type (income green / expense red). */
.tx-card {
  position: relative;
  margin-top: 42px;
  padding: 20px 16px 16px;
  border: 1px solid var(--line, var(--border));
  border-radius: 0 12px 12px 12px;
  background: #fff;
  transition: background 0.2s ease, border-color 0.2s ease;
  /* two cards peeking out bottom-right => file-index / stack of papers */
  box-shadow:
    7px 8px 0 -3px #f4f6fb,
    8px 9px 0 -3px rgba(0, 0, 0, 0.10),
    14px 16px 0 -6px #f4f6fb,
    15px 17px 0 -6px rgba(0, 0, 0, 0.07);
}
.tx-card.tx-card--income { --line: #bfe6cb; --tint: #e7f7ec; background: var(--tint); }
.tx-card.tx-card--expense { --line: #f4c4c4; --tint: #fdeaea; background: var(--tint); }

/* Income / Expense are folder tabs cut into the card's top edge. Each tab keeps
   its OWN type colour at all times — Income is green, Expense is red — whether it
   is active or not. The active tab is filled fuller (= card body tint) and its
   bottom merges into the card; the inactive tab is a lighter tint of its own
   colour, sitting separately. The first tab is flush with the card's left border. */
.tx-form__row--type {
  position: absolute;
  left: -1px;            /* Income tab flush with the card's left border line */
  top: 0;
  transform: translateY(-100%);
  margin: 0;
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  z-index: 1;
}
.tx-form__row--type .radio {
  position: relative;
  gap: 0;
  margin-bottom: 0;
  padding: 8px 20px 9px;
  border: 1px solid var(--tab-line);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: var(--tab-bg);
  color: var(--tab-fg);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  z-index: 1;
  opacity: 0.88;
  transition: color 0.16s ease, background 0.16s ease,
              margin-bottom 0.16s ease, opacity 0.16s ease;
}
/* each tab's own colour (inactive look) */
.tx-form__row--type .radio:nth-child(1) { --tab-line: #bfe6cb; --tab-bg: #e3f4e9; --tab-fg: #2a8a4f; } /* Income */
.tx-form__row--type .radio:nth-child(2) { --tab-line: #f4c4c4; --tab-bg: #fbe0e0; --tab-fg: #c95b5b; } /* Expense */
.tx-form__row--type .radio input { display: none; }
.tx-form__row--type .radio:hover { opacity: 1; }
/* active tab: fuller fill (= card body tint), merges into the card, full opacity */
.tx-form__row--type .radio:has(input:checked) {
  background: var(--tint);
  margin-bottom: -1px;
  opacity: 1;
  z-index: 3;
  box-shadow: 0 -1px 4px rgba(20, 28, 50, 0.05);
}
.tx-form__row--type .radio:nth-child(1):has(input:checked) { --tab-fg: #1d7a3a; }
.tx-form__row--type .radio:nth-child(2):has(input:checked) { --tab-fg: #c0322f; }

/* "All categories entered" prompt that replaces the entry fields once every
   category of the active type has a transaction this period. */
.cat-done { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 2px; }
.cat-done__msg { font-weight: 600; font-size: 14px; }
.cat-done__ask { font-size: 13px; color: #566173; }
.cat-done__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn--light { background: rgba(255, 255, 255, 0.95); color: var(--primary-dark); }
.btn--light:hover { background: #fff; }
.btn--sm { padding: 5px 10px; font-size: 12.5px; }
.panel__title:has(.btn--sm),
.panel__title:has(.sortby) { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* "Sort by" popup control */
.sortby { position: relative; }
.sortby__btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: 12.5px; font-weight: 500;
  color: var(--muted); background: #fff;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 5px 10px; cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.sortby__btn:hover { border-color: #cbd2e0; color: var(--text); }
.sortby__cur { color: var(--text); font-weight: 600; }
.sortby__caret { display: inline-flex; color: var(--muted); transition: transform 0.15s ease; }
.sortby__caret .ic { width: 0.9em; height: 0.9em; }
.sortby.is-open .sortby__caret { transform: rotate(180deg); }
.sortby.is-open .sortby__btn { border-color: var(--primary); color: var(--text); }
.sortby__menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 190px; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow); padding: 5px;
}
.sortby__menu[hidden] { display: none; }
.sortby__opt {
  display: flex; align-items: center; gap: 8px; width: 100%;
  font-family: inherit; font-size: 13px; font-weight: 500; text-align: left;
  background: none; border: none; border-radius: 7px; padding: 7px 9px;
  cursor: pointer; color: var(--text);
}
.sortby__opt:hover { background: #f3f5fa; }
.sortby__opt.is-active { color: var(--primary); font-weight: 600; }
.sortby__check { display: inline-flex; color: var(--primary); visibility: hidden; flex: none; }
.sortby__check .ic { width: 1em; height: 1em; }
.sortby__opt.is-active .sortby__check { visibility: visible; }

/* income / expense group headers in the list */
.tx-group {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 700; padding: 13px 0 5px;
  border-bottom: 1px solid var(--border);
}
.tx-list .tx-group:first-child { padding-top: 0; }

/* ---- Completeness checkup banner (subdued, collapsible) ---- */
/* Outer is a full-bleed centering container that matches the .dashboard / .layout
   gutters so the banner box lines up exactly with the cards and panels below. */
.checkup {
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 0 28px;
}
.checkup__inner {
  background: #f6f7fa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
}
.checkup__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.checkup__toggle {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: #5a6172;
  text-align: left;
}
.checkup__caret { display: inline-flex; color: var(--muted); transition: transform 0.15s ease; }
.checkup__caret .ic { width: 1em; height: 1em; }
.checkup:not(.is-collapsed) .checkup__caret { transform: rotate(90deg); }
.checkup__count { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.checkup.is-collapsed .checkup__chips { display: none; }
.checkup__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 6px 5px 12px;
  font-size: 13px;
}
.chip__action {
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
}
.chip__action:hover { background: var(--primary-dark); }
.chip--recurring .chip__action { background: var(--income); }
.chip--recurring .chip__action:hover { background: #1b5e20; }

/* ---- Stat strip (reusable mini-metrics, used by Budgets) ---- */
.stat-strip { display: flex; gap: 8px; margin: -2px 0 4px; }
.stat {
  flex: 1; min-width: 0;
  background: #f7f8fb; border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 3px;
}
.stat__label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); font-weight: 600;
}
.stat__value { font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stat__value--neg { color: var(--expense); }
.stat-strip__caption { font-size: 12px; color: var(--muted); margin: 8px 0 14px; }

/* quiet explanatory note at the foot of a panel */
.panel-help {
  font-size: 12px; color: var(--muted); line-height: 1.5;
  margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--border);
  white-space: pre-line; /* honour line breaks in multi-line help text */
}

/* ---- Budgets ---- */
.budget-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.bg-row { padding: 7px 8px; border-radius: 9px; transition: background 0.15s ease; }
.bg-row:hover { background: #f7f8fb; }
.bg-row__head { display: flex; justify-content: space-between; font-size: 13px; align-items: baseline; gap: 8px; }
.bg-row__name { font-weight: 550; }
.bg-row__nums { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bg-row__nums--over { color: var(--expense); font-weight: 600; }
.bg-row__bar { height: 8px; border-radius: 6px; background: #eef0f6; overflow: hidden; margin-top: 6px; }
.bg-row__fill { height: 100%; border-radius: 6px; min-width: 2px; background: var(--primary); }
.bg-row__fill--over { background: var(--expense); }
.bg-row__edit { border: none; background: transparent; cursor: pointer; color: var(--muted); font-size: 12px; padding: 4px 0 0; }
.bg-row__edit:hover { color: var(--text); text-decoration: underline; }
.set-budget { display: flex; gap: 8px; align-items: center; }
.set-budget select { flex: 1.4; }
.set-budget input { flex: 1; }

/* ---- Recurring ---- */
.recurring-list { display: flex; flex-direction: column; }
.rec-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  padding: 11px 8px;
  margin: 0 -8px;
  border-radius: 9px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}
.rec-item:hover { background: #f7f8fb; }
.rec-item:last-child { border-bottom: none; }
.rec-item__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rec-item__top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.rec-item__name { font-weight: 600; font-size: 14px; }
.rec-item__meta { font-size: 12px; color: var(--muted); }
.rec-item__amount { font-weight: 700; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rec-item__amount--income { color: var(--income); }
.rec-item__amount--expense { color: var(--expense); }
.rec-item__actions { display: flex; gap: 4px; align-items: center; justify-self: end; }
.rec-status { font-size: 12px; color: var(--income); font-weight: 600; gap: 4px; }
.rec-status .ic { width: 1em; height: 1em; }
.btn--post {
  background: var(--income); color: #fff; border: none;
  border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.btn--post:hover { background: #1b5e20; }
.rec-item.is-inactive { opacity: 0.5; }

/* ---- Wizard ---- */
.modal__box--wide { width: min(94vw, 720px); max-height: 88vh; }
.wizard__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wizard__head h3 { margin: 0; }
.wizard__toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wizard__count { margin-left: auto; font-size: 13px; color: var(--muted); }
.wizard__groups {
  overflow-y: auto;
  max-height: 52vh;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
}
.wz-group { padding: 10px 0; border-bottom: 1px solid var(--border); }
.wz-group:last-child { border-bottom: none; }
.wz-group__head {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 14px; margin-bottom: 8px;
}
.wz-group__toggle { font-size: 12px; color: var(--primary); background: none; border: none; cursor: pointer; }
/* one category per line, in catalog order, on every device */
.wz-items { display: flex; flex-direction: column; gap: 4px; }
.wz-item { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; padding: 3px 0; }
.wz-item input { width: auto; }
.wz-item__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.wz-item__monthly { font-size: 11px; color: var(--muted); }
.wz-item__monthly--ic { display: inline-flex; vertical-align: -0.15em; color: var(--muted); }
.wz-item__monthly--ic .ic { width: 0.95em; height: 0.95em; }

/* ---- Add-your-own category ---- */
.wz-custom {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 4px 0 10px;
  background: #f7f9fc;
}
.wz-custom__label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
.wz-custom__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wz-custom__input {
  flex: 1 1 220px; min-width: 160px;
  padding: 8px 10px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 8px;
}
.wz-custom__types { display: flex; gap: 12px; }
.radio--sm { font-size: 13px; }
.wz-customlist { margin-top: 12px; }
.wz-customlist__title { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.wz-customlist__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wz-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 8px 5px 10px;
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  font-size: 13px;
}
.wz-chip__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.wz-chip__name { font-weight: 500; }
.wz-chip__x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0;
  border: none; background: none; cursor: pointer; color: var(--muted);
  border-radius: 50%;
}
.wz-chip__x:hover { background: #f0e3e3; color: var(--expense); }
.wz-chip__x .ic { width: 13px; height: 13px; }

/* ---- Capital savings ---- */
.panel--capital {
  position: relative;
  background: var(--surface);
  border: 1px solid #e9e0fb;
  overflow: hidden;
}
/* thin accent ribbon along the top edge */
.panel--capital::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
}
.panel--capital .panel__title { color: #4c1d95; }
.panel--capital .panel__title .ic { color: #7c3aed; }

/* hero total: small uppercase label + large tabular figure */
.capital-hero {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 0 16px;
  border-bottom: 1px solid #efe9fb;
  margin-bottom: 16px;
}
.capital-hero__label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted);
}
.capital-hero__value {
  font-size: 30px; font-weight: 700; line-height: 1.1; color: #6d28d9;
  font-variant-numeric: tabular-nums;
}

/* contextual hint shown as a soft callout */
.capital-info {
  font-size: 12.5px; color: #5b4a86; line-height: 1.5;
  background: #f7f3fe; border: 1px solid #ece3fd;
  border-radius: 8px; padding: 8px 10px; margin: 0 0 12px;
}
.capital-info:empty { display: none; }
.capital-info strong { color: #4c1d95; font-weight: 700; }
/* income on its own line, the recommendation always on the next line */
.capital-info__line { display: block; }
/* the "left to contribute" line is the actionable bit — give it a little weight */
.capital-info__line--left { margin-top: 3px; font-weight: 600; color: #5b21b6; }
.capital-info__line--left strong { color: #4c1d95; }

/* small helper under the set-aside row: how to record a withdrawal */
.capital-hint { font-size: 11.5px; color: var(--muted); line-height: 1.4; margin: 10px 0 0; }

.capital-set__row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.field--inline { gap: 4px; }
.field--inline input { width: 72px; }
.field--grow { flex: 1; min-width: 130px; }
.field--grow input { width: 100%; }
.capital-set__row .btn { white-space: nowrap; }
/* match the Save button to the panel's purple theme */
.panel--capital .btn--primary { background: #7c3aed; }
.panel--capital .btn--primary:hover { background: #6d28d9; }

.capital-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13px; }
.capital-table th {
  text-align: right; color: var(--muted); font-weight: 600;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 6px; border-bottom: 1px solid #e4d8fb;
}
.capital-table th:first-child { text-align: left; }
.capital-table td {
  padding: 6px; text-align: right; border-bottom: 1px solid #f1ebfd;
  font-variant-numeric: tabular-nums;
}
.capital-table td:first-child { text-align: left; }
.capital-table tr:last-child td { border-bottom: none; }
.capital-table td.capital-cum { font-weight: 700; color: #7c3aed; }

/* Per-movement ledger: each contribution (+) and withdrawal (−) */
.capital-moves { margin-top: 14px; }
.cap-moves__title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); font-weight: 600; margin-bottom: 4px;
}
.cap-moves__list { max-height: 168px; overflow-y: auto; }
.cap-move {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; padding: 5px 0; border-bottom: 1px solid #f1ebfd;
}
.cap-move:last-child { border-bottom: none; }
.cap-move__date { color: var(--muted); font-variant-numeric: tabular-nums; }
.cap-move__amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.cap-move__amt--in { color: #2e7d32; }
.cap-move__amt--out { color: var(--expense); }

/* ---- Footer ---- */
.app-footer {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  padding: 24px 16px 8px;
  max-width: 1100px;
  margin: 0 auto;
}

/* ---- Responsive ---- */
@media (max-width: 620px) {
  .wz-items { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .dashboard { grid-template-columns: 1fr; }
  .layout, .biz-layout { grid-template-columns: 1fr; }
  .app-header { padding: 12px 16px; }
  .dashboard, .layout, .biz-layout, .biz-extra, .biz-entity-bar, .checkup { padding-left: 16px; padding-right: 16px; }
}
