:root{--bg: #f8fafc;--surface: #ffffff;--text: #0f172a;--muted: #475569;--border: #cbd5e1;--border-soft: #e2e8f0;--primary: #0f172a;--primary-text: #ffffff;--focus: #2563eb;--pos: #15803d;--pos-bg: #dcfce7;--neg: #b91c1c;--neg-bg: #fee2e2;--warn-bg: #fef3c7;--warn: #92400e;--radius: 10px;--tap: 44px;--sidebar: 232px;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;color:var(--text);background:var(--bg);line-height:1.45;-webkit-text-size-adjust:100%}*{box-sizing:border-box}body{margin:0;background:var(--bg);min-height:100vh}h1{font-size:1.45rem;margin:0}h2{font-size:1.1rem;margin:0}h3{font-size:1rem;margin:0}a{color:#1d4ed8}:focus-visible{outline:3px solid var(--focus);outline-offset:2px}.sr-only,.sr-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.muted{color:var(--muted)}.fineprint{color:var(--muted);font-size:.8rem;margin:.5rem 0 0}.cap{text-transform:capitalize}.skip-link{position:absolute;left:-999px;top:0;background:var(--surface);padding:.5rem 1rem;z-index:100}.skip-link:focus{left:1rem}.print-only{display:none}.shell{min-height:100vh}.sidebar{display:none}.content{padding-bottom:calc(72px + env(safe-area-inset-bottom))}.topbar{display:flex;justify-content:space-between;align-items:center;padding:.75rem 1rem;padding-top:calc(.75rem + env(safe-area-inset-top));background:var(--surface);border-bottom:1px solid var(--border-soft);position:sticky;top:0;z-index:10}.brand-mobile{font-weight:700}.role-chip{font-size:.75rem;text-transform:capitalize;border:1px solid var(--border);border-radius:999px;padding:.1rem .55rem;color:var(--muted);margin-left:.4rem}main{outline:none}.bottom-nav{position:fixed;bottom:0;left:0;right:0;display:grid;grid-template-columns:repeat(4,1fr);background:var(--surface);border-top:1px solid var(--border);padding-bottom:env(safe-area-inset-bottom);z-index:20}.bottom-link{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:60px;font-size:.78rem;color:var(--muted);text-decoration:none;gap:2px}.bottom-link span{font-size:1.15rem}.bottom-link.active{color:var(--text);font-weight:700;box-shadow:inset 0 3px 0 var(--text)}.offline-banner{background:var(--warn-bg);color:var(--warn);padding:.6rem 1rem;font-weight:600;text-align:center;border-bottom:1px solid #fcd34d}.no-desktop{display:block}@media (min-width: 900px){.sidebar{display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0;width:var(--sidebar);background:var(--surface);border-right:1px solid var(--border-soft);padding:1rem .75rem}.brand{font-weight:800;font-size:1.05rem;padding:.25rem .75rem 1rem;display:flex;flex-direction:column}.brand span{font-weight:500;font-size:.8rem;color:var(--muted)}.sidebar nav{display:flex;flex-direction:column;gap:2px}.side-link{display:flex;gap:.65rem;align-items:center;min-height:var(--tap);padding:0 .75rem;border-radius:8px;color:var(--text);text-decoration:none}.side-link:hover{background:var(--bg)}.side-link.active{background:#e2e8f0;font-weight:700}.sidebar-user{margin-top:auto;padding:.75rem;font-size:.9rem;border-top:1px solid var(--border-soft)}.content{margin-left:var(--sidebar);padding-bottom:2rem}.topbar,.bottom-nav,.no-desktop{display:none}}.page{padding:1rem;max-width:1100px;margin:0 auto;display:flex;flex-direction:column;gap:1rem}.page-narrow{max-width:720px}.page-head{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:.75rem}.page-head p{margin:.25rem 0 0}.quick-actions{display:flex;flex-wrap:wrap;gap:.5rem}.breadcrumb{font-size:.9rem;color:var(--muted)}.card{background:var(--surface);border:1px solid var(--border-soft);border-radius:var(--radius);padding:1rem;display:flex;flex-direction:column;gap:.75rem;min-width:0}.card-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem}.card-title{font-size:1.02rem}.section-title{margin:.25rem 0 -.5rem;font-size:1rem}.toolbar{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}.toolbar input[type=search]{flex:1 1 200px}input,select,textarea{font:inherit;color:inherit;background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:.55rem .7rem;min-height:var(--tap);width:100%;max-width:100%}.toolbar input,.toolbar select{width:auto}textarea{min-height:64px;resize:vertical}input:disabled,select:disabled{background:var(--bg);color:var(--muted)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:.35rem;min-height:var(--tap);padding:0 1rem;border-radius:8px;border:1px solid transparent;font:inherit;font-weight:600;cursor:pointer;text-decoration:none;white-space:nowrap}.btn:disabled{opacity:.55;cursor:not-allowed}.btn-primary{background:var(--primary);color:var(--primary-text)}.btn-secondary{background:var(--surface);color:var(--text);border-color:var(--border)}.btn-secondary:hover{background:var(--bg)}.btn-income{background:var(--pos);color:#fff}.btn-expense,.btn-danger{background:var(--neg);color:#fff}.btn-ghost-danger{background:var(--surface);color:var(--neg);border-color:#fca5a5}.btn-link{background:none;border:none;color:#1d4ed8;padding:0;min-height:var(--tap);font:inherit;cursor:pointer;text-align:left;text-decoration:underline}.btn-small{min-height:38px;padding:0 .75rem;font-size:.9rem}.btn-block{width:100%}.btn-icon{background:none;border:none;font-size:1.6rem;width:var(--tap);height:var(--tap);cursor:pointer;color:var(--muted)}.form{display:flex;flex-direction:column;gap:.8rem}.form-row{display:grid;gap:.8rem;grid-template-columns:1fr}@media (min-width: 600px){.form-row{grid-template-columns:1fr 1fr}}.field{display:flex;flex-direction:column;gap:.3rem;min-width:0}.field label,.custom-range label{font-weight:600;font-size:.9rem}.field-hint{margin:0;color:var(--muted);font-size:.8rem}.field-error{margin:0;color:var(--neg);font-size:.85rem;font-weight:600}.field-error:before{content:"⚠ "}.has-error input,.has-error select,.has-error textarea{border-color:var(--neg)}.form-actions{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:flex-end}.input-prefix{display:flex;align-items:center;border:1px solid var(--border);border-radius:8px;background:var(--surface);padding-left:.7rem}.input-prefix input{border:none;min-height:calc(var(--tap) - 2px)}.input-prefix:focus-within{outline:3px solid var(--focus);outline-offset:2px}.input-prefix input:focus-visible{outline:none}.check{display:flex;gap:.6rem;align-items:center;min-height:var(--tap)}.check input{width:22px;min-height:22px;height:22px}.prefilled{margin:0;padding:.6rem .75rem;background:var(--bg);border-radius:8px}.period-filter{display:flex;flex-direction:column;gap:.5rem}.segmented{display:flex;flex-wrap:wrap;gap:.35rem}.seg{min-height:40px;padding:0 .85rem;border-radius:999px;border:1px solid var(--border);background:var(--surface);font:inherit;cursor:pointer}.seg.active{background:var(--primary);color:#fff;border-color:var(--primary);font-weight:600}.custom-range{display:flex;flex-wrap:wrap;gap:.5rem;align-items:flex-end}.custom-range label{display:flex;flex-direction:column;gap:.2rem;flex:1 1 140px}.period-resolved{margin:0;font-size:.85rem;color:var(--muted)}.stat-grid{display:grid;gap:.75rem;grid-template-columns:1fr}@media (min-width: 560px){.stat-grid{grid-template-columns:repeat(3,1fr)}.stat-grid-2{grid-template-columns:2fr 1fr}}.stat-card{background:var(--surface);border:1px solid var(--border-soft);border-left:4px solid var(--border);border-radius:var(--radius);padding:.85rem 1rem;min-width:0}.stat-pos{border-left-color:var(--pos)}.stat-neg{border-left-color:var(--neg)}.stat-label{font-size:.85rem;color:var(--muted);font-weight:600}.stat-value{font-size:1.45rem;font-weight:750;margin-top:.15rem;overflow-wrap:anywhere}.stat-hint{font-size:.78rem;color:var(--muted);margin-top:.15rem}.amt{font-variant-numeric:tabular-nums;white-space:nowrap}.amt-pos{color:var(--pos)}.amt-neg{color:var(--neg)}.recovery{display:flex;flex-direction:column;gap:.25rem;min-width:120px}.progress{height:10px;border-radius:999px;background:#e2e8f0;overflow:hidden;border:1px solid var(--border-soft)}.progress-fill{height:100%;background:#64748b}.progress-fill.done{background:var(--pos)}.recovery-text{font-size:.82rem;color:var(--muted)}.recovery-na{font-size:.85rem;color:var(--muted);font-style:italic}.recovery-panel .progress{height:14px}.recovery-summary,.recovery-surplus,.recovery-loss{margin:0}.recovery-loss{color:var(--neg);font-weight:600}.recovery-loss:before{content:"⚠ "}.kv{display:grid;gap:.5rem 1rem;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));margin:0}.kv dt{font-size:.8rem;color:var(--muted)}.kv dd{margin:0;font-weight:650;overflow-wrap:anywhere}.truck-cards{list-style:none;margin:0;padding:0;display:grid;gap:.6rem}@media (min-width: 760px){.truck-cards{grid-template-columns:repeat(2,1fr)}}.truck-card{display:flex;flex-direction:column;gap:.5rem;padding:.85rem;border:1px solid var(--border-soft);border-radius:var(--radius);background:var(--surface);color:var(--text);text-decoration:none;min-height:var(--tap)}.truck-card:hover{border-color:var(--border);background:#fcfdff}.truck-card-head{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem .6rem}.truck-code{font-weight:750;font-size:1.05rem}.truck-driver{color:var(--muted);font-size:.88rem;margin-left:auto}.truck-card-figures{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.4rem;margin:0}.truck-card-figures dt{font-size:.75rem;color:var(--muted)}.truck-card-figures dd{margin:0;font-weight:650;font-size:.92rem;overflow-wrap:anywhere}.truck-card-figures .amt{white-space:normal}.badge{display:inline-block;font-size:.72rem;font-weight:700;border-radius:999px;padding:.1rem .5rem;border:1px solid transparent;vertical-align:middle}.badge-pos{background:var(--pos-bg);color:var(--pos)}.badge-neg{background:var(--neg-bg);color:var(--neg)}.badge-muted{background:#f1f5f9;color:var(--muted);border-color:var(--border)}.badge-void{background:#f1f5f9;color:var(--text);border-color:var(--text)}.tx-list,.history-list,.simple-list,.user-list,.breakdown{list-style:none;margin:0;padding:0}.tx{border-bottom:1px solid var(--border-soft);padding:.7rem 0;display:flex;flex-direction:column;gap:.3rem}.tx:last-child{border-bottom:none}.tx-void{opacity:.7}.tx-main{display:flex;justify-content:space-between;gap:.5rem;align-items:flex-start}.tx-title{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}.tx-cat{font-weight:650}.tx-amount{font-weight:750}.tx-meta{display:flex;flex-wrap:wrap;gap:.15rem .8rem;font-size:.8rem;color:var(--muted)}.tx-note{margin:0;font-size:.88rem;overflow-wrap:anywhere}.tx-actions{display:flex;gap:.4rem}.history-list li{padding:.6rem 0;border-bottom:1px solid var(--border-soft);display:flex;flex-direction:column;gap:.15rem}.history-list li:last-child{border-bottom:none}.history-list .badge{align-self:flex-start}.changes{margin:.2rem 0 0;padding-left:1.1rem;font-size:.85rem;color:var(--muted);overflow-wrap:anywhere}.simple-list li+li{margin-top:.4rem}.simple-row{display:flex;justify-content:space-between;align-items:center;gap:.5rem;min-height:52px;padding:.5rem 1rem;background:var(--surface);border:1px solid var(--border-soft);border-radius:var(--radius);color:var(--text);text-decoration:none}.simple-row .badge{margin-left:.4rem}.user-list{display:flex;flex-direction:column;gap:.6rem}.user-row{flex-direction:row;flex-wrap:wrap;justify-content:space-between}.user-controls{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center}.user-controls select{width:auto}.breakdown li{display:flex;justify-content:space-between;gap:.5rem;padding:.45rem 0;border-bottom:1px solid var(--border-soft)}.pager{display:flex;justify-content:center;align-items:center;gap:.75rem;padding-top:.5rem}.tabs{display:flex;gap:.25rem;overflow-x:auto;border-bottom:1px solid var(--border);scrollbar-width:thin}.tab{min-height:var(--tap);padding:0 .9rem;background:none;border:none;border-bottom:3px solid transparent;font:inherit;color:var(--muted);cursor:pointer;white-space:nowrap}.tab.active{color:var(--text);font-weight:700;border-bottom-color:var(--text)}.table-wrap{overflow-x:auto}.report-table{width:100%;border-collapse:collapse;font-size:.88rem}.report-table th,.report-table td{text-align:right;padding:.45rem .4rem;border-bottom:1px solid var(--border-soft)}.report-table th:first-child{text-align:left}.report-table thead th{color:var(--muted);font-weight:600;font-size:.8rem}.report-table tfoot th,.report-table tfoot td{font-weight:750;border-top:2px solid var(--border)}.report-table .recovery{min-width:100px;align-items:flex-end}.report-header h2{font-size:1.1rem}.report-header p{margin:.25rem 0 0;color:var(--muted);font-size:.88rem}.report{display:flex;flex-direction:column;gap:1rem}.state{padding:1.25rem;text-align:center;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:.6rem}.state-error{color:var(--neg)}.state-title{margin:0;font-weight:600;color:var(--text)}.state-loading{flex-direction:row;justify-content:center}.spinner{width:18px;height:18px;border:3px solid var(--border);border-top-color:var(--text);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.spinner{animation:none}}.alert{padding:.7rem .9rem;border-radius:8px;font-weight:550;overflow-wrap:anywhere}.alert-error{background:var(--neg-bg);color:#7f1d1d;border:1px solid #fca5a5}.alert-error:before{content:"⚠ "}.alert-success{background:var(--pos-bg);color:#14532d;border:1px solid #86efac}.alert-success:before{content:"✓ "}.alert-info{background:#e0f2fe;color:#0c4a6e}.boot{min-height:100vh;display:grid;place-items:center}.dialog{border:none;border-radius:14px;padding:0;width:min(520px,calc(100vw - 1.5rem));max-height:calc(100dvh - 2rem);color:var(--text);box-shadow:0 20px 50px #0f172a40}.dialog::backdrop{background:#0f172a73}.dialog-head{display:flex;justify-content:space-between;align-items:center;padding:.5rem .5rem .25rem 1rem;border-bottom:1px solid var(--border-soft);position:sticky;top:0;background:var(--surface)}.dialog-body{padding:1rem}@media (max-width: 560px){.dialog{width:100vw;max-width:100vw;margin:auto 0 0;border-radius:14px 14px 0 0;max-height:92dvh}.form-actions .btn{flex:1 1 auto}}.login-page{min-height:100vh;display:flex;flex-direction:column}.login-card{margin:auto;width:min(400px,calc(100vw - 2rem));background:var(--surface);border:1px solid var(--border-soft);border-radius:14px;padding:1.5rem;display:flex;flex-direction:column;gap:.9rem}.login-card img{border-radius:12px}.login-card p{margin:0}@media print{@page{margin:14mm}:root{background:#fff}body{background:#fff;font-size:11pt}.no-print,.sidebar,.topbar,.bottom-nav,.offline-banner,.skip-link,.tx-actions,.period-filter,button{display:none!important}.print-only{display:inline!important}.content{margin:0!important;padding:0!important}.page{padding:0;max-width:none}.card,.stat-card{border:1px solid #94a3b8;break-inside:avoid;box-shadow:none}.stat-grid{grid-template-columns:repeat(3,1fr)!important}.amt-pos,.amt-neg{color:#000!important}.report-recovery{break-before:auto}a{color:#000;text-decoration:none}.table-wrap{overflow:visible}.report-table{font-size:9.5pt}}
