/* ============================================================
   Планировщик крупных покупок — собственная таблица стилей.
   Светлая тема, карточная вёрстка, адаптивность до 640 px.
   ============================================================ */

:root {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --text: #1e2235;
  --muted: #6b7280;
  --border: #e5e7f0;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --green: #10b981;
  --green-soft: #ecfdf5;
  --amber: #f59e0b;
  --amber-soft: #fffbeb;
  --red: #ef4444;
  --red-soft: #fef2f2;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(30, 34, 53, .07), 0 8px 24px rgba(30, 34, 53, .05);
}

* { 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.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { width: min(1120px, 100% - 2rem); margin-inline: auto; }
main.container { flex: 1; padding-block: 1.5rem 3rem; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .3rem; }
h2 { font-size: 1.1rem; margin: 0; }

/* ---------- Шапка ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-block: .7rem;
}

.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-icon { font-size: 1.6rem; }
.brand-text { font-weight: 700; line-height: 1.15; display: flex; flex-direction: column; }
.brand-text small { font-weight: 400; color: var(--muted); font-size: .72rem; }

.main-nav { display: flex; gap: .25rem; margin-left: auto; }
.main-nav a {
  padding: .45rem .9rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
}
.main-nav a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.main-nav a.active { background: var(--primary-soft); color: var(--primary); }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.2rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { background: var(--bg); }
.btn--danger { background: var(--red-soft); color: var(--red); border-color: #fecaca; }
.btn--danger:hover { background: #fee2e2; }
.btn--sm { padding: .4rem .85rem; font-size: .88rem; }

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: .25rem;
  border-radius: 6px;
  line-height: 1;
}
.icon-btn:hover { background: var(--primary-soft); }
.icon-btn--danger:hover { background: var(--red-soft); }

/* ---------- Панели и карточки ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .9rem;
}

.panel--table { padding: 0; overflow: hidden; }
.panel--table .panel-head { padding: 1.1rem 1.25rem 0; }
.panel--table .table { margin: 0; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.cards-grid--three { grid-template-columns: repeat(3, 1fr); }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  border-top: 3px solid var(--primary);
}
.stat-card--green { border-top-color: var(--green); }
.stat-card--amber { border-top-color: var(--amber); }
.stat-card--indigo { border-top-color: #8b5cf6; }

.stat-label { color: var(--muted); font-size: .82rem; font-weight: 500; }
.stat-value { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; }
.stat-hint { color: var(--muted); font-size: .78rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
/* min-width: 0 позволяет grid-элементам сжиматься уже содержимого (таблиц) */
.two-col > .panel { min-width: 0; }
.two-col .panel { margin-bottom: 1.25rem; }

/* ---------- Главная ---------- */

.hero { margin-bottom: 1.4rem; }
.hero h1 { font-size: 1.9rem; }
.hero-sub { color: var(--muted); max-width: 640px; margin: .2rem 0 0; }

.goal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.goal-item { border-bottom: 1px dashed var(--border); padding-bottom: .9rem; }
.goal-item:last-child { border-bottom: none; padding-bottom: 0; }
.goal-top { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .4rem; }
.goal-name { font-weight: 600; color: var(--text); }
.goal-meta { display: flex; justify-content: space-between; gap: .75rem; color: var(--muted); font-size: .8rem; margin-top: .35rem; flex-wrap: wrap; }

/* ---------- Прогресс-бар ---------- */

.progress {
  position: relative;
  height: 20px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #8b5cf6);
  border-radius: 999px;
  transition: width .4s ease;
}
.progress-fill--done { background: linear-gradient(90deg, var(--green), #34d399); }
.progress-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--text);
  mix-blend-mode: luminosity;
}
.progress-cell { min-width: 110px; }
.progress-cell .progress { height: 12px; }

/* ---------- Бейджи и чипы ---------- */

.badge {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}
.badge--done { background: var(--green-soft); color: #047857; }
.badge--overdue { background: var(--red-soft); color: #b91c1c; }
.badge--active { background: var(--primary-soft); color: var(--primary); }
.badge--planned { background: var(--amber-soft); color: #b45309; }

.chip {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .1rem .6rem;
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Таблицы ---------- */

.table-wrap { overflow-x: auto; }
.table-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.pagination { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: center; margin-top: 1rem; }
.bulk-apply { padding: .75rem; border: 1px solid var(--border, #d8dde6); border-radius: .75rem; }
.import-summary { margin: 0 0 .75rem; padding: .65rem .9rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-muted, rgba(127,127,127,.06)); font-size: .95rem; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.col-check { width: 2.5rem; text-align: center; }
.row-duplicate { opacity: .58; }
.badge--muted { background: var(--border); color: var(--muted); }
.table th {
  text-align: left;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
}
.table td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafaff; }
.table .num { text-align: right; white-space: nowrap; }
.money-plus { color: #047857; font-weight: 600; }
.strong-link { font-weight: 600; color: var(--text); }
.strong-link:hover { color: var(--primary); }
.actions-cell { white-space: nowrap; display: flex; gap: .15rem; align-items: center; }
.actions-cell form { display: inline; }

/* ---------- Формы ---------- */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.head-actions { display: flex; gap: .5rem; align-items: center; }
.head-actions form { display: inline; }

.form-panel { max-width: 760px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; }
.form-field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; }
.form-field--wide { grid-column: 1 / -1; }
.form-field label { font-weight: 600; font-size: .88rem; }

.form-field input,
.form-field select,
.form-field textarea {
  font: inherit;
  padding: .55rem .75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 2px solid var(--primary-soft);
  border-color: var(--primary);
}
.form-field textarea { resize: vertical; }

.field-errors { list-style: none; margin: 0; padding: 0; color: var(--red); font-size: .8rem; }
.field-hint { color: var(--muted); font-size: .78rem; margin: 0; }
.form-actions { display: flex; gap: .75rem; margin-top: .5rem; }
.check-label { display: flex; gap: .55rem; align-items: flex-start; cursor: pointer; }
.check-label input { margin-top: .2rem; accent-color: var(--primary); }

.filter-bar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .8rem 1.1rem;
  margin-bottom: 1.25rem;
}
.filter-bar label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: var(--muted);
  font-weight: 500;
}
.filter-bar select {
  font: inherit;
  padding: .35rem .6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

/* ---------- Графики и прочее ---------- */

.chart { width: 100%; height: auto; display: block; }
.note-text { color: var(--muted); font-size: .9rem; margin: .8rem 0; }
.muted { color: var(--muted); }
.link { font-size: .85rem; font-weight: 500; }
.empty-note { color: var(--muted); font-size: .9rem; }

.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-state h1 { font-size: 3rem; color: var(--primary); margin-bottom: 0; }
.empty-state p { color: var(--muted); margin: .4rem 0 1.2rem; }

.flashes { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.flash {
  padding: .7rem 1rem;
  border-radius: 10px;
  font-size: .9rem;
  border: 1px solid;
}
.flash--success { background: var(--green-soft); border-color: #a7f3d0; color: #047857; }
.flash--error { background: var(--red-soft); border-color: #fecaca; color: #b91c1c; }
.flash--info { background: var(--primary-soft); border-color: #c7d2fe; color: var(--primary-dark); }
.flash--warning { background: var(--amber-soft); border-color: #fde68a; color: #b45309; }
[data-theme="dark"] .flash--info { border-color: #3b4270; color: #a5b4fc; }
[data-theme="dark"] .flash--warning { border-color: #5a481a; color: #fcd34d; }

/* ---------- Подвал ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: .8rem;
  padding-block: 1rem;
  text-align: center;
}
.site-footer p { margin: 0; }

/* ---------- Тёмная тема ---------- */

[data-theme="dark"] {
  --bg: #14161f;
  --surface: #1e2230;
  --text: #e8eaf2;
  --muted: #9aa1b5;
  --border: #2c3145;
  --primary: #818cf8;
  --primary-dark: #6366f1;
  --primary-soft: #262b45;
  --green: #34d399;
  --green-soft: #12291f;
  --amber: #fbbf24;
  --amber-soft: #2b2312;
  --red: #f87171;
  --red-soft: #2e1a1a;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .25);
}
[data-theme="dark"] .table tbody tr:hover { background: #232839; }
[data-theme="dark"] .btn--ghost:hover { background: #262b3d; }
[data-theme="dark"] .btn--danger { border-color: #4a2626; }
[data-theme="dark"] .btn--danger:hover { background: #3a2020; }
[data-theme="dark"] .flash--success { border-color: #1d4a38; color: #6ee7b7; }
[data-theme="dark"] .money-plus { color: #34d399; }
[data-theme="dark"] .badge--done { color: #6ee7b7; }
[data-theme="dark"] .badge--overdue { color: #fca5a5; }
[data-theme="dark"] .badge--planned { color: #fcd34d; }

.theme-toggle {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}
.theme-toggle:hover { border-color: var(--primary); }

/* Графики PNG имеют чёрный текст — держим их на белой подложке в обеих темах */
.chart { background: #fff; border-radius: 10px; padding: .4rem; }

/* ---------- Индикатор плана и прочее ---------- */

.plan-gap { font-size: .88rem; margin: .7rem 0 0; font-weight: 500; }
.plan-gap--ahead { color: #047857; }
.plan-gap--behind { color: #b45309; }
[data-theme="dark"] .plan-gap--ahead { color: #34d399; }
[data-theme="dark"] .plan-gap--behind { color: #fbbf24; }

.progress--lg { height: 26px; }
.overall-panel .panel-head { margin-bottom: .6rem; }

.search-label { flex: 1 1 180px; }
.search-label input {
  font: inherit;
  padding: .35rem .6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
}
.monthly-preview { font-weight: 600; color: var(--primary); }

.chip--btn { cursor: pointer; font: inherit; font-size: .78rem; }
.chip--btn:hover { border-color: var(--primary); color: var(--primary); }
.quick-amounts { display: flex; gap: .4rem; margin-top: .3rem; }

.deadline--soon { color: #b45309; font-weight: 600; }
[data-theme="dark"] .deadline--soon { color: #fbbf24; }

/* ---------- Печать ---------- */

@media print {
  .site-header, .site-footer, .filter-bar, .head-actions,
  .actions-cell, .btn, .theme-toggle, .flashes { display: none !important; }
  body { background: #fff; }
  .panel, .stat-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .chart { padding: 0; }
}

/* ---------- Адаптивность ---------- */

@media (max-width: 900px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .cards-grid--three { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .budget-list, .budget-list--compact { grid-template-columns: 1fr; }
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel--table { overflow-x: auto; }
}

@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; gap: .6rem; }
  .main-nav { order: 3; width: 100%; margin-left: 0; }
  .cards-grid, .cards-grid--three { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.5rem; }
  .header-actions { width: 100%; justify-content: flex-end; }
  .calendar-grid { gap: .2rem; }
  .cal-day { min-height: 46px; padding: .25rem; border-radius: 7px; }
  .cal-num { font-size: .75rem; }
  .cal-sum { font-size: .58rem; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .template-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Дневник доходов и расходов
   ============================================================ */

.header-actions { display: flex; gap: .5rem; align-items: center; margin-left: auto; }
.main-nav { margin-left: 0; }
.main-nav a { white-space: nowrap; font-size: .9rem; padding: .4rem .7rem; }

/* Алиасы для новых форм: существующие шаблоны используют .form-field */
.field { display: flex; flex-direction: column; gap: .3rem; }
.field--wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .88rem; }
.input {
  font: inherit;
  padding: .55rem .75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
}
.input:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  padding: .6rem 1rem; background: var(--primary); color: #fff;
  border-radius: 0 0 8px 0; text-decoration: none;
}
.skip-link:focus { left: 0; }
textarea.input { resize: vertical; }

.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.eyebrow {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: .35rem;
}
.stat-card--red { background: var(--red-soft); }

.ledger-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: linear-gradient(120deg, var(--primary-soft), var(--surface) 65%);
}

.day-strip {
  display: flex;
  align-items: flex-end;
  gap: .4rem;
  overflow-x: auto;
  padding-top: .5rem;
}
.day-bar {
  flex: 1 0 34px;
  min-width: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: .25rem;
  font-size: .72rem;
  color: var(--muted);
}
.day-bar-fill {
  width: 100%;
  min-height: 3px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--primary), #818cf8);
}

/* Календарь месяца: клик по дню открывает подробную карточку */
.calendar-nav { display: flex; gap: .4rem; align-items: center; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .35rem;
}
.calendar-grid--head {
  margin-bottom: .35rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cal-day {
  min-height: 58px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .35rem .45rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  transition: border-color .15s, background .15s, transform .05s;
}
.cal-day:hover { border-color: var(--primary); background: var(--primary-soft); text-decoration: none; }
.cal-day:active { transform: translateY(1px); }
.cal-day--empty { background: transparent; border-color: transparent; }
.cal-day--future { opacity: .38; cursor: default; background: transparent; }
.cal-day--future:hover { border-color: var(--border); background: transparent; }
.cal-day--today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cal-day.has-data { background: linear-gradient(180deg, var(--primary-soft), var(--surface)); }
.cal-num { font-weight: 700; font-size: .85rem; }
.cal-day--today .cal-num { color: var(--primary); }
.cal-sum { font-size: .68rem; color: var(--muted); white-space: nowrap; }
.day-nav { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }

/* Месячные лимиты по категориям */
.budget-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.budget-list--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.budget-item {
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: 10px;
  padding: .8rem 1rem;
  background: var(--surface);
}
.budget-item--warn { border-left-color: var(--amber); }
.budget-item--over { border-left-color: var(--red); background: var(--red-soft); }
.budget-item-head { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; margin-bottom: .45rem; flex-wrap: wrap; }
.budget-bar { display: flex; align-items: center; gap: .6rem; }
.budget-bar .progress { flex: 1; height: 12px; }
.budget-percent { font-size: .78rem; font-weight: 700; min-width: 34px; text-align: right; }
.budget-fill--warn { background: linear-gradient(90deg, var(--amber), #fcd34d); }
.budget-fill--over { background: linear-gradient(90deg, var(--red), #fb7185); }
.budget-item form { margin-top: .6rem; }

/* Шаблоны частых операций */
.template-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.template-chip {
  display: flex; flex-direction: column; gap: .25rem;
  padding: .8rem; border: 1px dashed var(--border); border-radius: 10px;
  color: var(--text); text-decoration: none; background: var(--surface);
  transition: border-color .15s, background .15s, transform .05s;
}
.template-chip:hover { border-color: var(--primary); background: var(--primary-soft); text-decoration: none; }
.template-chip:active { transform: translateY(1px); }
.template-icon { font-size: 1.3rem; }
.template-chip .badge { align-self: flex-start; margin-top: .2rem; max-width: 100%; white-space: normal; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.plain-list li:last-child { border-bottom: none; }

.row-actions { display: flex; gap: .35rem; align-items: center; }
.icon-link { font-size: .95rem; text-decoration: none; }
.money-plus { color: var(--green); }
.money-minus { color: var(--red); }

.form-stack { display: flex; flex-direction: column; gap: 1rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .82rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.checkbox-field { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; color: var(--muted); cursor: pointer; }
.checkbox-field input { width: 16px; height: 16px; accent-color: var(--primary); }
.notice { border-left: 4px solid var(--primary); }
code {
  background: var(--primary-soft);
  padding: .1rem .35rem;
  border-radius: 5px;
  font-size: .85em;
}

[data-theme="dark"] .ledger-summary { background: linear-gradient(120deg, #252a4a, var(--surface) 70%); }
[data-theme="dark"] .stat-card--red { background: #3a2020; }

@media (max-width: 900px) {
  .header-actions { margin-left: 0; }
  .main-nav { flex-wrap: wrap; }
}

@media print {
  .day-strip, .row-actions { display: none !important; }
}
