:root{--nav:#111a3d;--nav2:#1d2c58;--purple:#6c55e8;--bg:#f4f7fc;--card:#fff;--text:#101828;--muted:#667085;--border:#e3e8f1;--green:#23ad7a;--shadow:0 8px 24px rgba(18,31,67,.07);--radius:15px}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,Tahoma,Arial,sans-serif;font-size:14px}.hidden{display:none!important}.app-shell{display:flex;min-height:100vh;direction:ltr}.sidebar{width:198px;position:fixed;inset:0 auto 0 0;background:linear-gradient(180deg,var(--nav),var(--nav2));color:#fff;padding:18px 12px 12px;z-index:30;display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:11px;padding:0 8px 22px}.brand strong{font-size:20px;display:block}.brand small{font-size:10px;color:#d7def3}.brand-mark{width:36px;height:36px;position:relative}.brand-mark span{position:absolute;width:21px;height:12px;border-radius:3px;transform:rotate(-42deg);background:linear-gradient(90deg,#397de6,#6c55e8)}.brand-mark span:first-child{left:0;top:13px}.brand-mark span:last-child{right:0;top:6px;background:linear-gradient(90deg,#7655e9,#48a0eb)}.side-nav{display:flex;flex-direction:column;gap:5px}.nav-item{height:43px;border:0;background:transparent;color:#f1f4ff;border-radius:9px;padding:0 11px;display:grid;grid-template-columns:22px 1fr auto;align-items:center;text-align:left;gap:7px;cursor:pointer}.nav-item:hover,.nav-item.active{background:linear-gradient(90deg,#7651e5,#635be7);box-shadow:0 5px 13px rgba(56,40,170,.26)}.nav-item em{font-style:normal;background:#ea4b67;padding:2px 6px;border-radius:20px;font-size:10px}.user-card{margin-top:auto;padding:14px 2px 12px;border-top:1px solid rgba(255,255,255,.14);display:grid;grid-template-columns:34px 1fr auto;gap:8px;align-items:center}.avatar{width:34px;height:34px;border-radius:50%;background:#fff;color:#223258;display:grid;place-items:center;font-weight:800}.user-card strong{font-size:12px}.user-card small{display:block;font-size:9px;color:#cbd5e1}.logout-link{height:34px;border:1px solid rgba(255,255,255,.15);border-radius:8px;color:#fff;text-decoration:none;display:grid;place-items:center;font-size:11px}.main-content{margin-left:198px;width:calc(100% - 198px);direction:rtl}.topbar{height:74px;background:#fff;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;padding:0 24px;position:sticky;top:0;z-index:20}.title-block{display:flex;align-items:center;gap:14px;direction:ltr}.title-block h1{font-size:20px;margin:0;color:#15244c}.title-block p{margin:3px 0 0;font-size:10px;color:#6675a0}.mobile-menu{display:none;border:0;background:none;font-size:22px}.top-actions{display:flex;align-items:center;gap:10px;direction:ltr}.outline-btn,.date-chip{height:36px;border:1px solid var(--border);background:#fff;border-radius:8px;padding:0 12px;color:#2a3862;display:flex;align-items:center;gap:7px;font-size:11px}.notification{position:relative;font-size:18px}.notification b{position:absolute;top:-4px;right:-4px;background:#e44864;color:#fff;border-radius:20px;padding:1px 5px;font-size:8px}.page-body{padding:16px}.toolbar,.card{background:#fff;border:1px solid var(--border);box-shadow:var(--shadow)}.toolbar{border-radius:12px;padding:10px 12px;margin-bottom:12px}.toolbar-meta{display:flex;gap:9px;direction:ltr}.toolbar-meta label{font-size:8px;color:#5b6788}.toolbar-meta select{display:block;border:1px solid var(--border);height:30px;border-radius:7px;width:130px;padding:0 8px;background:#fff}.filter-toggle{height:30px;border:0;background:#6657e8;color:#fff;border-radius:7px;padding:0 12px;font-size:10px}.filters{display:grid;grid-template-columns:120px 145px 1.4fr 1.4fr auto auto;gap:8px;align-items:end;margin-top:10px}.filters label{font-size:10px;font-weight:700;color:#243154}.filters select,.filters input{display:block;width:100%;height:35px;border:1px solid var(--border);border-radius:8px;background:#fff;padding:0 9px;margin-top:4px;font:inherit;font-size:11px}.primary-btn,.secondary-btn{height:35px;border:0;border-radius:8px;padding:0 15px;font-weight:700}.primary-btn{background:#8b1a6e;color:#fff}.secondary-btn{background:#273754;color:#fff}.filter-note{margin:8px 0 0;color:#74809a;font-size:9px}.global-message{padding:9px 12px;border-radius:8px;margin-bottom:11px;font-size:11px}.warning{background:#fff7df;border:1px solid #efc45e;color:#875d00}.error{background:#fff0f2;border:1px solid #f197a6;color:#b4233d}.kpi-grid{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:12px;margin-bottom:12px}.kpi-card{height:112px;border-radius:12px;color:#fff;padding:13px;position:relative;overflow:hidden;box-shadow:0 7px 16px rgba(40,60,110,.13);direction:ltr}.kpi-card:after{content:"";position:absolute;left:-25px;bottom:-34px;width:95px;height:95px;border-radius:50%;background:rgba(255,255,255,.16)}.kpi-icon{position:absolute;right:12px;top:11px;width:35px;height:35px;border-radius:50%;background:rgba(255,255,255,.93);color:#5367c6;display:grid;place-items:center}.kpi-title{font-size:9px;font-weight:800}.kpi-period{font-size:8px;opacity:.9;margin-top:4px}.kpi-value{font-size:20px;font-weight:850;margin-top:9px}.kpi-delta{font-size:9px;margin-top:6px;font-weight:700}.kpi-spark{position:absolute;right:10px;bottom:8px;width:72px;height:20px}.kpi-blue{background:linear-gradient(135deg,#3597e5,#4b69df)}.kpi-violet{background:linear-gradient(135deg,#6659e6,#8e45d5)}.kpi-pink{background:linear-gradient(135deg,#8f1d70,#d33a93)}.kpi-teal{background:linear-gradient(135deg,#209da5,#4c8c91)}.kpi-slate{background:linear-gradient(135deg,#3c4a64,#586a87)}.card{border-radius:var(--radius);padding:13px;min-width:0}.card-title{display:flex;justify-content:space-between;gap:8px;align-items:flex-start;margin-bottom:9px}.card-title h2{margin:0;font-size:13px;color:#101d43}.card-title p{margin:3px 0 0;font-size:9px;color:#76809e}.card-title>b{color:#24375e;font-size:11px}.overview-row,.leaders-grid,.aging-grid,.invoice-row,.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:10px}.overview-row>.card{height:270px}.donut-layout{display:flex;align-items:center;justify-content:center;gap:14px;height:205px;direction:ltr}.legend{flex:1;max-height:195px;overflow:auto}.legend-item{display:grid;grid-template-columns:8px minmax(70px,1fr) auto;gap:7px;align-items:center;font-size:8px;margin:8px 0;color:#39486c}.legend-item i{width:7px;height:7px;border-radius:50%}.legend-item b{text-align:right}.legend-item small{display:block;color:#7b86a1}.health-layout{display:grid;grid-template-columns:180px 1fr;align-items:center;height:205px}.health-ring{width:145px;height:145px;border-radius:50%;margin:auto;display:grid;place-items:center;background:conic-gradient(var(--green) 0deg,#e7ebf3 0deg)}.health-ring>div{width:102px;height:102px;background:#fff;border-radius:50%;display:grid;place-content:center;text-align:center}.health-ring strong{font-size:22px}.health-ring span{font-size:9px;color:var(--green)}.health-stats{display:grid;grid-template-columns:1fr 1fr;gap:6px 14px;direction:ltr}.health-stat{display:flex;justify-content:space-between;font-size:9px;padding:7px;border-bottom:1px solid #edf0f5;color:#4d5d7e}.health-stat span:before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--dot);margin-right:5px}.leaders-grid .card{min-height:390px}.leader-split{display:grid;grid-template-rows:180px 1fr;gap:10px}.mini-bars{display:flex;flex-direction:column;justify-content:space-evenly;direction:ltr}.mini-bar-row{display:grid;grid-template-columns:180px 1fr 60px;gap:7px;align-items:center;font-size:8px}.mini-bar-row label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mini-bar-track{height:8px;background:#eef1f7;border-radius:4px;overflow:hidden}.mini-bar-track i{display:block;height:100%;background:linear-gradient(90deg,#744fe2,#9a42cb)}.table-scroll{overflow:auto;max-height:210px}.compact{max-height:205px}table{border-collapse:collapse;width:100%;font-size:8px}th,td{padding:6px 7px;border-bottom:1px solid #e9edf4;white-space:nowrap;text-align:right}th{background:#f7f9fc;color:#405074;font-weight:800;position:sticky;top:0;z-index:1}tfoot td{font-weight:800;background:#fbfcfe}.empty{text-align:center!important;color:#7b849c}.finance-grid{display:grid;grid-template-columns:1.2fr .9fr 1fr;gap:10px;margin-bottom:10px}.finance-grid>.card{height:270px}.chart-card canvas{width:100%}.pl-layout{display:grid;grid-template-columns:1.1fr 1fr;gap:8px;align-items:center}.pl-row{display:flex;justify-content:space-between;padding:11px 3px;border-bottom:1px solid #e8ecf3;font-size:9px}.pl-row.total{font-weight:900;color:#168456}.aging-card{min-height:390px}.aging-visual{display:grid;grid-template-columns:1.2fr 1fr;gap:12px;margin-bottom:9px}.aging-bars{display:flex;flex-direction:column;gap:6px}.age-bar{display:grid;grid-template-columns:52px 1fr 78px;gap:6px;align-items:center;font-size:8px;direction:ltr}.age-bar>div{height:7px;border-radius:6px;background:#edf0f5;overflow:hidden}.age-bar i{display:block;height:100%}.age-bar b{text-align:right}.aging-summary{display:grid;grid-template-columns:repeat(2,1fr);gap:6px}.age-chip{border:1px solid var(--border);border-radius:8px;padding:7px 4px;text-align:center;background:#fbfcff}.age-chip span{font-size:7px;color:#65718e;display:block}.age-chip b{font-size:9px}.invoice-widget{display:grid;grid-template-columns:130px 1fr;gap:12px;align-items:center;direction:ltr}.invoice-ring{width:110px;height:110px;border-radius:50%;display:grid;place-items:center}.invoice-ring div{width:76px;height:76px;border-radius:50%;background:#fff;display:grid;place-content:center;text-align:center}.invoice-ring strong{font-size:15px}.invoice-ring span{font-size:7px}.invoice-values{font-size:9px}.invoice-values div{display:flex;justify-content:space-between;padding:6px 0;border-bottom:1px solid var(--border)}.progress{height:7px;background:#edf0f6;border-radius:8px;overflow:hidden;margin-top:7px}.progress i{display:block;height:100%;background:linear-gradient(90deg,#6b55e6,#2fb38a)}.detail-grid .card{min-height:210px}.trend-bottom{margin-bottom:10px}.trend-bottom .card{height:300px}.bottom-grid{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:10px}.insight-card{display:flex;gap:10px}.insight-icon{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#edf0ff;color:#6657e8}.bottom-grid h2{font-size:11px;margin:0 0 8px}.insight-card ul{margin:0;padding-right:15px;font-size:9px;line-height:1.8}.alerts-card #smartAlerts{display:flex;gap:12px;flex-wrap:wrap}.alert-pill{display:flex;gap:6px;align-items:center;font-size:8px}.alert-pill i{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;background:#fff0f2;color:#d83658;font-style:normal}.alert-pill b{display:block}.quick-card>div{display:flex;gap:6px;flex-wrap:wrap}.quick-card button{height:30px;border:1px solid var(--border);background:#fff;border-radius:7px;padding:0 10px;color:#5a4cdc;font-size:8px}.loading-overlay{position:fixed;inset:0;background:rgba(244,247,252,.76);z-index:100;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px}.spinner{width:34px;height:34px;border-radius:50%;border:4px solid #dfe4ef;border-top-color:#6857e8;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
@media(max-width:1400px){.filters{grid-template-columns:repeat(3,1fr)}.finance-grid{grid-template-columns:1fr 1fr}.finance-grid>.card:last-child{grid-column:span 2}.kpi-grid{grid-template-columns:repeat(3,1fr)}.health-stats{grid-template-columns:1fr}}
@media(max-width:1050px){.sidebar{transform:translateX(-100%);transition:.2s}.sidebar.open{transform:translateX(0)}.main-content{margin-left:0;width:100%}.mobile-menu{display:block}.kpi-grid,.overview-row,.leaders-grid,.aging-grid,.invoice-row,.detail-grid,.bottom-grid,.finance-grid{grid-template-columns:1fr 1fr}.finance-grid>.card:last-child{grid-column:auto}.filters{grid-template-columns:repeat(2,1fr)}}
@media(max-width:700px){.page-body{padding:9px}.topbar{padding:0 10px}.date-chip,.outline-btn span{display:none}.kpi-grid,.overview-row,.leaders-grid,.aging-grid,.invoice-row,.detail-grid,.bottom-grid,.finance-grid{grid-template-columns:1fr}.filters{grid-template-columns:1fr}.health-layout,.aging-visual,.pl-layout,.invoice-widget{grid-template-columns:1fr}.overview-row>.card,.finance-grid>.card{height:auto;min-height:260px}.kpi-card{height:110px}.title-block h1{font-size:17px}}
.login-body{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#7d1c62,#1c174b);padding:20px}.login-card{width:min(420px,100%);background:#fff;border-radius:24px;padding:34px;box-shadow:0 25px 70px rgba(0,0,0,.28);direction:rtl}.logo-mark{font-size:34px;color:#6d5de7}.login-card h1{font-size:36px;margin:5px 0}.login-card p{color:#667085}.login-card label{display:block;font-weight:700;margin:16px 0 7px}.login-card input{width:100%;height:52px;border:1px solid #dfe4ee;border-radius:13px;padding:0 13px;font:inherit}.login-card button{width:100%;height:52px;border:0;border-radius:13px;background:#8b1a6e;color:#fff;font-weight:800;margin-top:20px}
/* V4.2 focused layout update */
.topbar{min-height:76px;height:auto;padding:10px 18px;gap:16px;flex-wrap:wrap}.top-actions-wide{display:flex;align-items:center;gap:8px;direction:ltr;flex-wrap:wrap}.top-select{font-size:8px;color:#5b6788;text-align:left}.top-select select{display:block;height:34px;min-width:125px;border:1px solid var(--border);border-radius:8px;padding:0 10px;background:#fff;color:#4d5872}.notification{width:34px;height:34px;border:1px solid var(--border);border-radius:9px;display:grid;place-items:center;color:#24375e;background:#fff}.filter-panel{margin-top:0}.filter-panel.hidden{display:none}.filters{margin-top:0;grid-template-columns:120px 145px 1.45fr 1.25fr auto auto}.footer-note{font-size:9px;color:#74809a;text-align:center;margin:10px 0 12px}.kpi-card{height:124px}.kpi-value{font-size:18px;margin-top:7px}.kpi-context{display:flex;gap:8px;margin-top:5px;font-size:7px;opacity:.96;white-space:nowrap}.kpi-context span{background:rgba(255,255,255,.13);border-radius:5px;padding:3px 5px}.kpi-context b{font-weight:800}.kpi-context.realtime{display:inline-block;background:rgba(255,255,255,.13);border-radius:5px;padding:3px 6px}.kpi-delta{margin-top:5px}.key-row{display:grid;grid-template-columns:1.15fr 1.15fr .9fr;gap:10px;margin-bottom:10px}.key-row>.card{height:290px}.metric-tabs{display:flex;gap:4px;direction:ltr;flex-wrap:wrap}.metric-tabs button{border:1px solid #e0e5ef;background:#fff;color:#596681;border-radius:6px;padding:4px 7px;font-size:7px;cursor:pointer}.metric-tabs button.active{background:#6657e8;color:#fff;border-color:#6657e8}.pnl-card .pl-layout{height:220px}.analytics-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:10px}.analytics-row>.card{height:285px}.leaders-grid .card{min-height:370px}.leader-split{grid-template-rows:155px 1fr}.leaders-grid table{table-layout:fixed;font-size:7.5px}.leaders-grid th,.leaders-grid td{padding:5px 4px;overflow:hidden;text-overflow:ellipsis}.leaders-grid #topProductsTable th:nth-child(1){width:14%}.leaders-grid #topProductsTable th:nth-child(2){width:34%}.leaders-grid #topProductsTable th:nth-child(3){width:15%}.leaders-grid #topProductsTable th:nth-child(4){width:22%}.leaders-grid #topProductsTable th:nth-child(5){width:15%}.leaders-grid #topCustomersTable th:nth-child(1){width:5%}.leaders-grid #topCustomersTable th:nth-child(2){width:26%}.leaders-grid #topCustomersTable th:nth-child(3){width:18%}.leaders-grid #topCustomersTable th:nth-child(4){width:23%}.leaders-grid #topCustomersTable th:nth-child(5){width:10%}.leaders-grid #topCustomersTable th:nth-child(6){width:18%}.invoice-row>.card{min-height:245px}.invoice-widget{grid-template-columns:145px 1fr}.invoice-ring{width:125px;height:125px}.invoice-ring div{width:88px;height:88px}.invoice-values{font-size:10px}.invoice-values div:not(.progress){padding:8px 0}.progress{height:10px}.aging-grid{margin-top:0}.health-layout{grid-template-columns:155px 1fr}.health-ring{width:130px;height:130px}.health-ring>div{width:91px;height:91px}.health-stats{gap:4px 9px}.health-stat{padding:5px;font-size:8px}.table-scroll{scrollbar-width:thin}.date-chip{white-space:nowrap}.outline-btn,.filter-toggle{white-space:nowrap}
@media(max-width:1450px){.top-actions-wide{gap:6px}.top-select select{min-width:105px}.key-row{grid-template-columns:1fr 1fr}.key-row>.health-card{grid-column:span 2;height:240px}.health-layout{grid-template-columns:180px 1fr}.kpi-context{font-size:6.5px}}
@media(max-width:1050px){.topbar{align-items:flex-start}.top-actions-wide{width:100%}.key-row,.analytics-row{grid-template-columns:1fr 1fr}.key-row>.health-card{grid-column:span 2}.top-select select{min-width:100px}.leaders-grid table{font-size:8px}}
@media(max-width:700px){.top-actions-wide{display:grid;grid-template-columns:1fr 1fr}.top-select,.top-select select,.filter-toggle,.outline-btn,.date-chip{width:100%}.notification{display:none}.key-row,.analytics-row{grid-template-columns:1fr}.key-row>.health-card{grid-column:auto}.key-row>.card,.analytics-row>.card{height:auto;min-height:270px}.kpi-card{height:126px}.kpi-context{font-size:7px;max-width:75%;overflow:hidden}.leaders-grid .card{min-height:400px}.leader-split{grid-template-rows:165px 1fr}.invoice-widget{grid-template-columns:1fr;text-align:center}.invoice-ring{margin:auto}.filters{grid-template-columns:1fr}.title-block{width:100%}}


/* V4.3 focused presentation refinements */
body{font-size:15px}
.card-title h2{font-size:15px}.card-title p{font-size:10px}.card-title>b{font-size:12px}
table{font-size:10px}th,td{padding:7px 7px}
.key-row>.card{height:300px}
.pnl-card .pl-layout{height:232px;display:grid;grid-template-columns:1fr;grid-template-rows:178px auto;gap:5px;align-items:stretch;overflow:hidden}
.pnl-card canvas{display:block;width:100%!important;height:176px!important;min-width:0}
.pl-list{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;direction:ltr}
.pl-row{padding:6px 7px;border:1px solid #e8ecf3;border-radius:7px;font-size:9px;min-width:0;gap:5px}
.pl-row span,.pl-row b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.metric-tabs button{font-size:8.5px;padding:5px 9px}
.leaders-grid .card{min-height:455px}
.leader-split{grid-template-rows:190px minmax(0,1fr);gap:7px}
.leader-split>canvas{display:block;width:100%!important;height:180px!important;max-height:180px}
.mini-bars{padding:2px 0;gap:3px}
.mini-bar-row{grid-template-columns:minmax(175px,230px) 1fr 72px;gap:9px;font-size:10px;min-height:15px}
.mini-bar-track{height:9px}.mini-bar-row b{font-size:10px}
.leaders-grid table{font-size:10px;table-layout:fixed}.leaders-grid th,.leaders-grid td{padding:6px 5px}
.leaders-grid .table-scroll{max-height:225px}
#topCustomersTable th:nth-child(1){width:5%}#topCustomersTable th:nth-child(2){width:25%}#topCustomersTable th:nth-child(3){width:17%}#topCustomersTable th:nth-child(4){width:25%}#topCustomersTable th:nth-child(5){width:10%}#topCustomersTable th:nth-child(6){width:18%}
.donut-layout{display:grid;grid-template-columns:210px minmax(0,1fr);gap:18px;height:215px;justify-content:stretch}
.legend{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:16px;row-gap:2px;max-height:210px;padding-right:4px}
.legend-item{grid-template-columns:9px minmax(90px,1fr) auto;font-size:10px;margin:3px 0;gap:7px;min-width:0}
.legend-item span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.legend-item b{font-size:10px;white-space:nowrap}.legend-item small{font-size:8.5px;margin-top:2px}
.health-stat{font-size:10px;padding:6px}.health-stat b{white-space:nowrap}.health-stat small{font-size:7px;color:#7b86a1;font-weight:500}
@media(max-width:1450px){.leaders-grid .card{min-height:465px}.mini-bar-row{grid-template-columns:minmax(150px,200px) 1fr 65px}.legend{grid-template-columns:1fr}.donut-layout{grid-template-columns:200px 1fr}.legend-item{font-size:9.5px}}
@media(max-width:1050px){table{font-size:9.5px}.leaders-grid .card{min-height:470px}.pl-list{grid-template-columns:1fr}.key-row>.card{height:auto;min-height:320px}.pnl-card .pl-layout{height:auto;grid-template-rows:176px auto}}
@media(max-width:700px){body{font-size:14px}.leaders-grid table{font-size:9px}.leaders-grid .card{min-height:430px}.mini-bar-row{grid-template-columns:115px 1fr 55px;font-size:8.5px}.donut-layout{grid-template-columns:1fr;height:auto}.legend{grid-template-columns:1fr;max-height:240px}.pl-list{grid-template-columns:1fr}.card-title h2{font-size:14px}}

/* V4.4 focused inventory operations and responsive refinements */
.sidebar-overlay{display:none;position:fixed;inset:0;background:rgba(10,20,48,.42);backdrop-filter:blur(1px);z-index:49}
.sidebar-overlay.show{display:block}.sidebar-close{display:none;position:absolute;top:12px;right:12px;width:34px;height:34px;border:0;border-radius:9px;background:rgba(255,255,255,.13);color:#fff;font-size:25px;line-height:1;cursor:pointer;z-index:2}
body.menu-open{overflow:hidden}
.kpi-context.inventory-context{max-width:78%;display:flex;flex-wrap:wrap;gap:5px;font-size:7px}.kpi-context.inventory-context span{white-space:nowrap}
.health-layout{display:grid;grid-template-columns:minmax(0,1fr) 132px;gap:14px;align-items:center;height:220px}.health-ring{order:2;justify-self:center}.health-stats{order:1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px 10px;min-width:0}.health-stat{min-width:0}.health-stat span{white-space:normal;line-height:1.2}.health-stat b{font-size:10px}
.donut-layout{grid-template-columns:205px minmax(0,1fr);gap:14px;overflow:hidden}.legend{overflow-y:auto;overflow-x:hidden;min-width:0;padding-right:7px}.legend-item{min-width:0}.legend-item span{min-width:0}.legend-item b{max-width:150px;text-align:right}
.inventory-operations{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:10px}.operation-card{min-height:330px}.operation-card .table-scroll{max-height:260px}.operation-card table{table-layout:fixed}.operation-card th,.operation-card td{font-size:9.5px;padding:7px 6px}.operation-card th:nth-child(1){width:14%}.operation-card th:nth-child(2){width:25%}.operation-card th:nth-child(3){width:13%}.operation-card th:nth-child(4){width:14%}.operation-card th:nth-child(5){width:17%}.operation-card th:nth-child(6){width:17%}.status-badge{display:inline-flex;align-items:center;justify-content:center;min-width:65px;padding:4px 7px;border-radius:999px;background:#eef2f7;color:#4d5a75;font-size:8px;font-weight:700;white-space:nowrap}.status-done,.status-delivered{background:#e7f8ef;color:#168457}.status-assigned,.status-ready{background:#e8f0ff;color:#315ec8}.status-confirmed,.status-waiting{background:#fff3da;color:#a36a00}.status-waiting-another-operation{background:#fff0e8;color:#b65b22}.status-cancel{background:#feecef;color:#c83752}
@media(max-width:1450px){.health-layout{grid-template-columns:minmax(0,1fr) 125px}.health-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 7px}.donut-layout{grid-template-columns:190px minmax(0,1fr)}.legend-item b{max-width:125px}.operation-card th,.operation-card td{font-size:8.5px}}
@media(max-width:1050px){.sidebar-close{display:block}.sidebar{z-index:50}.health-layout{grid-template-columns:minmax(0,1fr) 135px}.inventory-operations{grid-template-columns:1fr}.operation-card{min-height:310px}}
@media(max-width:700px){.health-layout{grid-template-columns:1fr;height:auto;gap:10px}.health-ring{order:1}.health-stats{order:2;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}.donut-layout{grid-template-columns:1fr;gap:8px}.legend{max-height:260px}.operation-card{min-height:300px}.operation-card .table-scroll{overflow-x:auto}.operation-card table{min-width:720px}.kpi-context.inventory-context{max-width:82%;font-size:6.7px}}
.side-nav a.nav-item{text-decoration:none;box-sizing:border-box}.side-nav a.nav-item b{margin-inline-start:auto}

/* V5.7 targeted dashboard refinements */
.negative-number{color:#d93755!important}
table tfoot{position:sticky;bottom:0;z-index:4;background:#f5f7fb;box-shadow:0 -1px 0 #dfe5ef}table tfoot td{font-weight:800}.table-scroll{position:relative}#bankTable th{cursor:pointer}.metric-tabs button.disabled{text-decoration:line-through;opacity:.5;background:#fff;color:#7f8798}.combined-invoices{display:grid;grid-template-columns:1fr 1fr;gap:8px;height:230px}.combined-invoices>div{min-width:0}.combined-invoices h3{font-size:11px;margin:0 0 3px}.combined-invoices .invoice-widget{grid-template-columns:85px 1fr;gap:6px}.combined-invoices .invoice-ring{width:80px;height:80px}.combined-invoices .invoice-ring div{width:56px;height:56px}.nav-group .nav-parent{width:100%;border:0;cursor:pointer}.nav-submenu{display:none;padding:3px 20px 6px}.nav-group.open .nav-submenu{display:grid}.nav-submenu a{color:#dbe5ff;text-decoration:none;padding:7px 12px;border-radius:7px;font-size:12px}.nav-submenu a:hover,.nav-submenu a.active{background:rgba(255,255,255,.12);color:#fff}

/* V5.9 targeted refinements */
.sidebar{overflow:hidden}.side-nav{min-height:0;overflow-y:auto;overflow-x:hidden;padding-bottom:10px;scrollbar-width:thin}.user-card{flex:0 0 auto;margin-top:8px}.nav-submenu{max-height:180px;overflow-y:auto}.combined-invoices{height:auto;align-items:start}.combined-invoices .invoice-widget{display:block}.invoice-line-widget{width:100%;font-size:9px}.invoice-line-widget>div:not(.progress):not(.invoice-progress-label){padding:7px 0}.invoice-progress-label{display:flex!important;justify-content:space-between;border:0!important;color:#6d7891;font-size:8px;padding:8px 0 4px!important}.invoice-progress{height:10px;margin-top:0;background:#edf0f6}.invoice-progress i{background:linear-gradient(90deg,#be5bd9,#7e56e8)}.sortable-head{cursor:pointer;user-select:none}.sortable-head:after{content:' ↕';font-size:8px;opacity:.45}.sortable-head[data-order=asc]:after{content:' ↑';opacity:1}.sortable-head[data-order=desc]:after{content:' ↓';opacity:1}.detail-grid table tfoot{position:sticky;bottom:0;z-index:3}.detail-grid table tfoot td{background:#f6f8fc;font-weight:800}

/* V6.0 targeted invoice summary redesign */
.invoice-combined-card{overflow:hidden}
.invoice-combined-card .card-title{margin-bottom:8px}
.combined-invoices{display:grid;grid-template-columns:1fr 1fr;gap:8px;height:auto;min-width:0}
.invoice-summary-panel{min-width:0;border:1px solid var(--border);border-radius:11px;padding:9px 10px;background:#fff;overflow:hidden}
.invoice-panel-heading{display:flex;align-items:center;gap:7px;direction:ltr;margin-bottom:7px;min-width:0}
.invoice-panel-heading h3{margin:0;font-size:10px;color:#12203f;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.invoice-panel-icon{width:25px;height:25px;border-radius:7px;display:grid;place-items:center;flex:0 0 25px;font-size:13px;font-weight:800}
.supplier-icon{color:#7048e8;background:#f0ebff}.customer-icon{color:#13a862;background:#e8f8ef}
.combined-invoices .invoice-widget{display:block;min-width:0;width:100%;text-align:left}
.invoice-compact-widget{width:100%;min-width:0;direction:ltr;color:#101828}
.invoice-main-values{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:7px;padding-bottom:7px;border-bottom:1px solid var(--border)}
.invoice-main-values>div{min-width:0}.invoice-main-values>div+div{border-left:1px solid var(--border);padding-left:7px}
.invoice-main-values span{display:block;color:#667085;font-size:7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:2px}
.invoice-main-values b{display:block;color:#101828;font-size:9px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
.invoice-percent-row{display:flex;justify-content:space-between;align-items:center;padding:7px 1px 3px;font-size:7.5px;color:#101828}
.invoice-percent-row .paid-percent{color:#18a957}
.invoice-split-track{height:7px;width:100%;display:flex;overflow:hidden;border-radius:99px;background:#e9edf3}
.invoice-split-track i{display:block;height:100%;min-width:0}.invoice-split-track .paid-segment{background:#18b85b}.invoice-split-track .outstanding-segment{background:#7b4ce2}
.invoice-detail-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px;margin-top:7px;color:#344054;font-size:6.8px;line-height:1.35}
.invoice-detail-row span{display:block;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.invoice-detail-row b{color:#101828;font-weight:700;font-variant-numeric:tabular-nums}.invoice-detail-row small{color:#667085;font-size:inherit}
.invoice-dot{display:inline-block;width:6px;height:6px;border-radius:50%;margin-right:4px;vertical-align:0}.paid-dot{background:#18b85b}.outstanding-dot{background:#7b4ce2}
@media(max-width:1450px){.invoice-summary-panel{padding:8px}.invoice-main-values b{font-size:8px}.invoice-detail-row{font-size:6.2px}}
@media(max-width:1050px){.combined-invoices{grid-template-columns:1fr}.invoice-combined-card{height:auto!important}.invoice-main-values b{font-size:10px}.invoice-detail-row{font-size:8px}}
@media(max-width:700px){.invoice-main-values{grid-template-columns:1fr}.invoice-main-values>div+div{border-left:0;border-top:1px solid var(--border);padding-left:0;padding-top:6px}.invoice-detail-row{grid-template-columns:1fr}.invoice-main-values b{font-size:11px}}

/* V6.1 targeted fix: stack customer and supplier invoice panels on all screen sizes */
.combined-invoices{
  grid-template-columns:minmax(0,1fr)!important;
  gap:8px;
  width:100%;
}
.invoice-summary-panel{
  width:100%;
  max-width:100%;
}

/* V6.2 targeted fix: compact stacked invoice cards and use green-only progress */
.invoice-combined-card{
  overflow:hidden;
  padding-bottom:10px;
}
.invoice-combined-card .card-title{
  margin-bottom:6px;
}
.combined-invoices{
  gap:6px!important;
  align-content:start;
}
.invoice-summary-panel{
  padding:7px 9px!important;
  border-radius:10px;
}
.invoice-panel-heading{
  margin-bottom:4px!important;
  gap:6px;
}
.invoice-panel-icon{
  width:23px;
  height:23px;
  flex-basis:23px;
  font-size:12px;
}
.invoice-panel-heading h3{
  font-size:9.5px;
}
.invoice-main-values{
  padding-bottom:5px!important;
  gap:6px;
}
.invoice-main-values span{
  margin-bottom:1px;
}
.invoice-percent-row{
  padding:5px 1px 2px!important;
}
.invoice-split-track{
  height:6px!important;
  background:#e4e8ef!important;
}
.invoice-split-track .paid-segment{
  background:#18b85b!important;
}
.invoice-split-track .outstanding-segment{
  background:#e4e8ef!important;
}
.invoice-detail-row{
  margin-top:5px!important;
  line-height:1.25;
}
.outstanding-dot{
  background:#cfd6e2!important;
}
.invoice-percent-row .outstanding-percent{
  color:#101828!important;
}
@media(max-width:1450px){
  .invoice-summary-panel{padding:7px 8px!important}
  .invoice-detail-row{font-size:6.1px}
}
@media(max-width:1050px){
  .invoice-combined-card{height:auto!important;min-height:0!important}
}
