:root{--bg:#f6f7f5;--paper:#fff;--ink:#202b29;--muted:#87908c;--line:#e9ede9;--green:#16634e;--green-light:#edf5ef;--orange:#d98a53;--purple:#8983b9;--red:#b94c47;--radius:15px;--font:Inter,"PingFang SC","Microsoft YaHei",system-ui,sans-serif}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.6 var(--font);-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
button,input,select,textarea,a{touch-action:manipulation}
button:disabled{cursor:not-allowed;opacity:.45}
button{color:inherit}
a{color:inherit;text-decoration:none}
svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.sprite{position:absolute;width:0;height:0;overflow:hidden}
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
button:focus-visible,a:focus-visible,summary:focus-visible,.drop-zone:focus-visible{outline:3px solid #8cc3ad;outline-offset:3px}
input:focus,select:focus,textarea:focus{outline:2px solid #99bbaa;outline-offset:1px}
h1,h2,h3,p{margin:0}
h2{font-size:16px;font-weight:650;letter-spacing:.1px}
h3{font-size:14px;font-weight:650}
.app-shell{min-height:100vh;display:grid;grid-template-columns:218px minmax(0,1fr)}
.sidebar{height:100vh;position:sticky;top:0;background:#fff;border-right:1px solid var(--line);padding:36px 22px 22px;display:flex;flex-direction:column}
.brand{display:flex;gap:11px;align-items:center;margin-bottom:50px;font-size:19px;font-weight:700;letter-spacing:1px}
.brand-mark{width:39px;height:42px;border-radius:11px;background:var(--green);color:#fff;display:grid;place-items:center}
.brand-mark svg{width:25px;height:25px}
.brand small{display:block;font-size:9px;color:#929a95;font-weight:400;letter-spacing:.5px;margin-top:2px}
.workspace-label{font-size:11px;color:#a0a7a1;margin:0 14px 13px;letter-spacing:1px}
.nav-item{border:0;background:none;text-align:left;display:flex;gap:12px;align-items:center;padding:13px 14px;border-radius:9px;margin-bottom:7px;font-size:13px;color:#737e77;width:100%}
.nav-item.active{background:var(--green-light);color:var(--green);font-weight:650}
.nav-item:hover{background:#f4f7f3}
.nav-dot{width:5px;height:5px;border-radius:50%;background:var(--green);margin-left:auto}
.sidebar-bottom{margin-top:auto;padding:22px 9px 0;border-top:1px solid var(--line);font-size:11px;color:#69786e}
.sidebar-bottom p{margin:10px 0 13px;color:#a0a7a1;font-size:10px;line-height:1.9}
.local-indicator,.status-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:#65a384;margin-right:6px}
.sidebar-bottom .text-btn{font-size:11px;color:#6a7b70}
main{min-width:0;padding:0 40px 20px;max-width:1760px;width:100%;margin:auto}
.topbar{height:76px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;font-size:11px;color:var(--muted)}
.breadcrumb{display:flex;gap:14px}
.breadcrumb span{color:#c3c9c3}
.breadcrumb strong{font-weight:500;color:#66746c}
.save-status{font-size:10px;display:flex;align-items:center}
.save-status.failed{color:var(--red)}
.save-status.failed .status-dot{background:var(--red)}
.page-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:32px 0 29px}
.eyebrow{font-size:10px;color:#819086;letter-spacing:1.5px;margin-bottom:6px}
h1{font-size:29px;font-weight:650;letter-spacing:1px;line-height:1.5}
.heading-dot{color:#4d9a79;margin-left:4px}
.page-heading p{font-size:11px;color:#8a958d;margin-top:5px}
.heading-actions{display:flex;gap:9px;align-items:center}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;background:#fff;border:1px solid #dde4dd;border-radius:8px;padding:9px 15px;font-size:12px;font-weight:500;white-space:nowrap;min-height:38px;transition:background .15s}
.btn svg{width:15px;height:15px}
.btn:hover{background:#f2f5f1}
.btn.primary{background:var(--green);border-color:var(--green);color:#fff;box-shadow:0 3px 7px #1b5d4110}
.btn.primary:hover{background:#104f3d}
.btn.danger{background:#b84b45;border-color:#b84b45;color:#fff}
.btn.small{padding:4px 10px;min-height:29px;font-size:11px}
.text-btn{padding:0;border:0;background:none;color:var(--green);font-size:11px;cursor:pointer;white-space:nowrap}
.text-btn:hover{text-decoration:underline}
.overview-filter{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:19px}
.section-mini{font-size:12px;font-weight:600;display:flex;align-items:center;gap:8px;white-space:nowrap}
.live-dot{width:6px;height:6px;border-radius:50%;background:var(--green)}
.date-controls{display:flex;align-items:center;gap:6px;font-size:10px;color:#97a097}
.date-controls input{background:#fff;border:1px solid #e0e6df;border-radius:6px;padding:5px 7px;color:#68756d;font-size:10px;min-width:0;width:116px}
.chip{background:transparent;border:0;color:#8b968d;font-size:10px;padding:5px 10px;border-radius:5px;white-space:nowrap}
.chip.selected{background:#e9efe7;color:#3c6b53;font-weight:600}
.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:23px}
.metric{padding:21px 22px 18px;background:#fff;border:1px solid var(--line);border-radius:var(--radius);position:relative;overflow:hidden;min-height:157px}
.metric-top{display:flex;align-items:center;justify-content:space-between;color:#78857c;font-size:11px;position:relative;z-index:1}
.metric-value{font-size:29px;font-variant-numeric:tabular-nums;letter-spacing:-.7px;font-weight:550;line-height:1.5;margin:12px 0 11px;white-space:nowrap;position:relative;z-index:1}
.metric-value.compact{font-size:21px}
.metric-foot{font-size:10px;color:#9aa39b;display:flex;align-items:center;gap:7px;position:relative;z-index:1}
.metric.balance-card{background:#175f4c;border-color:#175f4c;color:#fff}
.balance-card .metric-top{color:#c3d8cb}
.balance-card .metric-foot{color:#afc9bb}
.balance-card .metric-value{font-weight:500}
.metric-tag{font-size:8px;border:1px solid #ffffff2e;padding:0 5px;border-radius:4px;color:#d8e6dc}
.balance-art{position:absolute;border:1px solid #fff1;border-radius:50%;width:180px;height:180px;right:-80px;bottom:-110px;box-shadow:0 0 0 22px #ffffff04,0 0 0 43px #ffffff04}
.metric-icon{height:26px;width:26px;display:grid;place-items:center;border-radius:8px}
.metric-icon svg{width:15px;height:15px}
.green{background:#eff7f0;color:#5b9b77}
.orange{background:#fcf2e9;color:#d59058}
.purple{background:#f3f1f9;color:#8e83b6}
.chart-grid{display:grid;grid-template-columns:minmax(0,1.85fr) minmax(280px,1fr);gap:22px;margin-bottom:23px}
.panel{background:#fff;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.panel-heading{padding:21px 23px 16px;display:flex;justify-content:space-between;align-items:center;gap:15px}
.panel-heading p{font-size:10px;color:#97a198;margin-top:4px}
.legend{display:flex;gap:15px;font-size:10px;color:#7e8b80}
.legend span{display:flex;gap:6px;align-items:center}
.legend-dot{width:6px;height:6px;border-radius:50%;display:inline-block}
.income-dot{background:#38906e}
.expense-dot{background:#dc9c6a}
.trend-panel{position:relative;min-height:321px}
.chart-wrap{height:235px;padding:0 14px 10px 12px;position:relative}
.trend-svg{display:block;width:100%;height:100%;overflow:visible}
.trend-svg text{font-family:var(--font);fill:#a1aaa1;font-size:10px}
.chart-empty{position:absolute;inset:35px 0 25px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:7px;color:#a1ada3;pointer-events:none;font-size:11px}
.chart-empty strong{font-weight:500;color:#7b8e80;font-size:12px}
.chart-tooltip{position:absolute;background:#263e32;color:#fff;padding:9px 12px;border-radius:8px;font-size:11px;pointer-events:none;z-index:3;min-width:145px;box-shadow:0 5px 20px #16312620;line-height:1.8}
.composition-panel .panel-heading{padding-bottom:8px}
.muted{color:#9ba59c;font-size:11px}
.donut-wrap{display:flex;align-items:center;justify-content:center;position:relative;height:160px}
.donut-svg{width:155px;height:155px;transform:rotate(-90deg)}
.donut-center{position:absolute;text-align:center;pointer-events:none}
.donut-center span{display:block;font-size:9px;color:#99a299}
.donut-center strong{display:block;font-size:20px;font-weight:550;letter-spacing:-.3px}
.composition-legend{display:grid;grid-template-columns:1fr 1fr;gap:7px 15px;padding:7px 23px 20px;font-size:10px;max-height:136px;overflow:auto}
.composition-item{display:flex;align-items:center;gap:6px;min-width:0}
.composition-item .name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#7c8b7f}
.composition-item .percent{margin-left:auto;color:#566e5c;font-variant-numeric:tabular-nums}
.color-dot{width:7px;height:7px;flex-shrink:0;border-radius:2px}
.composition-empty{font-size:10px;text-align:center;color:#9da99f;padding:8px 0 22px}
.records-panel .panel-heading{padding-bottom:17px}
.records-title{display:flex;align-items:center;gap:9px}
.count-badge{font-size:9px;color:#6f8677;background:#eff4ef;padding:1px 7px;border-radius:5px}
.table-filters{display:flex;gap:9px;align-items:center;padding:0 23px 20px;flex-wrap:wrap}
.search-box{position:relative;display:flex;align-items:center;flex:1;min-width:175px;max-width:340px}
.search-box svg{position:absolute;left:10px;width:14px;height:14px;color:#a4aea5}
.search-box input{padding-left:31px!important;width:100%}
.table-filters input,.table-filters select{font-size:10px;padding:8px 10px;border:1px solid #e2e8e0;border-radius:6px;background:#fff;color:#748277;min-height:34px}
.table-filters select{max-width:150px}
.filter-note{font-size:9px;color:#a7afa6;margin-left:auto}
.table-scroll{overflow:auto}
.records-table,.preview-table{width:100%;border-collapse:collapse;text-align:left;white-space:nowrap}
.records-table{min-width:700px}
.records-table th{padding:11px 20px;font-size:9px;background:#f8faf7;color:#8b988e;font-weight:500;border-top:1px solid #eef1ec;border-bottom:1px solid #eef1ec}
.records-table td{padding:14px 20px;font-size:11px;border-bottom:1px solid #f1f3ee;color:#6d7c70}
.records-table td:first-child{color:#8a978b;font-variant-numeric:tabular-nums}
.records-table tr:hover td{background:#fafcf9}
.records-table .detail-cell{max-width:330px;min-width:150px;white-space:normal;word-break:break-word;color:#485b4b}
.detail-cell p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.badge{display:inline-flex;font-size:9px;border-radius:4px;padding:2px 7px;font-weight:500}
.badge.income{background:#edf6ed;color:#538567}
.badge.expense{background:#fcf0e5;color:#b2804d}
.badge.investment{background:#f0edf9;color:#8c7bb3}
.category-caption{font-size:9px;color:#9ca79b;display:block;margin-top:3px}
.number{text-align:right;font-variant-numeric:tabular-nums}
.money-income{color:#3f8962!important;font-weight:550}
.money-expense{color:#566658!important;font-weight:550}
.money-investment{color:#8d7bb2!important;font-weight:550}
.avatar{display:inline-flex;width:22px;height:22px;border-radius:50%;background:#edf2ec;align-items:center;justify-content:center;font-size:9px;color:#7f9483;margin-right:6px}
.actions-col{width:80px}
.row-actions{display:flex;gap:3px;justify-content:flex-end}
.icon-btn{display:inline-flex;align-items:center;justify-content:center;border:0;background:transparent;border-radius:6px;padding:6px;color:#95a193;width:30px;height:30px}
.icon-btn svg{width:14px;height:14px}
.icon-btn:hover{background:#eff4ec;color:var(--green)}
.icon-btn.delete:hover{background:#faeeee;color:var(--red)}
.empty-records{text-align:center;padding:34px 20px 38px}
.empty-icon{margin:0 auto 12px;display:grid;place-items:center;width:44px;height:44px;border-radius:12px;background:#f0f5ed;color:#90a18c}
.empty-records h3{font-size:13px;color:#74846f;font-weight:500}
.empty-records p{font-size:10px;color:#a4aea0;margin:5px 0 18px}
.table-footer{display:flex;justify-content:space-between;align-items:center;padding:13px 23px;border-top:1px solid #f0f3ec;color:#99a493;font-size:10px}
.pagination{display:flex;align-items:center;gap:12px}
.page-footer{padding:21px 0;display:flex;justify-content:space-between;gap:15px;font-size:9px;color:#a5aea0}
.page-footer .text-btn{font-size:9px;color:#99a58f}
.modal{border:1px solid #e0e7dc;border-radius:18px;box-shadow:0 25px 100px #163c3033;padding:26px;width:540px;max-width:calc(100vw - 28px);max-height:calc(100dvh - 40px);overflow:auto;background:#fff;color:var(--ink)}
.modal::backdrop{background:#142b264d;backdrop-filter:blur(3px)}
.modal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;margin-bottom:23px}
.modal-header h2{font-size:21px}
.modal-header>.icon-btn{margin-right:-7px;margin-top:-5px}
.modal form label,.modal>label,.mapping-header label,#sheet-picker-wrap label{display:flex;flex-direction:column;gap:7px;font-size:12px;font-weight:500;color:#647361}
.modal input:not([type=checkbox]):not([type=radio]),.modal select,.modal textarea{width:100%;padding:10px 12px;border:1px solid #dee6da;border-radius:8px;background:#fff;color:#394e3b;font-size:13px;min-width:0}
.modal textarea{resize:vertical;min-height:86px;line-height:1.8}
.modal input::placeholder,.modal textarea::placeholder{color:#b1b9aa}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.full{grid-column:1/-1}
.label-row{display:flex;justify-content:space-between;align-items:center;gap:12px}
.modal-footer{display:flex;gap:9px;justify-content:flex-end;align-items:center;margin-top:23px;padding-top:19px;border-top:1px solid #edf1e8}
.type-tabs{display:flex;background:#f3f6ef;border-radius:9px;padding:4px;gap:4px;margin-bottom:24px}
.type-tabs button{flex:1;padding:8px;border:0;border-radius:6px;color:#92a08b;background:transparent;font-size:12px}
.type-tabs button.selected{color:var(--green);background:#fff;box-shadow:0 1px 5px #193e2110;font-weight:600}
.amount-input-label{font-size:11px;color:#85947e;display:block;margin-bottom:7px}
.amount-input{display:flex;align-items:center;gap:12px;border-bottom:1px solid #e4ebde;margin-bottom:25px;padding-bottom:8px}
.amount-input span{font-size:25px;color:#a2af98}
.modal .amount-input input{padding:0;border:0;background:none;border-radius:0;font-size:39px;box-shadow:none;font-weight:500;letter-spacing:-1px;outline-offset:5px}
.field-error{font-size:11px;color:var(--red);margin-top:10px;white-space:pre-line}
.field-error:empty{margin:0}
.form-help{display:block;color:#9aa68f;font-size:10px;font-weight:400;line-height:1.9}
.settings-modal form>.btn{margin-top:15px}
.dictionary-section{margin-top:25px;padding-top:21px;border-top:1px solid #edf1e7}
.dictionary-list{display:flex;gap:7px;flex-wrap:wrap;margin:14px 0}
.dictionary-tag{display:inline-flex;gap:10px;align-items:center;padding:5px 9px;border:1px solid #e5ebdf;border-radius:7px;background:#f8faf5;font-size:11px}
.dictionary-tag button{border:0;background:none;color:#91a085;padding:1px;display:flex}
.dictionary-tag svg{width:12px;height:12px}
.compact-modal{width:475px}
.confirm-message{font-size:13px;color:#7c8b73;line-height:1.9;white-space:pre-line}
.import-modal{width:1050px}
.import-steps{display:flex;gap:30px;border-bottom:1px solid #e9eee3;margin-bottom:22px;font-size:11px;color:#a5af9c}
.step{padding:0 0 11px}
.step.active{color:var(--green);border-bottom:2px solid var(--green);font-weight:600}
.drop-zone{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:9px;border:1.5px dashed #c8d7bd;border-radius:12px;background:#f9fcf6;padding:45px 20px;cursor:pointer;text-align:center}
.drop-zone:hover,.drop-zone.dragging{background:#eff6e9;border-color:#6c9d55}
.upload-icon{display:grid;place-items:center;background:#e9f1df;color:#7a9e62;width:51px;height:51px;border-radius:14px;margin-bottom:8px}
.upload-icon svg{width:25px;height:25px}
.drop-zone strong{font-size:14px;font-weight:500;color:#5a7750}
.drop-zone span:not(.upload-icon){font-size:11px;color:#91a484}
.drop-zone small{font-size:9px;color:#a7b49b;margin-top:5px}
#import-upload>.form-help{margin-top:12px}
.import-filebar{display:flex;justify-content:space-between;align-items:center;gap:15px;font-size:12px;margin-bottom:15px;word-break:break-all}
.import-filebar .muted{margin-left:10px}
#sheet-picker-wrap{margin-bottom:15px;max-width:300px}
details{border:1px solid #e5ecdf;border-radius:8px;padding:11px 14px;font-size:11px;color:#829574;margin-bottom:17px}
summary{cursor:pointer}
.mapping-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:15px 0}
.mapping-grid label{display:flex;flex-direction:column;gap:5px;font-size:10px}
.mapping-grid select{padding:7px;font-size:10px}
.mapping-header{display:flex;gap:20px;align-items:center;margin-top:15px}
.mapping-header label{font-size:10px!important}
.mapping-header input[type=number]{width:75px!important;padding:5px!important}
.mapping-header label:first-child{flex-direction:row!important;align-items:center}
.checkbox-label{display:inline-flex!important;flex-direction:row!important;align-items:center;gap:6px;font-size:10px;font-weight:400!important;cursor:pointer;color:#829373}
.checkbox-label input,.radio-inline input,.radio-card input{accent-color:var(--green);width:15px;height:15px;flex-shrink:0}
.import-batch{display:grid;grid-template-columns:1.2fr 1fr auto;align-items:end;gap:13px;margin-bottom:17px}
.import-batch>label{display:flex;flex-direction:column;gap:6px;font-size:11px;color:#7e9072}
.import-batch select{font-size:11px;padding:8px 10px}
.import-summary{display:flex;gap:15px;padding:13px 16px;border-radius:8px;background:#f2f7ec;color:#74905f;font-size:11px;flex-wrap:wrap}
.import-summary strong{color:#466e33;font-size:14px;font-variant-numeric:tabular-nums;margin:0 4px}
.preview-toolbar{display:flex;justify-content:space-between;align-items:center;margin:17px 0 11px}
.segmented{display:flex;gap:5px}
.segmented button{font-size:11px;border:0;background:transparent;color:#95a189;border-radius:6px;padding:6px 12px}
.segmented .selected{background:#eaf1e2;color:var(--green)}
.preview-scroll{max-height:360px;overflow:auto;border:1px solid #e8eee1;border-radius:8px}
.preview-table{min-width:720px}
.preview-table th{background:#f7faf2;color:#91a181;padding:10px 12px;font-size:10px;font-weight:500;position:sticky;top:0;z-index:1}
.preview-table td{font-size:11px;padding:10px 12px;border-top:1px solid #edf2e6;vertical-align:top}
.preview-table td:nth-child(4){white-space:normal;min-width:230px;max-width:360px}
.preview-table td:nth-child(4) p{max-height:55px;overflow:auto;overflow-wrap:anywhere}
.preview-table small{display:block;font-size:9px;color:#a2af96;margin-top:3px}
.preview-table select{font-size:10px;padding:5px;width:135px}
.preview-table .row-warning{font-size:10px;color:#bb8645;white-space:normal}
.preview-table .row-error{color:#b75c51;font-size:10px;white-space:normal}
.preview-pagination{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin:9px 0;color:#9ba88e;font-size:10px}
.preview-pagination span{margin-right:auto}
.import-modal .modal-footer>.form-help{margin-right:auto}
.notice{padding:15px;background:#f4f8ee;border:1px solid #e4edda;border-radius:8px;font-size:12px;color:#698553;white-space:pre-line;line-height:1.9;margin-bottom:20px}
.radio-card{display:flex!important;flex-direction:row!important;align-items:flex-start;gap:10px;border:1px solid #e2ead8;border-radius:9px;padding:15px;margin-bottom:10px}
.radio-card strong{font-size:12px;color:#5e7a48}
.radio-card small{display:block;font-size:10px;color:#9aa88d;margin-top:5px;font-weight:400}
.export-card{display:flex;align-items:flex-start;gap:13px;border:1px solid #e5ecdc;padding:18px 15px;border-radius:10px;margin-bottom:14px;flex-wrap:wrap}
.export-filetype{font-size:9px;background:#eaf2e1;color:#7b9a5b;padding:6px 7px;border-radius:6px}
.export-filetype.csv{background:#f1ebf7;color:#9783ac}
.export-card>div{flex:1;min-width:180px}
.export-card p{font-size:11px;color:#9aa78d;line-height:1.9;margin:5px 0 10px}
.export-card>.btn{margin-left:auto}
.radio-inline{display:inline-flex;align-items:center;gap:4px;font-size:10px;color:#879a74;margin-right:9px}
.help-content h3{margin:20px 0 6px;color:#5d7b49}
.help-content p{font-size:12px;line-height:1.95;color:#8a9b7b}
.help-content h3:first-child{margin-top:0}
.toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);z-index:1000;background:#244b36;color:white;padding:12px 22px;border-radius:10px;box-shadow:0 6px 28px #19382625;font-size:12px;max-width:calc(100vw - 30px);white-space:pre-line}
.warning-banner{background:#fff3df;color:#976a2e;border:1px solid #f0d9b0;border-radius:8px;padding:10px 14px;font-size:12px;margin-top:15px}

.trend-svg,.donut-svg{stroke:none}
.trend-svg text{fill:#819080;font-size:10px}
.project-button{border:0;background:none;padding:0;font-size:11px;color:#66746c;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.project-button::after{content:'⌄';margin-left:6px;color:#99a593}
.project-button:hover{color:var(--green)}

@media(min-width:1500px){main{padding-left:52px;padding-right:52px}
.chart-wrap{height:270px}
.trend-panel{min-height:355px}
.donut-wrap{height:190px}
.donut-svg{width:180px;height:180px}}

@media(max-width:1180px){.app-shell{grid-template-columns:178px minmax(0,1fr)}
.sidebar{padding:30px 14px 20px}
.brand{font-size:16px;gap:8px}
.brand small{font-size:8px;letter-spacing:0}
.brand-mark{width:32px;height:36px}
main{padding:0 24px}
.metric{padding:18px 16px}
.metric-value{font-size:24px}
.metric-foot{font-size:9px}
.chart-grid{grid-template-columns:minmax(0,1.6fr) minmax(245px,1fr);gap:16px}
.panel-heading{padding:20px 18px 15px}
.metrics{gap:12px}
.heading-actions .btn{padding:8px 11px}
.date-controls input{width:108px}}

@media(max-width:950px){.app-shell{grid-template-columns:74px minmax(0,1fr)}
.sidebar{padding:28px 11px}
.brand{margin-left:7px;margin-bottom:45px}
.brand>span:last-child,.workspace-label,.sidebar-bottom,.nav-dot{display:none}
.nav-item{font-size:0;gap:0;justify-content:center;padding:14px}
.nav-item svg{width:20px;height:20px}
.overview-filter{flex-wrap:wrap}
.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
.metric{min-height:139px}
.metric-value{font-size:29px;margin:7px 0}
.page-heading{padding:25px 0}
.page-heading h1{font-size:26px}
.chart-grid{grid-template-columns:minmax(0,1.5fr) minmax(230px,1fr)}
.chart-wrap{height:220px}
.trend-panel{min-height:306px}
.composition-legend{padding-left:18px;padding-right:18px;gap:7px 9px}
.filter-note{display:none}
.metric-value.compact{font-size:25px}}

@media(max-width:700px){.app-shell{display:block}
.sidebar{display:none}
main{padding:0 17px}
.topbar{height:57px}
.page-heading{align-items:flex-start;padding:23px 0 22px;flex-direction:column;gap:18px}
.page-heading .eyebrow{font-size:9px}
h1{font-size:27px}
.heading-actions{width:100%;gap:8px}
.heading-actions .btn{flex:1;font-size:11px;padding:9px 7px}
.heading-actions .btn svg{width:14px}
.overview-filter{gap:10px;margin-bottom:14px}
.date-controls{flex-wrap:wrap;width:100%;gap:5px}
.date-controls input{width:calc((100% - 152px)/2);min-width:94px;flex:1}
.chip{padding:5px 8px}
.metrics{gap:11px;margin-bottom:16px}
.metric{padding:16px 14px;min-height:141px;border-radius:12px}
.metric-top{font-size:10px}
.metric-value{font-size:25px;margin:11px 0 10px}
.metric-value.compact{font-size:19px}
.metric-foot{font-size:8px;gap:5px}
.metric-icon{width:22px;height:22px}
.chart-grid{grid-template-columns:1fr;gap:15px;margin-bottom:17px}
.trend-panel{min-height:290px}
.chart-wrap{height:215px}
.panel-heading{padding:18px 18px 13px}
h2{font-size:14px}
.panel-heading p{font-size:9px}
.composition-panel{min-height:240px}
.composition-panel>#composition-chart{display:grid;grid-template-columns:160px minmax(0,1fr);align-items:center;padding:0 12px 15px}
.donut-wrap{height:160px}
.donut-svg{width:145px;height:145px}
.composition-legend{grid-template-columns:1fr;padding:0 12px 0 5px;gap:9px;max-height:158px}
.composition-empty{padding-right:15px;line-height:1.8}
.donut-center strong{font-size:19px}
.table-filters{padding:0 17px 15px;gap:7px}
.search-box{flex-basis:100%;max-width:none}
.table-filters select{flex:1;min-width:0;max-width:none;padding:7px 4px;font-size:9px}
.table-footer{padding:12px 17px}
.page-footer{flex-direction:column;gap:7px;text-align:center}
.page-footer .text-btn{align-self:center}
.modal{padding:21px;border-radius:14px;max-height:calc(100dvh - 24px);max-width:calc(100vw - 18px)}
.modal-header h2{font-size:19px}
.modal .eyebrow{font-size:9px}
.form-grid{gap:15px}
.modal-footer{flex-wrap:wrap}
.import-batch{grid-template-columns:1fr 1fr;gap:10px}
.import-batch>.btn{grid-column:1/-1}
.mapping-grid{grid-template-columns:1fr 1fr}
.mapping-header{flex-wrap:wrap;gap:10px}
.import-filebar{align-items:flex-start}
.import-filebar .muted{display:block;margin:4px 0}
.import-summary{gap:8px;font-size:10px}
.import-summary strong{font-size:12px}
.preview-toolbar{align-items:flex-start;gap:8px}
.segmented button{padding:6px 8px;font-size:10px}
.import-modal .modal-footer>.form-help{width:100%;font-size:9px}
.drop-zone{padding:33px 12px}
.drop-zone strong{font-size:12px}
.drop-zone span:not(.upload-icon){font-size:10px}
.page-footer{padding-bottom:29px}
.export-card{padding:15px 12px}
.export-card>div{min-width:150px}
.export-card>.btn{width:100%}
.empty-records{padding:28px 15px}
.empty-records h3{font-size:12px}
.empty-records p{font-size:9px}}

@media(max-width:700px){.records-table{display:block;min-width:0;white-space:normal}
.records-table thead{display:none}
.records-table tbody{display:block}
.records-table tr{display:grid;grid-template-columns:minmax(0,1fr) auto auto;grid-template-areas:'date amount amount' 'type person person' 'detail detail actions';gap:8px 10px;padding:16px 18px;border-top:1px solid #eef1e9}
.records-table td{border:0;padding:0;font-size:11px}
.records-table td:nth-child(1){grid-area:date}
.records-table td:nth-child(2){grid-area:type}
.records-table td:nth-child(3){grid-area:person;text-align:right}
.records-table td:nth-child(4){grid-area:detail;min-width:0;max-width:none;align-self:center}
.records-table td:nth-child(5){grid-area:amount;font-size:15px;align-self:center}
.records-table td:nth-child(6){grid-area:actions;align-self:center}
.records-table .category-caption{display:inline;margin-left:6px}
.records-table .icon-btn{height:30px;width:28px}
.records-table .avatar{width:20px;height:20px}
.table-filters input,.table-filters select{font-size:11px}
.metric-foot{font-size:9px}
.metric-top{font-size:11px}
.form-help{color:#7d8d73}}

@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
@media print{.sidebar,.heading-actions,.table-filters,.pagination,.page-footer,dialog,.toast,.date-controls{display:none!important}
.app-shell{display:block}
main{padding:0}
.panel,.metric{break-inside:avoid}
.records-table{min-width:0}
.metric.balance-card{-webkit-print-color-adjust:exact;print-color-adjust:exact}}


.capital-card .metric-value{margin-bottom:6px}
.capital-card .metric-foot{flex-wrap:wrap;font-size:9px;line-height:1.8;overflow-wrap:anywhere}
.capital-actions{display:flex;gap:12px;justify-content:space-between;margin-top:8px}
.capital-actions .text-btn{font-size:10px;min-height:25px}
.capital-actions [data-action=withdrawal]{color:#b27058}
.badge.withdrawal{background:#faece8;color:#b27460}
.money-withdrawal{color:#b27460!important;font-weight:550}
.entry-funding-note{margin:-12px 0 20px;padding:10px 12px;border-radius:8px;background:#f4f7f0;color:#718565}
.filter-context{margin:-6px 23px 16px;font-size:11px;color:#7c8e74;line-height:1.8}
.table-footer{gap:12px;flex-wrap:wrap}
.entry-modal .type-tabs button{white-space:nowrap;padding:8px 4px;font-size:11px}
.capital-card{min-width:0}
@media(max-width:700px){.capital-actions{gap:6px}
.capital-actions .text-btn{font-size:9px}
.filter-context{margin-left:17px;margin-right:17px;font-size:10px}
.table-footer>span{flex:1;min-width:180px}
.metric-foot{flex-wrap:wrap}}

/* server edition */
body:not([data-write=true]) [data-write],body:not([data-editor=true]) [data-editor],body:not([data-admin=true]) [data-admin]{display:none!important}
.auth-view{min-height:100vh;display:grid;place-items:center;padding:24px}
.auth-card{background:#fff;border:1px solid var(--line);border-radius:18px;padding:34px 32px;width:100%;max-width:400px}
.auth-card .brand{margin-bottom:30px}
.auth-card form{display:flex;flex-direction:column;gap:16px}
.auth-card h2{font-size:21px}
.auth-card label{display:flex;flex-direction:column;gap:7px;font-size:12px;font-weight:500;color:#647361}
.auth-card input{padding:11px 12px;border:1px solid #dee6da;border-radius:8px;font-size:14px;color:#394e3b}
.auth-card input:read-only{background:#f6f8f4}
.auth-card .btn{min-height:42px}
.auth-card .text-btn{align-self:center}
.topbar-right{display:flex;align-items:center;gap:18px}
.account-button{border:0;background:none;font-size:11px;color:#66746c;display:flex;align-items:center;padding:4px;border-radius:8px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.account-button:hover{color:var(--green)}
.item-list{display:flex;flex-direction:column;gap:8px;margin:12px 0}
.item-row{display:flex;align-items:center;gap:14px;border:1px solid #e5ebdf;border-radius:9px;padding:11px 14px}
.item-row.current{border-color:#8cb79f;background:#f5faf5}
.item-row.off{opacity:.6}
.item-main{flex:1;min-width:0;text-align:left;border:0;background:none;padding:0;overflow-wrap:anywhere}
.item-main strong{display:block;font-size:12px;font-weight:600;color:#405446}
.item-main small{display:block;font-size:10px;color:#8b988e;margin-top:3px}
.item-main p{font-size:11px;color:#66746c;white-space:pre-line;margin-top:3px;max-height:110px;overflow:auto}
.item-row .form-help{white-space:nowrap}
.modal .item-row select{width:auto;padding:6px 9px;font-size:11px}
.inline-form{display:flex;gap:12px;align-items:flex-end;margin-top:14px;flex-wrap:wrap}
.inline-form label{flex:1;min-width:130px}
.dialog-links{display:flex;gap:20px;margin-top:20px;padding-top:16px;border-top:1px solid #edf1e8}
.admin-modal,.history-modal{width:720px}
.secret-row{display:flex;gap:9px;margin:9px 0 4px;align-items:center}
.secret-row input{font-family:ui-monospace,Consolas,monospace}
.modal code{font-family:ui-monospace,Consolas,monospace;font-size:11px;color:#4d6353;user-select:all;overflow-wrap:anywhere}
.preview-table .preview-category{margin-top:5px}
.preview-table .preview-empty{text-align:center;padding:25px;color:#9ba891}
@media(max-width:700px){.item-row{flex-wrap:wrap}
.item-main{flex-basis:100%}
.topbar-right{gap:10px}
.account-button{max-width:96px}
.auth-card{padding:28px 22px}}
