:root{--navy:#172d36;--ink:#1c3039;--muted:#718087;--bg:#f3f5f5;--line:#dfe6e6;--teal:#087f73;--mint:#e3f3ed;--red:#b93e40}*{box-sizing:border-box}body{margin:0;font-family:"Segoe UI","Malgun Gothic",sans-serif;color:var(--ink);background:var(--bg);font-size:14px}button,input,select,textarea{font:inherit}button,a,input,select,textarea{outline-offset:4px}button{cursor:pointer;border:0;border-radius:7px;padding:11px 17px;font-weight:600}button:disabled{cursor:wait;opacity:.5}a{color:inherit;text-decoration:none}input,select,textarea{border:1px solid #cdd8d9;border-radius:6px;padding:11px 12px;background:white;max-width:100%;color:var(--ink)}input:focus,select:focus,textarea:focus{outline:2px solid #86c8bd;border-color:var(--teal)}input[type=number]{width:110px;text-align:right}label{display:block;font-weight:600;margin:16px 0 8px}h1,h2,h3,p{margin-top:0}h1{font-size:28px;letter-spacing:-1px;margin-bottom:10px}h2{font-size:23px;letter-spacing:-.6px}h3{font-size:16px}.muted{color:var(--muted);line-height:1.7}.primary{background:var(--teal);color:white}.primary:hover{background:#06665c}.secondary{background:white;border:1px solid var(--line);color:var(--ink)}.secondary:hover{background:#f1f6f4}.small{padding:8px 12px;font-size:12px}.full{width:100%;display:flex;justify-content:space-between;align-items:center}.text-button{background:none;color:var(--teal);padding:8px}.pill,.badge{display:inline-block;border-radius:5px;padding:5px 9px;font-size:11px;font-weight:700;white-space:nowrap;background:#edf1f2;color:#52636c}.pill{letter-spacing:1.3px;color:var(--teal);background:var(--mint)}.badge.submitted,.badge.partially_received{background:#fff0d5;color:#8d641b}.badge.approved,.badge.received{background:var(--mint);color:#087365}.badge.planned{background:#e8effc;color:#3b5b9a}.brand{display:flex;align-items:center;gap:12px;font-size:23px;font-weight:800;letter-spacing:-1px}.brand-mark{width:37px;height:37px;border-radius:9px;display:grid;place-items:center;background:#149788;color:white;font-size:22px}.brand small{font-size:10px;letter-spacing:1.7px;font-weight:500;margin-left:8px;color:#a4b7bc}.login-shell{min-height:100vh;display:grid;grid-template-columns:1.1fr 1fr}.login-story{background:var(--navy);color:#f4fbf9;padding:42px 52px;display:flex;flex-direction:column;overflow:hidden}.story-content{margin:auto 0;padding:56px 0}.eyebrow{color:#81c5b6;font-size:13px;letter-spacing:1px}.story-content h1{font-size:45px;line-height:1.35;letter-spacing:-2px}.story-content>p:not(.eyebrow){color:#a7bcc2;font-size:15px;line-height:1.9;margin-top:22px}.warehouse-art{margin-top:45px;max-width:430px}.rack{height:150px;border:2px solid #53767b;border-bottom:5px solid #53767b;display:grid;grid-template-columns:repeat(3,1fr);gap:15px;padding:14px 17px;background:linear-gradient(transparent 48%,#53767b 49%,#53767b 51%,transparent 52%)}.rack i{display:block;background:#84b6a1;border:1px solid #9fcab7;border-radius:2px;position:relative}.rack i:after{content:"";position:absolute;left:43%;top:0;bottom:0;width:10%;background:#b6d1bf}.rack i:nth-child(3n){background:#d7b783;border-color:#dfc498}.art-label{color:#b2c9ca;font-size:11px;letter-spacing:1px;margin-top:18px;display:flex;justify-content:space-between}.story-footer{font-size:10px;letter-spacing:2px;color:#7b969c;margin:0}.login-panel{display:flex;align-items:center;justify-content:center;background:#fafcfb;padding:35px}.login-card{width:370px;max-width:100%}.login-card h2{margin:22px 0 12px;font-size:26px}.login-card input{width:100%;height:46px}.login-card form{margin-top:30px}.password-wrap{display:flex;border:1px solid #cdd8d9;border-radius:6px;background:white}.password-wrap input{border:0;width:calc(100% - 55px)}.login-note{border-top:1px solid var(--line);margin-top:28px;padding-top:22px;font-size:12px;color:var(--muted);line-height:1.8}.error-text{color:var(--red);font-size:13px;min-height:18px;line-height:1.6;margin:12px 0}.workspace{display:flex;min-height:100vh}.sidebar{width:220px;background:var(--navy);color:white;position:fixed;inset:0 auto 0 0;padding:28px 18px;display:flex;flex-direction:column}.sidebar .brand{padding:0 12px}.sidebar-label{margin:45px 14px 16px;color:#80989f;font-size:10px;letter-spacing:1.8px}nav button{display:flex;align-items:center;gap:12px;color:#b9c9cc;background:none;width:100%;text-align:left;padding:14px;margin-bottom:5px;font-size:13px;font-weight:500}nav button.active{background:#244740;color:#a9e1ce;border-left:3px solid #69c4a8;border-radius:5px}nav .nav-icon{font-size:18px;width:21px}.sidebar-bottom{margin-top:auto;padding:20px 12px 0;border-top:1px solid #31474d;font-size:12px;color:#bed0d3}.sidebar-bottom p{font-size:10px;color:#819ba0;margin:10px 0 0}.status-dot{display:inline-block;width:6px;height:6px;background:#70c5a7;border-radius:50%;margin-right:6px}.main-area{width:calc(100% - 220px);margin-left:220px}.topbar{height:75px;display:flex;align-items:center;justify-content:space-between;padding:0 35px;background:white;border-bottom:1px solid var(--line);font-size:12px}.top-label{color:var(--muted)}.top-divider{margin:0 14px;color:#bfcbce}.user-tools{display:flex;align-items:center;gap:16px}main{padding:32px 35px;min-height:calc(100vh - 126px);max-width:1700px;margin:auto}.page-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:26px;gap:15px}.page-heading .eyebrow{color:var(--teal);font-size:10px;font-weight:700;margin-bottom:10px}.page-heading p{margin-bottom:0}.metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-bottom:24px}.metric{background:white;border:1px solid var(--line);border-radius:9px;padding:20px 23px}.metric span{color:var(--muted);font-size:12px}.metric strong{display:block;font-size:29px;margin:12px 0 5px;font-weight:650;letter-spacing:-1px}.metric small{font-size:11px;color:var(--muted)}.metric.emphasis{border-top:3px solid var(--teal);padding-top:18px}.panel{background:white;border:1px solid var(--line);border-radius:9px;overflow:hidden;margin-bottom:20px}.panel-head{padding:20px 22px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:15px}.panel-head h3{margin:0}.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.toolbar input{width:260px;padding:9px 12px;font-size:12px}.table-scroll{overflow:auto}table{width:100%;border-collapse:collapse;white-space:nowrap}th{font-size:11px;background:#f8faf9;color:#718087;text-align:left;font-weight:600;padding:14px 20px;border-bottom:1px solid var(--line)}td{padding:17px 20px;border-bottom:1px solid #edf0f0;font-size:12px}tbody tr:last-child td{border-bottom:0}tbody tr:hover{background:#fafcfb}td small{display:block;color:var(--muted);font-size:10px;margin-top:5px}.number{text-align:right;font-variant-numeric:tabular-nums}.table-note{padding:13px 22px;color:var(--muted);font-size:11px;border-top:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}.empty{text-align:center;padding:55px 20px;color:var(--muted);font-size:13px;line-height:1.8}.empty strong{display:block;color:var(--ink);margin-bottom:7px}.page-footer{padding:16px 35px;color:#839094;font-size:9px;letter-spacing:1.2px;display:flex;justify-content:space-between}.page-footer span{letter-spacing:0}.back{margin-bottom:20px}.detail-summary{display:flex;gap:30px;flex-wrap:wrap;padding:22px}.detail-summary span{color:var(--muted);font-size:11px;display:block;margin-bottom:9px}.detail-summary strong{font-size:14px}.actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:18px 22px;border-top:1px solid var(--line)}.flow{display:flex;gap:10px;margin-bottom:24px;flex-wrap:wrap}.flow span{font-size:12px;color:#849295;padding:10px 15px;background:#e9eeee;border-radius:5px}.flow span.current{background:#deeee6;color:#087365;font-weight:700}.detail-error{padding:0 22px;color:var(--red)}dialog{border:0;border-radius:12px;box-shadow:0 25px 100px #152f3740;width:720px;max-width:calc(100vw - 28px);padding:0;color:var(--ink);max-height:90vh}dialog::backdrop{background:#102d3877;backdrop-filter:blur(2px)}.dialog-head{display:flex;justify-content:space-between;align-items:center;padding:24px 26px;border-bottom:1px solid var(--line)}.dialog-head h2{font-size:20px;margin:0}.dialog-body{padding:6px 26px 24px}.dialog-body>label:first-child{margin-top:18px}.dialog-body select,.dialog-body>input,.dialog-body textarea{width:100%}.dialog-body textarea{resize:vertical;min-height:70px}.dialog-foot{display:flex;justify-content:flex-end;gap:10px;padding:18px 26px;background:#f7f9f8;border-top:1px solid var(--line)}.inline-fields{display:grid;grid-template-columns:1fr 1fr;gap:16px}.inline-fields input,.inline-fields select{width:100%}.helper{font-size:11px;color:var(--muted);line-height:1.7;margin:10px 0}.dialog-body table{margin-top:20px}.dialog-body td,.dialog-body th{padding:12px 10px}.dialog-body input[type=number]{width:105px}.dialog-body .lot-input{width:150px}.error-box{padding:22px;border:1px solid #edc2be;border-radius:8px;background:#fff5f3;color:#934345}#notice{position:fixed;bottom:25px;right:25px;background:#173e35;color:white;padding:15px 24px;border-radius:8px;box-shadow:0 6px 20px #1234;max-width:80vw;z-index:5}.loading{padding:50px;text-align:center;color:var(--muted)}[hidden]{display:none!important}@media(min-width:1500px){.login-story{padding-left:80px}.story-content h1{font-size:54px}}@media(max-width:1000px){.sidebar{width:185px}.main-area{margin-left:185px;width:calc(100% - 185px)}main{padding:25px 20px}.topbar{padding:0 20px}.login-story{padding:30px}.story-content h1{font-size:36px}.brand small{display:none}.metrics{gap:10px}.metric{padding:18px}}@media(max-width:700px){.login-shell{display:block}.login-story{padding:22px}.story-content,.story-footer{display:none}.login-panel{min-height:calc(100vh - 81px);padding:28px}.sidebar{position:static;width:100%;padding:16px}.sidebar .brand{font-size:20px}.sidebar-label,.sidebar-bottom{display:none}.workspace{display:block}nav{display:flex;overflow:auto;margin-top:15px}nav button{width:auto;white-space:nowrap;padding:10px;margin:0 4px}.main-area{margin:0;width:100%}.topbar{height:64px}.top-label,.top-divider{display:none}.metrics{grid-template-columns:1fr}.metric{display:grid;grid-template-columns:1fr auto;align-items:center}.metric strong{grid-row:span 2;margin:0}.metric small{grid-column:1}.page-heading{align-items:flex-start}h1{font-size:24px}.panel-head{flex-wrap:wrap}.toolbar input{width:100%}.page-footer span{display:none}.inline-fields{grid-template-columns:1fr}.dialog-body{padding:5px 15px 20px}.dialog-head,.dialog-foot{padding:18px}.page-heading .primary{font-size:12px}.detail-summary{gap:18px}}

#user-role{width:32px;height:32px}.badge.partially_shipped{background:#fff0d5;color:#8d641b}.badge.shipped{background:var(--mint);color:#087365}.shipping-product-title{margin:24px 0 8px}.shipping-product-title small{display:block;font-size:12px;color:var(--muted);margin-top:8px}#ship-new-destination input{width:100%}
.statement-tools{display:flex;gap:12px;margin-bottom:20px}.billing-statement{background:#fff;padding:32px;border:1px solid #dce3ed;border-radius:12px}.billing-statement h2{margin-top:28px}.billing-statement p{line-height:1.7;overflow-wrap:anywhere}.billing-statement td{overflow-wrap:anywhere}
@media print{
 @page{size:A4;margin:14mm}
 body:has(.billing-statement){background:white!important;color:black!important}
 body:has(.billing-statement) .sidebar,body:has(.billing-statement) .topbar,body:has(.billing-statement) .page-footer,.statement-tools,#notice,dialog{display:none!important}
 body:has(.billing-statement) .workspace,body:has(.billing-statement) .main-area{display:block!important;margin:0!important;width:100%!important;min-height:0!important}
 body:has(.billing-statement) #content{padding:0!important;max-width:none!important}
 .billing-statement{border:0;padding:0;border-radius:0;font-size:10pt}
 .billing-statement .table-wrap{overflow:visible!important}.billing-statement table{width:100%;min-width:0!important;table-layout:fixed;font-size:9pt}
 .billing-statement th,.billing-statement td{white-space:normal!important;padding:6px!important;overflow-wrap:anywhere}
 .billing-statement tr{break-inside:avoid}.billing-statement thead{display:table-header-group}.billing-statement h2{break-after:avoid}
}
#stock-filter{padding:16px 20px;gap:12px}#stock-filter label{display:flex;align-items:center;gap:8px;margin:0;font-size:13px}#stock-filter #stock-available{width:18px;height:18px;padding:0;flex:none}

.sidebar{height:100vh;position:fixed;top:0;overflow:hidden;display:flex;flex-direction:column}.sidebar #navigation{overflow-y:auto;flex:1;min-height:0}.sidebar-bottom{position:static;flex-shrink:0}fieldset{border:1px solid #dce4eb;border-radius:8px;margin:12px 0;padding:12px}fieldset .toolbar label{min-width:120px;max-width:180px}dialog{max-width:min(1100px,95vw)}
@media(max-width:700px){.sidebar{position:static;height:auto;max-height:45vh}.sidebar #navigation{max-height:30vh}}

.nav-group{border:0;margin:4px 0}.nav-group summary{padding:12px 14px;font-size:12px;font-weight:700;color:#8191a3;cursor:pointer}.nav-group button{font-size:12px}.nav-group button small{min-width:45px;opacity:.7;font-size:10px}

/* Keep controls and content inside the workspace; wide tables scroll locally. */
.main-area,main,.panel,.dialog-body,fieldset{min-width:0}
.page-heading{flex-wrap:wrap;gap:12px}.page-heading>div{min-width:0;overflow-wrap:anywhere}
.toolbar{flex-wrap:wrap}.toolbar label{min-width:0;max-width:100%}
.toolbar input,.toolbar select,.toolbar button{max-width:100%}
.table-scroll{max-width:100%;overflow:auto;overscroll-behavior-x:contain}
#dialog{max-height:calc(100dvh - 32px);max-width:calc(100vw - 24px);overflow:auto}
#dialog-content{min-width:0}#dialog input,#dialog select,#dialog textarea{max-width:100%;box-sizing:border-box}
#dialog label{min-width:0;overflow-wrap:anywhere}#dialog fieldset{min-inline-size:0}
.dialog-footer{flex-wrap:wrap;gap:8px}.page-heading button,.toolbar button{white-space:normal;overflow-wrap:anywhere}
@media(max-width:700px){.main-area{width:100%;min-width:0}.topbar{height:auto;min-height:64px;flex-wrap:wrap;gap:8px;padding:12px}.user-tools{flex-wrap:wrap;max-width:100%}.page-heading{flex-direction:column;align-items:stretch}.toolbar input,.toolbar select{width:100%;min-width:0}.metrics>*{min-width:0}.page-footer{flex-wrap:wrap;gap:8px}#dialog{width:calc(100vw - 24px)}#navigation .nav-group{flex-shrink:0}}
@media print{.table-scroll{overflow:visible}table{white-space:normal}th,td{white-space:normal!important}}

/* Long editors retain their heading/actions while the input area scrolls. */
#dialog[open]{display:flex;flex-direction:column;overflow:hidden}
#dialog-content{display:flex;flex-direction:column;max-height:calc(100dvh - 32px)}
#action-form{display:flex;flex-direction:column;min-height:0}
#dialog .dialog-head,#dialog .dialog-foot{flex-shrink:0}
#dialog .dialog-body{overflow:auto;min-height:0;overscroll-behavior:contain}
#dialog .dialog-body label{display:flex;flex-direction:column;align-items:stretch;gap:6px}
#dialog .dialog-body label input:not([type=checkbox]),#dialog .dialog-body label select,#dialog .dialog-body label textarea{width:100%}
#dialog .toolbar{align-items:flex-start}
#dialog .dialog-foot{display:flex;flex-wrap:wrap;gap:8px}
#dialog .dialog-body label:has(input[type=checkbox]){flex-direction:row;align-items:center;justify-content:flex-start}#dialog input[type=checkbox]{width:auto;flex:0 0 auto}

.audit-json{white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%}
