:root { --bg: #f6f5f2; --card: #fff; --text: #1c1b18; --muted: #6b6860; --line: #e4e1da; --accent: #14532d; --on-accent: #fff; --out: #9f1d1d; --in: #146c43; --sel: #eaf3ec; }
@media (prefers-color-scheme: dark) { :root { --bg: #121311; --card: #1c1e1b; --text: #eceae4; --muted: #a5a299; --line: #31332e; --accent: #7ed8a0; --on-accent: #0c1a11; --out: #f19a9a; --in: #86d9a8; --sel: #1f2d24; color-scheme: dark; } }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
header { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 3; }
header a { color: var(--muted); text-decoration: none; white-space: nowrap; }
header .brand { color: var(--text); font-weight: 700; }
nav { display: flex; gap: 6px; flex: 1; overflow-x: auto; }
nav a { padding: 5px 12px; border-radius: 99px; }
nav a.on { background: var(--accent); color: var(--on-accent); }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { margin: 0; font-size: 26px; } h2 { margin: 0 0 10px; font-size: 16px; }
.muted { color: var(--muted); font-size: 13px; margin: 2px 0; }
.error { color: var(--out); }
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0 0 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile { display: flex; flex-direction: column; gap: 2px; margin: 0; color: inherit; text-decoration: none; }
.big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 14px; align-items: start; }
.note { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.filters .wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
input[type=checkbox] { width: 18px; height: 18px; padding: 0; accent-color: var(--accent); }
button, .button { font: inherit; cursor: pointer; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; text-decoration: none; }
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--out); }
button.small { padding: 3px 8px; font-size: 12px; }
.more { display: block; margin: 0 auto; }
.bar { position: sticky; top: 55px; z-index: 2; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
td div { overflow-wrap: anywhere; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.date { white-space: nowrap; }
td.expense { color: var(--out); } td.income { color: var(--in); } td.transfer { color: var(--muted); }
.list tbody tr { cursor: pointer; } tr.sel { background: var(--sel); }
.chip { display: inline-block; font-size: 12px; background: var(--sel); border: 1px solid var(--line); border-radius: 99px; padding: 1px 9px; }
.login { max-width: 360px; padding-top: 14vh; } .login form { display: flex; flex-direction: column; gap: 12px; padding: 22px; }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; }
#toast.show { opacity: 1; }
@media (max-width: 600px) { th, td { padding: 8px 4px; font-size: 13px; } .big { font-size: 19px; } .grid { grid-template-columns: 1fr; } .date { white-space: normal; } .bar { font-size: 13px; } }
@media print { :root { --bg: #fff; --card: #fff; --text: #000; --muted: #444; --line: #ccc; --out: #000; --in: #000; } header, .noprint, #toast { display: none !important; } .scroll { overflow: visible; } .card { break-inside: auto; } tr { break-inside: avoid; } }
