:root{--bg: #f4f6f5;--surface: #ffffff;--surface-2: #eef2f0;--border: #dbe2de;--text: #17211c;--muted: #64716a;--primary: #0f5132;--primary-strong: #0a3a24;--on-primary: #ffffff;--in: #0c6b3f;--out: #b3261e;--warn-bg: #fff4d6;--warn-text: #6b4e00;--danger-bg: #fde8e6;--ok-bg: #dff3e7;--info-bg: #e3edf8;--radius: 12px;--shadow: 0 1px 2px rgb(16 24 20 / 6%), 0 4px 14px rgb(16 24 20 / 5%);--nav-height: 62px;color-scheme:light dark}@media(prefers-color-scheme:dark){:root{--bg: #101513;--surface: #18201c;--surface-2: #202a25;--border: #2c3832;--text: #e7eeea;--muted: #94a39b;--primary: #3fb37f;--primary-strong: #57c592;--on-primary: #06140d;--in: #58c994;--out: #ff8a80;--warn-bg: #3a3112;--warn-text: #f1d98a;--danger-bg: #3b1a17;--ok-bg: #163324;--info-bg: #17283a;--shadow: none}}*{box-sizing:border-box}html{-webkit-text-size-adjust:100%}body{margin:0;background:var(--bg);color:var(--text);font:16px/1.45 system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}h1{font-size:1.35rem;margin:0;line-height:1.2}h2{font-size:1.1rem;margin:0}h3{font-size:.95rem;margin:1.1rem 0 .5rem;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}p{margin:0 0 .75rem}.muted{color:var(--muted)}.small{font-size:.82rem}.break{overflow-wrap:anywhere}:focus-visible{outline:3px solid color-mix(in srgb,var(--primary) 55%,transparent);outline-offset:2px}.shell{min-height:100dvh}.content{padding:1rem 1rem calc(var(--nav-height) + 1.5rem + env(safe-area-inset-bottom));max-width:1100px;margin:0 auto}.sidebar{position:fixed;inset:auto 0 0;z-index:20;display:flex;align-items:stretch;height:calc(var(--nav-height) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);background:var(--surface);border-top:1px solid var(--border);overflow-x:auto;scrollbar-width:none}.sidebar::-webkit-scrollbar{display:none}.sidebar nav{display:flex;flex:1}.sidebar .brand{display:none}.nav-link{flex:1 0 68px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:var(--muted);text-decoration:none;font-size:.7rem;padding:0 .25rem;min-height:48px}.nav-link.active{color:var(--primary);font-weight:600}.nav-icon{font-size:1.15rem;line-height:1}.nav-label{display:none}.brand{display:flex;align-items:center;gap:.6rem;font-weight:700}.brand-mark{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:var(--primary);color:var(--on-primary);font-weight:800}.brand-large{flex-direction:column;margin-bottom:1.25rem}.brand-large .brand-mark{width:54px;height:54px;font-size:1.6rem;border-radius:16px}@media(min-width:900px){.shell{display:grid;grid-template-columns:250px 1fr}.sidebar{position:sticky;inset:0 auto auto 0;height:100dvh;flex-direction:column;align-items:stretch;border-top:0;border-right:1px solid var(--border);padding:1.25rem .75rem;gap:1rem;overflow:visible}.sidebar .brand{display:flex;padding:0 .5rem}.sidebar nav{flex-direction:column;gap:2px}.nav-link{flex:0 0 auto;flex-direction:row;justify-content:flex-start;gap:.75rem;font-size:.95rem;padding:.6rem .75rem;border-radius:10px}.nav-link:hover{background:var(--surface-2)}.nav-link.active{background:color-mix(in srgb,var(--primary) 12%,transparent)}.nav-label{display:inline}.nav-short{display:none}.nav-profile{margin-top:auto}.content{padding:1.75rem 2rem 3rem;margin:0;width:100%}}.page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem;margin-bottom:1rem;flex-wrap:wrap}.page-header p{margin:.2rem 0 0;font-size:.88rem}.btn{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;min-height:44px;padding:0 1rem;border-radius:10px;border:1px solid transparent;font:inherit;font-weight:600;cursor:pointer;text-decoration:none;white-space:nowrap}.btn:disabled{opacity:.5;cursor:not-allowed}.btn-primary{background:var(--primary);color:var(--on-primary)}.btn-primary:hover:not(:disabled){background:var(--primary-strong)}.btn-ghost{background:transparent;color:var(--text);border-color:var(--border)}.btn-danger{background:var(--out);color:#fff}.btn-danger-ghost{background:transparent;color:var(--out);border-color:color-mix(in srgb,var(--out) 40%,transparent)}.btn-small{min-height:36px;padding:0 .75rem;font-size:.86rem}.btn-block{width:100%}.icon-btn{background:none;border:0;font-size:1.6rem;line-height:1;color:var(--muted);cursor:pointer;width:44px;height:44px;border-radius:10px}.chip{border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:999px;padding:.35rem .75rem;font:inherit;font-size:.82rem;cursor:pointer}.field{display:flex;flex-direction:column;gap:.3rem;min-width:0}.field label{font-size:.82rem;font-weight:600;color:var(--muted)}input,select,textarea{width:100%;min-height:44px;padding:.55rem .7rem;border-radius:10px;border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit}textarea{resize:vertical}input[type=checkbox]{width:20px;min-height:20px;height:20px;padding:0}.checkbox{display:flex;align-items:center;gap:.5rem;font-size:.9rem}.field-invalid input,.field-invalid select,.field-invalid textarea,.field-invalid .money-input{border-color:var(--out)}.field-error{color:var(--out);font-size:.8rem}.field-hint{color:var(--muted);font-size:.78rem}.money-input{display:flex;align-items:center;border:1px solid var(--border);border-radius:10px;background:var(--surface);padding-left:.7rem;color:var(--muted)}.money-input input{border:0;background:transparent;text-align:right;font-variant-numeric:tabular-nums;font-size:1.1rem;font-weight:600}.form{display:flex;flex-direction:column;gap:.85rem}.form-row{display:grid;grid-template-columns:1fr 1fr;gap:.75rem}.form-actions{display:flex;justify-content:flex-end;gap:.6rem;margin-top:.4rem}.segmented{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;border:1px solid var(--border);border-radius:10px;overflow:hidden}.segmented button{border:0;background:var(--surface);color:var(--text);font:inherit;font-size:.86rem;min-height:42px;cursor:pointer}.segmented button.active{background:var(--primary);color:var(--on-primary);font-weight:600}.filters{display:grid;grid-template-columns:1fr;gap:.75rem;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:.9rem;margin-bottom:1rem}.period{display:grid;grid-template-columns:1fr 1fr;gap:.75rem}.period-shortcuts{grid-column:1 / -1;display:flex;flex-wrap:wrap;gap:.4rem}@media(min-width:700px){.filters{grid-template-columns:repeat(auto-fit,minmax(190px,1fr));align-items:start}.filters .period{grid-column:span 2}}.stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem;margin-bottom:1rem}.stats-compact{grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}@media(min-width:700px){.stats{grid-template-columns:repeat(4,minmax(0,1fr))}.stats-compact{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}}.stat{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:.8rem .9rem;display:flex;flex-direction:column;gap:.15rem;min-width:0;box-shadow:var(--shadow)}.stat-label{font-size:.76rem;color:var(--muted)}.stat-value{font-size:1.08rem;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.stat-hint{font-size:.72rem;color:var(--muted)}.stat-in .stat-value{color:var(--in)}.stat-out .stat-value{color:var(--out)}.stat-primary{background:var(--primary);border-color:var(--primary);color:var(--on-primary)}.stat-primary .stat-label,.stat-primary .stat-hint{color:color-mix(in srgb,var(--on-primary) 80%,transparent)}.summary-line{display:flex;flex-wrap:wrap;gap:.4rem 1.25rem;font-size:.88rem;color:var(--muted);margin-bottom:1rem}.summary-line strong{color:var(--text)}.quick-links{display:flex;flex-wrap:wrap;gap:.6rem}.cards{list-style:none;margin:0 0 1rem;padding:0;display:flex;flex-direction:column;gap:.55rem}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:.8rem .9rem;box-shadow:var(--shadow)}.cards-inner .card{box-shadow:none;background:var(--surface-2)}.card-muted{opacity:.68}.card-main{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem}.card-main>div:first-child{min-width:0}.card-title{display:block;overflow-wrap:anywhere}.card-meta{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem .6rem;font-size:.82rem;color:var(--muted);margin-top:.2rem}.card-value{text-align:right;display:flex;flex-direction:column;align-items:flex-end}.card-value small{color:var(--muted);font-size:.74rem}.card-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:.4rem;margin-top:.65rem}.card-actions small{margin-right:auto}.amount{font-weight:700;font-size:1.05rem;font-variant-numeric:tabular-nums;white-space:nowrap}.amount-in{color:var(--in)}.amount-out{color:var(--out)}.responsible{font-size:.74rem;color:var(--muted);font-weight:400}.badge{display:inline-block;padding:.08rem .5rem;border-radius:999px;font-size:.72rem;font-weight:600;background:var(--surface-2);color:var(--muted)}.badge-pending{background:var(--warn-bg);color:var(--warn-text)}.badge-partially_settled{background:var(--info-bg);color:var(--text)}.badge-settled,.badge-realized,.badge-confirmed{background:var(--ok-bg);color:var(--in)}.badge-cancelled,.badge-reversed{background:var(--danger-bg);color:var(--out)}summary.card-main{cursor:pointer;list-style:none}summary.card-main::-webkit-details-marker{display:none}.panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1rem;margin-bottom:1rem}.panel h3:first-child{margin-top:0}.details{display:grid;grid-template-columns:minmax(110px,auto) 1fr;gap:.35rem .9rem;margin:.6rem 0;font-size:.9rem}.details dt{color:var(--muted)}.details dd{margin:0;overflow-wrap:anywhere}.plain-list{margin:0;padding-left:1.1rem;font-size:.9rem}.table-scroll{overflow-x:auto}.changes{width:100%;border-collapse:collapse;font-size:.8rem}.changes th,.changes td{text-align:left;padding:.3rem .5rem;border-top:1px solid var(--border);overflow-wrap:anywhere;vertical-align:top}.changes .changed td{background:var(--warn-bg);color:var(--warn-text)}.alert{border-radius:10px;padding:.7rem .85rem;margin-bottom:.9rem;font-size:.9rem}.alert-error{background:var(--danger-bg);color:var(--out)}.alert-success{background:var(--ok-bg);color:var(--in)}.alert-info{background:var(--info-bg)}.empty{text-align:center;color:var(--muted);padding:1.5rem .5rem}.loading{display:flex;align-items:center;justify-content:center;gap:.6rem;color:var(--muted);padding:1.5rem}.spinner{width:18px;height:18px;border-radius:50%;border:2px solid var(--border);border-top-color:var(--primary);animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation:none}}.offline-banner{background:var(--warn-bg);color:var(--warn-text);border-radius:10px;padding:.6rem .8rem;margin-bottom:.9rem;font-size:.86rem}.update-toast{position:fixed;left:50%;transform:translate(-50%);z-index:40;bottom:calc(var(--nav-height) + .75rem + env(safe-area-inset-bottom));display:flex;align-items:center;gap:.75rem;padding:.5rem .6rem .5rem .9rem;background:var(--text);color:var(--bg);border-radius:999px;font-size:.86rem;box-shadow:0 6px 24px #00000040;max-width:calc(100vw - 1.5rem)}.update-toast .btn{background:var(--bg);color:var(--text)}@media(min-width:900px){.update-toast{bottom:1.25rem}}.pagination{display:flex;align-items:center;justify-content:center;gap:.75rem;font-size:.86rem;color:var(--muted);margin:.5rem 0 1rem}.modal-backdrop{position:fixed;inset:0;z-index:50;background:#0000007f;display:flex;align-items:flex-end;justify-content:center}.modal{background:var(--surface);width:100%;max-width:560px;max-height:92dvh;overflow-y:auto;border-radius:18px 18px 0 0;padding:1rem 1rem calc(1rem + env(safe-area-inset-bottom));outline:none}.modal-header{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.75rem}.modal-footer{display:flex;justify-content:flex-end;gap:.6rem;margin-top:1rem}@media(min-width:700px){.modal-backdrop{align-items:center;padding:1.5rem}.modal{border-radius:18px;padding:1.25rem}}.login{min-height:100dvh;display:grid;place-items:center;padding:1.25rem}.login-card{width:100%;max-width:380px;background:var(--surface);border:1px solid var(--border);border-radius:18px;padding:1.5rem;display:flex;flex-direction:column;gap:.9rem;box-shadow:var(--shadow)}.permissions{border:1px solid var(--border);border-radius:10px;padding:.75rem;display:flex;flex-direction:column;gap:.55rem;margin:0;min-width:0}.permissions legend{font-size:.82rem;font-weight:600;color:var(--muted);padding:0 .3rem}.secret{display:block;text-align:center;font:600 1.25rem/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.06em;padding:.9rem;margin:.5rem 0 .9rem;background:var(--surface-2);border:1px dashed var(--border);border-radius:10px;overflow-wrap:anywhere;user-select:all}.page-header a{color:var(--primary)}.login-card .panel{border:0;padding:0;margin:0;background:transparent}.bar{display:flex;height:14px;margin-top:.7rem;border-radius:999px;background:var(--surface-2);overflow:hidden}.bar-paid{background:var(--out)}.bar-pending{background:color-mix(in srgb,var(--out) 35%,var(--surface-2))}.bar-values{display:flex;justify-content:space-between;gap:.75rem;margin-top:.35rem;font-size:.82rem;color:var(--muted)}.bar-values strong{color:var(--text);font-variant-numeric:tabular-nums}.legend{display:flex;gap:1rem;font-size:.8rem;color:var(--muted);margin-bottom:.5rem}.swatch{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:.3rem;vertical-align:middle}.swatch-paid{background:var(--out)}.swatch-pending{background:color-mix(in srgb,var(--out) 35%,var(--surface-2))}.filters-toggle{display:flex;align-items:center;gap:.6rem;width:100%;min-height:48px;padding:.55rem .9rem;margin-bottom:.75rem;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:var(--radius);font:inherit;text-align:left;cursor:pointer}.filters-toggle-text{display:flex;flex-direction:column;flex:1;min-width:0}.filters-toggle-summary{font-size:.8rem;color:var(--muted)}.filters-toggle-icon{color:var(--muted);font-size:1.1rem}.filters-wrap .filters-collapsed{display:none}@media(min-width:700px){.filters-toggle{display:none}.filters-wrap .filters-collapsed{display:grid}}.file-row{display:flex;align-items:center;justify-content:space-between;gap:.6rem;font-size:.9rem}
