:root{font-family:'Segoe UI',system-ui,Arial,sans-serif;color:#253247;background:#f5f7fb}*{box-sizing:border-box}body{margin:0}.app-shell{display:flex;min-height:100vh}.sidebar{width:250px;flex:0 0 250px;background:#fff;border-right:1px solid #e2e8f0;display:flex;flex-direction:column;min-height:100vh;position:sticky;top:0;height:100vh}.brand{font-size:1.12rem;font-weight:750;letter-spacing:.025em;color:#17365b;text-decoration:none;padding:29px 18px 25px;white-space:nowrap}.sidebar nav{display:flex;flex-direction:column;gap:4px;padding:0 12px}.nav-link{display:flex;align-items:center;gap:12px;text-decoration:none;color:#475569;padding:12px 13px;border-radius:7px;font-size:.93rem;font-weight:650}.nav-link img{width:19px;height:19px;object-fit:contain}.nav-link:hover,.nav-link.active{background:#eaf2ff;color:#1d4f91}.nav-link.active{outline:1px solid #cfe0f8}.sidebar-bottom{margin-top:auto;padding:18px}.logout-button{width:100%;background:#f1f5f9;color:#475569}.workspace{min-width:0;flex:1;display:flex;flex-direction:column}main{width:100%;max-width:1500px;margin:0 auto;padding:25px 27px;flex:1}h1{font-size:1.75rem;color:#17365b;margin:0 0 19px;font-weight:750}h2{font-size:1.05rem;color:#17365b;margin:0 0 14px}.panel{background:white;border:1px solid #dce5ef;border-radius:9px;padding:20px;margin-bottom:18px;box-shadow:0 2px 7px #25324706}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.stats.three{grid-template-columns:repeat(3,minmax(0,1fr))}.stat{text-align:center;display:flex;flex-direction:column;gap:6px;padding:20px 12px}.stat span,.muted{color:#66758a;font-size:.9rem}.stat strong{font-size:2rem;color:#17365b}.toolbar{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 19px}.split{display:grid;grid-template-columns:1fr 1fr;gap:18px}.panel-heading,.page-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.panel-heading h2,.page-heading h1{margin-bottom:12px}.page-heading{margin-bottom:8px}.table-wrap{overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:.91rem}th{text-align:left;color:#334155;background:#eaf0f7;font-weight:700;font-size:.82rem;white-space:nowrap}td,th{padding:10px 9px;border-bottom:1px solid #e8edf2;vertical-align:middle}tr[hidden]{display:none}tbody tr:hover{background:#f8fbff}.low{color:#b42318;font-weight:700}a{color:#2f6fbd}button,.button{border:0;background:#2f6fbd;color:#fff;border-radius:6px;padding:10px 14px;cursor:pointer;text-decoration:none;display:inline-block;font-size:.88rem;font-weight:650;white-space:nowrap}button:hover,.button:hover{filter:brightness(.95)}.secondary{background:#e8eef6;color:#20324a}.subtle{background:#f1f5f9;color:#475569;border:1px solid #cbd5e1}.fields{display:flex;flex-wrap:wrap;align-items:end;gap:14px}label{display:flex;flex-direction:column;gap:5px;font-size:.82rem;font-weight:650;color:#44596e}input,select{padding:10px 9px;border:1px solid #cbd6e0;border-radius:6px;min-width:110px;max-width:100%;font:inherit;color:#253247;background:#fff}.inline-form{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.inline-form input{width:125px}.inline-form input[type=number]{width:75px}.login{max-width:420px;margin:9vh auto}.login form{display:flex;flex-direction:column;gap:15px}.login input{width:100%}.flash{padding:13px 16px;margin-bottom:16px;border-radius:8px;background:#e6f4e9;color:#27633a}.flash.error{background:#ffe9e7;color:#8e302b}footer{text-align:center;color:#8796a4;padding:15px}.logged-out .workspace{width:100%}@media(max-width:1000px){.sidebar{width:210px;flex-basis:210px}.brand{font-size:1rem}.split{grid-template-columns:1fr}}@media(max-width:720px){.app-shell{display:block}.sidebar{position:relative;height:auto;min-height:0;width:100%;border-right:0;border-bottom:1px solid #e2e8f0}.brand{padding:14px 17px 8px}.sidebar nav{flex-direction:row;overflow-x:auto;padding:6px 10px 12px}.nav-link{flex:0 0 auto;font-size:.82rem;padding:9px}.sidebar-bottom{position:absolute;right:8px;top:3px;padding:0}.logout-button{padding:7px}main{padding:20px 13px}.stats.three{grid-template-columns:repeat(3,minmax(0,1fr))}.stat{padding:14px 5px}.stat strong{font-size:1.6rem}}@media(max-width:450px){.stats.three{grid-template-columns:1fr}.stat{flex-direction:row;justify-content:space-between;align-items:center}.panel{padding:14px}}
/* Consolidated v3.0 refinements */
.brand{display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center;white-space:normal;padding:22px 15px 24px;text-transform:none}
.company-logo{display:block;max-width:100%;width:200px;height:auto;max-height:95px;object-fit:contain}
.brand span{display:block;font-size:1.12rem;font-weight:750}
.stats.two{grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:16px}
.critical-total{color:#b42318!important}
.critical-transaction td{color:#b42318;font-weight:750}
.critical-transaction a{color:#b42318;font-weight:750}
.danger{background:#b42318;color:#fff}
.permanent-delete-form{display:inline-block;margin-left:8px}
.sort-header{background:transparent;border:0;color:inherit;font:inherit;font-weight:inherit;padding:0;text-align:left;cursor:pointer;white-space:nowrap}
.sort-header:hover{text-decoration:underline;filter:none}
.sort-header:focus-visible{outline:2px solid #2563eb;outline-offset:3px;border-radius:2px}
.sort-indicator{font-size:.9em;opacity:.75;margin-left:3px}
th[aria-sort="ascending"] .sort-indicator,th[aria-sort="descending"] .sort-indicator{opacity:1}
@media(max-width:720px){.brand{align-items:flex-start;gap:3px;padding:10px 15px}.company-logo{width:140px;max-height:48px}.brand span{font-size:1rem}}
@media(max-width:450px){.stats.two{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Distribution reporting */
.filter-fields{margin-bottom:12px}.report-metrics{display:flex;gap:12px;flex-wrap:wrap;margin:18px 0}.metric{background:#f1f6fc;border:1px solid #dbe6f4;border-radius:8px;padding:13px 18px;min-width:155px;display:flex;flex-direction:column;gap:4px}.metric span{color:#60728a;font-size:.8rem}.metric strong{color:#17365b;font-size:1.55rem}.bar-list{display:flex;flex-direction:column;gap:10px;margin:18px 0 26px}.bar-button{display:block;width:100%;background:transparent;color:#253247;text-align:left;padding:6px 3px;border-radius:5px;white-space:normal}.bar-button:hover{background:#f3f7fc;filter:none}.bar-label{display:flex;justify-content:space-between;gap:12px;margin-bottom:5px}.bar-track{height:23px;background:#e8eef6;border-radius:4px;overflow:hidden}.bar-fill{height:100%;background:#457eb8;border-radius:4px;min-width:2px}.drilldown{border-top:1px solid #dce5ef;padding-top:18px}.drilldown[hidden],#distribution-detail[hidden]{display:none}.drilldown h3{color:#17365b}#distribution-detail{margin-top:18px}@media print{.sidebar,.sidebar-bottom,.print-report,form,.button,footer{display:none!important}.workspace main{padding:0}.panel{box-shadow:none;break-inside:avoid}.bar-fill{print-color-adjust:exact;-webkit-print-color-adjust:exact}}

/* v3.2 polish */
:root{--line:#e5ebf3}body{background:#f5f7fa}h1{letter-spacing:-.025em}.panel{border-radius:12px;box-shadow:0 3px 14px #183b6508}.nav-link{transition:background .15s,color .15s}button,.button{transition:filter .15s,transform .15s}button:focus-visible,.button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #377cce;outline-offset:2px}thead th{position:sticky;top:0;z-index:1}tbody tr:nth-child(even){background:#fafcff}.table-wrap{max-height:650px}.global-search{display:flex;gap:8px;align-items:center;justify-content:flex-end;margin-bottom:20px}.global-search label{white-space:nowrap}.global-search input{width:min(440px,100%)}.stock-pill{display:inline-block;border-radius:30px;padding:5px 9px;font-size:.8rem;font-weight:700;white-space:nowrap}.stock-ok{background:#e8f5ee;color:#166534}.stock-low{background:#fff4d7;color:#92400e}.stock-out{background:#fde9e7;color:#a12a24}.metric small{color:#66758a;font-size:.72rem;max-width:240px}.date-stat{font-size:1.15rem!important}.page-heading .toolbar{margin-bottom:12px}@media(max-width:720px){.global-search{justify-content:stretch;flex-wrap:wrap}.global-search input{flex:1;min-width:150px}.stats.three{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* v3.2 consolidated usability refinements */
.inline-form label{display:flex;flex-direction:column;gap:4px;font-size:12px;font-weight:600;min-width:95px}
.inline-form label input{font-size:14px;font-weight:400}
.check-inline{display:flex!important;align-items:center;gap:8px;white-space:normal}
.check-inline input{width:auto!important}
.batch-form .toolbar{margin-bottom:12px}.batch-form .row-select,.batch-form .select-all{width:17px;height:17px;cursor:pointer}
.focused-row{outline:3px solid #377dbd;outline-offset:-3px;background:#e9f4ff!important}
.switch-employee{display:flex;flex-direction:column;gap:5px;font-weight:600;min-width:220px}
.switch-employee select{max-width:300px}
@media(max-width:720px){.switch-employee{width:100%;min-width:0}.switch-employee select{max-width:100%}}

/* v3.2 final preview: consistent inventory controls */
.inventory-edit-form,.inventory-action-form{display:flex;flex-direction:column;gap:9px;align-items:stretch}
.inventory-actions{display:flex;flex-direction:column;gap:16px;min-width:480px}
.inventory-fields{display:flex;align-items:flex-start;gap:8px;flex-wrap:nowrap}
.inventory-fields label{display:flex;flex:1 1 0;min-width:105px;gap:5px;font-size:12px;font-weight:650}
.inventory-fields input,.inventory-fields select{height:39px;width:100%;min-width:0;font-size:13px;font-weight:400}
.inventory-form-actions{display:flex;align-items:center;min-height:38px}
.inventory-edit-form{min-width:380px}
.inventory-action-form .inventory-fields label:last-child{flex:1.7 1 0;min-width:175px}
@media(max-width:800px){.inventory-actions{min-width:430px}}
