:root{--ink: #020833;--muted: #6b7688;--surface: #ffffff;--scaffold: #f7f9fb;--line: #e1e7f0;--line-soft: #e7ecf3;--primary: #28c7b7;--primary-soft: #ddf9f5;--secondary: #ffc53d;--tertiary: #5a8f3b;--danger: #b84e5a;--loan: #1d58b8;color:var(--ink);background:var(--scaffold);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-synthesis:none;text-rendering:optimizeLegibility}*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh;background:var(--scaffold)}a{color:inherit;text-decoration:none}button,input,select,textarea{font:inherit}button{cursor:pointer}.center-page,.login-page{min-height:100vh;display:grid;place-items:center;padding:24px}.login-panel{width:min(440px,100%);background:var(--surface);border:1px solid var(--line);border-radius:22px;padding:28px;box-shadow:0 18px 50px #0208331a}.login-panel h1{margin:14px 0 8px}.login-panel p{color:var(--muted);line-height:1.6}.loading-state{position:relative;display:grid;justify-items:center;gap:14px;color:var(--ink);font-weight:900}.loading-mark{width:68px;height:68px;overflow:hidden;border-radius:22px;box-shadow:0 18px 36px #28c7b733}.loading-mark img{display:block;width:100%;height:100%;object-fit:cover}.loading-ring{position:absolute;top:-8px;width:84px;height:84px;border:4px solid var(--primary-soft);border-top-color:var(--primary);border-radius:50%;animation:spin .85s linear infinite}.loading-state p{margin:8px 0 0;color:var(--muted)}@keyframes spin{to{transform:rotate(360deg)}}.brand-mark,.brand span{width:42px;height:42px;display:inline-grid;place-items:center;border-radius:15px;background:var(--secondary);color:var(--ink);font-weight:900;overflow:hidden;flex:0 0 42px}.brand-mark img,.brand span img,.mobile-brand img{display:block;width:100%;height:100%;object-fit:cover}.app-shell{min-height:100vh;display:grid;grid-template-columns:244px 1fr}.mobile-topbar,.menu-scrim,.sidebar-close,.mobile-actions{display:none}.sidebar{position:sticky;top:0;height:100vh;padding:16px;background:var(--surface);border-right:1px solid var(--line);display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:10px;margin-bottom:18px;padding:14px;border-radius:22px;color:var(--surface);background:linear-gradient(135deg,#020833,#0d5b68,#28c7b7);box-shadow:0 18px 36px #28c7b72e}.brand strong{font-size:18px}.sidebar-close{margin-left:auto}.sidebar nav{display:grid;gap:8px}.sidebar button,.sidebar-links a,.ghost-button,.icon-button,.primary-button{border:0;border-radius:18px;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:42px;padding:0 14px;font-weight:800}.sidebar button{justify-content:flex-start;color:#4e5c70;background:transparent;position:relative}.sidebar button.active{color:var(--ink);background:var(--primary-soft)}.sidebar button.active:before{content:"";position:absolute;left:6px;width:4px;height:24px;border-radius:99px;background:var(--primary)}.sidebar-links{display:grid;gap:8px;margin-top:auto;padding-top:18px}.sidebar-links a{justify-content:flex-start;min-height:42px;color:var(--ink);background:var(--primary-soft)}.sidebar-links a:last-child{min-height:60px;color:var(--ink);background:var(--secondary);box-shadow:0 12px 28px #ffc53d38}.sidebar-links a:last-child span{display:grid;gap:2px;line-height:1.05}.sidebar-links a:last-child small{font-size:11px;font-weight:800;opacity:.9}.google-play-icon{width:30px;height:30px;flex:0 0 30px;padding:5px;border-radius:50%;background:#fff}main{min-height:100vh;padding:22px;background:var(--scaffold);display:flex;flex-direction:column}.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}.topbar h1{margin:0}.topbar h1{font-size:34px;line-height:1.15;font-weight:900}.topbar-actions,.toolbar,.entry-actions{display:flex;align-items:center;gap:10px}.account-menu{position:relative}.profile-button{width:44px;height:44px;padding:0;display:grid;place-items:center;overflow:hidden;border:2px solid var(--line-soft);border-radius:50%;background:var(--surface)}.profile-button img{width:100%;height:100%;object-fit:cover}.profile-button span{width:100%;height:100%;display:grid;place-items:center;color:var(--secondary);background:var(--ink);font-weight:900}.account-popover{position:absolute;top:calc(100% + 10px);right:0;z-index:5;width:260px;padding:10px;border:1px solid var(--line);border-radius:18px;background:var(--surface);box-shadow:0 18px 50px #0208331f}.account-info{padding:8px 8px 10px;border-bottom:1px solid var(--line-soft)}.account-info strong,.account-info span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account-info span{margin-top:3px;color:var(--muted);font-size:13px}.logout-menu-button{width:100%;min-height:42px;margin-top:8px;padding:0 10px;display:flex;align-items:center;justify-content:flex-start;gap:8px;border:0;border-radius:16px;color:var(--danger);background:#fff4f5;font-weight:800}.topbar select{min-height:42px;border:1px solid var(--line);border-radius:18px;padding:0 10px;background:var(--surface)}.ledger-selector{display:grid;gap:6px;min-width:min(430px,48vw)}.ledger-tabs{min-height:42px;padding:4px;display:grid;grid-template-columns:1fr 1fr;gap:4px;border:1px solid var(--line);border-radius:18px;background:var(--surface)}.ledger-tabs button{position:relative;min-width:0;min-height:32px;padding:0 12px;border:0;border-radius:14px;color:#4e5c70;background:transparent;font-weight:900;white-space:nowrap}.ledger-tabs button.active{color:var(--ink);background:var(--primary-soft)}.ledger-tabs button:disabled{cursor:not-allowed;opacity:.45}.new-dot{width:9px;height:9px;margin-left:6px;display:inline-block;border-radius:50%;background:var(--danger);box-shadow:0 0 0 3px #b84e5a1f}.ledger-caption{padding:0 8px;color:var(--muted);font-size:13px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.primary-button{color:var(--ink);background:var(--primary)}.add-entry-button{width:48px;min-width:48px;height:46px;padding:0;border-radius:16px}.ghost-button{color:var(--ink);background:var(--surface);border:1px solid var(--line-soft)}.icon-button{width:42px;padding:0;color:var(--ink);background:var(--surface);border:1px solid var(--line-soft)}.icon-button.danger{color:var(--danger)}.metrics-grid{display:grid;grid-template-columns:1.4fr repeat(4,1fr);gap:12px;margin:0 0 16px}.metric{min-height:92px;padding:16px;border:1px solid var(--line);border-radius:22px;background:var(--surface);box-shadow:0 10px 22px #0208330a;position:relative;overflow:hidden}.metric.primary{color:var(--surface);background:linear-gradient(135deg,#020833,#0d5b68,#28c7b7);border-color:transparent;box-shadow:0 18px 36px #28c7b738}.metric.income{background:#f0f8eb;border-color:#d9ebcf}.metric.expense{background:#fff3f4;border-color:#f4d5d9}.metric.udhari{background:#fff8e3;border-color:#ffeab0}.metric.loan{background:#eef3ff;border-color:#d8e3ff}.metric span{display:block;margin-bottom:8px;color:inherit;opacity:.75;font-size:13px;font-weight:800}.metric strong{font-size:21px;line-height:1.1}.metric.income strong{color:var(--tertiary)}.metric.expense strong{color:var(--danger)}.metric.udhari strong{color:#986f00}.metric.loan strong{color:var(--loan)}.toolbar{justify-content:space-between;margin-bottom:14px}.search-box{flex:1;min-height:46px;display:flex;align-items:center;gap:10px;padding:0 14px;border:1px solid var(--line);border-radius:18px;background:var(--surface)}.search-box input{width:100%;border:0;outline:0}.month-list{display:grid;gap:10px}details{background:var(--surface);border:1px solid var(--line);border-radius:22px;overflow:hidden;box-shadow:0 10px 22px #0208330a}summary{min-height:58px;padding:0 16px;display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;font-weight:900}summary span{display:inline-flex;align-items:center;gap:10px}summary small{color:var(--muted)}.entry-list{border-top:1px solid var(--line-soft)}.entry-row{display:grid;grid-template-columns:1fr auto;align-items:center;gap:14px;min-height:74px;padding:12px 16px;border-left:5px solid #8492a6;border-bottom:1px solid #eef3f8}.entry-row:last-child{border-bottom:0}.entry-row.expense{border-left-color:var(--danger)}.entry-row.income{border-left-color:var(--tertiary)}.entry-row.udhari{border-left-color:var(--secondary)}.entry-row.loanDebt{border-left-color:var(--loan)}.entry-row strong,.entry-row span{display:block}.entry-row span{margin-top:3px;color:var(--muted);font-size:14px}.entry-actions b{min-width:112px;text-align:right}.empty-state,.error{padding:24px;border:1px solid var(--line);border-radius:22px;background:var(--surface);color:var(--muted);font-weight:800}.error{margin-bottom:14px;color:var(--danger);border-color:#f2cbd0;background:#fff4f5}.modal-backdrop{position:fixed;inset:0;display:grid;place-items:center;padding:20px;background:#0d15246b;z-index:50}.modal{width:min(760px,100%);max-height:min(90vh,760px);overflow:auto;border-radius:22px;background:var(--surface);border:1px solid var(--line);padding:18px;box-shadow:0 22px 80px #02083333}.modal.small{width:min(460px,100%)}.modal header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.modal h2{margin:0}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:16px}.field{display:grid;gap:6px}.field span{color:#4e5c70;font-size:13px;font-weight:800}.field input,.field select,.field textarea{width:100%;min-height:42px;border:1px solid var(--line);border-radius:18px;padding:9px 10px;background:var(--surface)}.field textarea{min-height:84px;resize:vertical}.modal-actions{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center}.modal-actions .ghost-button{min-width:120px}.site-footer{display:flex;justify-content:space-between;gap:16px;margin-top:auto;padding:18px 4px 4px;color:var(--muted);font-size:13px;line-height:1.55}.site-footer span:last-child{text-align:right}.site-footer a{color:var(--ink);font-weight:800}.back-to-top{position:fixed;right:24px;bottom:24px;z-index:8;width:48px;height:48px;display:grid;place-items:center;border:0;border-radius:16px;color:var(--ink);background:var(--secondary);box-shadow:0 18px 36px #0208332e;opacity:0;pointer-events:none;transform:translateY(12px);transition:opacity .18s ease,transform .18s ease}.back-to-top.is-visible{opacity:1;pointer-events:auto;transform:translateY(0)}@media(max-width:980px){.app-shell{grid-template-columns:1fr;padding-top:72px}.mobile-topbar{position:fixed;inset:0 0 auto;z-index:20;min-height:72px;display:grid;grid-template-columns:44px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 14px;background:#f7f9fbf0;border-bottom:1px solid var(--line);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px)}.mobile-brand{display:flex;align-items:center;gap:10px;min-width:0;font-weight:900}.mobile-brand img{width:42px;height:42px;border-radius:14px;flex:0 0 42px}.mobile-brand strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-actions{display:flex;align-items:center;gap:8px}.sidebar{position:fixed;inset:0 auto 0 0;z-index:30;width:min(320px,86vw);height:100vh;border-right:1px solid var(--line);border-bottom:0;transform:translate(-105%);transition:transform .18s ease;box-shadow:0 24px 70px #02083329}.menu-open .sidebar{transform:translate(0)}.menu-scrim{position:fixed;inset:0;z-index:25;border:0;background:#0208335c;opacity:0;pointer-events:none;transition:opacity .18s ease}.menu-open .menu-scrim{display:block;opacity:1;pointer-events:auto}.sidebar-close{display:inline-grid;place-items:center;width:36px;height:36px;border:0;border-radius:14px;color:var(--surface);background:#ffffff1f}.sidebar nav{grid-template-columns:1fr}.sidebar-links{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:12px;padding-top:12px;border-top:1px solid #e7edf5}.sidebar button{justify-content:flex-start}.metrics-grid{grid-template-columns:repeat(2,1fr)}.desktop-only{display:none!important}}@media(max-width:700px){main{padding:14px}.topbar,.entry-row{align-items:stretch;flex-direction:column;display:flex}.topbar{margin-bottom:10px}.topbar h1{font-size:30px}.toolbar{display:grid;grid-template-columns:minmax(0,1fr) 48px;align-items:center;gap:10px;margin-bottom:12px}.topbar-actions{flex-wrap:wrap}.ledger-selector{width:100%;min-width:0}.topbar-actions select,.ledger-selector select,.search-box,.ghost-button{width:100%}.metrics-grid,.form-grid,.modal-actions{grid-template-columns:1fr}.entry-actions{justify-content:space-between}.entry-actions b{min-width:0}.site-footer{flex-direction:column}.site-footer span:last-child{text-align:left}}
