:root{--bg:#f6f8ff;--surface:#fff;--ink:#151d3e;--muted:#7d859b;--primary:#4855d9;--primary2:#6975e9;--green:#078052;--green-bg:#e6f7ef;--red:#d73449;--red-bg:#fff0f1;--orange:#af6a12;--orange-bg:#fff3d9;--line:#e9edf6;--shadow:0 9px 25px rgba(31,45,111,.045);--radius:20px;--safe-bottom:env(safe-area-inset-bottom,0px)}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html{background:var(--bg);scroll-behavior:smooth}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Arial,sans-serif;font-size:14px;color:var(--ink);-webkit-font-smoothing:antialiased;background:var(--bg);min-height:100vh;line-height:1.42}
button,input,textarea,select{font:inherit}
button{cursor:pointer}
button:disabled{opacity:.45;cursor:default}
input,select,textarea{color:var(--ink)}
svg{flex:none}
#app{max-width:620px;margin:0 auto;padding-bottom:calc(102px + var(--safe-bottom));min-height:100vh;background:var(--bg)}
.main{padding:0 17px 22px}
.topbar{padding:21px 18px 12px;background:radial-gradient(circle at 100% 0%,#dee5ff 0,#edf0ff 18%,transparent 54%);display:flex;align-items:center;justify-content:space-between;gap:9px}
.brand{display:flex;align-items:center;gap:11px;min-width:0}
.brand-logo{width:43px;height:43px;border-radius:13px;background:linear-gradient(145deg,#7587ed,#3641bd);display:grid;place-items:center;box-shadow:0 7px 14px #525bdc26;color:white}
.brand-name{font-size:20px;font-weight:820;letter-spacing:-.6px;white-space:nowrap}
.brand-caption{font-size:11px;color:var(--muted);margin-top:2px}
.header-actions{display:flex;gap:7px;align-items:center}
.icon-btn{background:#fff;border:1px solid #e8eaf5;color:var(--ink);border-radius:12px;width:38px;height:38px;display:grid;place-items:center;box-shadow:0 2px 9px #31398408}
.icon-btn:active,.btn:active,.nav-item:active,.pressable:active{transform:scale(.98)}
.period-bar{display:flex;align-items:center;gap:8px;padding:5px 18px 16px}
.period{border:1px solid #e0e4f7;border-radius:15px;background:#fff;display:flex;align-items:center;justify-content:space-between;min-height:43px;flex:1;min-width:0}
.period button{border:0;background:transparent;color:#434f80;width:42px;height:40px;display:grid;place-items:center}
.period-label{font-weight:780;font-size:14px}
.currency-picker{border:1px solid #e0e4f7;background:#fff;border-radius:13px;height:43px;min-width:72px;padding:0 7px;font-size:12px;font-weight:780;color:#3d47a2}
.section-note{font-size:11px;color:var(--muted);margin-bottom:11px;line-height:1.5}
.section-header{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:13px}
.section-header h2{font-size:18px;letter-spacing:-.4px;margin:0;font-weight:800}
.section-action{border:0;background:transparent;color:var(--primary);font-weight:740;font-size:12px;padding:0;white-space:nowrap}
.summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:18px}
.summary-card{border-radius:18px;padding:14px 12px;min-height:119px;position:relative;overflow:hidden;display:flex;flex-direction:column;justify-content:space-between}
.summary-card::after{content:"";position:absolute;width:85px;height:85px;border-radius:50%;background:#fff6;right:-40px;top:-44px}
.summary-card.green{background:linear-gradient(128deg,#e9f9f1,#f0fcf7)}
.summary-card.red{background:linear-gradient(128deg,#fff0f1,#fff5f5)}
.summary-card.blue{background:linear-gradient(128deg,#f0f1ff,#f6f6ff)}
.summary-card.yellow{background:linear-gradient(128deg,#fff7e8,#fffaef)}
.summary-title{font-size:12px;color:#4b5671;font-weight:700;display:flex;align-items:center;gap:7px}
.summary-icon{width:27px;height:27px;border-radius:9px;display:grid;place-items:center;background:#fff9}
.summary-amount{font-size:24px;font-weight:850;letter-spacing:-1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.summary-card.green .summary-amount,.summary-card.green .summary-icon{color:var(--green)}
.summary-card.red .summary-amount,.summary-card.red .summary-icon{color:var(--red)}
.summary-card.blue .summary-amount,.summary-card.blue .summary-icon{color:var(--primary)}
.summary-card.yellow .summary-amount,.summary-card.yellow .summary-icon{color:var(--orange)}
.panel{background:#fff;border:1px solid #edf0f8;border-radius:20px;padding:17px 15px;box-shadow:var(--shadow);margin-bottom:13px}
.panel.flat{box-shadow:none}
.list-row{display:flex;align-items:center;gap:10px;width:100%;padding:11px 0;border:0;border-bottom:1px solid var(--line);background:transparent;text-align:left;color:inherit}
.list-row:last-child{border-bottom:0;padding-bottom:3px}
.list-row:first-of-type{padding-top:0}
.row-icon{display:grid;place-items:center;flex:0 0 38px;height:38px;border-radius:13px;color:var(--primary);background:#f0f2ff}
.row-icon.red{color:var(--red);background:#fff0f2}
.row-icon.green{color:var(--green);background:#e9f8ef}
.row-icon.orange{color:var(--orange);background:#fff7e6}
.row-content{flex:1;min-width:0}
.row-title{font-size:13.5px;font-weight:760;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row-sub{color:var(--muted);font-size:11px;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row-right{display:flex;gap:6px;align-items:center;flex:none;max-width:50%}
.row-amount{font-size:14px;font-weight:790;white-space:nowrap}
.positive{color:var(--green)}
.negative{color:var(--red)}
.neutral{color:var(--ink)}
.chev{color:#a9b0c4}
.pill{font-size:10px;border-radius:999px;background:#edf0fd;color:#525d9c;padding:5px 8px;font-weight:770;white-space:nowrap;display:inline-flex;align-items:center;gap:4px}
.pill.green{background:#e4f6ec;color:var(--green)}
.pill.red{background:#fff0f1;color:var(--red)}
.pill.yellow{background:#fff2d9;color:#95611c}
.pill.grey{background:#f0f2f6;color:#687187}
.empty{padding:25px 12px 20px;text-align:center;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:8px}
.empty .empty-icon{width:54px;height:54px;border-radius:20px;background:#f0f2ff;color:var(--primary);display:grid;place-items:center}
.empty strong{color:var(--ink);font-size:14px}
.empty p{font-size:12px;max-width:290px;margin:0 0 6px}
.btn{display:inline-flex;justify-content:center;align-items:center;gap:7px;border-radius:13px;border:1px solid transparent;min-height:42px;padding:10px 15px;font-weight:760;transition:.15s;white-space:nowrap}
.btn.primary{background:var(--primary);color:#fff;box-shadow:0 6px 15px #4a56dc24}
.btn.secondary{background:#f0f2ff;color:#4c57bd}
.btn.outline{background:#fff;border-color:#e3e7f2;color:#394268}
.btn.danger{background:#fff0f1;color:#c52337}
.btn.small{min-height:34px;font-size:12px;padding:7px 11px;border-radius:10px}
.btn.full{width:100%}
.bottom-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:620px;padding:9px 8px calc(9px + var(--safe-bottom));background:#fffdfdf7;backdrop-filter:blur(15px);border-top:1px solid #e8ecf7;z-index:30;display:flex;justify-content:space-between;gap:2px;box-shadow:0 -8px 25px #171d3a08}
.nav-item{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:0;background:transparent;color:#8c94a7;padding:8px 1px;border-radius:13px;font-size:10px;font-weight:750;line-height:1.25}
.nav-item.active{background:#eef0ff;color:var(--primary)}
.nav-item svg{width:20px;height:20px}
.fab{position:fixed;bottom:calc(84px + var(--safe-bottom));left:calc(50% + min(310px, 50vw) - 70px);z-index:31;height:57px;width:57px;border-radius:19px;background:linear-gradient(145deg,#6472ed,#3b45c4);border:0;display:grid;place-items:center;color:white;box-shadow:0 9px 24px #4a56d95b;transform:rotate(-1deg)}
.fab:active{transform:scale(.95)}
.page-title{font-size:23px;margin:7px 0 4px;letter-spacing:-.5px;font-weight:850}
.page-desc{color:var(--muted);margin:0 0 17px;font-size:12px}
.toolbar{display:flex;align-items:center;gap:8px;margin:8px 0 14px}
.search{position:relative;flex:1;display:flex;align-items:center}
.search svg{position:absolute;left:12px;color:#9199ab}
.search input{width:100%;border:1px solid #e4e8f3;background:#fff;border-radius:13px;padding:11px 10px 11px 35px;font-size:13px;outline:none;min-height:43px}
.search input:focus,.field input:focus,.field select:focus,.field textarea:focus{border-color:#8792ed;box-shadow:0 0 0 3px #5364f013}
.filter-chips{display:flex;gap:7px;overflow-x:auto;padding-bottom:9px;scrollbar-width:none}
.filter-chips::-webkit-scrollbar{display:none}
.chip{background:#fff;border:1px solid #e4e8f3;padding:8px 12px;white-space:nowrap;border-radius:999px;color:#6e768f;font-weight:730;font-size:11px}
.chip.active{background:#e9edff;border-color:#cbd2fd;color:var(--primary)}
.stats-strip{border-radius:15px;padding:12px 14px;background:#eef1ff;margin-bottom:13px;display:flex;justify-content:space-between;align-items:center;gap:7px}
.stats-strip strong{font-size:16px;color:#3342ae;white-space:nowrap}
.stats-strip small{font-size:11px;color:#59658d}
.mini-separator{height:1px;background:var(--line);margin:12px 0}
.detail-head{display:flex;gap:12px;align-items:center;margin-bottom:17px}
.detail-head h3{margin:0;font-size:18px}
.detail-head p{margin:3px 0 0;color:var(--muted);font-size:12px}
.detail-amount{font-size:34px;font-weight:850;letter-spacing:-1px}
.progress{height:9px;border-radius:100px;background:#ecf0f8;overflow:hidden;margin-top:8px}
.progress span{display:block;height:100%;background:linear-gradient(90deg,#6472e8,#22a47c);border-radius:100px;transition:width .2s}
.keyval{display:flex;align-items:start;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid var(--line);font-size:12px}
.keyval:last-of-type{border-bottom:0}
.keyval span{color:var(--muted)}
.keyval strong{text-align:right;font-weight:740;max-width:66%;overflow-wrap:anywhere}
.grid-2{display:grid;grid-template-columns:repeat(2,1fr);gap:9px}
.text-help{font-size:11px;color:var(--muted);margin:7px 0}
.block-subtitle{font-size:14px;font-weight:800;margin:17px 0 9px}
.chart{display:flex;align-items:end;justify-content:space-around;gap:11px;height:154px;margin:14px 0 2px;padding:0 4px}
.chart-group{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:end;gap:6px;min-width:0}
.chart-bars{height:124px;display:flex;gap:3px;align-items:end;justify-content:center;width:100%;border-bottom:1px solid #e2e7f0}
.chart-bar{width:15px;min-height:2px;border-radius:5px 5px 0 0;transition:.2s;max-width:40%}
.chart-bar.income{background:#54b38f}
.chart-bar.expense{background:#f29ba5}
.chart-lbl{font-size:10px;color:#7d859c;font-weight:700}
.legend{display:flex;align-items:center;gap:13px;font-size:11px;color:var(--muted);margin-top:9px}
.legend i{display:inline-block;width:9px;height:9px;border-radius:3px;margin-right:4px}
.note-box{border-radius:14px;padding:12px;background:#f1f3fe;font-size:12px;color:#586388;display:flex;gap:9px;line-height:1.55}
.note-box.warning{background:#fff4e5;color:#865822}
.settings-tile{display:flex;align-items:center;gap:13px;text-align:left;width:100%;border:0;background:#fff;padding:13px 0;border-bottom:1px solid var(--line);color:inherit}
.settings-tile:last-child{border-bottom:0}
.settings-tile .tile-body{flex:1;min-width:0}
.settings-tile strong{font-size:13px}
.settings-tile span{color:var(--muted);font-size:11px;display:block;margin-top:4px}
.modal-scrim{position:fixed;inset:0;background:#10172b84;z-index:80;display:flex;align-items:end;justify-content:center;overscroll-behavior:contain}
.modal{width:100%;max-width:620px;max-height:92dvh;overflow-y:auto;border-radius:25px 25px 0 0;background:#fff;box-shadow:0 -12px 40px #1a1d3a1f;padding:18px 18px calc(22px + var(--safe-bottom));-webkit-overflow-scrolling:touch}
.modal-top{display:flex;align-items:start;justify-content:space-between;gap:12px;margin-bottom:17px}
.modal-title{margin:0;font-size:20px;font-weight:850;letter-spacing:-.4px}
.modal-sub{font-size:12px;color:var(--muted);margin:4px 0 0}
.field{display:flex;flex-direction:column;gap:5px;margin:0 0 13px}
.field label{font-weight:740;font-size:12px;color:#36405d}
.field input,.field select,.field textarea{width:100%;border:1px solid #e0e5ef;border-radius:12px;background:#fcfdff;padding:12px;min-height:45px;font-size:14px;outline:0;appearance:auto}
.field textarea{resize:vertical;min-height:80px}
.field .hint{font-size:10px;color:var(--muted)}
.field .error{font-size:11px;color:var(--red)}
.segment{display:flex;border:1px solid #e2e7f3;border-radius:13px;padding:3px;background:#f6f8fe;margin:6px 0 17px;gap:4px}
.segment button{flex:1;padding:10px 4px;border:0;background:transparent;border-radius:10px;color:#7f879c;font-size:12px;font-weight:770}
.segment button.active{background:white;color:var(--primary);box-shadow:0 2px 8px #2f37650e}
.modal-actions{display:flex;gap:8px;margin-top:10px}
.modal-actions>.btn{flex:1}
#toast{position:fixed;bottom:calc(91px + var(--safe-bottom));left:50%;transform:translateX(-50%) translateY(15px);color:#fff;background:#253053;padding:12px 17px;max-width:calc(100vw - 36px);width:max-content;border-radius:13px;z-index:200;box-shadow:0 8px 28px #1f23402e;font-weight:700;font-size:12px;opacity:0;pointer-events:none;transition:.2s;text-align:center}
#toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.boot{min-height:80dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:#7a83a0}
.boot strong{font-size:22px;color:var(--ink)}
.boot-logo{display:grid;place-items:center;background:var(--primary);color:#fff;width:66px;height:66px;border-radius:20px;font-size:40px}
@media(min-width:700px){body{background:#e9edf7}#app{box-shadow:0 0 35px #1f2b5f12;min-height:100vh}.bottom-nav{box-shadow:0 -8px 25px #171d3a14}.fab{left:calc(50% + 240px)}}
@media(max-width:355px){.brand-name{font-size:18px}.summary-amount{font-size:20px}.summary-title{font-size:11px}.row-amount{font-size:12px}.row-title{font-size:12px}.pill{font-size:9px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
