:root{color-scheme:light;--background:#f4f7fb;--surface:#ffffff;--surface-soft:#f8fafc;--surface-hover:#f2f4f7;--border:#e4e7ec;--border-strong:#d0d5dd;--text:#101828;--text-soft:#344054;--muted:#667085;--primary:#2563eb;--primary-dark:#1d4ed8;--danger:#dc2626;--danger-dark:#b91c1c;--green:#067647;--amber:#9a6700;--shadow:rgba(16,24,40,0.08);--chart-grid:#e4e7ec;--chart-sales:#2563eb;--chart-expenses:#ef4444;--chart-profit:#10b981}html[data-theme=dark]{color-scheme:dark;--background:#0b1120;--surface:#111827;--surface-soft:#182235;--surface-hover:#202c42;--border:#273449;--border-strong:#3b4a61;--text:#f8fafc;--text-soft:#d0d8e5;--muted:#94a3b8;--primary:#3b82f6;--primary-dark:#2563eb;--danger:#ef4444;--danger-dark:#dc2626;--green:#34d399;--amber:#fbbf24;--shadow:rgba(0,0,0,0.35);--chart-grid:#273449;--chart-sales:#60a5fa;--chart-expenses:#fb7185;--chart-profit:#34d399}*{box-sizing:border-box}body,html{margin:0;min-width:320px;min-height:100%;background:var(--background);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}button,input,select{font:inherit}button{cursor:pointer}.app-shell{min-height:100vh}.topbar{height:72px;background:var(--surface);border-bottom:1px solid var(--border);justify-content:space-between;padding:0 32px;position:-webkit-sticky;position:sticky;top:0;z-index:20}.brand,.topbar{display:flex;align-items:center}.brand{gap:12px}.brand>div:last-child{display:flex;flex-direction:column}.brand span{color:var(--muted);font-size:12px}.logo{width:54px;height:54px;display:grid;place-items:center;border-radius:17px;color:white;background:linear-gradient(145deg,#2563eb,#1d4ed8);font-weight:800;box-shadow:0 14px 30px rgba(37,99,235,.25)}.logo.small{width:42px;height:42px;border-radius:13px}.action-row,.row-actions,.topbar-actions{display:flex;align-items:center;gap:10px}.demo-badge{color:#9a3412;background:#fff7ed;border-radius:999px;padding:8px 11px;font-size:13px}.page-content{max-width:1450px;margin:0 auto;padding:32px}.month-navigation{display:flex;justify-content:center;align-items:center;gap:22px;margin-bottom:24px}.month-navigation>div{min-width:230px;text-align:center}.month-navigation span{color:var(--muted);font-size:13px}.month-navigation h1{margin:4px 0 0;text-transform:capitalize;font-size:28px}.stats-grid{display:grid;grid-template-columns:repeat(5,1fr);grid-gap:14px;gap:14px}.stats-grid article{background:var(--surface);border:1px solid var(--border);border-radius:17px;padding:20px;box-shadow:0 4px 14px rgba(16,24,40,.04)}.stats-grid article span{display:block;color:var(--muted);font-size:13px;margin-bottom:10px}.stats-grid article strong{font-size:24px}.expense-card{border-top:4px solid #ef4444!important}.friend-card{border-top:4px solid #f59e0b!important}.mine-card{border-top:4px solid #10b981!important}.action-row{margin:24px 0}.button{min-height:42px;padding:10px 16px;border:0;border-radius:11px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:8px}.button.primary{background:var(--primary);color:white}.button.primary:hover{background:var(--primary-dark)}.button.danger{background:var(--danger);color:white}.button.danger:hover{background:var(--danger-dark)}.button.secondary{background:#f2f4f7;color:#344054}.button.full{width:100%}.icon-button{width:42px;height:42px;border:1px solid #d0d5dd;border-radius:12px;background:white;display:inline-grid;place-items:center;color:#344054}.icon-button:hover{background:#f9fafb}.icon-button.tiny{width:32px;height:32px;border-radius:9px}.icon-button.delete{color:#b42318}.table-card{background:var(--surface);border:1px solid var(--border);border-radius:18px;overflow:hidden;box-shadow:0 5px 20px rgba(16,24,40,.04)}.table-heading{padding:20px 22px;border-bottom:1px solid #eaecf0}.table-heading h2{margin:0;font-size:18px}.table-heading span{color:var(--muted);font-size:13px}.table-scroll{overflow-x:auto}table{width:100%;border-collapse:collapse;min-width:1120px}th{padding:13px 15px;background:#f9fafb;border-bottom:1px solid #eaecf0;color:var(--muted);text-align:left;font-size:12px}td{padding:14px 15px;border-bottom:1px solid #f0f2f5;font-size:14px}tbody tr.sale{box-shadow:inset 4px 0 #22c55e;background:#fbfffc}tbody tr.expense{box-shadow:inset 4px 0 #ef4444;background:#fffdfd}td small{display:block;color:var(--muted);margin-top:4px}.type-badge{display:inline-flex;border-radius:999px;padding:5px 9px;font-size:12px;font-weight:700}.type-badge.sale{color:#067647;background:#ecfdf3}.type-badge.expense{color:#b42318;background:#fef3f2}.positive{color:#067647;font-weight:800}.negative{color:#b42318;font-weight:800}tfoot td{font-weight:800;background:#f9fafb;border-top:2px solid #d0d5dd}.empty-cell{text-align:center;color:var(--muted);padding:42px}.modal-backdrop{position:fixed;inset:0;background:rgba(16,24,40,.58);display:grid;place-items:center;z-index:50;padding:18px}.modal-card{width:min(560px,100%);background:var(--surface);border-radius:22px;padding:28px;position:relative;max-height:95vh;overflow-y:auto;box-shadow:0 30px 80px rgba(16,24,40,.3)}.close-button{position:absolute;top:18px;right:18px}.modal-symbol{width:48px;height:48px;display:grid;place-items:center;border-radius:14px}.modal-symbol.green{color:#067647;background:#ecfdf3}.modal-symbol.red{color:#b42318;background:#fef3f2}.modal-card h2{margin:14px 0 22px}label{display:flex;flex-direction:column;gap:7px;margin-bottom:16px;color:#344054;font-size:13px;font-weight:700}input,select{width:100%;min-height:43px;padding:9px 12px;border:1px solid #d0d5dd;border-radius:10px;color:var(--text);background:white}input:focus,select:focus{outline:3px solid rgba(37,99,235,.12);border-color:var(--primary)}.form-row{display:grid;grid-template-columns:1fr 1fr;grid-gap:12px;gap:12px}.printer-buttons{display:grid;grid-template-columns:repeat(3,1fr);grid-gap:8px;gap:8px}.printer-buttons button{padding:11px;border:1px solid #d0d5dd;border-radius:10px;background:white}.printer-buttons button.selected{color:#1d4ed8;background:#eff6ff;border-color:#2563eb;font-weight:800}.preview-grid{display:grid;grid-template-columns:repeat(3,1fr);grid-gap:10px;gap:10px;background:#f8fafc;border-radius:14px;padding:14px;margin:4px 0 18px}.preview-grid div{display:flex;flex-direction:column;gap:4px}.preview-grid span{color:var(--muted);font-size:12px}.preview-grid strong{font-size:16px}.loading-page,.login-page{min-height:100vh;display:grid;place-items:center;padding:20px;background:radial-gradient(circle at top,#eaf2ff,#f4f7fb 48%)}.login-card{width:min(420px,100%);background:var(--surface);border:1px solid var(--border);border-radius:24px;padding:34px;box-shadow:0 30px 70px rgba(16,24,40,.12)}.login-card h1{margin:18px 0 5px}.login-card p{color:var(--muted);margin:0 0 25px}.error-box{margin-top:12px;color:#b42318;background:#fef3f2;border-radius:10px;padding:10px;font-size:13px}@media (max-width:1050px){.stats-grid{grid-template-columns:repeat(2,1fr)}.stats-grid article:last-child{grid-column:span 2}}@media (max-width:650px){.topbar{padding:0 15px}.page-content{padding:20px 14px}.demo-badge{display:none}.stats-grid{grid-template-columns:1fr 1fr;gap:10px}.stats-grid article{padding:15px}.stats-grid article strong{font-size:19px}.action-row{display:grid;grid-template-columns:1fr 1fr}.form-row{gap:0}.form-row,.preview-grid{grid-template-columns:1fr}.month-navigation{gap:10px}.month-navigation>div{min-width:170px}}.page-error{margin:18px 0 0;padding:12px 14px;color:#b42318;background:#fef3f2;border:1px solid #fecdca;border-radius:12px;font-size:14px}.confirm-card{width:min(430px,100%);background:var(--surface);border-radius:22px;padding:28px;box-shadow:0 30px 80px rgba(16,24,40,.3)}.confirm-icon{width:48px;height:48px;display:grid;place-items:center;border-radius:14px;color:#b42318;background:#fef3f2}.confirm-card h2{margin:16px 0 8px}.confirm-card p{margin:0;color:var(--muted);line-height:1.55}.confirm-card p strong{color:var(--text)}.confirm-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:24px}.debug-page{min-height:100vh;padding:32px;max-width:1180px;margin:0 auto;color:#172033}.debug-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:24px}.debug-header h1{margin:8px 0 4px;font-size:32px}.debug-header p{margin:0;color:#667085}.debug-back{color:#2563eb;text-decoration:none;font-weight:700}.debug-refresh{border:0;border-radius:10px;padding:12px 18px;background:#2563eb;color:white;font-weight:800;cursor:pointer}.debug-refresh:disabled{opacity:.65;cursor:wait}.debug-summary{display:flex;flex-direction:column;gap:4px;padding:18px 20px;border-radius:14px;margin-bottom:20px;border:1px solid}.debug-summary.ok{background:#ecfdf3;border-color:#75d6a0;color:#05603a}.debug-summary.bad{background:#fff1f2;border-color:#fda4af;color:#9f1239}.debug-summary strong{font-size:18px}.debug-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-gap:18px;gap:18px}.debug-card{background:#fff;border:1px solid #dfe5ee;border-radius:14px;padding:20px;box-shadow:0 8px 24px rgba(15,23,42,.06)}.debug-card h2{margin:0 0 16px;font-size:19px}.debug-card code{display:block;overflow-wrap:anywhere;background:#f5f7fa;border-radius:8px;padding:9px 11px;margin:8px 0 14px;font-size:13px}.debug-card p{color:#475467;line-height:1.45}.debug-card small{display:block;color:#667085;margin-top:-8px;margin-bottom:18px}.debug-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 0;border-bottom:1px solid #eef1f5}.debug-status{white-space:nowrap;font-weight:900;font-size:12px}.debug-status.ok{color:#067647}.debug-status.bad{color:#c01048}.debug-warning{padding:10px;background:#fff7ed;color:#9a3412!important;border-radius:8px}.debug-error{border-color:#fda4af;color:#9f1239;margin-bottom:20px}.debug-raw{margin-top:18px;background:#0f172a;color:#e2e8f0;border-radius:14px;padding:14px 18px}.debug-raw summary{cursor:pointer;font-weight:800}.debug-raw pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}@media (max-width:760px){.debug-page{padding:18px}.debug-header{flex-direction:column}.debug-grid{grid-template-columns:1fr}.debug-refresh{width:100%}}html{transition:background-color .18s ease,color .18s ease}.confirm-card,.dashboard-panel,.dashboard-stat-card,.login-card,.modal-card,.table-card,.topbar,body,button,input,select{transition:background-color .18s ease,border-color .18s ease,color .18s ease,box-shadow .18s ease}.theme-toggle{flex:0 0 auto}.button.secondary{background:var(--surface-hover);color:var(--text-soft)}.icon-button{border-color:var(--border-strong);background:var(--surface);color:var(--text-soft)}.icon-button:hover{background:var(--surface-hover)}.table-heading,tfoot td,th{border-color:var(--border)}tfoot td,th{background:var(--surface-soft)}td{border-color:var(--border)}tbody tr.sale{background:color-mix(in srgb,var(--surface) 94%,#22c55e 6%)}tbody tr.expense{background:color-mix(in srgb,var(--surface) 94%,#ef4444 6%)}label{color:var(--text-soft)}.printer-buttons button,input,select{border-color:var(--border-strong);color:var(--text);background:var(--surface)}.printer-buttons button.selected{color:#60a5fa;background:color-mix(in srgb,var(--surface) 82%,#2563eb 18%);border-color:var(--primary)}.preview-grid{background:var(--surface-soft)}.loading-page,.login-page{background:radial-gradient(circle at top,color-mix(in srgb,var(--primary) 16%,var(--background)),var(--background) 48%)}.error-box,.page-error{color:#fda4af;background:color-mix(in srgb,var(--surface) 82%,#ef4444 18%);border-color:color-mix(in srgb,var(--border) 65%,#ef4444 35%)}.demo-badge{color:var(--amber);background:color-mix(in srgb,var(--surface) 82%,#f59e0b 18%)}.modal-symbol.green,.type-badge.sale{color:var(--green);background:color-mix(in srgb,var(--surface) 82%,#10b981 18%)}.confirm-icon,.modal-symbol.red,.type-badge.expense{color:#fb7185;background:color-mix(in srgb,var(--surface) 82%,#ef4444 18%)}.positive{color:var(--green)}.negative{color:#fb7185}.dashboard{margin:0 0 26px}.dashboard-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:16px}.dashboard-heading span{color:var(--muted);font-size:13px}.dashboard-heading h2{margin:4px 0 0;font-size:22px;text-transform:capitalize}.dashboard-heading>svg{color:var(--primary)}.dashboard-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-gap:14px;gap:14px;margin-bottom:16px}.dashboard-stat-card{display:flex;align-items:center;gap:14px;min-width:0;padding:18px;background:var(--surface);border:1px solid var(--border);border-radius:17px;box-shadow:0 5px 20px var(--shadow)}.dashboard-stat-icon{width:42px;height:42px;flex:0 0 auto;display:grid;place-items:center;border-radius:13px;background:var(--surface-soft)}.dashboard-stat-card>div:last-child{min-width:0}.dashboard-stat-card span{display:block;margin-bottom:5px;color:var(--muted);font-size:12px}.dashboard-stat-card strong{display:block;overflow:hidden;color:var(--text);font-size:clamp(18px,2vw,24px);text-overflow:ellipsis;white-space:nowrap}.dashboard-stat-card.blue .dashboard-stat-icon{color:#60a5fa;background:color-mix(in srgb,var(--surface) 80%,#2563eb 20%)}.dashboard-stat-card.red .dashboard-stat-icon{color:#fb7185;background:color-mix(in srgb,var(--surface) 80%,#ef4444 20%)}.dashboard-stat-card.green .dashboard-stat-icon{color:#34d399;background:color-mix(in srgb,var(--surface) 80%,#10b981 20%)}.dashboard-stat-card.amber .dashboard-stat-icon{color:#fbbf24;background:color-mix(in srgb,var(--surface) 80%,#f59e0b 20%)}.dashboard-stat-card.purple .dashboard-stat-icon{color:#c084fc;background:color-mix(in srgb,var(--surface) 80%,#9333ea 20%)}.dashboard-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(300px,.85fr);grid-gap:16px;gap:16px}.dashboard-panel{min-width:0;padding:20px;background:var(--surface);border:1px solid var(--border);border-radius:18px;box-shadow:0 5px 20px var(--shadow)}.dashboard-panel-wide{min-height:390px}.dashboard-panel-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}.dashboard-panel-heading h3{margin:0;font-size:17px}.dashboard-panel-heading span{display:block;margin-top:4px;color:var(--muted);font-size:12px}.dashboard-chart{width:100%;height:310px}.dashboard-chart.pie{height:215px}.dashboard-chart.small{height:235px}.dashboard-empty{min-height:180px;display:grid;place-items:center;padding:24px;color:var(--muted);text-align:center}.dashboard-legend{display:grid;grid-gap:8px;gap:8px;margin-top:4px}.dashboard-legend>div{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;grid-gap:9px;gap:9px;font-size:12px}.dashboard-legend-dot{width:9px;height:9px;border-radius:50%}.dashboard-legend span:nth-child(2){overflow:hidden;color:var(--muted);text-overflow:ellipsis;white-space:nowrap}.dashboard-summary-list{display:grid;grid-gap:1px;gap:1px;overflow:hidden;border:1px solid var(--border);border-radius:14px;background:var(--border)}.dashboard-summary-list>div{display:flex;justify-content:space-between;gap:18px;padding:14px;background:var(--surface-soft)}.dashboard-summary-list span{color:var(--muted);font-size:13px}.dashboard-summary-list strong{white-space:nowrap}.recharts-default-tooltip{box-shadow:0 14px 36px var(--shadow)}.recharts-legend-item-text,.recharts-text{color:var(--muted)!important;fill:var(--muted)}@media (max-width:1050px){.dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-grid{grid-template-columns:1fr}}@media (max-width:650px){.topbar-actions .button.secondary{width:42px;padding:0;font-size:0}.topbar-actions .button.secondary svg{width:18px;height:18px}.dashboard-stats{grid-template-columns:1fr}.dashboard-panel,.dashboard-stat-card{padding:15px}.dashboard-panel-wide{min-height:355px}.dashboard-chart{height:275px}.dashboard-chart.pie{height:200px}}