:root{--bg:#f7f8fb;--panel:#fff;--muted:#6b7280;--text:#0f172a;--primary:#2563eb;--primary-600:#1d4ed8;--border:#e5e7eb;--card:#fff;--success:#16a34a;--warning:#d97706;--danger:#dc2626}*{box-sizing:border-box}body,html{height:100%}body{margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,Apple Color Emoji,Segoe UI Emoji;background:radial-gradient(1200px 600px at 30% -20%,#fff 0,hsla(0,0%,100%,0) 45%),linear-gradient(180deg,#f7faff,#f7f8fb 60%);color:var(--text)}.public-shell,.shell{display:flex;min-height:100vh}.public-shell{align-items:stretch;justify-content:center}.sidebar{width:264px;background:#111315;color:#e2e8f0;display:flex;flex-direction:column;border-right:1px solid #1b1d21;position:-webkit-sticky;position:sticky;top:0;height:100vh;align-self:flex-start;transition:width .15s ease}.sidebar.collapsed{width:76px}.logo-row{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px;text-decoration:none;color:inherit;border-bottom:1px solid #1b1d21;min-height:120px;text-align:center;background:linear-gradient(180deg,#15171a,#111315 70%)}.logo{width:200px;height:100px;background:transparent;border-radius:12px;object-fit:contain;transition:width .15s ease,height .15s ease}.brand{font-weight:500;letter-spacing:.2px;font-size:18px;color:#e5e7eb;margin-top:2px}.sidebar.collapsed .brand{display:none}.sidebar.collapsed .logo{width:40px;height:40px}.nav{display:grid;padding:8px}.nav-link{color:#cbd5e1;padding:10px 12px;border-radius:8px;text-decoration:none;position:relative;display:flex;align-items:center;gap:10px}.nav-link:hover{background:hsla(0,0%,100%,.06);color:#fff}.nav-link.active{background:hsla(0,0%,100%,.08);color:#fff}.nav-link.active:before{content:"";position:absolute;left:-8px;top:8px;bottom:8px;width:3px;border-radius:3px;background:#3b82f6}.sidebar.collapsed .nav-link{justify-content:center}.sidebar.collapsed .nav-link .label{display:none}.sidebar-footer{margin-top:auto;padding:12px 16px;border-top:1px solid #0b1220}.main{flex:1 1;min-width:0}.site-footer{border-top:1px solid var(--border);background:#fff;margin-top:16px}.footer-inner{display:flex;align-items:center;gap:8px;padding:10px 0}.tiny{font-size:11px}.container{max-width:1200px;margin:0 auto;padding:24px}.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;position:-webkit-sticky;position:sticky;top:0;background:linear-gradient(180deg,rgba(247,250,255,.9),rgba(247,248,251,.7));-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);border-bottom:1px solid var(--border);padding:12px 0;z-index:10}.title{font-size:28px;font-weight:800;letter-spacing:.2px}.toolbar{display:flex;gap:8px;flex-wrap:nowrap;align-items:center;background:#fff;border:1px solid var(--border);border-radius:12px;padding:6px 8px;box-shadow:0 1px 2px rgba(0,0,0,.04)}.toolbar input,.toolbar select{background:#fff;border:1px solid var(--border);color:var(--text);height:34px;padding:0 10px;border-radius:10px;outline:none;transition:border-color .15s ease,box-shadow .15s ease}.toolbar input::placeholder{color:#9aa3af}.toolbar input:focus,.toolbar select:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,.15)}.toolbar select{padding-right:24px;width:150px}.toolbar .search{width:clamp(180px,28vw,320px)}.toolbar .btn{height:34px;padding:0 10px}@media (max-width:900px){.toolbar{flex-wrap:wrap}}.btn{background:var(--primary);border:1px solid var(--primary-600);color:#fff;padding:0 12px;height:36px;border-radius:10px;cursor:pointer;font-weight:600;box-shadow:0 1px 2px rgba(0,0,0,.06);transition:transform .05s ease,background .15s ease,border-color .15s ease;display:inline-flex;align-items:center;gap:6px;text-decoration:none}.btn:hover{filter:brightness(.98)}.btn:active{transform:translateY(1px)}.btn.secondary{background:#fff;border:1px solid var(--border);color:var(--text)}.btn.secondary:hover{background:#f8fafc}.btn.ghost{background:transparent;border:1px solid transparent;color:#334155}.btn.ghost:hover{background:#f1f5f9;border-color:#e2e8f0}.btn:disabled{opacity:.6;cursor:not-allowed}.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:10px;border:1px solid var(--border);background:#fff;color:#0f172a;cursor:pointer}.icon-btn:hover{background:#f8fafc}.icon-btn.danger{color:#b91c1c;border-color:#fecaca;background:#fff5f5}.icon{width:18px;height:18px;display:inline-block}.icon-btn.small{width:28px;height:28px;border-radius:8px}.icon-btn.xs{width:22px;height:22px;border-radius:6px;font-size:12px}.spinner{width:14px;height:14px;border:2px solid #e5e7eb;border-top:2px solid var(--primary);border-radius:50%;display:inline-block;animation:spin .7s linear infinite}@keyframes spin{to{transform:rotate(1turn)}}.modal-root{position:fixed;inset:0;z-index:50;display:grid;place-items:center}.modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.45);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.modal-panel{position:relative;width:min(520px,92%);background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:0 20px 40px rgba(15,23,42,.25);overflow:hidden}.modal-header{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--border);background:#fff7ed}.modal-title{font-weight:900;color:#7c2d12}.modal-body{padding:12px 16px;color:#0f172a}.modal-footer{display:flex;gap:8px;justify-content:flex-end;padding:12px 16px;border-top:1px solid var(--border);background:#f8fafc}.icon.warn{color:#b45309}.grid{display:grid;grid-template-columns:1fr 1fr;grid-gap:24px;gap:24px;align-items:start}.section h2{margin:8px 0 10px;font-size:15px;color:#334155;font-weight:700;text-transform:uppercase;letter-spacing:.6px}.stack{grid-gap:12px}.grid-2,.stack{display:grid;gap:12px}.grid-2{grid-template-columns:1fr 1fr;grid-gap:12px}@media (max-width:900px){.grid-2{grid-template-columns:1fr}}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(220px,1fr));grid-gap:12px 16px;gap:12px 16px}@media (max-width:900px){.form-grid{grid-template-columns:1fr}}.field{display:grid;grid-gap:6px;gap:6px}.field.col-span-2{grid-column:span 2}.field label.small{color:#475569;font-weight:600}.card{border:1px solid var(--border);border-radius:12px;background:var(--card);padding:12px;box-shadow:0 4px 16px rgba(15,23,42,.06)}.item{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.item-left{display:grid;grid-gap:6px;gap:6px;min-width:0}.item-right{text-align:right;display:grid;grid-gap:4px;gap:4px}.code{font-weight:700;padding:2px 6px;border-radius:6px;background:#eef2ff;border:1px solid #e0e7ff;color:#3730a3}.code,.meta{font-size:12px}.meta{display:flex;flex-wrap:wrap;gap:10px;color:var(--muted)}.label{color:#475569;font-weight:600}.dot{width:3px;height:3px;background:#cbd5e1;border-radius:999px;align-self:center}.sep{color:#94a3b8;margin:0 4px}.amount-large{font-size:18px;font-weight:800}.small{font-size:12px}.hr{height:1px;background:var(--border);margin:10px 0}.muted{color:var(--muted)}.row{display:flex;align-items:center;gap:10px}.spacer{flex:1 1}.tag{font-size:12px;padding:2px 8px;border-radius:999px;border:1px solid var(--border);color:var(--muted);background:#fff}.tag.success{color:var(--success);border-color:rgba(22,163,74,.25);background:rgba(22,163,74,.06)}.tag.warn{color:#b45309;border-color:rgba(217,119,6,.25);background:rgba(217,119,6,.08)}.tag.danger{color:var(--danger);border-color:rgba(220,38,38,.25);background:rgba(220,38,38,.06)}.board{display:grid;grid-template-columns:1fr;grid-gap:24px;gap:24px;align-items:start}.lane{background:#fff;border:1px solid var(--border);border-radius:14px;overflow:hidden;box-shadow:0 6px 18px rgba(15,23,42,.05)}.lane-header{padding:14px 16px;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:12px;background:linear-gradient(#fff,#fbfdff)}.lane-title{font-size:14px;font-weight:800;letter-spacing:.6px;text-transform:uppercase;color:#0f172a}.lane-count{margin-left:auto;font-weight:700;background:#f1f5f9;color:#0f172a;border:1px solid var(--border);border-radius:999px;padding:4px 10px;font-size:12px}.lane-body{padding:14px;display:grid;grid-gap:12px;gap:12px}.kpis{display:flex;gap:10px;align-items:center}.kpi{background:#f8fafc;border:1px solid var(--border);border-radius:10px;padding:6px 10px;font-size:12px;color:#334155}.amount{font-weight:700}.pill{font-size:11px;padding:2px 8px;border-radius:999px;background:#eef2ff;color:#3730a3;border:1px solid #e0e7ff}.pill.overdue{background:#fee2e2;color:#991b1b;border-color:#fecaca}.pill.today{background:#fef9c3;color:#854d0e;border-color:#fde68a}.pill.upcoming{background:#ecfccb;color:#365314;border-color:#d9f99d}.callout{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:10px;border:1px solid var(--border);background:#fff}.callout.warn{border-color:rgba(217,119,6,.3);background:#fff7ed}.callout .title{font-weight:800;color:#92400e}.callout .amount-big{font-size:18px;font-weight:900;color:#92400e}.callout .desc{color:#7c2d12}.drawer-root{position:fixed;inset:0;z-index:40;display:grid}.drawer-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.35)}.drawer-panel{position:absolute;right:0;top:0;height:100%;width:min(860px,100%);background:#fff;border-left:1px solid var(--border);box-shadow:-8px 0 24px rgba(15,23,42,.12);display:flex;flex-direction:column;animation:slideIn .18s ease-out}.drawer-header{display:flex;align-items:center;gap:12px;padding:14px;border-bottom:1px solid var(--border);background:#f8fafc}.drawer-title{font-weight:800;font-size:16px}.drawer-body{padding:16px;overflow:auto;display:grid;grid-gap:12px;gap:12px}.close-x{margin-left:auto;background:transparent;border:none;padding:4px;border-radius:6px;color:#64748b;cursor:pointer}.close-x:hover{color:#dc2626;background:transparent}.close-x:focus{outline:none;box-shadow:0 0 0 2px rgba(220,38,38,.15);border-radius:6px}@keyframes slideIn{0%{transform:translateX(16px);opacity:.9}to{transform:translateX(0);opacity:1}}@media (max-width:900px){.board,.grid{grid-template-columns:1fr}}tbody tr.clickable{cursor:pointer}tbody tr.clickable:hover td{background:#f8fafc}.row.clickable{cursor:pointer;padding:6px 8px;border-radius:8px}.row.clickable:hover{background:#f8fafc}.row.clickable.selected{background:#eef2ff;border:1px solid #c7d2fe}.item.clickable{cursor:pointer;border-radius:8px}.item.clickable:hover{background:#f8fafc}.input-amount{width:100px;flex:0 0 100px;padding:4px 8px}.btn.small,.input-amount{height:32px;font-size:14px}.btn.small{padding:0 10px}.deposit-right{text-align:right;display:grid;grid-gap:4px;gap:4px;align-items:end;justify-items:end}.deposit-right .deposit-title{font-size:15px;font-weight:800;color:#b45309}.deposit-right .deposit-amount{font-size:18px;font-weight:900;color:#b45309}.card input:not([type=checkbox]):not([type=radio]),.card select,.card textarea,.drawer-body input:not([type=checkbox]):not([type=radio]),.drawer-body select,.drawer-body textarea{background:#fff;border:1px solid var(--border);border-radius:10px;padding:8px 12px;height:38px;color:var(--text);outline:none;transition:border-color .15s ease,box-shadow .15s ease}.card textarea,.drawer-body textarea{min-height:96px;height:auto;resize:vertical}.card input:not([type=checkbox]):not([type=radio]):focus,.card select:focus,.card textarea:focus,.drawer-body input:not([type=checkbox]):not([type=radio]):focus,.drawer-body select:focus,.drawer-body textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,.15)}.card input:not([type=checkbox]):not([type=radio]):disabled,.card select:disabled,.card textarea:disabled,.drawer-body input:not([type=checkbox]):not([type=radio]):disabled,.drawer-body select:disabled,.drawer-body textarea:disabled{background:#f1f5f9;color:#94a3b8;cursor:not-allowed}.row.wrap{flex-wrap:wrap}.row label.small{color:#475569}.row input:not([type=checkbox]):not([type=radio]),.row select,.row textarea{flex:1 1 260px;min-width:0}.row input[type=checkbox],.row input[type=radio]{flex:0 0 auto;width:14px;height:14px}.line-group{display:grid;grid-gap:10px;gap:10px}.line-header{display:flex;align-items:center;gap:10px;padding:2px 4px;font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:#64748b}.line-header span{display:block;white-space:nowrap}.line-row{flex-wrap:nowrap;align-items:center;gap:10px;width:100%;padding:2px 0}.line-type{flex:0 0 140px;min-width:140px}.line-lookup{flex:0 1 240px;min-width:210px}.line-description{flex:1 1 320px;min-width:220px}.line-qty{flex:0 0 68px;min-width:60px}.line-rate{flex:0 0 86px;min-width:80px}.line-amount{flex:0 0 96px;min-width:90px}.line-remove{flex:0 0 32px;min-width:32px}.line-row .icon-btn.small{width:32px;height:32px;padding:0}.line-placeholder{height:38px;border-radius:10px;background:transparent;pointer-events:none}.line-footer{margin-top:4px}.line-add-btn,.line-footer{display:flex;justify-content:center}.line-add-btn{width:36px;height:36px;border-radius:999px;border:none;background:var(--primary);color:#fff;font-size:22px;line-height:0;align-items:center;box-shadow:0 6px 18px rgba(37,99,235,.25);cursor:pointer;transition:transform .15s ease,box-shadow .15s ease,background .15s ease}.line-add-btn:hover{transform:translateY(-1px);box-shadow:0 8px 20px rgba(37,99,235,.28)}.line-add-btn:active{transform:translateY(0);box-shadow:0 4px 12px rgba(37,99,235,.22)}.line-add-btn:focus{outline:none;box-shadow:0 0 0 3px rgba(37,99,235,.3)}.chip{border:1px solid var(--border);background:#fff;color:#334155;padding:4px 10px;border-radius:999px;font-size:12px;cursor:pointer}.chip.active{background:#eef2ff;color:#3730a3;border-color:#e0e7ff}.cal-header{display:flex;align-items:center;gap:8px;padding:6px 8px}.cal-title{font-weight:800;font-size:16px}.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);grid-gap:8px;gap:8px;padding:12px}.cal-dow{text-align:center;font-size:12px;color:#475569;font-weight:700;padding:4px;text-transform:uppercase;letter-spacing:.02em}.cal-day{min-height:120px;background:#fff;border:1px solid var(--border);border-radius:12px;padding:8px;display:grid;grid-template-rows:auto 1fr;grid-gap:6px;gap:6px;box-shadow:0 1px 2px rgba(16,24,40,.04);transition:background .15s ease,border-color .15s ease}.cal-day:hover{background:#f8fafc}.cal-day.muted{background:#f1f5f9;border-color:#e5e7eb}.cal-day.muted .cal-date{color:#94a3b8}.cal-day.muted .cal-event{opacity:.65}.cal-day.today{border-color:#93c5fd;box-shadow:inset 0 0 0 2px rgba(59,130,246,.15)}.cal-day.today .cal-date{color:#1d4ed8;background:#dbeafe;border-radius:6px;padding:2px 6px;display:inline-block;font-weight:800}.cal-date{font-size:12px;color:#64748b;font-weight:700}.cal-events{display:grid;grid-gap:4px;gap:4px}.cal-event{font-size:11px;display:grid;grid-template-columns:auto 1fr;align-items:center;grid-gap:6px;gap:6px;padding:4px 6px;border-radius:6px;border:1px solid var(--border);background:#f8fafc;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cal-event .cal-amt{font-weight:800}.cal-event .cal-label{color:#334155;overflow:hidden;text-overflow:ellipsis}.cal-event.type-prepay{background:#ecfccb;border-color:#d9f99d;color:#365314}.cal-event.type-deposit{background:#fef9c3;border-color:#fde68a;color:#854d0e}.cal-event.type-balance{background:#e0e7ff;border-color:#c7d2fe;color:#3730a3}.cal-legend{display:flex;gap:12px;padding:8px;color:#475569;font-size:12px}.legend-item{display:inline-flex;align-items:center;gap:6px}.swatch{width:12px;height:12px;border-radius:3px;display:inline-block;border:1px solid var(--border)}.swatch.type-prepay{background:#ecfccb;border-color:#d9f99d}.swatch.type-deposit{background:#fef9c3;border-color:#fde68a}.swatch.type-balance{background:#e0e7ff;border-color:#c7d2fe}