:root{font-family:Inter,Arial,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#172b3d;background:#f5f7fa;font-synthesis:none;font-size:15px;--navy:#183b59;--blue:#2469a5;--line:#dbe3ea;--muted:#5e7080;--green:#e0f3e7;--bg:#f5f7fa;--white:#fff;--shadow:0 3px 16px rgba(15,42,64,.06)}*{box-sizing:border-box}body{margin:0;min-height:100vh}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}a{color:#1f629b;text-decoration:none}input,select,textarea{display:block;width:100%;background:white;border:1px solid #c7d5df;border-radius:8px;padding:10px 11px;color:#193449;outline:none}input:focus,select:focus,textarea:focus{border-color:#2271ad;box-shadow:0 0 0 3px #dbeffc}textarea{min-height:90px;resize:vertical}label{font-size:13px;color:#415769;display:block;font-weight:600}label input,label select,label textarea{margin-top:6px;font-weight:400}h1,h2,h3,p{margin-top:0}h1{font-size:24px;line-height:1.3;margin-bottom:12px}h2{font-size:18px;line-height:1.35;margin-bottom:12px}h3{font-size:15px;margin-bottom:10px}.tiny,.hint{font-size:12px;color:var(--muted)}.error{color:#a22028}.success{color:#197044}.loading-screen{display:grid;place-items:center;align-content:center;gap:20px;min-height:90vh;color:var(--muted)}.brand-symbol{width:64px;height:64px;border-radius:18px;background:#1a4e76;color:white;display:grid;place-items:center;font-size:32px;font-weight:800}.shell{min-height:100vh;display:flex}.sidebar{width:245px;flex:none;background:var(--navy);color:#f3f7fa;padding:23px 12px;position:sticky;top:0;height:100vh;overflow-y:auto}.brand{padding:10px 13px 26px;display:flex;align-items:center;gap:11px;font-size:18px;font-weight:800;letter-spacing:.01em}.brand-badge{background:#2f739f;width:37px;height:37px;display:grid;place-items:center;border-radius:11px;font-size:24px}.nav-link{display:flex;gap:11px;align-items:center;color:#d9e5ed;cursor:pointer;border:0;background:transparent;border-radius:9px;width:100%;text-align:left;padding:11px 12px;margin:2px 0;font-weight:600;font-size:14px}.nav-link:hover,.nav-link.active{background:#335b78;color:white}.nav-link.sub{padding-left:34px;font-size:13px}.nav-link svg{flex:none}.nav-label{color:#a8bfcf;font-size:11px;text-transform:uppercase;letter-spacing:.08em;padding:18px 12px 5px}.sidebar-bottom{margin-top:24px;padding:14px 12px;border-top:1px solid #3b5970;color:#c4d4df;font-size:12px}.workspace{flex:1;min-width:0}.topbar{min-height:66px;display:flex;align-items:center;justify-content:space-between;padding:10px 26px;border-bottom:1px solid var(--line);background:#fff;position:sticky;top:0;z-index:10}.page-title{font-size:21px;font-weight:800;color:#183b59}.right-tools{display:flex;gap:8px;align-items:center}.content{padding:24px 26px 64px;max-width:1640px;margin:0 auto}.stack{display:grid;gap:16px}.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}.grid4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.panel{background:white;border:1px solid var(--line);border-radius:13px;padding:18px;box-shadow:var(--shadow);min-width:0}.panel.flush{padding:0;overflow:hidden}.toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:15px}.toolbar-left,.toolbar-right{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.btn,button.primary,button.ghost,button.light,button.danger,button.small{display:inline-flex;align-items:center;justify-content:center;gap:7px;border-radius:8px;border:1px solid #bfd0df;padding:9px 13px;background:white;color:#1c4f78;font-weight:650;white-space:nowrap;min-height:38px}.btn:hover,button.ghost:hover,button.light:hover{background:#eff6fa}.btn.primary,button.primary{background:#246db0;border-color:#246db0;color:white}.btn.primary:hover,button.primary:hover{background:#155a96}.btn.danger,button.danger{color:#ad2937;border-color:#ecc8cd}.btn.small,button.small{padding:5px 8px;min-height:28px;font-size:12px}.btn.flat{border-color:transparent;background:transparent}.btn.square{width:34px;height:34px;padding:0}.chip{font-size:12px;font-weight:700;background:#ecf3f8;color:#2d607f;border:1px solid #cddfe9;padding:4px 8px;border-radius:6px}.muted{color:var(--muted)}.tabs{display:flex;gap:6px;flex-wrap:wrap}.tab{border:1px solid #d5e1e9;border-radius:7px;padding:8px 12px;background:#fff;color:#37566f;font-weight:650}.tab.active{background:#1f5e8f;color:white;border-color:#1f5e8f}.kpi{padding:17px 18px;border-radius:12px;background:#fff;border:1px solid var(--line);box-shadow:var(--shadow)}.kpi span{display:block;color:#627789;font-size:13px;margin-bottom:9px}.kpi strong{color:#193d59;font-size:25px;font-weight:850;letter-spacing:-.025em}.kpi em{display:block;color:#6c8394;font-size:12px;font-style:normal;margin-top:6px}.kpi.green{border-top:3px solid #48a47c}.kpi.orange{border-top:3px solid #e1aa58}.kpi.blue{border-top:3px solid #438bc9}.chart{display:flex;align-items:flex-end;gap:8px;min-height:240px;overflow:auto}.chart-col{min-width:35px;flex:1;text-align:center;font-size:11px;color:#5e7286}.chart-bars{height:205px;display:flex;justify-content:center;align-items:flex-end;gap:3px;padding-bottom:6px;border-bottom:1px solid #d8e2ea}.chart-bar{width:10px;min-height:2px;border-radius:4px 4px 0 0}.legend{display:flex;gap:20px;flex-wrap:wrap;color:#445c6c;font-size:13px}.legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:6px}.table-scroll{overflow:auto;max-width:100%}table{width:100%;border-collapse:separate;border-spacing:0;font-size:13.5px;color:#1a3347}th,td{border-right:1px solid #dde6eb;border-bottom:1px solid #dde6eb;padding:9px 10px;text-align:right;min-width:92px;white-space:nowrap;vertical-align:middle}th{background:#ecf3f8;color:#24435b;font-weight:800}th:first-child,td:first-child{text-align:left;position:sticky;left:0;z-index:2;background:#fff;min-width:150px}th:first-child{background:#dceaf4;z-index:3}.table-scroll table{border-top:1px solid var(--line);border-left:1px solid var(--line)}td.amount-cell{cursor:pointer}td.amount-cell:hover{box-shadow:inset 0 0 0 2px #aacce1}td.total, tr.total td{background:#e4eff8;font-weight:800}tr.total td:first-child{background:#cfe3f2}tr.average td{background:#f2f7fa;color:#365269}tr.average td:first-child{background:#e8eff6}td.highlight-green,th.highlight-green{background:#dff1e6!important;color:#1a663d}td.highlight-blue,th.highlight-blue{background:#e5f0fb!important}td.highlight-yellow,th.highlight-yellow{background:#fff1c7!important}.cell-content{display:flex;align-items:center;justify-content:flex-end;gap:4px}.cell-plus{border:0;background:#e8f1f9;color:#286ba0;border-radius:5px;min-width:23px;height:23px;display:inline-grid;place-items:center;font-size:16px;padding:0;font-weight:800}.expense-grid{display:grid;grid-template-columns:repeat(6,minmax(175px,1fr));gap:12px;overflow-x:auto}.expense-col{border:1px solid #d7e3ea;border-radius:10px;min-width:175px;background:#fff;overflow:hidden}.expense-head{padding:11px 12px;font-weight:850;background:#e9f2f9;color:#1b4d74}.expense-head.c1{background:#e0f3e6;color:#17573b}.expense-head.c2{background:#fff0d4;color:#8a5b1c}.expense-head.c3{background:#f0e9fa;color:#66518e}.expense-head.c4{background:#e3f0f5;color:#1c6178}.expense-head.c5{background:#fae9e9;color:#915258}.expense-line{padding:9px 10px;border-bottom:1px solid #edf0f3;display:flex;gap:5px;align-items:start;justify-content:space-between}.expense-line .desc{font-size:11px;color:#667d8e;margin-top:3px;white-space:normal;word-break:break-word}.expense-line strong{font-size:13px}.expense-footer{padding:12px;background:#f3f7fa;display:flex;align-items:center;justify-content:space-between;font-weight:850}.expense-add{border:0;border-top:1px dashed #c7d7e2;color:#286ba0;background:white;width:100%;padding:11px;font-weight:800}.swatches{display:flex;gap:7px;align-items:center;flex-wrap:wrap}.swatch{width:29px;height:29px;border-radius:7px;border:2px solid #e0e6ec;cursor:pointer;position:relative}.swatch.selected{outline:3px solid #6ea3c8;outline-offset:2px}.swatch.none{background:repeating-linear-gradient(45deg,#fff,#fff 7px,#eef1f4 7px,#eef1f4 14px)}.swatch.none:after{content:'×';position:absolute;left:9px;top:3px;color:#627282;font-size:17px}.modal-overlay{position:fixed;inset:0;background:rgba(15,31,48,.48);display:grid;place-items:center;padding:18px;z-index:50}.modal{background:#fff;width:min(630px,100%);max-height:90vh;overflow:auto;border-radius:15px;padding:21px;box-shadow:0 25px 65px #102b4266}.modal-head{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);padding-bottom:13px;margin-bottom:16px}.modal-head h2{margin:0}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.modal-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:18px;border-top:1px solid #e4ebf0;padding-top:15px}.split-row{display:flex;gap:9px;justify-content:space-between;align-items:center}.detail-row{display:flex;justify-content:space-between;align-items:center;gap:9px;border:1px solid #e0e8ef;border-radius:8px;padding:9px 11px;margin-bottom:7px}.detail-row .detail-caption{font-size:11px;color:#637d8f}.note-card{border:1px solid var(--line);border-radius:9px;padding:14px;background:white}.note-card p{white-space:pre-wrap;overflow-wrap:anywhere}.note-card .meta{font-size:12px;color:#657b8b}.progress{height:9px;background:#e4edf2;border-radius:10px;overflow:hidden}.progress div{height:100%;background:#2d7cae;border-radius:10px}.donut{width:210px;height:210px;flex:none;border-radius:50%;display:grid;place-items:center;position:relative}.donut:after{content:'';position:absolute;inset:45px;background:white;border-radius:50%}.donut strong{position:relative;z-index:1;font-size:18px}.file-drop{border:2px dashed #bdd3e2;border-radius:11px;padding:18px;background:#f9fcff}.install-prompt{background:#e7f4fb;border:1px solid #b7d5eb;border-radius:10px;padding:12px 15px}.login-bg,.setup-body{min-height:100vh;background:linear-gradient(135deg,#eaf3f9,#f6f8fb);display:grid;place-items:center;padding:20px}.login-card,.setup{width:min(430px,100%);padding:27px;background:#fff;border:1px solid #dbe5ec;border-radius:16px;box-shadow:0 18px 50px rgba(17,48,74,.10)}.setup label,.login-card label{margin-top:16px}.login-card button,.setup button.primary{width:100%;margin-top:22px}.login-card h1,.setup h1{color:#183b59}.toast{position:fixed;bottom:22px;right:20px;max-width:min(440px,90vw);background:#153a57;color:white;padding:12px 16px;border-radius:9px;box-shadow:0 9px 25px #0f293a44;z-index:70}.toast.error{background:#9d2935;color:white}.mobilebar{display:none}.pill{display:inline-block;padding:4px 9px;border-radius:20px;background:#eef3f6;color:#5c7486;font-size:12px;font-weight:700}.year-select{width:auto;min-width:90px;padding:8px 10px}.month-select{width:auto;min-width:160px;padding:8px 10px}.compact-field{max-width:150px}.text-left{text-align:left}.mt{margin-top:16px}.mb{margin-bottom:14px}.nowrap{white-space:nowrap}.all-list{display:grid;gap:6px}.empty{padding:25px;color:#657d8d;text-align:center;border:1px dashed #c7d8e5;border-radius:10px}.color-selected{box-shadow:inset 0 0 0 1px #b9d0e2}.hide-mobile{}@media(max-width:1200px){.expense-grid{grid-template-columns:repeat(3,minmax(170px,1fr))}.sidebar{width:217px}.content{padding:20px}.grid4{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:770px){:root{font-size:14px}.sidebar{display:none}.topbar{min-height:57px;position:sticky;top:0;padding:10px 16px}.content{padding:14px 12px 90px}.page-title{font-size:18px}.right-tools .hide-mobile{display:none}.grid2,.grid3{grid-template-columns:1fr}.grid4{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.kpi{padding:13px}.kpi strong{font-size:20px}.panel{padding:13px;border-radius:10px}.toolbar{align-items:flex-start}.expense-grid{grid-template-columns:repeat(2,minmax(145px,1fr));gap:8px}.expense-head{padding:8px}.expense-line{padding:8px}.mobilebar{display:flex;position:fixed;bottom:0;left:0;right:0;padding:7px 5px max(8px,env(safe-area-inset-bottom));background:#fff;border-top:1px solid #d6e2ea;z-index:20;gap:2px;justify-content:space-between}.mobilebar button{display:grid;place-items:center;gap:3px;min-width:0;flex:1;border:0;background:transparent;color:#587083;font-size:10px;font-weight:800;padding:5px 1px}.mobilebar button.active{color:#145d91}.mobilebar button svg{width:21px;height:21px}.form-grid{grid-template-columns:1fr}.modal{padding:15px}.hide-mobile{display:none}.chart{min-height:180px}.chart-bars{height:158px}.donut{width:170px;height:170px}.donut:after{inset:37px}}@media(max-width:370px){.expense-grid{grid-template-columns:1fr}.grid4{grid-template-columns:1fr 1fr}.kpi strong{font-size:17px}}
/* Version 1.1: sync indicator is always visible, including on narrow phones. */
.sync-indicator{font-size:12px;color:#1f6943;background:#e3f5e8;border:1px solid #abd5b6;border-radius:9px;padding:7px 10px;cursor:pointer;font-weight:750;max-width:min(58vw,380px);white-space:normal;text-align:center;line-height:1.3}
.sync-indicator.sync-wait{background:#fff3d8;border-color:#e6c57a;color:#835606}
.sync-indicator.sync-problem{background:#fce7e7;border-color:#eda8a8;color:#9e2929}
@media(max-width:620px){.topbar{padding:9px 11px;gap:9px}.page-title{font-size:17px}.sync-indicator{font-size:11px;padding:6px;max-width:55vw}.right-tools{min-width:0}}

/* Visual refresh v1.2 — crisp icons, considered typographic hierarchy and denser financial grids. */
:root{--navy:#172f4b;--blue:#2b70a8;--line:#dce5ee;--bg:#f3f6fa;--muted:#5d7487;--shadow:0 4px 18px rgba(26,57,91,.055)}
body{background:var(--bg);-webkit-font-smoothing:antialiased}
.sidebar{background:linear-gradient(165deg,#192f4a 0%,#102a44 100%);box-shadow:2px 0 18px rgba(11,37,67,.09)}
.brand{letter-spacing:-.025em;display:flex;align-items:center;gap:11px;padding-top:22px;padding-bottom:23px;font-size:17px}
.brand-text{display:flex;flex-direction:column;line-height:1.1}
.brand-text small{font-size:10px;letter-spacing:.1em;text-transform:uppercase;opacity:.6;margin-top:6px;font-weight:500}
.brand-badge{background:linear-gradient(145deg,#3886cf,#245f9a);box-shadow:0 5px 16px rgba(42,130,197,.22);border-radius:11px;width:39px;height:39px;display:grid;place-items:center;color:#fff;font-weight:900;font-size:23px}
.nav-link{border-radius:9px;min-height:39px;font-weight:570;transition:background .18s,color .18s,box-shadow .18s;display:flex;align-items:center;gap:11px}
.nav-link:hover{background:rgba(255,255,255,.10)}
.nav-link.active{background:#365d82;color:white;box-shadow:inset 3px 0 0 #81c2ff}
.nav-link.sub{padding-left:26px}
.ui-icon{width:19px;height:19px;flex-shrink:0;vertical-align:middle;stroke-width:1.9}
.nav-link.sub .ui-icon{height:17px;width:17px;opacity:.88}
.sidebar-bottom{line-height:1.6;font-size:11px;opacity:.75}
.side-status-dot{display:inline-block;width:6px;height:6px;background:#57d4b2;border-radius:50%;margin-right:7px;vertical-align:1px}
.topbar{box-shadow:0 1px 0 rgba(35,71,108,.04)}
.page-title{font-size:21px;letter-spacing:-.03em;font-weight:800}
.panel{border-color:#dee7ef;box-shadow:var(--shadow);border-radius:12px}
.panel h2{font-size:16px;letter-spacing:-.018em}
.kpi{border:1px solid #dce6ee;border-radius:11px;box-shadow:var(--shadow);padding:17px 18px}
.kpi strong{font-variant-numeric:tabular-nums;font-size:27px;letter-spacing:-.04em}
.kpi.green{border-top:3px solid #38a982;background:linear-gradient(165deg,#fff 65%,#f5fbf8)}
.kpi.orange{border-top:3px solid #e8a849;background:linear-gradient(165deg,#fff 65%,#fffaf3)}
.kpi.blue{border-top:3px solid #438acb;background:linear-gradient(165deg,#fff 65%,#f4f9fe)}
.kpi-label{display:flex!important;align-items:center;gap:7px;line-height:19px}
.kpi-label .ui-icon{width:16px;height:16px;opacity:.8;color:#47718c}
.btn{transition:background .16s,box-shadow .16s,border-color .16s}
.btn.primary{box-shadow:0 2px 6px rgba(28,100,165,.15)}
input:focus,select:focus,textarea:focus{box-shadow:0 0 0 3px #cce5fb}
.table-scroll{border-radius:7px}
th{background:#e8f0f6;color:#23496b;font-weight:750}
td{font-variant-numeric:tabular-nums}
tr.total td{background:#dcebf6!important;color:#1c4669;font-weight:850}
tr.average td{background:#f0f6fb}
.note-card{border-radius:10px;box-shadow:0 2px 9px rgba(25,57,85,.03)}
.mobilebar .ui-icon{width:20px;height:20px}
.mobilebar button.active{color:#1b6499}
@media(max-width:770px){.page-title{font-size:18px}.kpi strong{font-size:21px}.kpi-label .ui-icon{height:14px;width:14px}}

/* v1.3: align the self-hosted layout with the original private cabinet. */
:root{--navy:#162b43;--line:#d4e0ec;--bg:#f2f5f9;--muted:#59718a;--shadow:0 3px 14px rgba(31,53,80,.04)}
body{background:var(--bg);color:#182a41}
.sidebar{width:195px;min-width:195px;padding:8px 9px;background:linear-gradient(180deg,#1b304a 0%,#15283d 100%);display:flex;flex-direction:column}
.brand{font-size:17px;padding:0 7px 20px;gap:10px;letter-spacing:-.025em;min-height:56px}
.brand-badge{width:33px;height:33px;font-size:21px;border-radius:9px}
.brand-text small{display:none}
.nav-link{margin:2px 0;padding:10px 11px;font-weight:600;font-size:12.5px;gap:8px;min-height:38px}
.nav-link.sub{min-height:37px;padding-left:29px;font-size:12px}
.nav-link .ui-icon{width:18px;height:18px}
.nav-link.sub .ui-icon{width:15px;height:15px}
.sidebar-bottom{margin-top:auto;padding:14px 10px;font-size:11px}
.topbar{padding:13px 26px 4px;min-height:53px;background:transparent;border:0;box-shadow:none;position:static}
.page-title{font-size:24px;letter-spacing:-.025em;color:#1a2e47}
.content{max-width:none;padding:11px 17px 30px 26px}
.stack{gap:13px}
.panel{border-radius:11px;padding:13px;border-color:var(--line);box-shadow:var(--shadow)}
.panel h2{font-size:15px;font-weight:800;margin:0 0 9px}
.toolbar{margin-bottom:0;gap:9px}
.top-controls{margin-bottom:3px}
.btn{border-color:#c7d8e6;color:#254466;font-size:12.5px;font-weight:650;padding:8px 11px;border-radius:7px}
.btn.small{font-size:12px}
.btn.primary{background:#266fbb;border-color:#266fbb}
.period-selectors select{font-size:13px;font-weight:750;border-color:#cbd9e6;background:#fff;min-height:37px;border-radius:8px;padding:7px 12px}
.year-select{min-width:80px}.month-select{min-width:106px}
.section-period{display:flex;align-items:baseline;gap:9px;color:#24405f}
.section-period strong{font-size:14px}.section-period span{font-size:12px;color:#667c90}
.dashboard-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.dashboard-kpi{position:relative;background:#fff;border:1px solid var(--line);border-radius:11px;padding:13px 13px 11px;min-height:80px;box-shadow:var(--shadow)}
.dashboard-kpi.focus{background:#e5f2ff;border-color:#acd2fa}
.dashboard-kpi>span{display:block;color:#3b5875;font-size:12px;margin-bottom:10px}
.dashboard-kpi>svg{position:absolute;right:13px;top:14px;width:14px;height:14px;color:#365574}
.dashboard-kpi strong{display:block;color:#17293f;font-size:22px;letter-spacing:-.025em;font-weight:820;white-space:nowrap;font-variant-numeric:tabular-nums}
.dashboard-columns{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(300px,1fr);gap:12px}
.dashboard-chart-panel,.dashboard-income-panel{min-height:312px;padding:14px 13px 11px}
.dashboard-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.dashboard-panel-head h2{font-size:15px;color:#1d3049;margin-bottom:5px}
.dashboard-panel-head p{font-size:11px;color:#718499;margin:0}
.dashboard-legend{display:flex;gap:12px;flex-wrap:wrap;align-items:center;font-size:10.5px;color:#536c7d}
.dashboard-legend i{display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:3px}
.dashboard-legend .green{background:#609b80}.dashboard-legend .beige{background:#d9bf8f}.dashboard-legend .blue{background:#94b2d1}
.dashboard-chart-grid{height:209px;position:relative;display:grid;grid-template-columns:repeat(12,minmax(0,1fr));align-items:end;margin-top:7px}
.dashboard-chart-grid>span.line25,.dashboard-chart-grid>span.line50,.dashboard-chart-grid>span.line75{position:absolute;z-index:0;left:0;right:0;height:1px;background:#e7edec;pointer-events:none}
.line25{bottom:61px}.line50{bottom:109px}.line75{bottom:158px}
.dashboard-month{background:transparent;border:0;padding:0 1px;min-width:0;position:relative;z-index:1;display:flex;flex-direction:column;align-items:stretch;gap:7px;color:#57718a;min-height:206px;justify-content:end}
.dashboard-month:hover .dashboard-month-name{color:#206b9e;font-weight:800}
.dashboard-bar-area{display:flex;align-items:flex-end;justify-content:center;height:192px;gap:3px;border-bottom:1px solid #dbe6ed;padding:0 2px}
.dashboard-bar{display:block;max-width:12px;width:25%;min-width:2px;border-radius:4px 4px 0 0}
.dashboard-bar.green{background:#73a08b}.dashboard-month.selected .dashboard-bar.green{background:#295b3b}
.dashboard-bar.beige{background:#dac49f}.dashboard-bar.blue{background:#92b3d4}
.dashboard-month-name{display:block;text-align:center;font-size:10.5px;padding-bottom:1px}
.chart-help{font-size:10.5px;color:#5c768e;margin-top:13px;line-height:1.4}
.income-breakdown{display:grid;margin-top:16px}
.income-breakdown-row{display:flex;gap:10px;align-items:center;padding:14px 0;border-bottom:1px solid #e9edf1}
.income-type-icon{flex:none;display:grid;place-items:center;height:34px;width:34px;border-radius:9px}
.income-type-icon svg{height:16px;width:16px}
.income-breakdown-body{flex:1;min-width:0}
.income-breakdown-caption{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:11px;color:#223b57}
.income-breakdown-caption strong{white-space:nowrap;font-size:11px;color:#243e5a}
.income-progress{margin-top:7px;width:74%;max-width:280px;height:3px;background:#e7eae8;overflow:hidden}
.income-progress span{height:3px;display:block}
.dashboard-text-link{border:0;background:transparent;padding:13px 0 2px;color:#2474b5;font-size:11.5px;display:flex;align-items:center;gap:6px}
.dashboard-text-link svg{width:12px;height:12px}
.dashboard-year-panel{padding:0;overflow:hidden}
.dashboard-year-title{background:#eaf4ff;padding:14px 15px;display:flex;justify-content:space-between;align-items:center;gap:10px}
.dashboard-year-title h2{margin:0;font-size:15px;color:#21466c}
.dashboard-year-title span{font-size:11px;color:#66819b}
.dashboard-year-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
.year-cell{padding:17px 18px 16px;border-right:1px solid #e0e8ef;border-bottom:1px solid #e0e8ef;min-height:83px}
.year-cell:nth-child(3n){border-right:0}.year-cell:nth-last-child(-n+3){border-bottom:0}
.year-cell span{display:block;color:#607a96;font-size:11.5px;font-weight:700;margin-bottom:8px}
.year-cell strong{color:#1d4568;font-weight:820;font-size:21px;white-space:nowrap}
.dashboard-year-note{border-top:1px solid #dbe5ef;background:#f6f9fc;color:#64809a;font-size:10px;padding:11px 14px}
.view-tabs{display:flex;gap:0;border-bottom:1px solid #ccdbeb;overflow-x:auto;white-space:nowrap}
.view-tabs .tab{border:0;border-radius:6px 6px 0 0;background:transparent;color:#4c6680;padding:11px 14px;font-size:12.5px;flex:none}
.view-tabs .tab.active{color:#1f598e;background:#e5f2ff;border-bottom:3px solid #287aca}
.expense-month-panel{padding:12px;border-radius:10px}
.expense-period-bar{background:#edf6ff;display:flex;align-items:center;justify-content:space-between;max-width:100%;min-height:43px;padding:5px 13px;font-size:15px;color:#234565}
.expense-period-bar .btn{border-color:#b6d4ed;color:#2677ad;font-size:19px;min-width:31px;min-height:28px;padding:0}
.expense-matrix{table-layout:fixed;min-width:680px;max-width:none}
.expense-matrix th,.expense-matrix td{width:auto;min-width:110px;position:static;text-align:left!important;white-space:normal}
.expense-matrix th{color:#fff;background:#2d5a7a;font-size:12.5px;padding:10px;font-weight:800}
.expense-matrix th.c0{background:#2e607d}.expense-matrix th.c1{background:#36747b}.expense-matrix th.c2{background:#3d5d77}.expense-matrix th.c3{background:#6d637b}.expense-matrix th.c4{background:#607b7b}.expense-matrix th.c5{background:#56728b}
.expense-matrix td{height:50px;padding:8px 9px;vertical-align:top}
.expense-matrix tbody tr:nth-child(even):not(.expense-sums):not(.expense-add-row) td{background:#f5f7fb}
.expense-entry{display:flex;align-items:flex-start;justify-content:space-between;gap:5px}
.expense-entry strong{font-size:12.5px;color:#254b71;font-weight:850}
.expense-entry small{display:block;margin-top:5px;font-size:10.5px;line-height:1.3;color:#657e90;max-width:175px}
.expense-matrix .cell-plus{background:#daecff;border-radius:5px;font-size:15px;min-width:21px;height:22px}
.expense-matrix .expense-sums td{background:#dceefa!important;font-weight:800;color:#254963;padding:12px 10px;height:auto}
.expense-add-row td{padding:7px!important;background:#fff!important;height:44px}
.expense-add-row button{border:1px dashed #b8d9f4;background:#eaf5ff;color:#2772ab;border-radius:6px;display:block;width:100%;font-size:11.5px;padding:7px 1px;font-weight:700}
.expense-add-row button:hover{background:#d9eefe}
.stats-row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:12px 0}
.stats-row>div{border:1px solid #dae5ed;border-radius:8px;padding:12px}
.stats-row span{display:block;font-size:11px;color:#647d91}.stats-row strong{font-size:19px;color:#214667}
.table-link{background:transparent;border:0;text-decoration:underline;color:#236eab;font-weight:800}
.history-comment{text-align:left;white-space:normal;min-width:190px}
.domain-year-total{display:flex;gap:10px;justify-content:space-between;align-items:center;padding:14px 17px;background:#e6f2fc;border:1px solid #c6ddee;border-radius:9px;color:#244767;margin:11px 0}
.domain-year-total strong{font-size:22px}
.domain-grid{display:grid;grid-template-columns:repeat(3,minmax(210px,1fr));gap:12px}
.domain-month{min-width:0;border:1px solid #d5e3ec;border-radius:8px;overflow:hidden;background:#fff}
.domain-month-title{display:flex;justify-content:space-between;align-items:center;padding:11px 12px;background:#eaf3fb;font-size:12.5px;color:#244e70}
.domain-month-title span{font-weight:850}
.domain-payment{display:flex;align-items:center;justify-content:space-between;gap:8px;text-align:left;background:#fff;border:0;border-bottom:1px solid #e9edf3;padding:9px 12px;width:100%;font-size:11.5px}
.domain-payment:hover{background:#f0f7fc!important}
.domain-name{display:block;min-width:0;overflow-wrap:anywhere;color:#1c3e58;font-weight:700}
.domain-name small{display:block;margin-top:3px;font-weight:400;color:#687b8d}
.domain-sum{white-space:nowrap;font-weight:800;color:#1d496c}
.domain-sum small{color:#31835d}
.domain-quick-add{border:0;border-radius:0;font-size:11.5px;background:#f7fafc;color:#35678b;padding:9px 11px;width:100%}
.domain-directory{margin-top:16px;border-top:1px solid #e0e8ef;padding-top:12px}
.domain-directory>div{display:flex;gap:6px;flex-wrap:wrap}
.domain-directory .btn{font-size:10.5px}
.table-scroll th,.table-scroll td{font-size:12px;padding:9px}
#sync-badge{font-size:11px;padding:5px 8px}
@media(max-width:1200px){.sidebar{width:195px;min-width:195px}.content{padding:13px 14px 30px}.dashboard-columns{grid-template-columns:minmax(0,1fr)}.domain-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:770px){.sidebar{display:none}.topbar{padding:10px 13px 0;min-height:51px;position:sticky;background:#f3f6fa}.content{padding:12px 10px 85px}.page-title{font-size:19px}.dashboard-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-kpi strong{font-size:18px}.dashboard-columns{grid-template-columns:1fr}.dashboard-chart-panel{overflow:hidden}.dashboard-chart-grid{overflow-x:auto}.dashboard-month{min-width:34px}.dashboard-income-panel{min-height:0}.dashboard-year-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.year-cell:nth-child(3n){border-right:1px solid #e0e8ef}.year-cell:nth-child(even){border-right:0}.year-cell:nth-last-child(-n+3){border-bottom:1px solid #e0e8ef}.year-cell:nth-last-child(-n+2){border-bottom:0}.year-cell strong{font-size:17px}.dashboard-year-title{padding:12px}.dashboard-year-title span{display:none}.domain-grid{grid-template-columns:1fr}.dashboard-legend{gap:7px;font-size:10px}.period-selectors{gap:6px}}
.sidebar-bottom{opacity:1;border-top:1px solid #36516a;padding:14px 6px}
.sidebar-backup{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:11px 9px;min-height:42px;background:#d9f2ec;border:0;border-radius:7px;color:#1b4d50;font-weight:800;font-size:11px;line-height:1.2}
.sidebar-backup .ui-icon{height:18px;width:18px;flex:none}
.sidebar-backup:hover{background:#c8eae1}
.sidebar-bottom>small{display:block;margin-top:9px;font-size:9px;text-align:center;line-height:1.4;color:#bdd1df}
.mobile-menu-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.mobile-menu-grid button{display:flex;align-items:center;gap:10px;text-align:left;border:1px solid #d4e3ed;border-radius:9px;padding:13px 9px;background:#f7fafc;color:#23425e;font-size:13px;font-weight:700}
.mobile-menu-grid button:hover{background:#e4f3fc}
.mobile-menu-grid button .ui-icon{flex:none;width:18px;height:18px}
@media(max-width:420px){.mobile-menu-grid{grid-template-columns:1fr}}
.check-label{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600}
.check-label input{width:auto!important;margin:0!important}
/* Tab rows match the original cabinet's lightweight underlined navigation. */
.stack>.tabs:not(.view-tabs){border-bottom:1px solid #cbdbe8;gap:0;white-space:nowrap;overflow:auto}
.stack>.tabs:not(.view-tabs) .tab{border:0;border-radius:6px 6px 0 0;background:transparent;padding:11px 14px;font-size:12.5px;flex:none;color:#4a6580}
.stack>.tabs:not(.view-tabs) .tab.active{border-bottom:3px solid #2b7dbe;background:#e7f3ff;color:#1b5a8a}

/* Version 1.4: align structure and interaction density with the original cabinet. */
:root{--navy:#192f4a;--line:#d3e0eb;--bg:#f3f6fa}
body{background:var(--bg)}
.sidebar{width:195px;min-width:195px}
.sidebar .nav-link.sub{font-size:12px}
.nav-link.active{background:#325b80}
.content{max-width:none;padding:20px 26px 70px}
.topbar{padding-left:26px}
.top-controls{margin-bottom:0;align-items:center;min-height:43px}
.period-selectors .period-arrow{width:27px;height:31px;min-height:31px;padding:0 5px;color:#246495;font-size:20px;line-height:1}
.period-selectors select{height:37px;border-radius:7px}
.toolbar-right .btn{font-size:12px}
.view-tabs{margin:0 0 -4px}
.expense-month-panel{padding:12px;border:1px solid #d6e2ed}
.expense-period-bar{padding:8px 12px;display:flex;align-items:center;justify-content:space-between;gap:10px;background:#ebf5ff}
.expense-period-left,.expense-period-right{display:flex;align-items:center;gap:13px}
.expense-period-left strong{font-size:14px;color:#203e59;min-width:124px;text-align:center}
.expense-period-right span{font-size:11px;color:#455f77}
.expense-period-right strong{font-size:17px;color:#18528b;white-space:nowrap}
.expense-period-right .btn{border:1px solid #c5daeb;background:#fff;color:#235f91;font-size:11px;min-height:33px}
.expense-matrix th{font-weight:800;padding:10px 9px}
.expense-matrix th.c0{background:#2e5d7c}.expense-matrix th.c1{background:#31717b}.expense-matrix th.c2{background:#415f7c}.expense-matrix th.c3{background:#876c54}.expense-matrix th.c4{background:#686386}.expense-matrix th.c5{background:#317369}
.expense-matrix tbody td{height:55px}
.expense-matrix .expense-sums td{border-top:2px solid #94c6eb;background:#dceefa!important;padding:12px 9px}
.expense-matrix .expense-add-row td{height:40px}
.expense-matrix .expense-add-row button{font-size:11px}
/* Monthly promotion: compact cells, one row per contract, with reordering and deletion. */
.promotion-panel{padding:13px;overflow:hidden}
.promo-actionbar{display:flex;align-items:center;justify-content:space-between;background:#eff6fd;gap:12px;padding:10px 12px;margin:0;border-bottom:1px solid #d3e4f1}
.promotion-table{width:100%;min-width:1130px;table-layout:fixed}
.promotion-table th{font-size:11px;background:#293f5a;color:#fff;text-align:center;padding:10px 5px;white-space:nowrap}
.promotion-table th:first-child{text-align:left;width:228px}
.promotion-table th:last-child{width:90px;background:#2f5975}
.promotion-table td{font-size:11px;padding:3px 5px;text-align:center;border:1px solid #d5e1eb;height:31px;white-space:nowrap;color:#223b57}
.promotion-table tbody tr:nth-child(even):not(.total) td.payment-client-name{background:#f1f5f9}
.promotion-table .payment-client-name{text-align:left;padding:2px 5px;background:#fff;position:sticky;left:0;z-index:2}
.promotion-table .client-inline{display:flex;align-items:center;gap:5px;min-width:0}
.promotion-table .order-buttons{display:grid;grid-template-rows:repeat(2,10px);gap:0;width:15px;flex:none}
.promotion-table .order-arrow{border:0;background:transparent;height:11px;line-height:9px;font-size:13px;color:#5b7d9e;padding:0}
.promotion-table .client-name-btn{text-align:left;flex:1;min-width:0;background:transparent;border:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:760;color:#253b52;padding:4px 0}
.promotion-table .client-name-btn:hover{text-decoration:underline}
.promotion-table .client-delete{border:0;background:transparent;display:grid;place-items:center;color:#ad7184;width:18px;height:19px;flex:none;padding:0}
.promotion-table .client-delete svg{height:14px;width:14px}
.promotion-table .payment-cell{cursor:pointer;font-variant-numeric:tabular-nums}
.promotion-table .payment-cell:hover{box-shadow:inset 0 0 0 2px #459ed6}
.promotion-table .payment-cell.has-entry:not([style*="background"]) {background:#eaf3f6}
.promotion-table .payment-cell strong{font-size:11px;font-weight:760}
.promotion-table .cell-empty-plus{color:#628fc2;font-size:15px;display:inline-block;width:100%}
.promotion-table td.total{font-weight:820;background:#e5eff7!important;font-size:11px}
.promotion-table tr.total td{font-size:11px;font-weight:820}
.promotion-table .color-selected{box-shadow:inset 0 0 0 2px #2679bf}
/* Investments: editable monthly summary and history tabs. */
.investment-wrap{border:1px solid var(--line);border-radius:10px;overflow:auto;background:#fff}
.investment-table{width:100%;min-width:850px;table-layout:fixed}
.investment-table th{font-weight:800;color:#fff;font-size:12px;padding:13px 12px}
.investment-head-month{background:#243c59!important;text-align:left!important;width:12%}
.investment-head-my{background:#2b5c7d!important}.investment-head-salary{background:#415f81!important}.investment-head-investments{background:#656184!important}.investment-head-total{background:#266348!important}.investment-head-invested{background:#5c7189!important}
.investment-table td{font-weight:720;padding:10px 11px;font-size:12px;text-align:right;height:40px}
.investment-table td.month-name{text-align:left;font-weight:800}
.investment-table tbody tr:nth-child(even):not(.total):not(.average) td:not(.highlight-green){background:#f2f6fa}
.investment-table td.highlight-green{background:#e2f1e5;color:#205839}
.investment-table .cell-content{justify-content:flex-end}
.investment-table tr.total td{background:#dcebf9!important;color:#203e5b;font-weight:900}
.investment-table tr.average td{background:#eaf4fd!important;color:#316ca1;font-weight:800}
.invest-shortcuts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.invest-shortcuts .btn{justify-content:center}
/* Portfolio replicates an annual valuation snapshot dashboard. */
.portfolio-v14{gap:15px}
.portfolio-overview{padding:0;overflow:hidden}
.portfolio-section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px 18px;background:#edf6ff;border-bottom:1px solid #d7e5f2}
.portfolio-section-head h2{font-size:18px;margin:0;color:#204667}
.portfolio-section-head p{margin:5px 0 0;font-size:11px;color:#5a7896}
.portfolio-overview-grid{display:grid;grid-template-columns:30% 70%;min-height:345px}
.portfolio-kpis{padding:27px 23px 23px;background:#f8fbfd;border-right:1px solid #dae6ef}
.portfolio-kpis>.hint{display:block;font-size:12px;font-weight:720}
.big-money{font-size:37px;color:#204667;font-weight:850;line-height:1.15;letter-spacing:-.025em;margin:14px 0 15px}
.portfolio-kpis>.muted{font-size:12px;line-height:1.55;margin-bottom:20px}
.portfolio-stats{display:grid;grid-template-columns:repeat(2,1fr);border-top:1px solid #d8e5f0;padding-top:17px;gap:8px}
.portfolio-stats>div{display:grid;gap:4px}.portfolio-stats span,.last-updated span{font-size:11px;color:#7492a8}.portfolio-stats strong{font-size:21px;color:#204765}
.last-updated{display:grid;gap:5px;margin-top:16px}.last-updated strong{font-size:14px}
.portfolio-warning{margin-top:18px;background:#fff7e9;border:1px solid #f1d8a9;color:#8c6c40;border-radius:8px;padding:12px;font-size:11px;line-height:1.5}
.portfolio-graphic{display:grid;grid-template-columns:minmax(205px,35%) minmax(0,1fr);align-items:center;gap:18px;padding:22px 22px 25px}
.portfolio-donut{width:min(20vw,260px);height:min(20vw,260px);min-width:190px;min-height:190px;margin:auto}
.portfolio-donut:after{inset:24%;z-index:0;pointer-events:none}
.portfolio-donut .donut-core{display:grid;place-items:center;position:relative;z-index:1;gap:6px}
.portfolio-donut .donut-core small{font-size:11px;color:#7392a7}
.portfolio-donut .donut-core strong{font-size:17px;color:#254d70;white-space:nowrap}
.asset-legend{min-width:0}.asset-legend-line{display:flex;align-items:center;gap:9px;border-bottom:1px solid #e6edf3;padding:9px 0}
.asset-mark{height:10px;width:10px;border-radius:2px;flex:none}.asset-name-line{flex:1;min-width:0}.asset-name-line strong{font-size:12px;display:block;color:#2a4562}.asset-name-line small,.asset-legend-value small{font-size:10px;color:#829ab0;display:block;margin-top:4px}
.asset-legend-value{text-align:right;white-space:nowrap}.asset-legend-value strong{font-size:12px;color:#223f5d}
.portfolio-history{padding:0;overflow:hidden}.portfolio-history-actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.segmented{display:flex;padding:3px;gap:3px;background:#e2edf8;border-radius:8px}.segmented button{background:transparent;border:0;color:#426b92;font-weight:750;font-size:11px;padding:8px 12px;border-radius:6px;white-space:nowrap}.segmented button.selected{background:#fff;color:#135c95;box-shadow:0 1px 4px #133b5e1c}
.portfolio-history-table th{background:#273f5a;color:white;padding:11px 8px;font-size:11px;text-align:right}.portfolio-history-table th:first-child{text-align:left;min-width:175px}.portfolio-history-table th:nth-last-child(2){background:#2c5c80}.portfolio-history-table th:last-child{background:#2e6a88}
.portfolio-history-table td{height:50px;text-align:right;font-size:11.5px;font-weight:700}.portfolio-history-table tbody tr:nth-child(even):not(.total) td{background:#f5f8fc}
.portfolio-history-table .asset-table-name{text-align:left;min-width:175px}.asset-table-controls{display:flex;align-items:center;gap:7px}.asset-table-controls>strong{flex:1;font-size:12px}.move-arrows{display:grid;grid-template-rows:repeat(2,11px)}.mini-action{border:0;background:transparent;padding:1px;color:#4c81b1;font-size:12px}.mini-action svg{height:13px;width:13px}.mini-action.danger-link{color:#b36c7d}.carried-value{color:#829cb7}.portfolio-history-table td.latest-value{background:#e6f1fb!important;color:#1d517b}.latest-value small{display:block;font-size:10px;color:#7691a8;margin-top:3px}.asset-share{color:#216960}
/* Notes: searchable private journal with tabs and empty state. */
.notes-hero,.plan-hero{display:flex;align-items:center;justify-content:space-between;gap:25px;border:1px solid #cedfef;background:linear-gradient(120deg,#f5f9ff,#e8f3fc);border-radius:11px;padding:27px 26px}
.notes-hero>div,.plan-hero>div:first-child{max-width:720px}.hero-kicker{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:800;color:#2d719c}.hero-kicker svg{height:15px;width:15px}
.notes-hero h2,.plan-hero h2{font-size:23px;margin:14px 0 8px;color:#1b4569}.notes-hero p,.plan-hero p{font-size:12px;color:#597a9b;line-height:1.6;margin:0}
.notes-counts{display:flex;gap:24px;color:#7691a9;font-size:11.5px;align-items:center}.notes-counts strong{font-size:14px;color:#184d74}.notes-counts svg{height:14px;width:14px}
.notes-panel{padding:0;overflow:hidden}.notes-filter-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px;border-bottom:1px solid #dce6ef}.notes-filter-buttons{display:flex;gap:6px;flex-wrap:wrap}.notes-filter{border:0;border-radius:7px;padding:10px 13px;background:#eef4f9;color:#4d6c87;font-size:11.5px;font-weight:760}.notes-filter.selected{background:#265d89;color:#fff}
.notes-search{position:relative;display:flex;align-items:center;max-width:270px;width:100%}.notes-search>svg{position:absolute;width:16px;height:16px;left:10px;color:#8a9eb0}.notes-search input{padding-left:32px;font-weight:400;font-size:12px}
.notes-cards{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;padding:15px}
.notes-empty{display:grid;place-items:center;text-align:center;align-content:center;gap:12px;min-height:250px;color:#6482a0}.notes-empty>svg{width:34px;height:34px;color:#85a5c0}.notes-empty strong{font-size:16px;color:#2c5579}.notes-empty p{font-size:12px;margin:0}.notes-empty .btn{min-width:150px}
/* Financial plan: original goal dashboard, target/actual progress and editor. */
.plan-v14{gap:15px}.plan-hero{min-height:155px}.goals-configured{border:1px solid #c7deef;background:#fff;min-width:125px;min-height:110px;border-radius:12px;display:grid;place-items:center;align-content:center;gap:7px}.goals-configured>strong{font-size:35px;color:#1c577f;line-height:1}.goals-configured small{font-size:16px;color:#87a2b5}.goals-configured>span{font-size:10.5px;color:#7894a8}
.plan-status{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:11px;color:#6685a1}.plan-status span:first-child{color:#39846a;font-weight:700}.plan-status svg{height:15px;width:15px}
.goal-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.goal-card{padding:20px 21px}.goal-header{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;margin-bottom:24px}.goal-header h2{font-size:16px;color:#204769;margin:0 0 4px}.goal-header p{font-size:11.5px;color:#7792aa;margin:0}.goal-icon-button{height:30px;width:30px;border:0;border-radius:7px;background:#edf5ff;color:#3973a6;display:grid;place-items:center}.goal-icon-button svg{height:17px;width:17px}
.goal-actual,.goal-target,.goal-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px}.goal-actual span,.goal-target span{font-size:11px;color:#718da7}.goal-actual strong{font-size:21px;color:#214d71}.goal-target{margin-top:10px}.goal-target strong{font-size:12px;color:#3c6d92}.goal-progress{background:#e7eef4;border-radius:99px;height:10px;margin:13px 0 14px;overflow:hidden}.goal-progress>span{display:block;height:100%;background:linear-gradient(90deg,#5795bf,#3573a3);border-radius:99px}.goal-bottom{font-size:10.5px;color:#7590a9}.goal-bottom strong{color:#2c6697}.goal-link{border:0;background:transparent;color:#216bad;padding:14px 0 0;font-size:11px;font-weight:850;display:flex;align-items:center;gap:4px}.goal-link>svg{width:13px;height:13px}
@media(max-width:1300px){.portfolio-overview-grid{grid-template-columns:1fr}.portfolio-kpis{border-right:0;border-bottom:1px solid #dae6ef}.portfolio-graphic{grid-template-columns:minmax(210px,35%) 1fr}.portfolio-donut{height:220px;width:220px}}
@media(max-width:930px){.expense-period-bar{flex-wrap:wrap}.portfolio-graphic{grid-template-columns:1fr}.notes-filter-bar{flex-wrap:wrap}.goal-grid{grid-template-columns:1fr}}
@media(max-width:770px){.content{padding:12px 10px 85px}.topbar{padding:10px 12px}.period-selectors{flex-wrap:wrap}.expense-period-right{flex-wrap:wrap;justify-content:flex-start}.expense-period-right>strong{font-size:15px}.notes-hero,.plan-hero{padding:19px 15px;flex-wrap:wrap}.notes-hero h2,.plan-hero h2{font-size:19px}.notes-cards{grid-template-columns:1fr}.goals-configured{min-height:84px}.portfolio-overview-grid{display:block}.portfolio-kpis{padding:20px 15px}.portfolio-graphic{padding:16px}.portfolio-section-head{padding:12px;flex-wrap:wrap}.portfolio-section-head h2{font-size:16px}.portfolio-donut{width:210px;height:210px}.invest-shortcuts{grid-template-columns:1fr}.goal-card{padding:16px}.goal-actual strong{font-size:17px}}
/* Long annual matrices are deliberately compact at desktop widths. */
.receipts-table,.properties-table{width:100%;table-layout:fixed;min-width:1180px}
.receipts-table th,.properties-table th{background:#293e59;color:#fff;font-weight:800;padding:8px 4px;font-size:10.5px}
.receipts-table th:first-child,.properties-table th:first-child{width:155px;text-align:left}
.receipts-table th:last-child,.properties-table th:last-child{background:#326385}
.receipts-table td,.properties-table td{font-size:10.5px;padding:5px 4px;height:38px;text-align:right}
.receipts-table td:first-child,.properties-table td:first-child{text-align:left}
.receipts-table .cell-content{gap:2px;align-items:center;justify-content:flex-end;white-space:nowrap}
.receipts-table .cell-plus{width:18px;height:20px;min-width:18px;font-size:12px;padding:0}
.receipts-table .btn.small{font-size:10px;min-height:22px;padding:2px 4px}
.receipts-table tr.total td,.properties-table tr.total td{font-weight:850;background:#dcebf6}
@media(max-width:1250px){.receipts-table,.properties-table{min-width:1250px}}


/* v1.5 readability: use the available width, retain horizontal scrolling on phones. */
.receipts-table{min-width:1430px;table-layout:fixed}
.receipts-table th{font-size:12px;padding:11px 5px}
.receipts-table td{font-size:12.5px;font-weight:700;padding:7px 5px;height:44px}
.receipts-table td:first-child,.receipts-table th:first-child{min-width:165px;width:165px}
.receipts-table .source-title{display:flex;align-items:center;gap:5px;justify-content:space-between}
.receipts-table .source-title strong{overflow:hidden;text-overflow:ellipsis}
.receipts-table .cell-content{gap:4px}
.receipts-table .cell-plus{width:22px;min-width:22px;height:23px;font-size:14px}
.receipts-table tr.total td{font-size:12.5px}
.properties-table{min-width:1420px;table-layout:fixed}
.properties-table th{font-size:12px;padding:11px 6px}
.properties-table td{font-size:13px;font-weight:740;padding:9px 7px;height:43px}
.properties-table th:first-child,.properties-table td:first-child{width:175px;min-width:175px}
.properties-table .amount-cell{font-weight:760}
.investment-table{min-width:920px}
.investment-table th{font-size:13.5px;padding:13px 12px}
.investment-table td{font-size:14px;padding:12px 13px;height:47px}
.investment-table tr.total td,.investment-table tr.average td{font-size:14px}
.investment-table .cell-plus{width:25px;min-width:25px;height:25px}
.promotion-table{min-width:1400px}
.promotion-table th{font-size:12px;padding:11px 5px}
.promotion-table td{font-size:12.5px;height:36px;padding:4px 5px}
.promotion-table .client-name-btn{font-size:12.5px}
.promotion-table .payment-cell strong,.promotion-table td.total,.promotion-table tr.total td{font-size:12.5px}
.promotion-table th:first-child{width:235px}
/* Compact but readable editing of any decomposed Excel source amounts. */
.detail-row{padding:8px 10px;gap:7px}
.detail-row input[data-detail-amount],.detail-row input[data-add-number],#new-detail-amount{width:160px;min-width:115px;flex:0 1 160px;font-size:14px}
.detail-row input[data-detail-comment],.detail-row input[data-add-comment],#new-detail-comment{flex:1 1 190px;min-width:0;font-size:14px}
.detail-row.is-removed{opacity:.38;text-decoration:line-through}
.detail-total-line{font-size:15px;padding:9px 3px;font-weight:650}
.detail-total-line strong{color:#205b8a;font-size:18px}
@media(max-width:770px){
 .receipts-table{min-width:1430px}.properties-table{min-width:1420px}.promotion-table{min-width:1400px}
 .detail-row input[data-detail-amount],.detail-row input[data-add-number],#new-detail-amount{width:100px;min-width:85px}
 .detail-row{padding:6px;gap:5px}
 .detail-row input[data-detail-comment],.detail-row input[data-add-comment],#new-detail-comment{min-width:90px}
}
/* Keep the annual receipts grid entirely visible on common 1600–1920px monitors. */
.receipts-table{min-width:1345px;width:100%;table-layout:fixed}
.receipts-table th,.receipts-table td{min-width:0;padding-left:3px;padding-right:3px}
.receipts-table th:first-child,.receipts-table td:first-child{width:158px;min-width:158px}
.receipts-table th:nth-last-child(2),.receipts-table td:nth-last-child(2){width:106px}
.receipts-table th:last-child,.receipts-table td:last-child{width:110px}
.receipts-table .cell-content{gap:2px}
@media(max-width:770px){.receipts-table{min-width:1345px}}

/* 1.6: Separate signed adjustment (+/-) from direct expense editing. */
.expense-value-link{border:0;background:transparent;padding:0;margin:0;cursor:pointer;color:#254b71;font-size:12.5px;font-weight:850;text-align:left;line-height:1.3}
.expense-value-link:hover{color:#176aad;text-decoration:underline;text-underline-offset:2px}
.expense-value-link:focus-visible{outline:2px solid #4684ca;border-radius:3px;outline-offset:2px}
.adjust-current{font-size:14px;color:#50677a;margin:0 0 13px}
.adjust-current strong{font-size:15px;color:#1a3b56}
.expense-adjustment{display:grid;gap:10px}
.expense-adjustment label{margin-top:0}
.adjust-result{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:13px;background:#e7f4f8;border-radius:8px;color:#344f64}
.adjust-result strong{font-size:19px;color:#14506f}
.adjust-result strong.adjust-negative{color:#ab2f39}
#expense-adjust-error{min-height:1em;margin:0;font-size:12px}
@media(max-width:770px){.expense-value-link{font-size:13px}.adjust-result strong{font-size:17px}}
/* v1.7: compact income / receipt amount editor, one-click removals */
.income-detail-compact{display:grid;gap:14px}
.income-detail-count{font-size:12px;color:#617991}
.income-amount-list{display:flex;flex-wrap:wrap;gap:8px;align-items:center;max-height:44vh;overflow-y:auto;padding:3px 2px 5px}
.income-amount-pill{display:inline-flex;align-items:center;gap:7px;background:#e6f2ff;border:1px solid #b9d6f1;border-radius:7px;padding:5px 6px 5px 10px;color:#234e7a;font-size:13px;font-weight:700;white-space:nowrap;line-height:1.1}
.income-amount-pill button{min-width:21px;height:22px;display:inline-grid;place-items:center;padding:0;background:#cddff4;color:#234e7a;border:0;border-radius:5px;font-size:16px;font-weight:700}
.income-amount-pill button:hover{background:#f3cfce;color:#9c1d2d}
.income-amount-pill.is-removed{opacity:.5;text-decoration:line-through;background:#f9e8e9;border-color:#f1c9cb}
.income-detail-add{display:flex;align-items:center;gap:10px;border-top:1px solid #dfe9f2;padding-top:14px}
.income-detail-add input{max-width:190px;flex:1}
.income-detail-total{padding-top:12px;border-top:1px solid #dfe9f2;display:flex;justify-content:space-between;align-items:center;font-weight:700}
.income-detail-total strong{font-size:20px;color:#16456e}
@media(max-width:560px){.income-amount-list{max-height:48vh}.income-detail-add{flex-wrap:wrap}.income-detail-add input{max-width:none;min-width:120px}}

/* 1.8: readable, visibly separated data cells on desktop and mobile. */
.expense-matrix,.promotion-table,.property-table,.receipt-table,.income-table,.portfolio-history-table{border-collapse:collapse}
.expense-matrix th,.expense-matrix td,.promotion-table th,.promotion-table td,
.portfolio-history-table th,.portfolio-history-table td,
.table-scroll table th,.table-scroll table td{border:1px solid #d4dfeb}
.expense-matrix td{border-color:#d4dfeb}
.expense-adjustment .btn.danger{color:#a63842}
@media (max-width:770px){
 .table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
 .table-scroll table{min-width:720px}
}

/* Keep category labels visible when a tall financial grid scrolls. */
.table-scroll .expense-matrix thead th,.table-scroll .promotion-table thead th,.table-scroll .portfolio-history-table thead th{position:sticky;top:0;z-index:2}
