:root{color-scheme:light;--surface-0: #f4f3f0;--surface-1: #fcfcfb;--surface-2: #ffffff;--border: #e3e2dd;--grid: #ecebe7;--text-primary: #0b0b0b;--text-secondary: #52514e;--text-muted: #77756f;--accent: #256abf;--accent-ink: #ffffff;--series-1: #2a78d6;--series-1-soft: #b7d3f6;--good: #0ca30c;--good-text: #006300;--warning: #fab219;--critical: #d03b3b;--critical-text: #b42f2f;--radius: 12px;--shadow: 0 1px 2px rgb(0 0 0 / 6%);font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;font-size:16px;line-height:1.4}@media (prefers-color-scheme: dark){:root:not([data-theme=light]){color-scheme:dark;--surface-0: #121211;--surface-1: #1a1a19;--surface-2: #222220;--border: #33332f;--grid: #2b2b28;--text-primary: #f0efec;--text-secondary: #c3c2b7;--text-muted: #96958d;--accent: #3987e5;--series-1: #3987e5;--series-1-soft: #184f95;--good-text: #4cc94c;--critical-text: #f08080;--shadow: none}}:root[data-theme=dark]{color-scheme:dark;--surface-0: #121211;--surface-1: #1a1a19;--surface-2: #222220;--border: #33332f;--grid: #2b2b28;--text-primary: #f0efec;--text-secondary: #c3c2b7;--text-muted: #96958d;--accent: #3987e5;--series-1: #3987e5;--series-1-soft: #184f95;--good-text: #4cc94c;--critical-text: #f08080;--shadow: none}*{box-sizing:border-box}html,body{margin:0;background:var(--surface-0);color:var(--text-primary)}body{min-height:100dvh;-webkit-tap-highlight-color:transparent}button,input,select,textarea{font:inherit;color:inherit}a{color:var(--accent)}h1{font-size:1.35rem;margin:0 0 12px}h2{font-size:1.05rem;margin:0 0 10px}.num{font-variant-numeric:tabular-nums;white-space:nowrap}.muted{color:var(--text-muted)}.secondary{color:var(--text-secondary)}.pos{color:var(--good-text)}.neg{color:var(--text-primary)}.small{font-size:.85rem}.app{display:flex;flex-direction:column;min-height:100dvh}main{flex:1;width:100%;max-width:960px;margin:0 auto;padding:16px 16px calc(84px + env(safe-area-inset-bottom))}.topbar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:calc(10px + env(safe-area-inset-top)) 16px 10px;background:var(--surface-1);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:5}.topbar .brand{font-weight:650}.nav{position:fixed;bottom:0;left:0;right:0;display:grid;grid-template-columns:repeat(5,1fr);background:var(--surface-1);border-top:1px solid var(--border);padding-bottom:env(safe-area-inset-bottom);z-index:5}.nav a{display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 2px;color:var(--text-muted);text-decoration:none;font-size:.72rem;position:relative}.nav a svg{width:22px;height:22px}.nav a.active{color:var(--accent)}.nav .badge{position:absolute;top:4px;left:calc(50% + 6px)}@media (min-width: 900px){.app{flex-direction:row}.nav{position:sticky;top:0;height:100dvh;width:200px;display:flex;flex-direction:column;border-top:0;border-right:1px solid var(--border);padding:72px 8px 8px}.nav a{flex-direction:row;gap:10px;font-size:.95rem;padding:10px 12px;border-radius:8px}.nav a.active{background:var(--surface-2)}.nav .badge{position:static;margin-left:auto}.content{flex:1;min-width:0}main{padding-bottom:32px}}.card{background:var(--surface-1);border:1px solid var(--border);border-radius:var(--radius);padding:14px;box-shadow:var(--shadow);margin-bottom:12px}.grid{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));margin-bottom:12px}.tile{background:var(--surface-1);border:1px solid var(--border);border-radius:var(--radius);padding:12px 14px}.tile .label{font-size:.8rem;color:var(--text-secondary)}.tile .value{font-size:1.35rem;font-weight:650;margin-top:2px}.tile.low{border-color:var(--critical)}.tile.low .value{color:var(--critical-text)}.btn{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:1px solid var(--border);background:var(--surface-2);border-radius:10px;padding:9px 14px;cursor:pointer;min-height:40px}.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}.btn.ghost{background:transparent;border-color:transparent;color:var(--accent)}.btn:disabled{opacity:.55;cursor:default}.btn-row{display:flex;gap:8px;flex-wrap:wrap}.field{display:flex;flex-direction:column;gap:4px;margin-bottom:12px}.field label{font-size:.85rem;color:var(--text-secondary)}input[type=text],input[type=password],input[type=search],select{width:100%;min-height:42px;padding:8px 10px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}.toolbar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px;align-items:center}.toolbar>*{flex:1 1 140px}.month-picker{display:flex;align-items:center;gap:4px}.month-picker span{min-width:9.5em;text-align:center;font-weight:600;text-transform:capitalize}.badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--critical);color:#fff;font-size:.7rem;font-weight:700}.chip{display:inline-block;padding:2px 8px;border-radius:999px;border:1px solid var(--border);font-size:.75rem;color:var(--text-secondary);white-space:nowrap}.chip.warn{border-color:var(--warning)}.error{color:var(--critical-text);margin:8px 0}.empty{text-align:center;padding:28px 12px;color:var(--text-muted)}.list{list-style:none;margin:0;padding:0}.list li{display:flex;gap:10px;align-items:center;padding:10px 2px;border-bottom:1px solid var(--grid)}.list li:last-child{border-bottom:0}.list .main{flex:1;min-width:0}.list .title{font-weight:550;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.list .sub{font-size:.8rem;color:var(--text-muted);display:flex;gap:6px;flex-wrap:wrap;align-items:center}.list button.row{all:unset;display:flex;gap:10px;align-items:center;width:100%;cursor:pointer}.alert{display:flex;gap:10px;padding:10px 12px;border-radius:10px;border:1px solid var(--border);background:var(--surface-2);margin-bottom:8px}.alert .icon{flex:none;width:20px;height:20px}.alert.high .icon{color:var(--critical)}.alert.mid .icon{color:var(--warning)}.alert .msg{white-space:pre-line;font-size:.85rem;color:var(--text-secondary)}.sheet-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#0006;z-index:20;display:flex;align-items:flex-end;justify-content:center}.sheet{background:var(--surface-1);width:100%;max-width:560px;max-height:88dvh;overflow:auto;border-radius:16px 16px 0 0;padding:16px 16px calc(16px + env(safe-area-inset-bottom))}@media (min-width: 700px){.sheet-backdrop{align-items:center}.sheet{border-radius:16px}}.cat-group{margin-bottom:10px}.cat-group h3{font-size:.8rem;text-transform:uppercase;letter-spacing:.04em;color:var(--text-muted);margin:8px 0 4px}.cat-options{display:flex;flex-wrap:wrap;gap:6px}.cat-options button{border:1px solid var(--border);background:var(--surface-2);border-radius:999px;padding:6px 10px;cursor:pointer;font-size:.85rem}.cat-options button.selected{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}.check{display:flex;gap:8px;align-items:center;margin:8px 0}.bars{display:flex;flex-direction:column;gap:10px}.bar-row{display:grid;grid-template-columns:minmax(0,9em) 1fr auto;gap:8px;align-items:center;cursor:default}.bar-row .name{font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text-secondary)}.bar-track{position:relative;height:12px}.bar-fill{position:absolute;left:0;top:0;bottom:0;background:var(--series-1);border-radius:0 4px 4px 0;min-width:2px}.bar-avg{position:absolute;top:-3px;bottom:-3px;width:2px;background:var(--text-secondary);border-radius:1px}.bar-row .val{font-size:.85rem;text-align:right}.legend{display:flex;gap:14px;font-size:.75rem;color:var(--text-muted);margin-top:10px;flex-wrap:wrap}.legend i{display:inline-block;width:10px;height:10px;border-radius:2px;background:var(--series-1);margin-right:5px;vertical-align:-1px}.legend i.avg{width:2px;height:12px;background:var(--text-secondary);border-radius:1px}.tooltip{position:fixed;z-index:30;pointer-events:none;background:var(--surface-2);color:var(--text-primary);border:1px solid var(--border);border-radius:8px;padding:6px 9px;font-size:.8rem;box-shadow:0 4px 14px #00000026;white-space:nowrap}.chart svg{display:block;width:100%;height:auto;overflow:visible}.chart .axis text{fill:var(--text-muted);font-size:11px}.chart .gridline{stroke:var(--grid)}.chart .col{fill:var(--series-1)}.chart .col.dim{fill:var(--series-1-soft)}.chart .hit{fill:transparent;cursor:default}.table-wrap{overflow-x:auto}table.data{border-collapse:collapse;width:100%;font-size:.85rem}table.data th,table.data td{padding:6px 8px;border-bottom:1px solid var(--grid);text-align:right;white-space:nowrap}table.data th:first-child,table.data td:first-child{text-align:left;position:sticky;left:0;background:var(--surface-1)}.segmented{display:inline-flex;border:1px solid var(--border);border-radius:10px;overflow:hidden}.segmented button{border:0;background:transparent;padding:6px 12px;cursor:pointer}.segmented button.on{background:var(--surface-2);font-weight:600}.login{min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:16px}.login .card{width:100%;max-width:380px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.budget-row{all:unset;display:block;width:100%;padding:10px 0;border-bottom:1px solid var(--grid);cursor:pointer}.budget-row:last-child{border-bottom:0}.budget-head,.budget-foot{display:flex;justify-content:space-between;gap:8px;align-items:center}.budget-head .name{font-weight:550;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bar-track.budget{height:10px;margin:6px 0 4px;background:var(--grid);border-radius:4px}.bar-track.budget .bar-fill{border-radius:4px 0 0 4px}.bar-over{position:absolute;top:0;bottom:0;background:var(--critical);border-radius:0 4px 4px 0}.bar-budget{position:absolute;top:-3px;bottom:-3px;width:2px;background:var(--text-primary);border-radius:1px}.bar-proj{position:absolute;top:1px;width:8px;height:8px;border-radius:50%;border:2px solid var(--series-1);background:var(--surface-1)}.status{display:inline-flex;align-items:center;gap:4px;font-weight:600;color:var(--text-secondary)}.status svg{width:14px;height:14px}.status.depasse svg{color:var(--critical)}.status.attention svg{color:var(--warning)}.legend i.proj{width:8px;height:8px;border-radius:50%;border:2px solid var(--series-1);background:transparent}.legend i.limit{width:2px;height:12px;background:var(--text-primary)}.chart .line{fill:none;stroke:var(--series-1);stroke-width:2;stroke-linejoin:round}.chart .area{fill:var(--series-1);opacity:.08}.chart .zero{stroke:var(--text-secondary);stroke-width:1}.chart .cross{stroke:var(--text-muted);stroke-width:1}.chart .dot{fill:var(--series-1);stroke:var(--surface-1);stroke-width:2}.tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}.tabs a{flex:none;padding:7px 12px;border-radius:999px;border:1px solid var(--border);text-decoration:none;color:var(--text-secondary);font-size:.9rem}.tabs a.active{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}.markdown h3{font-size:1rem;margin:16px 0 6px}.markdown p{margin:6px 0;line-height:1.5}.markdown ul{margin:6px 0;padding-left:20px}.markdown li{margin:3px 0;line-height:1.45}
