/* Finanse Orabelle — wygląd jak AdTASK (paleta zinc + akcent Orabelle, tryb ciemny).
   Kolory tylko przez zmienne; tryb ciemny: prefers-color-scheme albo data-theme na <html> (static/app.js). */
:root {
  color-scheme: light;
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --hover: #f4f4f5;
  --ink: #18181b;
  --ink-2: #3f3f46;
  --muted: #71717a;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;
  --accent: #a1663a;
  --accent-hover: #87522c;
  --accent-ink: #87522c;
  --accent-soft: #f7eee7;
  --good: #047857;
  --good-soft: #ecfdf5;
  --good-line: #a7f3d0;
  --bad: #b91c1c;
  --bad-soft: #fef2f2;
  --bad-line: #fecaca;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --chart-cost: #a1a1aa;
  --shadow: 0 1px 2px rgba(24, 24, 27, 0.05);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar: 15rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #09090b;
    --surface: #18181b;
    --surface-2: #27272a;
    --hover: #27272a;
    --ink: #fafafa;
    --ink-2: #d4d4d8;
    --muted: #a1a1aa;
    --line: #27272a;
    --line-strong: #3f3f46;
    --accent: #be8556;
    --accent-hover: #d3a37c;
    --accent-ink: #e2bc9c;
    --accent-soft: rgba(190, 133, 86, 0.18);
    --good: #34d399;
    --good-soft: rgba(16, 185, 129, 0.12);
    --good-line: rgba(16, 185, 129, 0.35);
    --bad: #f87171;
    --bad-soft: rgba(239, 68, 68, 0.12);
    --bad-line: rgba(239, 68, 68, 0.35);
    --warn: #fbbf24;
    --warn-soft: rgba(245, 158, 11, 0.12);
    --chart-cost: #52525b;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #18181b;
  --surface-2: #27272a;
  --hover: #27272a;
  --ink: #fafafa;
  --ink-2: #d4d4d8;
  --muted: #a1a1aa;
  --line: #27272a;
  --line-strong: #3f3f46;
  --accent: #be8556;
  --accent-hover: #d3a37c;
  --accent-ink: #e2bc9c;
  --accent-soft: rgba(190, 133, 86, 0.18);
  --good: #34d399;
  --good-soft: rgba(16, 185, 129, 0.12);
  --good-line: rgba(16, 185, 129, 0.35);
  --bad: #f87171;
  --bad-soft: rgba(239, 68, 68, 0.12);
  --bad-line: rgba(239, 68, 68, 0.35);
  --warn: #fbbf24;
  --warn-soft: rgba(245, 158, 11, 0.12);
  --chart-cost: #52525b;
  --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.85em; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* ---------- Układ: menu boczne + treść ---------- */
@media (min-width: 901px) {
  body { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 0.6rem;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.55rem 0.8rem;
  font-weight: 650;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 0.5rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}
.nav-toggle { display: none; }
.side-nav { display: flex; flex-direction: column; gap: 0.1rem; }
.nav-group {
  margin: 0.85rem 0 0.2rem;
  padding: 0 0.6rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  color: var(--ink-2);
  font-size: 0.875rem;
  text-decoration: none;
}
.side-nav a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.side-nav a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 550; }
.nav-fold summary { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.6rem; border-radius: 0.5rem; color: var(--ink-2); font-size: 0.875rem; cursor: pointer; list-style: none; }
.nav-fold summary::-webkit-details-marker { display: none; }
.nav-fold summary::after { content: "▸"; margin-left: auto; font-size: 0.7rem; color: var(--muted); }
.nav-fold[open] summary::after { content: "▾"; }
.nav-fold summary:hover { background: var(--hover); color: var(--ink); }
.side-nav a.nav-sub { padding-left: 2.2rem; font-size: 0.82rem; }
.side-nav svg, .theme-toggle svg { width: 1rem; height: 1rem; flex: none; opacity: 0.85; }
.side-foot { margin-top: auto; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 450;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--hover); color: var(--ink); }
a.theme-toggle:hover { text-decoration: none; }

@media (max-width: 900px) {
  .sidebar {
    position: sticky;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  .brand { padding: 0.2rem 0; }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    cursor: pointer;
  }
  .nav-toggle svg { width: 1.1rem; height: 1.1rem; }
  .side-nav, .side-foot { display: none; width: 100%; }
  body.nav-open .side-nav, body.nav-open .side-foot { display: flex; }
  .side-foot { flex-direction: column; }
  body.nav-open .side-nav { max-height: 70vh; overflow-y: auto; padding-bottom: 0.25rem; }
}

/* ---------- Treść ---------- */
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.75rem 2rem 3rem; min-width: 0; }
.wrap.narrow { max-width: 640px; }
@media (max-width: 900px) { .wrap { padding: 1.1rem 1rem 2.5rem; } }

.hero-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
h1 { margin: 0; font-size: 1.5rem; font-weight: 650; letter-spacing: -0.02em; }
h2 { font-size: 1rem; font-weight: 600; margin: 1.75rem 0 0.6rem; letter-spacing: -0.01em; }
h3 { font-size: 0.92rem; font-weight: 600; margin: 1.25rem 0 0.5rem; }
p { margin: 0.5rem 0; }
.muted { color: var(--muted); }
p.muted { font-size: 0.85rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

/* ---------- Formularze i przyciski ---------- */
.month-pick { display: flex; gap: 0.5rem; align-items: end; flex-wrap: wrap; }
.month-pick label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.75rem; color: var(--muted); }
select, input, textarea {
  font: inherit;
  font-size: 0.875rem;
  padding: 0.42rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--ink);
}
input[type="checkbox"], input[type="radio"] { padding: 0; accent-color: var(--accent); }
select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
select:disabled, input:disabled { opacity: 0.55; }
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 550;
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  padding: 0.45rem 0.9rem;
  border-radius: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease;
}
button:hover, .btn:hover { background: var(--accent-hover); }
a.btn, a.btn:hover { color: #fff; text-decoration: none; }
.btn.ghost, button.ghost, a.btn.ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn.ghost:hover, button.ghost:hover, a.btn.ghost:hover { background: var(--hover); color: var(--ink); }
button:disabled { opacity: 0.6; cursor: default; }
.row-actions { display: flex; gap: 0.5rem; align-items: end; justify-content: flex-end; flex-wrap: wrap; }

.stack { display: flex; flex-direction: column; gap: 0.9rem; }
.stack label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.82rem; font-weight: 500; color: var(--ink-2); }
.stack input, .stack select, .stack textarea { width: 100%; }
.stack-tight { flex-direction: column !important; align-items: stretch !important; gap: 0.25rem !important; }
.stack-tight select, .stack-tight button { max-width: none; width: 100%; }
form.inline { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
form.inline select { max-width: 160px; padding: 0.3rem 0.45rem; font-size: 0.82rem; }
form.inline input { padding: 0.3rem 0.45rem; font-size: 0.82rem; }
form.inline button { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.form-grid, .invest-head, .invest-add {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.75rem 1rem;
  align-items: end;
  margin: 0.5rem 0 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
}
.form-grid label, .invest-head label, .invest-add label, .settings-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; color: var(--muted); min-width: 0; }
.form-grid input:not([type="checkbox"]), .form-grid select, .invest-head input, .invest-add input, .invest-add select, .settings-form label select, .settings-form label input { width: 100%; }
.form-grid label.check { flex-direction: row; align-items: center; gap: 0.5rem; min-height: 2.3rem; color: var(--ink-2); font-size: 0.875rem; }
.form-grid .wide, .invest-head .wide { grid-column: span 2; }
@media (max-width: 600px) { .form-grid .wide, .invest-head .wide { grid-column: auto; } }
fieldset.partner, fieldset {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
}
fieldset legend { font-weight: 600; padding: 0 0.4rem; }

/* Formularze zdarzeń w jednym rzędzie (płace, pożyczki, wypłaty, ceny): pełnowymiarowe, jednakowe pola. */
form.event-form input, form.event-form select, form.event-form button { padding: 0.42rem 0.6rem; font-size: 0.875rem; }
form.event-form button { padding: 0.45rem 0.9rem; }
form.event-form select { max-width: none; }
form.event-form input:not([type="checkbox"]):not([size]) { width: 11rem; }
form.event-form label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.875rem; color: var(--ink-2); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Kafelki ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0 1.5rem;
}
.kpi {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
  min-width: 0;
}
.kpi-label { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.kpi-val { font-size: 1.15rem; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-delta { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.kpi-delta.up { color: var(--good); }
.kpi-delta.down { color: var(--bad); }
.kpi.good { background: var(--good-soft); border-color: var(--good-line); }
.kpi.good .kpi-val { color: var(--good); }
.kpi.bad { background: var(--bad-soft); border-color: var(--bad-line); }
.kpi.bad .kpi-val { color: var(--bad); }
.kpis.big .kpi-val { font-size: 1.4rem; }

/* ---------- Pulpit ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; margin: 0 0 0.75rem; font-size: 0.92rem; font-weight: 600; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .zero { stroke: var(--line-strong); stroke-width: 1; }
.chart .bar-rev { fill: var(--accent); }
.chart .bar-cost { fill: var(--chart-cost); }
.chart .profit { fill: none; stroke: var(--good); stroke-width: 2; }
.chart .dot-good { fill: var(--good); }
.chart .dot-bad { fill: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.78rem; color: var(--muted); margin-top: 0.5rem; }
.legend i { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 0.2rem; margin-right: 0.35rem; vertical-align: -0.05rem; }
.attention { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.attention li { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.6rem 0.7rem; border-radius: 0.5rem; background: var(--surface-2); font-size: 0.85rem; }
.attention li.bad { background: var(--bad-soft); color: var(--bad); }
.attention li.warn { background: var(--warn-soft); color: var(--warn); }
.attention li.ok { background: var(--good-soft); color: var(--good); }
.attention a { color: inherit; font-weight: 600; }
.quick { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }

/* ---------- Synchronizacja ---------- */
.sync-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.75rem 0 1.25rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
}
.sync-bar.bad { background: var(--bad-soft); border-color: var(--bad-line); }
.sync-detail { font-size: 0.8rem; }
.sync-msg { font-size: 0.85rem; font-weight: 600; }

/* ---------- Proste tabele (formularze, karty) ---------- */
.wrap table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.wrap table th, .wrap table td { padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.wrap table th { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.wrap table tbody tr:hover td { background: var(--hover); }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.neg, td.neg, span.neg { color: var(--bad); }
tr.pay-paid td { background: var(--good-soft); }
tr.pay-overdue td { background: var(--bad-soft); }
tr.pay-cancelled td { opacity: 0.55; }

/* ---------- Plakietki ---------- */
.tag {
  display: inline-block;
  background: var(--surface-2);
  color: var(--muted);
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}
.tag.ok { background: var(--good-soft); color: var(--good); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }

/* Przyciski pomocnicze (menu, motyw, zamknięcie filtrów) — bez wyglądu przycisku głównego. */
.theme-toggle { color: var(--muted); }
.theme-toggle:hover { background: var(--hover); color: var(--ink); }
.nav-toggle:hover { background: var(--hover); }

/* Wspólny okres: skróty obok Od/Do (03.12.2026). */
.period-shortcuts { display: flex; gap: 0.3rem; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.55rem; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 0.78rem; text-decoration: none;
  line-height: 1.4; cursor: pointer; }
.chip:hover { background: var(--hover); color: var(--ink); }
.chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

/* Klikalne kafelki: przełączają tabelę, filtrują ją albo prowadzą do szczegółów. */
a.kpi, .kpi.kpi-link { color: inherit; text-decoration: none; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
a.kpi:hover, .kpi.kpi-link:hover { border-color: var(--accent); }
a.kpi:focus-visible, .kpi.kpi-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kpi.is-active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }

/* Wspólny nagłówek widoków (03.12.2026): ta sama wysokość i miejsce okresu na każdej stronie. */
.page-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.5rem; margin: -1rem -1.25rem 0.75rem; padding: 0.6rem 1.25rem; background: var(--bg);
  border-bottom: 1px solid var(--line); }
.page-head-title { min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.page-head-title h1 { font-size: 1.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-back { font-size: 0.78rem; color: var(--muted); text-decoration: none; }
.page-back:hover { color: var(--accent-ink); }
.page-head-period { display: flex; justify-content: flex-end; flex: 1 1 auto; min-width: 0; }
.page-head-period .month-pick { justify-content: flex-end; align-items: center; }
.page-head-period .month-pick label { flex-direction: row; align-items: center; gap: 0.35rem; }
.page-head-note { color: var(--muted); font-size: 0.8rem; }
.page-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0 0 0.75rem; min-height: 2.25rem; }
.page-tools:empty { min-height: 0; margin: 0; }
@media (max-width: 900px) {
  .page-head { position: static; flex-direction: column; align-items: stretch; }
  .page-head-period { justify-content: flex-start; }
  .page-head-period .month-pick { justify-content: flex-start; }
}

/* Podgląd kosztu i obciążenia (03.12.2026). */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; margin-bottom: 0.5rem; }
.doc-card h2 { margin-top: 0; }
.doc-fields { display: grid; grid-template-columns: minmax(9rem, max-content) 1fr; gap: 0.4rem 1rem; margin: 0; font-size: 0.9rem; }
.doc-fields dt { color: var(--muted); }
.doc-fields dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.nav-section { margin: 1.1rem 0 0.1rem; padding: 0 0.6rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.nav-section + .nav-group { margin-top: 0.2rem; }
.event-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.5rem 0 1.5rem; }

/* Zwarte tabele (03.12.2026): tekst w komórce w jednej linii, ucięty; pełny w podpowiedzi. */
.grid-table td.cell-trunc { max-width: 16rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-table td.cell-trunc > div, .grid-table td.cell-trunc > .muted { display: inline; }
.grid-table td.cell-trunc > div::before { content: " · "; }

/* Formularz ustawień płacowych (03.12.2026): siatka pól, przycisk w osobnym rzędzie. */
.settings-form { display: flex; flex-direction: column; gap: 0.75rem; max-width: 72rem; }
.settings-form > h2 { margin: 1rem 0 0; }
.settings-form > label { max-width: 24rem; }
.settings-form .grid-table { max-width: 40rem; }
.settings-form .form-grid { align-items: start; }
/* Etykiety o różnej długości: pola i podpowiedzi w tych samych liniach siatki. */
.settings-form .form-grid > label { display: grid; grid-template-rows: subgrid; grid-row: span 3; row-gap: 0.25rem; align-content: start; }
.settings-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.settings-actions .muted { font-size: 0.8rem; }
.btn.small { padding: 0.25rem 0.6rem; font-size: 0.78rem; }

/* Cash Flow (03.12.2026): kolumny prognozy, rozwijanie kategorii. */
th.fcst, td.fcst { background: var(--accent-soft); }
th.fcst { color: var(--accent-ink); }
.fcst-tag { display: inline-block; padding: 0 0.4rem; border-radius: 0.3rem; background: var(--accent-soft); color: var(--accent-ink); font-size: 0.78rem; }
.cashflow td.cf-cat { max-width: 22rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-toggle { border: 0; background: none; color: var(--muted); cursor: pointer; width: 1.2rem; padding: 0; font-size: 0.8rem; }
.cf-toggle:hover { color: var(--accent-ink); }
.cf-toggle-space { display: inline-block; width: 1.2rem; }
.cf-indent { display: inline-block; width: 1.8rem; }
tr.cf-sub td { font-size: 0.82rem; color: var(--ink-2); background: var(--surface-2); }

/* Finanse Orabelle: wiersze raportów */
.matrix tr.row-strong td, .matrix tr.row-strong th { font-weight: 600; }
.matrix tr.row-muted td { color: var(--muted, #888); }
.matrix tr.row-sep td { padding-top: 14px; font-weight: 600; border-top: 1px solid var(--border, #ddd); }
.matrix td.ind { padding-left: 22px; }
.matrix td.warn, table td.warn { background: color-mix(in srgb, #d33 14%, transparent); }
.matrix td.fcst, .matrix th.fcst { font-style: italic; }
.tabs { margin: 4px 0 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.notice { padding: 0.6rem 0.8rem; border-radius: 0.5rem; background: var(--warn-soft); color: var(--warn); font-size: 0.85rem; }
.notice a { color: inherit; font-weight: 600; }
body.login-page { display: grid; grid-template-columns: 1fr; place-items: center; min-height: 100vh; }
.login-box { width: min(24rem, calc(100vw - 2rem)); box-sizing: border-box; border: 1px solid var(--line); padding: 2rem; border-radius: 0.75rem; background: var(--surface-2); display: flex; flex-direction: column; gap: 0.8rem; }
.nav-logout { margin: 0; }
.nav-logout button { width: 100%; }
.invest { margin-bottom: 2.5rem; }
.invest h3 { margin: 1.2rem 0 0.4rem; font-size: 0.95rem; }
.invest-add { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); margin-top: 0.6rem; }
.settle-sum td.pay { font-weight: 650; }
.settle-sum td.pay.pos { color: var(--good, #1a7f37); }
.hint { font-size: 0.82rem; color: var(--muted); margin: 0.2rem 0 0.6rem; }
.small { font-size: 0.78rem; }
