/* CABINETTE SETTLEMENT V2.2.2 — compact, spreadsheet-first workspace */
:root{--accent:#3479e6;--nav:#f3f5f9;--bg:#f6f7fa;--ink:#182d41;--line:#e1e7ed}
.sidebar{background:#f4f6fa;border-right:1px solid #e2e8ef;color:#172e44;padding:21px 13px 17px;width:235px}
.sidebar-head{padding:0 3px 28px;gap:10px}.sidebar-head strong{color:#19384e;font-size:16px}.sidebar-head small{color:#92a3b5}.sidebar-head em{color:#3479e6}
.sidebar-head .brandmark.image.small{width:40px;height:63px}
nav button{color:#6f8192;font-weight:700;font-size:12px;padding:12px 12px}
nav button:hover{color:#2e73d0;background:#ebf1fb}nav button.selected{color:#2870dc;background:white;box-shadow:0 0 0 1px #d8e5f6,0 2px 9px #152c4208}
.ni{font-size:18px}.nav-calendar-sep{border-top:1px solid #e2e7ef;margin:18px 7px 12px}
.sidebar-foot{border-top:1px solid #e4e8ee}.sidebar-foot .privacy-dot{color:#8ea2b8}.sidebar-foot .dot{background:#53b591}
.topbar{height:96px;padding:24px 38px 20px}.topbar h2{font-size:21px}.mainbody{max-width:none;padding:34px 36px 65px;min-width:0}
.btn.primary{background:#3478e9;border-color:#3478e9}.btn.primary:hover{background:#2464d3}
.btn:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #6295e9;outline-offset:1px}
.storage-state{color:#698da3;font-size:11px;white-space:nowrap}.storage-state[data-state='error']{color:#b94648}.storage-state[data-state='busy']{color:#ad8736}
.sales-page{display:grid;gap:17px;width:100%;min-width:0}.sales-head{display:flex;align-items:end;justify-content:space-between;gap:15px;flex-wrap:wrap}.sales-head h3{font-size:23px;margin:5px 0 5px}.sales-head p{font-size:12px;margin:0}.sales-top-actions{display:flex;gap:7px;flex-wrap:wrap}
.sales-filters{display:flex;align-items:end;gap:10px;flex-wrap:wrap;background:#fff;padding:13px 15px;border:1px solid #e4eaf0;border-radius:11px}
.sales-filters label{font-size:10px;font-weight:750;color:#8192a0;display:grid;gap:4px}.sales-filters select,.sales-filters input{height:34px;border-radius:7px;border:1px solid #dce5ee;background:#fff;padding:0 10px;font-size:12px;color:#24445b;min-width:116px}
.sales-filters .search-label{margin-left:4px}.sales-filters .search-label input{min-width:250px}.sales-count{margin-left:auto;font-size:11px;color:#7c90a1;padding-bottom:8px}
.sales-grid-wrap{background:#fff;overflow:auto;max-height:calc(100vh - 325px);min-height:230px;border:1px solid #dfe6ef;border-radius:11px;box-shadow:0 5px 25px #152e4706;overscroll-behavior-x:contain}
.sales-grid{border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;font-size:12px;table-layout:fixed}
.sales-grid thead th{position:sticky;top:0;z-index:5;text-align:left;background:#f4f7fb;border-right:1px solid #dce5ed;border-bottom:1px solid #cad8e7;vertical-align:middle;height:58px;padding:0 7px;white-space:nowrap;color:#4d6579}
.sales-grid th.sheet-rowno{position:sticky;left:0;z-index:7;min-width:50px;max-width:50px;width:50px;text-align:center;background:#f2f5f9;color:#92a2b0;font-size:11px;border-right:1px solid #dce5ed}
.sales-grid thead th.sheet-rowno{z-index:9}.sheet-th{display:flex;flex-direction:column;gap:2px}.sheet-letter{font-size:9px;color:#9babbd;letter-spacing:1px}.sheet-th button{border:0;background:none;padding:0;color:#36576b;font-size:11px;font-weight:750;text-align:left;cursor:default}.sheet-th button.sortable{cursor:pointer}.sheet-th button.sortable:hover{color:#3478e9}.sheet-th small{color:#86a3c8;font-weight:400}
.sales-grid td{height:40px;padding:0;border-right:1px solid #e9eef3;border-bottom:1px solid #e9eef3;background:white;min-width:80px}
.sales-grid tbody tr:hover td{background:#fafcff}.sales-grid tbody th.sheet-rowno{height:40px;font-weight:500}.sheet-input,.cell-select{width:100%;height:39px;border:0;border-radius:0;outline:0;background:transparent;color:#22394b;padding:0 9px;font-size:12px;text-overflow:ellipsis;min-width:0}
.sheet-input:focus,.cell-select:focus{outline:2px solid #3b84eb;outline-offset:-2px;background:#f4f9ff;box-shadow:none}.sheet-input.num-field{text-align:right;font-variant-numeric:tabular-nums}
.sales-grid .computed-cell{background:#f8fafc}.sales-grid .computed-cell .calculated{display:block;padding:11px 9px;text-align:right;font-size:11px;font-weight:700;color:#416e96;white-space:nowrap}
.sales-grid .computed-cell:first-child .calculated{text-align:left}.cell-select{font-size:11px;color:#35506a}.cell-select.status-control{font-weight:700;color:#336ab0}
.sales-grid .sheet-actions-col{width:54px;max-width:54px;min-width:54px;text-align:center}.delete-row{border:0;border-radius:6px;padding:4px 8px;color:#aeb8c2;background:transparent;font-size:20px}.delete-row:hover{color:#b74242;background:#fff0f0}
.sheet-foot{display:flex;justify-content:space-between;gap:14px;align-items:center;color:#8797a5;font-size:11px}.sheet-foot>div{display:flex;gap:9px;align-items:center}.sheet-foot b{font-size:11px;color:#657c8f}.sheet-disclaimer{font-size:11px;color:#8899a6;margin:0}
.column-manager{max-height:300px;overflow:auto;border:1px solid #e8edf2;border-radius:9px;margin-bottom:17px}.column-manager-item{padding:11px 12px;display:flex;align-items:center;gap:10px;border-bottom:1px solid #edf1f4}.column-manager-item:last-child{border-bottom:0}.column-manager-item strong{font-size:12px}.column-manager-item small{color:#8799a8;font-size:11px;margin-right:auto}
.column-form{display:flex;gap:10px;align-items:end;flex-wrap:wrap}.column-form label{display:grid;gap:6px;font-size:11px;color:#637c8f;font-weight:700;flex:1}.column-form input,.column-form select{height:38px;border:1px solid #d5e0e9;border-radius:8px;padding:7px;min-width:130px}.formula-guide p{font-size:12px}.formula-guide code{background:#f0f5fa;color:#24517c;padding:3px 5px;border-radius:3px}
.analysis-dashboard{max-width:none;gap:18px}.analysis-toolbar{align-items:end}.analysis-kpis article{min-height:127px}.analysis-kpis strong{font-size:clamp(17px,1.65vw,25px)}
.sales-trend{display:flex;align-items:flex-end;gap:11px;height:245px;padding:18px 6px 3px;border-top:1px solid #f1f4f7}.trend-col{height:100%;flex:1;display:flex;flex-direction:column;align-items:center;min-width:0;gap:4px}.trend-value{font-size:9px;height:13px;color:#7f9ebc;white-space:nowrap}.trend-bar-track{height:calc(100% - 35px);width:min(52px,85%);position:relative;display:flex;align-items:flex-end;background:linear-gradient(to top,#edf2f7 1px,transparent 1px) 0 0/100% 25%}.trend-bar-track>div{background:#668dc7;max-height:100%;width:100%;border-radius:4px 4px 0 0}.trend-col small{color:#8e9fae;font-size:10px}
.bars-list{display:grid;gap:15px;max-height:320px;overflow:auto}.bar-item{display:grid;gap:6px}.bar-item-head{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:12px}.bar-item-head span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#587087}.bar-item-head b{flex:none;font-size:11px;color:#324e66}.bar-track{background:#eef2f6;border-radius:9px;height:7px;overflow:hidden}.bar-track>span{display:block;height:100%;border-radius:9px}
.finance-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.finance-grid>div{padding:17px;background:#f6f9fb;border-radius:9px;display:flex;flex-direction:column;gap:10px}.finance-grid small{font-size:11px;color:#8295a6}.finance-grid strong{font-size:clamp(15px,1.65vw,23px);color:#25435a}.analysis-section{margin-bottom:0}
@media(max-width:1180px){.analysis-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.finance-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:920px){.sidebar{width:190px}.topbar{padding:18px}.mainbody{padding:20px}.topright{gap:7px}.sales-filters .search-label input{min-width:160px}}
@media(max-width:640px){#app{display:block}.sidebar{position:relative;width:100%;height:auto;padding:12px}.sidebar-head{padding:0 0 10px}.sidebar nav{display:flex;flex-direction:row;overflow:auto}.sidebar nav button{white-space:nowrap}.nav-calendar-sep{display:none}.sidebar-foot{display:none}.topbar{height:auto;gap:10px}.topright{flex-wrap:wrap}.mainbody{padding:14px}.analysis-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.analysis-grid{grid-template-columns:1fr}.finance-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.sales-filters .search-label input{min-width:150px}}

/* V2.2.1: dashboard expansion, category master and drill-down detail */
.bars-list.expanded{max-height:none;overflow:visible}
.bar-more{display:block;margin:16px auto 0;padding:8px 17px;border:1px solid #dbe6f4;border-radius:7px;background:#f8fbff;color:#3475c7;font-size:12px;font-weight:700;cursor:pointer}
.bar-more:hover{background:#edf5ff}.bar-more small{font-weight:500;color:#8298b5}
.bar-label-link{border:0;background:none;padding:0;font:inherit;text-align:left;color:#47769b;cursor:pointer;max-width:75%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bar-label-link:hover{text-decoration:underline;color:#216ccc}.bar-label-link:focus-visible{outline:2px solid #3478e9;border-radius:3px}
.category-pills{display:flex;gap:7px;flex-wrap:wrap;margin:10px 0 18px;max-height:270px;overflow:auto}
.category-pill{display:inline-flex;align-items:center;gap:5px;border:1px solid #e0e9f4;background:#f5f8fd;border-radius:15px;color:#536e87;padding:7px 10px;font-size:12px}
.category-pill small{color:#94a8b7;font-size:10px}.category-form{border-top:1px solid #eef2f6;padding-top:15px}
.category-select{font-weight:600;color:#4a7092}
.detail-view{min-width:0}.detail-context{color:#8195a5;font-size:12px;margin:5px 0 15px}.detail-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:14px 0}
.detail-kpis>div{background:#f6f9fc;border:1px solid #ebf0f5;padding:14px 11px;border-radius:9px;display:grid;gap:7px}
.detail-kpis small{color:#8194a7;font-size:11px}.detail-kpis strong{font-size:clamp(13px,1.5vw,20px);color:#214762;white-space:nowrap}
.detail-scroll{max-height:50vh;overflow:auto;border:1px solid #e4eaf1;border-radius:9px}
.detail-table{border-collapse:collapse;width:100%;min-width:760px;font-size:12px}.detail-table th{position:sticky;top:0;background:#f5f8fb;text-align:left;font-weight:700;color:#587086;padding:12px;border-bottom:1px solid #dfe7ef}
.detail-table td{padding:12px;border-bottom:1px solid #edf0f4;color:#425e76}.detail-table .money{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
@media(max-width:700px){.detail-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* V2.2.3: settlement status panel placed next to category sales; purple progress UI. */
.finance-status-panel{display:flex;flex-direction:column;min-height:0}
.finance-status-list{display:grid;gap:10px}
.finance-status-row{padding:10px 12px 9px;border:1px solid #ece9fb;background:#fbfaff;border-radius:9px;display:grid;gap:6px}
.finance-status-top,.finance-status-foot{display:flex;justify-content:space-between;align-items:center;gap:8px;min-width:0}
.finance-status-top strong{font-size:12px;color:#344056}
.finance-status-top span{font-size:11px;color:#5d4acb;font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums}
.finance-status-track{height:7px;border-radius:999px;background:#eae6fa;overflow:hidden}
.finance-status-track>span{display:block;height:100%;background:#7563ea;border-radius:999px}
.finance-status-foot{font-size:10px;color:#8791a3}
.finance-status-note{font-size:10px;color:#9a9aaa;margin:10px 0 0;line-height:1.5}

/* V2.2.8 — monthly sales drill-down and compact settlement status */
.trend-clickable{border:0;background:transparent;appearance:none;cursor:pointer;padding:0;color:inherit;font:inherit;border-radius:6px;transition:background .16s ease}
.trend-clickable:hover{background:#F6F4FF}
.trend-clickable:hover .trend-bar-track>div{filter:brightness(.92)}
.trend-clickable:focus-visible{outline:2px solid #6150F5;outline-offset:3px}
.trend-clickable .trend-bar-track{pointer-events:none}
.monthly-analysis-panel{width:100%;min-width:0}
.monthly-analysis-panel .bars-list{max-height:none;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;overflow:visible}
.monthly-analysis-panel .bar-item{min-width:0;border:1px solid #ECE9F8;border-radius:10px;padding:12px;background:#FCFBFF}
.monthly-analysis-panel .bar-item-head{display:flex;align-items:flex-start;flex-direction:column;gap:8px}
.monthly-analysis-panel .bar-item-head b{font-size:12px;white-space:normal;overflow-wrap:anywhere}
.monthly-analysis-panel .bar-more{margin:12px 0 0}
.finance-status-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.finance-status-card{min-width:0;border-radius:10px;background:#F7F7FB;border:1px solid #EBE9F5;padding:15px 14px;display:flex;flex-direction:column;gap:10px}
.finance-status-card small{font-size:11px;font-weight:700;color:#716F87}
.finance-status-card strong{font-size:clamp(18px,1.55vw,24px);color:#312461;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.finance-status-card strong span{font-size:11px;color:#86819A;font-weight:600}
.finance-status-card p{margin:0;color:#817B96;font-size:11px}
.month-detail-empty{padding:28px!important;color:#8C88A1!important;text-align:center!important}
@media(max-width:1150px){.monthly-analysis-panel .bars-list{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){.monthly-analysis-panel .bars-list{grid-template-columns:repeat(2,minmax(0,1fr))}.finance-status-card{padding:12px 10px}.finance-status-card strong{font-size:17px}}


/* V2.2.9 — monthly chronological listing and combined daily settlement reminders */
.month-ranking-view .ranking-scroll{max-height:min(62vh,720px)}
.month-sort-button{border:0;background:transparent;font:inherit;color:inherit;font-weight:700;cursor:pointer;padding:7px 0;display:inline-flex;align-items:center;justify-content:flex-end;gap:7px;white-space:nowrap}
.month-sort-button span{color:#9888de;font-size:14px}
.month-sort-heading[aria-sort="ascending"] .month-sort-button,.month-sort-heading[aria-sort="descending"] .month-sort-button{color:#6250db}
.month-ranking-view .ranking-table td:first-child{font-weight:650}
.settlement-alert-banner{display:flex;justify-content:space-between;align-items:center;gap:14px;background:#f5f2ff;border:1px solid #e1dbff;border-radius:12px;padding:14px 18px;margin:14px 0 6px}
.settlement-alert-banner-label{display:flex;gap:12px;align-items:center;min-width:0}
.settlement-alert-bell{border-radius:50%;height:30px;width:30px;display:inline-flex;align-items:center;justify-content:center;color:#6351d9;background:#e8e2ff;font-size:15px;font-weight:800;flex:none}
.settlement-alert-banner strong{font-size:13px;color:#32265f}
.settlement-alert-banner p{font-size:11px;color:#766993;margin:5px 0 0}
.settlement-alert-banner .btn{border:1px solid #dad3ff;color:#5d4bcc;background:white;white-space:nowrap}
#modal.settlement-alert-modal .modal-card{width:min(950px,calc(100vw - 36px));max-width:950px;max-height:min(90vh,960px)}
.settlement-alert-intro{background:#f8f7ff;border:1px solid #ece9ff;border-radius:10px;padding:16px;margin-bottom:14px}
.settlement-alert-intro strong{font-size:15px;color:#35276e}
.settlement-alert-intro p{font-size:12px;color:#817c91;margin:5px 0 0;line-height:1.5}
.settlement-alert-scroll{max-height:min(65vh,690px);overflow-y:auto;display:grid;gap:12px;padding-right:4px}
.settlement-alert-entry{border:1px solid #e6e6ef;border-radius:12px;padding:16px;background:white;min-width:0}
.settlement-alert-entry-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.settlement-alert-entry-head strong{font-size:14px;color:#27334c}
.settlement-alert-entry-head p{font-size:11px;color:#8490a2;margin:6px 0 0;line-height:1.5}
.settlement-alert-tags{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:6px}
.settlement-alert-tags span{font-size:10px;padding:5px 8px;border-radius:5px;font-weight:700;white-space:nowrap}
.settlement-alert-tags .alert-tag{color:#be514d;background:#fff0f0}
.settlement-alert-tags .ok-tag{color:#4d8a71;background:#eaf6f0}
.settlement-alert-tags .future-tag{color:#6e7c90;background:#f0f2f6}
.settlement-alert-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin-bottom:12px}
.settlement-alert-state{padding:10px;background:#f6f7fb;border:1px solid #edf0f6;border-radius:7px;display:flex;flex-direction:column;gap:5px;min-width:0}
.settlement-alert-state small{color:#6a7990;font-size:10px}
.settlement-alert-state strong{font-size:12px;color:#65738a}
.settlement-alert-state.pending{border-color:#ffe1e1;background:#fff8f8}
.settlement-alert-state.pending strong{color:#b94747}
.settlement-alert-state.done strong{color:#398061}
.settlement-alert-state.upcoming strong{color:#8e99aa}
.settlement-row-link{border-color:#e1dcff!important;color:#604bd5!important;background:#faf9ff!important}
.sales-grid tr.settlement-target-row td,.sales-grid tr.settlement-target-row th{background:#fff8df!important;box-shadow:inset 0 1px 0 #eacb73,inset 0 -1px 0 #eacb73}
@media(max-width:720px){.settlement-alert-banner{align-items:stretch;flex-direction:column}.settlement-alert-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.settlement-alert-entry-head{flex-direction:column}.settlement-alert-tags{justify-content:flex-start}}
@media(max-width:460px){.settlement-alert-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.settlement-alert-entry{padding:11px}.settlement-alert-scroll{max-height:55vh}}

/* V2.2.12 — persistent save failure, recovery, external changes; preserve 2.2.11 palette. */
.save-risk-banner,.external-change-banner{display:flex;align-items:center;flex-wrap:wrap;gap:10px;border-radius:10px;padding:13px 16px;margin-bottom:14px;background:#fff5f3;border:1px solid #e6bcb9;color:#863d3d;font-size:12px}
.save-risk-banner[hidden],.external-change-banner[hidden]{display:none!important}
.save-risk-banner{display:block}.save-risk-banner strong{display:block;font-size:13px}.save-risk-banner p{margin:5px 0 10px;color:#915957}
.save-risk-item{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid #ebd6d4;padding:9px 0;overflow-wrap:anywhere}.save-risk-item .btn{flex:none}
.external-change-banner{background:#f8f6ff;border-color:#dfdaf8;color:#4e4085}.external-change-banner strong{font-weight:800}
.external-change-banner .btn{margin-left:auto}
.row-save-badge{display:inline-flex;margin-left:3px;align-items:center;justify-content:center;font-weight:800;line-height:1;min-width:14px;height:14px;border-radius:10px;font-size:10px}.row-save-badge.failed{color:white;background:#b94b48}.row-save-badge.pending{color:#6756d8;background:#e8e4ff}
.trash-list{max-height:min(56vh,570px);overflow:auto;display:grid;gap:7px}.trash-item{border:1px solid #e6e2f4;padding:13px;display:flex;gap:14px;justify-content:space-between;align-items:center;border-radius:9px}.trash-item div{display:grid;gap:5px}.trash-item strong{font-size:13px}.trash-item small{font-size:11px;color:#7f899c}.trash-item button{flex:none}
@media(max-width:700px){.trash-item,.save-risk-item{align-items:flex-start;flex-direction:column}}

.row-save-badge.saved{background:#e3f4e9;color:#287a50}.row-save-badge.saving{background:#eae5fb;color:#6756d8}.row-save-badge.pending{background:#ebedf4;color:#77859c}

/* V2.2.12 internal release — user-controlled daily reminder snooze. */
#modal.settlement-alert-modal .modal-card{display:flex;flex-direction:column;overflow:hidden}
#modal.settlement-alert-modal #modalBody{min-height:0;flex:1;display:flex;flex-direction:column}
.settlement-alert-view{min-height:0;display:flex;flex-direction:column;flex:1}
.settlement-alert-view .settlement-alert-scroll{min-height:0;flex:1;max-height:none;overflow-y:auto;overscroll-behavior:contain}
.settlement-alert-actions{display:flex;align-items:center;justify-content:space-between;gap:14px;padding-top:16px;border-top:1px solid #ebe8f4;margin-top:14px;flex:none}
.settlement-alert-snooze{display:inline-flex;align-items:center;gap:10px;font-size:12px;color:#4b426c;font-weight:650;cursor:pointer;min-height:36px}
.settlement-alert-snooze input{accent-color:#6753dd;width:16px;height:16px;margin:0;flex:none;cursor:pointer}
.settlement-alert-snooze input:focus-visible{outline:2px solid #6753dd;outline-offset:3px}
.settlement-alert-actions .btn{min-width:100px}
@media(max-width:460px){.settlement-alert-actions{align-items:stretch;flex-wrap:wrap}.settlement-alert-actions .btn{width:100%}}
