*{box-sizing:border-box}body{margin:0;background:#f3f4f6;color:#111827;font:15px system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.top{min-height:64px;background:#111827;color:white;display:flex;justify-content:space-between;align-items:center;padding:12px max(16px,calc((100% - 1100px)/2));gap:16px}.top small{display:block;color:#9ca3af}.top .brand{color:white;text-decoration:none}.top nav a{color:white;text-decoration:none;margin-left:14px;opacity:.8}.top nav a.active{opacity:1;font-weight:700;text-decoration:underline}.wrap{max-width:1100px;margin:auto;padding:20px 16px 70px}.toolbar{display:flex;gap:10px;align-items:center;justify-content:flex-end;margin-bottom:14px}.toolbar input{max-width:180px}.stats,.grid2{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.grid2{grid-template-columns:1fr 1fr;margin-top:14px}.stat,.card{background:#fff;border-radius:16px;padding:18px;box-shadow:0 2px 14px #0000000b}.stat span{color:#6b7280}.stat b{display:block;font-size:24px;margin-top:7px}.card{margin-bottom:14px}h1,h2{margin:0 0 14px}h2{font-size:18px}.item{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid #eee}.item small{display:block;color:#6b7280;margin-top:3px}.row,.end{display:flex;gap:8px;align-items:center}.between{justify-content:space-between}.end{justify-content:flex-end}.primary,.button,button{border:0;border-radius:10px;padding:10px 13px;cursor:pointer;font:inherit;background:#e5e7eb;color:#111827;text-decoration:none}.primary{background:#111827;color:#fff}label{display:block;font-weight:600;margin:11px 0;color:#374151}input,select{display:block;width:100%;padding:11px 12px;margin-top:5px;border:1px solid #d1d5db;border-radius:10px;background:white;font:inherit;font-weight:400}.auth{min-height:100vh;display:grid;place-items:center;padding:20px}.authbox{width:min(420px,100%)}.wide{width:100%;margin-top:10px}.alert{padding:11px;border-radius:10px;background:#fef2f2;color:#991b1b;margin-bottom:12px}.muted{color:#6b7280}dialog{border:0;border-radius:18px;padding:0;box-shadow:0 20px 60px #0004}dialog::backdrop{background:#0007}.modal{min-width:min(500px,92vw);padding:22px;max-height:88vh;overflow:auto}.modal h2{margin-top:0}
.text-expense,.amt-expense{color:#c0392b}.text-income,.amt-income{color:#2e8b57}
.tabs{display:flex;gap:6px;margin-bottom:12px}.tabs button{background:transparent;color:#6b7280;border-radius:8px}.tabs button.active{background:#111827;color:#fff}
.cat-row{display:flex;gap:10px;overflow-x:auto;padding:4px 2px 10px;scrollbar-width:thin}.cat-chip{flex:0 0 auto;display:flex;flex-direction:column;align-items:center;gap:4px;padding:8px 10px;border-radius:12px;border:2px solid transparent;background:#f3f4f6;cursor:pointer;min-width:64px}.cat-chip .em{font-size:22px}.cat-chip .lb{font-size:11px;color:#4b5563;text-align:center;line-height:1.2;max-width:64px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cat-chip.sel{border-color:#111827;background:#eef2ff}.cat-chip .star{font-size:11px;color:#f59e0b}
.cal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.cal-head button{background:#e5e7eb}.cal-totals{display:flex;gap:16px}.cal-totals span{font-weight:600}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}.cal-dow{text-align:center;color:#6b7280;font-size:12px;padding-bottom:4px}.cal-day{background:#fff;border-radius:12px;min-height:64px;padding:6px;box-shadow:0 1px 6px #0000000a;cursor:pointer;display:flex;flex-direction:column;gap:4px}.cal-day.empty{background:transparent;box-shadow:none;cursor:default}.cal-day .dnum{font-size:12px;color:#374151;font-weight:600}.cal-day .dem{font-size:16px;line-height:1}.cal-day.today{outline:2px solid #111827}
.pie-wrap{display:flex;gap:20px;align-items:center;flex-wrap:wrap}.pie{width:160px;height:160px;border-radius:50%;flex:0 0 auto}.pie-legend{flex:1;min-width:160px}.pie-legend .item{padding:6px 0}.dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:8px}
.cal-day .damt{font-size:9px;line-height:1.2;font-weight:600}.cal-day .damt.exp{color:#c0392b}.cal-day .damt.inc{color:#2e8b57}
.progress-track{background:#e5e7eb;border-radius:999px;height:10px;overflow:hidden;margin-top:6px}.progress-fill{height:100%;background:#2e8b57;transition:width .3s}.progress-fill.over{background:#c0392b}.progress-pct{font-size:13px;font-weight:700;margin-top:4px;color:#2e8b57}.progress-pct.over{color:#c0392b}
.filter-chip{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border-radius:999px;border:2px solid transparent;cursor:pointer;font-size:13px;white-space:nowrap}.filter-chip.expense{background:#fee2e2;color:#b91c1c}.filter-chip.income{background:#dcfce7;color:#15803d}.filter-chip.sel{border-color:#111827;font-weight:700}
.chip-row{display:flex;gap:8px;overflow-x:auto;padding:2px 2px 10px;flex-wrap:wrap}
.tx-table-wrap{max-height:72vh;overflow:auto;border-radius:12px;background:#fff}
.tx-table{width:100%;border-collapse:collapse;font-size:14px}
.tx-table th{position:sticky;top:0;background:#f9fafb;text-align:left;padding:10px 8px;font-size:12px;color:#374151;cursor:pointer;user-select:none;white-space:nowrap;z-index:1;border-bottom:1px solid #e5e7eb}
.tx-table td{padding:9px 8px;border-bottom:1px solid #f0f0f0;white-space:nowrap}
.sort-arrow{font-size:10px;margin-left:3px;color:#9ca3af}
.line-chart-wrap{width:100%;overflow-x:auto}
.limit-card{cursor:pointer}
@media(max-width:760px){.stats{grid-template-columns:1fr 1fr}.grid2{grid-template-columns:1fr}.top{align-items:flex-start}.top nav{display:flex;flex-wrap:wrap;gap:8px}.top nav a{margin:0}.toolbar{justify-content:stretch}.toolbar>*{flex:1}.stat{padding:13px}.stat b{font-size:19px}.cal-day{min-height:52px}}