:root{font-family:'Segoe UI',Arial,sans-serif;color:#24323c;background:#f3f5f7;font-size:14px}*{box-sizing:border-box}body{margin:0;min-height:100vh}header{position:sticky;top:0;z-index:10;display:flex;align-items:center;gap:32px;background:#fff;border-bottom:1px solid #e1e6ea;padding:18px 32px}.brand{font-size:21px;font-weight:650;text-decoration:none;color:#24323c;white-space:nowrap}.brand span{color:#2563eb}nav{display:flex;align-items:center;gap:8px;min-width:0}nav a{white-space:nowrap}nav a{padding:10px 14px;color:#677680;text-decoration:none;border-radius:7px}nav a:hover{background:#f0f5ff;color:#1d4ed8}nav a.active{background:#eaf1ff;color:#1d4ed8}.local{margin-left:auto;white-space:nowrap;color:#7b8993;font-size:12px}main{min-width:0;width:100%;margin:0;padding:32px}h1{font-size:28px;letter-spacing:-.7px;margin:0 0 7px}h2{font-size:16px;margin:0 0 20px}p.sub{color:#74828c;margin:0 0 26px}.panel{background:#fff;border:1px solid #e0e6ea;border-radius:12px;padding:24px}.layout{max-width:1200px;display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:22px}.fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.wide{grid-column:span 2}.full{grid-column:1/-1}label{display:flex;flex-direction:column;gap:7px;color:#62717c;font-size:13px}input,select,textarea,button{font:inherit}input,select,textarea{min-width:0;width:100%;padding:11px;border:1px solid #d5dee3;border-radius:6px;background:#fff;color:#24323c}input:read-only{background:#f1f4f6;color:#6f7e89}textarea{min-height:80px;resize:vertical}button,.button{display:inline-block;border:1px solid #d5dee3;background:#fff;color:#354853;border-radius:7px;padding:11px 16px;text-decoration:none;cursor:pointer}button.primary,.button.primary{background:#245bce;color:#fff;border-color:#245bce}button:disabled{opacity:.5;cursor:default}a{color:#245bce}button:hover,.button:hover{filter:brightness(.96)}:focus-visible{outline:3px solid #75acde;outline-offset:2px}.section+.section{margin-top:27px;padding-top:24px;border-top:1px solid #e8ecef}.actions{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.check{flex-direction:row;align-items:center;align-self:end;padding:12px 0}.check input{width:auto}.badge{display:inline-block;background:#eef4ff;color:#245bce;border-radius:5px;padding:5px 9px;font-size:12px}.summary{display:grid;gap:18px;margin:22px 0}.summary small{display:block;color:#798791;margin-bottom:4px}.summary strong{font-weight:500}.note{font-size:12px;color:#798791;border-top:1px solid #e4e9ec;padding-top:16px}.toolbar{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:20px}.toolbar input{max-width:360px}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;font-size:13px}th{text-align:left;color:#70818c;font-weight:500;background:#f7f9fa}th,td{padding:15px 12px;border-bottom:1px solid #e7ecef;white-space:nowrap}td.client{white-space:normal;min-width:170px}td.num{font-variant-numeric:tabular-nums;text-align:right}.empty{padding:45px;text-align:center;color:#71808b}.directory{max-width:560px}.manager-form{display:flex;gap:10px;margin-bottom:25px}.manager-form input{flex:1}.row-actions{display:flex;gap:8px}.row-actions button{font-size:12px;padding:7px 10px}#notice:not(:empty){position:fixed;bottom:24px;right:24px;max-width:calc(100% - 48px);background:#193968;color:white;padding:15px 22px;border-radius:9px;box-shadow:0 4px 22px #0002}.error{color:#a83232;margin-top:15px}.muted{color:#7c8b95}@media(max-width:950px){header{padding:16px 20px;gap:16px;flex-wrap:wrap}.brand{font-size:19px}nav{order:3;flex-basis:100%;overflow-x:auto}.layout{grid-template-columns:1fr}main{padding:20px}}@media(max-width:600px){header{padding:14px 12px;gap:12px}.brand{font-size:18px}nav a{padding:10px 8px;font-size:12px}.local{font-size:11px}main{padding:20px 12px}.fields{grid-template-columns:1fr}.wide{grid-column:auto}.panel{padding:18px}.toolbar{align-items:stretch;flex-direction:column}.manager-form{flex-wrap:wrap}.manager-form input{flex-basis:100%}h1{font-size:24px}}
.computed-fields{border-top:1px solid #e8ecef;padding-top:20px;margin-top:4px}.computed-fields h3{font-size:13px;font-weight:500;color:#798791;margin:0 0 14px}



.employees{max-width:1000px}.employee-list{margin-top:22px}

.order-number{width:1%;padding-left:10px;padding-right:10px}.order-number .muted{display:inline-block;width:76px;white-space:normal;font-size:12px}

.order-notes{min-width:220px;max-width:320px;white-space:pre-wrap;overflow-wrap:anywhere}

.orders-table{min-height:0;overflow:auto}
.orders-table table{border-collapse:separate;border-spacing:0;table-layout:auto;width:max-content}
.orders-table th{position:sticky;top:0;z-index:1;box-shadow:0 1px 0 #e7ecef}



.page-heading{min-width:0;margin-left:auto}
.page-heading h1{font-size:22px;margin:0 0 3px;letter-spacing:-.4px}
.page-heading p{margin:0;color:#74828c;font-size:12px}
.page-heading:not([hidden])+.local{margin-left:auto}
@media(max-width:1200px){header{gap:20px}.page-heading{max-width:250px}}
@media(max-width:950px){.page-heading{max-width:none}.page-heading h1{font-size:20px}}
@media(max-width:600px){.page-heading{order:4;flex-basis:100%;margin-left:0}.page-heading h1{font-size:20px}}

[hidden]{display:none!important}
.local{display:flex;align-items:center;gap:12px}
.local button{padding:7px 12px;font-size:12px}
.login-layout{display:flex;justify-content:center;padding:40px 0}
.login-panel{width:100%;max-width:400px}
.login-panel label{margin-bottom:18px}
.login-panel>button{width:100%;margin-top:6px}
.login-panel .error:empty{display:none}
@media(max-width:600px){.login-layout{padding:12px 0}.local{margin-left:auto}}

.orders-toolbar{justify-content:flex-start;flex-wrap:wrap;gap:12px}
.orders-toolbar #search{flex:1 1 280px}
.shipping-months{display:flex;flex-wrap:wrap;gap:5px}
.shipping-months button{padding:9px 10px;font-size:12px}
.shipping-months button[aria-pressed="true"]{background:#245bce;border-color:#245bce;color:#fff}
.orders-toolbar #shipping-year{width:auto}
.orders-toolbar>.button{margin-left:auto;white-space:nowrap}
@media(max-width:600px){.orders-toolbar #search{flex-basis:auto;max-width:none}.orders-toolbar>.button{margin-left:0;text-align:center}}

.orders-table select[data-order-status]{field-sizing:fixed;width:auto;min-width:0;padding:7px 0 7px 3px;font-size:11px}


.directory{max-width:1100px;display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,1fr);gap:22px;align-items:start}.directory input[type=color]{width:64px;height:38px;padding:3px;cursor:pointer}@media(max-width:800px){.directory{grid-template-columns:1fr}}

.directory{grid-template-columns:minmax(280px,380px) minmax(300px,1fr)}@media(max-width:800px){.directory{grid-template-columns:1fr}}


.directory{max-width:742px;grid-template-columns:minmax(280px,380px) 340px}.directory>.panel:last-child{width:340px;max-width:100%}.directory>.panel:last-child th:first-child{width:1%}.directory>.panel:last-child .note{max-width:290px}@media(max-width:800px){.directory{grid-template-columns:minmax(0,380px)}.directory>.panel:last-child{width:340px;max-width:100%}}


#history-panel{padding:16px 20px;margin-bottom:20px}
#history-panel h2{margin-bottom:12px}
.history-table{table-layout:fixed}
.history-table th,.history-table td{padding:8px 10px;white-space:normal;overflow-wrap:anywhere;vertical-align:top;line-height:1.4}
.history-table th:first-child{width:270px}
.history-table th:nth-child(2){width:22%}
.history-table .history-actor time,.history-table .history-actor span{display:block}
.history-table .history-actor span{font-size:12px;color:#7c8b95;margin-top:2px}
.history-table .history-actor strong{color:#354853}
.history-table tbody+tbody{border-top:1px solid #d5dee3}
@media(max-width:600px){#history-panel{padding:14px 12px}.history-table{min-width:620px}.history-table th:first-child{width:210px}}

/* Compact columns and two-line headings in the order list. */
.orders-table th,.orders-table td{padding:5px 7px;width:auto;min-width:0;max-width:none;white-space:nowrap;overflow-wrap:normal}
.orders-table td{line-height:1.25;vertical-align:middle}
.orders-table .badge{padding:4px 7px}
.orders-table th{line-height:1.3;vertical-align:top;text-align:left}
.orders-table .order-sort{display:flex;align-items:center;justify-content:space-between;gap:5px;width:100%;padding:0;border:0;border-radius:2px;background:transparent;color:inherit;font:inherit;line-height:inherit;text-align:left}
.orders-table .order-sort:hover{color:#245bce}
.orders-table .sort-indicator{font-size:10px;color:#8b98a3;flex:none}
.orders-table th[aria-sort=ascending] .order-sort,.orders-table th[aria-sort=descending] .order-sort,.orders-table th[aria-sort=ascending] .sort-indicator,.orders-table th[aria-sort=descending] .sort-indicator{color:#245bce}





.orders-table .option-no{color:#d1d6db}



.month-totals{display:flex;align-items:center;justify-content:flex-start;flex:0 1 auto;max-width:100%;flex-wrap:wrap;gap:18px;padding:5px 16px;background:#f0f7f3;border:1px solid #dfebe4;border-radius:7px}.month-totals>div{display:flex;flex-direction:column;gap:3px;white-space:nowrap}.month-totals span{font-size:11px;color:#627b6f}.month-totals strong{font-size:14px;font-weight:600;color:#245bce;font-variant-numeric:tabular-nums}@media(max-width:600px){.month-totals{flex-wrap:wrap;justify-content:space-between;gap:12px;padding:10px 12px}}

/* Compact new-order workspace across the full desktop width. */
.order-layout{max-width:none;grid-template-columns:minmax(0,1fr) 260px;gap:18px;align-items:start}
.new-order-layout .panel{padding:20px}
.new-order-layout #order-form{display:grid;grid-template-columns:minmax(230px,1fr) minmax(0,2.4fr);gap:20px 24px;align-items:start}
.new-order-layout #order-form>.section:nth-child(1){grid-column:1;grid-row:1}
.new-order-layout #order-form>.section:nth-child(2){grid-column:2;grid-row:1/span 2;border-left:1px solid #e8ecef;padding-left:24px}
.new-order-layout #order-form>.section:nth-child(3){grid-column:1;grid-row:2}
.new-order-layout .section+.section{margin-top:0;padding-top:0;border-top:0}
.new-order-layout .section:first-child .fields,.new-order-layout .section:nth-child(3) .fields{grid-template-columns:1fr}
.new-order-layout .section:first-child .wide{grid-column:auto}
.new-order-layout h2{margin-bottom:14px}
.new-order-layout .fields{gap:12px 14px}
.new-order-layout label{gap:5px}
.new-order-layout input,.new-order-layout select,.new-order-layout textarea{padding:8px 10px;min-height:36px}
.new-order-layout textarea{height:60px;min-height:60px}
.new-order-layout .actions{grid-column:1/-1;margin-top:0;padding-top:14px;border-top:1px solid #e8ecef}
.new-order-layout #form-error{grid-column:1/-1;margin:0}
.new-order-layout #form-error:empty{display:none}
.new-order-layout .summary{gap:14px;margin:16px 0}
.new-order-layout .summary strong{overflow-wrap:anywhere}
.new-order-layout .note{line-height:1.4;margin-bottom:0;padding-top:12px}
@media(min-width:951px){main:has(.new-order-layout){padding:20px 24px}}
@media(min-width:1600px){.new-order-layout{grid-template-columns:minmax(0,1fr) 300px}.new-order-layout #order-form{grid-template-columns:minmax(280px,1fr) minmax(0,2.8fr)}.new-order-layout .section:nth-child(2) .fields{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:1199px){.new-order-layout #order-form{grid-template-columns:1fr}.new-order-layout #order-form>.section:nth-child(n){grid-column:1;grid-row:auto;border-left:0;padding-left:0}.new-order-layout .section+.section{border-top:1px solid #e8ecef;padding-top:16px}.new-order-layout .section:first-child .fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:950px){.order-layout{grid-template-columns:1fr}.new-order-layout .summary{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:600px){.new-order-layout .panel{padding:16px}.new-order-layout .fields,.new-order-layout .section:first-child .fields{grid-template-columns:1fr}.new-order-layout .summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Short production values do not need full-width controls. */
#order-form>.section:nth-child(2) input[type="number"],
#order-form select[name="layers"]{width:96px;max-width:100%}
@media(min-width:1200px){
.new-order-layout #order-form>.section:nth-child(2) .fields{grid-template-columns:repeat(4,minmax(0,160px))}
}
.calculated-value{display:block;min-height:36px;padding:8px 0;color:#24323c;font-size:15px;font-weight:500;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
/* Navigation already identifies the current page. */
#page-heading{display:none!important}

header>.local{margin-left:auto}

/* Label specifications are independent of production values. */
.label-help{color:#798791;font-size:12px;line-height:1.5;margin:0 0 14px}
.new-order-layout .label-section .fields{grid-template-columns:repeat(3,minmax(0,1fr))}
#order-form .label-section input[type=number],#order-form select[name=labelLayers]{width:120px;max-width:100%}

@media(min-width:1200px){
.new-order-layout #order-form>.section:nth-child(2){grid-row:1}
.new-order-layout #order-form>.section:nth-child(3){grid-column:2;grid-row:2;border-left:1px solid #e8ecef;padding-left:24px}
.new-order-layout #order-form>.section:nth-child(4){grid-column:1;grid-row:2}
.new-order-layout #order-form>.section:nth-child(3) .fields{grid-template-columns:repeat(3,minmax(0,1fr))}
.new-order-layout #order-form>.section:nth-child(4) .fields{grid-template-columns:1fr}
}
@media(max-width:600px){.new-order-layout .label-section .fields{grid-template-columns:1fr}}
/* Order creation: blue cards and horizontal summary. */
body:has(.new-order-layout){background:#f3f5f9;color:#172238}
.order-page-title{max-width:1480px;margin:4px auto 26px}.order-page-title>span{font-size:11px;font-weight:700;letter-spacing:1.4px;color:#54719b}.order-page-title h1{font-size:36px;margin:8px 0;letter-spacing:-1px}.order-page-title p{margin:0;color:#69758a;font-size:16px}
main:has(.new-order-layout){padding:28px 32px 36px}.new-order-layout{display:block;max-width:1480px;margin:auto}
.new-order-layout #order-form.panel{display:grid;grid-template-columns:minmax(270px,.85fr) minmax(0,2fr);gap:22px;padding:0;border:0;background:none}
.order-client-card,.order-product-card{padding:26px;background:white;border:1px solid #e0e5ed;border-radius:16px;box-shadow:0 3px 10px #162b4d05;min-width:0}
.new-order-layout #order-form .section{border:0;padding:0;margin:0}.new-order-layout h2{display:flex;align-items:center;gap:12px;font-size:19px;color:#172238;margin-bottom:24px}.new-order-layout h2:before{content:'';width:7px;height:22px;border-radius:3px;background:#316bd9;flex-shrink:0}
.new-order-layout .order-client-card .fields{grid-template-columns:1fr;gap:19px}.new-order-layout .order-client-card .wide{grid-column:auto}
.new-order-layout .order-client-card .section+.section{margin-top:30px!important;padding-top:24px!important;border-top:1px solid #e7ebf2!important}
.new-order-layout .order-product-card .section:first-child .fields{grid-template-columns:repeat(4,minmax(0,1fr));gap:22px 20px}
.new-order-layout label{font-size:13px;gap:8px;color:#455168}.new-order-layout input,.new-order-layout select,.new-order-layout textarea{width:100%!important;min-height:43px;padding:10px 12px;border-radius:8px;border-color:#ccd4e0;color:#172238}.new-order-layout input:read-only{background:#f3f5f9}.new-order-layout textarea{min-height:76px}
.new-order-layout .order-metrics{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:19px 20px;background:#eff5ff;border-radius:10px;gap:18px}.new-order-layout .order-metrics label+label{border-left:1px solid #cedcf2;padding-left:20px}.new-order-layout .calculated-value{font-size:23px;font-weight:700;color:#204d9c;padding:0;min-height:0}
.new-order-layout .order-product-card .label-section{margin-top:24px!important;padding-top:24px!important;border-top:1px solid #e7ebf2!important}.new-order-layout .label-section h2{margin-bottom:12px}.new-order-layout .label-section .fields{grid-template-columns:repeat(3,minmax(0,1fr));gap:15px 20px}
.new-order-layout .order-total-bar{display:flex;align-items:center;gap:28px;margin-top:22px;padding:22px 26px;border-radius:16px;box-shadow:0 5px 15px #162b4d08}.new-order-layout .order-total-bar h2{margin:0;white-space:nowrap}.new-order-layout .order-total-bar .summary{display:flex;flex:1;justify-content:space-evenly;gap:24px;margin:0}.new-order-layout .order-total-bar .summary>div{display:flex;flex-direction:column-reverse;gap:5px}.new-order-layout .order-total-bar .summary strong{font-size:25px;font-weight:700;color:#204d9c}.new-order-layout .order-total-bar .summary small{font-size:12px;margin:0}.new-order-layout .order-total-bar .actions{border:0;padding:0;margin:0;gap:10px}.new-order-layout .order-total-bar button{white-space:nowrap}.new-order-layout .order-total-bar .primary{padding:14px 24px;font-weight:600;background:#245bce;border-color:#245bce}
@media(max-width:1150px){.new-order-layout .order-product-card .section:first-child .fields{grid-template-columns:repeat(2,minmax(0,1fr))}.new-order-layout .order-total-bar{flex-wrap:wrap}.new-order-layout .order-total-bar .actions{margin-left:auto}}
@media(max-width:800px){main:has(.new-order-layout){padding:22px 16px}.new-order-layout #order-form.panel{grid-template-columns:1fr}.order-client-card,.order-product-card{padding:20px}.new-order-layout .order-total-bar .summary{flex-basis:100%;justify-content:space-between}.new-order-layout .order-total-bar .actions{width:100%;justify-content:flex-end}.order-page-title h1{font-size:30px}}
@media(max-width:480px){.new-order-layout .label-section .fields{grid-template-columns:1fr}.new-order-layout .order-metrics{padding:14px 10px;gap:8px}.new-order-layout .order-metrics label{font-size:11px}.new-order-layout .order-metrics label+label{padding-left:8px}.new-order-layout .calculated-value{font-size:20px}.new-order-layout .order-total-bar{padding:20px 16px}.new-order-layout .order-total-bar .summary{gap:10px}.new-order-layout .order-total-bar .summary strong{font-size:20px}.new-order-layout .order-total-bar .actions{flex-wrap:wrap}}

/* One compact row per label parameter. */
#order-form .label-section [data-label-modified]{grid-template-columns:minmax(0,1fr);gap:12px}
#order-form .label-parameter-row{display:flex;align-items:center;gap:18px;min-width:0}
#order-form .label-parameter-row>label:first-child{display:grid;grid-template-columns:150px 80px;align-items:center;gap:12px}
#order-form .label-parameter-row input[type=number],#order-form .label-parameter-row select{width:80px!important;min-height:36px;padding:7px 8px}
#order-form .label-section .check{display:flex;flex-direction:row;align-items:center;align-self:center;gap:8px;padding:0;line-height:1.4}
#order-form .label-section input[type=checkbox]{width:16px!important;height:16px;min-height:16px;flex:0 0 16px;margin:0;padding:0;accent-color:#2563eb}
@media(max-width:600px){
#order-form .label-parameter-row{gap:12px}
#order-form .label-parameter-row>label:first-child{grid-template-columns:116px 72px;gap:8px}
#order-form .label-parameter-row input[type=number],#order-form .label-parameter-row select{width:72px!important}
}
@media(max-width:420px){#order-form .label-parameter-row{flex-wrap:wrap;gap:6px}#order-form .label-parameter-row>.check{margin-left:124px}}

/* Size the label type selector to its longest option. */
#order-form .label-section select[name="labelType"]{width:max-content!important;max-width:100%;justify-self:start;align-self:flex-start;field-sizing:fixed}

#order-form .label-type-row{display:flex;align-items:flex-end;gap:24px;flex-wrap:wrap}
#order-form .label-type-row>label:first-child{min-width:0;max-width:100%}
#order-form .label-type-row>.check{align-self:flex-end;min-height:43px}
@media(max-width:600px){#order-form .label-type-row{gap:12px}}

#order-form label:has(>input[name="invoice"]){grid-column:1/-1;min-width:0}
#order-form input[name="invoice"]{width:240px!important;max-width:100%;align-self:flex-start;flex-shrink:0}

#order-form>.order-notes-field{grid-column:1/-1}
.new-order-layout .order-product-column{display:flex;flex-direction:column;gap:22px;min-width:0}
.new-order-layout .order-product-column>.order-notes-field{padding:24px 26px;background:#fff;border:1px solid #e0e5ed;border-radius:16px;width:100%;box-shadow:0 3px 10px #162b4d05}
.new-order-layout .order-client-card{align-self:start}

#order-form .client-details-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 14px}
#order-form .client-details-fields>label:has([name="client"]),#order-form .client-details-fields>label:has([name="managerId"]){grid-column:1/-1}

.new-order-layout #order-form .order-label-card{padding:26px;margin:0;background:#fff;border:1px solid #e0e5ed;border-radius:16px;box-shadow:0 3px 10px #162b4d05;min-width:0}
@media(max-width:800px){.new-order-layout #order-form .order-label-card{padding:20px}}

/* Compact client card aligned with the left page margin. */
.new-order-layout{margin-left:0;margin-right:auto}
.new-order-layout #order-form.panel{grid-template-columns:300px minmax(0,1fr)}
@media(max-width:800px){.new-order-layout #order-form.panel{grid-template-columns:1fr}}

/* Keep the shipping controls and their headings aligned. */
#order-form .client-details-fields>label:has([name="shippingDate"]),
#order-form .client-details-fields>label:has([name="delivery"]){white-space:nowrap;align-self:start;font-size:12px;gap:8px}
#order-form .client-details-fields input[name="shippingDate"],
#order-form .client-details-fields select[name="delivery"]{height:43px;min-height:43px;padding-left:8px;padding-right:8px;font-size:12px}

#order-form .product-primary-row{display:flex;align-items:start;flex-wrap:wrap;gap:16px 24px}
#order-form .product-primary-row>label{flex:0 0 auto}
#order-form .product-primary-row input,#order-form .product-primary-row select{width:96px!important;max-width:100%}

#order-form .product-primary-row{gap:16px 18px}
#order-form .product-primary-row>label{min-width:0}
@media(min-width:1100px){#order-form .product-primary-row{flex-wrap:nowrap}}

/* Calculated values in a separate card on the right. */
.new-order-layout{max-width:none}
.new-order-layout #order-form.panel{grid-template-columns:300px minmax(0,1fr) 200px;align-items:start}
.new-order-layout #order-form .order-calculation-card{grid-column:3;grid-row:1;display:grid;grid-template-columns:1fr;gap:20px;margin:0;padding:24px 20px;border:1px solid #dce6f6;border-radius:16px;background:#eff5ff}
.new-order-layout .order-calculation-card label+label{border-left:0;border-top:1px solid #cedcf2;padding:18px 0 0}
@media(max-width:1400px){
.new-order-layout #order-form.panel{grid-template-columns:260px minmax(0,1fr) 170px}
#order-form .product-primary-row{flex-wrap:wrap}
}
@media(max-width:1100px){
.new-order-layout #order-form.panel{grid-template-columns:260px minmax(0,1fr)}
.new-order-layout #order-form .order-calculation-card{grid-column:2;grid-row:auto}
}
@media(max-width:800px){
.new-order-layout #order-form.panel{grid-template-columns:minmax(0,1fr)}
.new-order-layout #order-form .order-calculation-card{grid-column:1;grid-row:auto}
}

/* Keep the production cards close to the width of their controls. */
.new-order-layout{max-width:1444px}
.new-order-layout #order-form.panel{grid-template-columns:300px minmax(0,900px) 200px;justify-content:start}
#order-form input[name="quantity"]{width:96px!important;max-width:100%}
@media(max-width:1400px){.new-order-layout #order-form.panel{grid-template-columns:260px minmax(0,900px) 170px}}
@media(max-width:1100px){.new-order-layout #order-form.panel{grid-template-columns:260px minmax(0,900px)}}
@media(max-width:800px){.new-order-layout #order-form.panel{grid-template-columns:minmax(0,1fr)}}

.label-preview{margin-top:24px;padding-top:20px;border-top:1px solid #e7ebf2}
.label-preview h3{margin:0 0 8px;font-size:15px;color:#172238}
.label-a4-sheet{container-type:inline-size;display:flex;flex-direction:column;gap:2.5%;width:420px;max-width:100%;aspect-ratio:210/297;padding:3.8%;background:white;border:1px solid #d6dce5;box-shadow:0 3px 12px #17223812;color:#000;font-family:Arial,sans-serif}
.printed-label{flex:1;min-height:0;border:1px solid #222;border-radius:2cqw;display:flex;flex-direction:column;padding:1.5cqw 2cqw}
.printed-label-title{text-align:center;font-size:5.5cqw;line-height:1.15;white-space:nowrap}
.printed-label-meta{display:flex;justify-content:space-between;margin-top:4cqw;font-size:2.6cqw}
.printed-label-code{display:flex;align-items:center;justify-content:center;flex:1;font-size:19cqw;line-height:1.1;font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums}
.printed-label-dimensions{display:flex;justify-content:space-around;gap:2cqw;font-size:6.4cqw;line-height:1.3;white-space:nowrap;min-height:8cqw}
.label-preview-empty{margin:0;padding:20px;background:#f3f5f9;color:#62717c;border-radius:8px}

.label-a4-sheet{aspect-ratio:210/99;gap:0;padding:3.8%}

/* Match the supplied label: a single rounded frame, without a sheet mockup. */
.label-a4-sheet{width:760px;max-width:100%;aspect-ratio:2/1;padding:0;border:0;box-shadow:none;background:#fff;overflow:hidden}
.printed-label{border:1px solid #222;border-radius:2cqw;padding:1cqw 1.5cqw}
.printed-label-title{font-size:5.6cqw;line-height:1.15;font-weight:400;text-align:center}
.printed-label-meta{margin-top:4.5cqw;padding:0 .5cqw;font-size:2.5cqw;line-height:1.2}
.printed-label-code{font-family:Arial,sans-serif;font-size:20cqw;font-weight:700;line-height:1;letter-spacing:0}
.printed-label-dimensions{justify-content:space-between;gap:1cqw;font-size:6.7cqw;line-height:1.15;min-height:0;font-weight:400}

.new-order-layout #order-form>.order-right-column{grid-column:3;grid-row:1;display:flex;flex-direction:column;gap:22px;min-width:0}
.new-order-layout .order-right-column>.label-preview{margin:0;padding:10px;border:1px solid #e0e5ed;border-radius:12px;background:#fff}
@media(max-width:1100px){.new-order-layout #order-form>.order-right-column{grid-column:2;grid-row:auto}}
@media(max-width:800px){.new-order-layout #order-form>.order-right-column{grid-column:1;grid-row:auto}}

.new-order-layout #order-form .order-submit-actions{display:flex;flex-direction:column;gap:12px;margin:0;padding:0;border:0}
.new-order-layout .order-submit-actions .primary{order:0;width:100%;padding:13px 12px;font-weight:600}
.new-order-layout .order-submit-actions #clear-order-form{order:1;align-self:center;padding:6px;border:0;background:transparent;color:#74828c;font-size:12px}

.new-order-layout .product-card-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:24px}
.new-order-layout .product-card-header h2{margin-bottom:0}
.new-order-layout .product-card-header #clear-order-form{flex-shrink:0;padding:6px 0;border:0;background:transparent;color:#74828c;font-size:12px}

.perforation-group{display:flex;flex-direction:column;gap:12px;flex:0 0 auto}
#order-form .perforation-distance-field{font-size:12px}

#order-form .free-tension-option{display:flex;flex-direction:row;align-items:center;gap:8px;padding:0}
#order-form .free-tension-option input{width:16px!important;height:16px;min-height:16px;flex:0 0 16px;margin:0;padding:0;accent-color:#2563eb}

#order-form .bag-color-field select{width:160px!important;max-width:100%}

#order-form .label-mark-field input{width:160px!important;max-width:100%}
.printed-label{position:relative}
.printed-label-mark{position:absolute;right:2.5cqw;top:8cqw;max-width:28%;font:italic 6.5cqw/1.1 'Times New Roman',serif;overflow-wrap:anywhere;text-align:right}
.printed-label:has(.printed-label-mark) .printed-label-meta{padding-right:30%}

#order-form .label-mark-field{display:grid;grid-template-columns:150px 80px;align-items:center;gap:12px}
#order-form .label-mark-field input{width:80px!important;min-height:36px;padding:7px 8px}
@media(max-width:600px){#order-form .label-mark-field{grid-template-columns:116px 72px;gap:8px}#order-form .label-mark-field input{width:72px!important}}

.directory{max-width:740px;grid-template-columns:minmax(280px,380px) 340px}
@media(max-width:800px){.directory{grid-template-columns:minmax(0,380px)}}

.directory table th,.directory table td{border-bottom:0}

/* Product parameters: one compact vertical column with aligned controls. */
#order-form .fields:has(>.product-primary-row){grid-template-columns:minmax(0,1fr);gap:10px}
#order-form .product-primary-row{display:flex;flex-direction:column;align-items:stretch;gap:10px}
#order-form .product-primary-row>label,
#order-form .perforation-group>label,
#order-form .fields:has(>.product-primary-row)>label:not(.check){display:grid;grid-template-columns:minmax(0,170px) minmax(0,160px);align-items:center;gap:12px}
#order-form .perforation-group{gap:10px}
#order-form .product-primary-row input,
#order-form .product-primary-row select,
#order-form .fields:has(>.product-primary-row)>label:not(.check) input,
#order-form .fields:has(>.product-primary-row)>label:not(.check) select{min-height:34px;height:34px;padding:6px 10px}
#order-form .fields:has(>.product-primary-row) .free-tension-option{margin-top:2px}
.new-order-layout .product-card-header{margin-bottom:16px;flex-wrap:wrap}
@media(max-width:420px){
#order-form .product-primary-row>label,
#order-form .perforation-group>label,
#order-form .fields:has(>.product-primary-row)>label:not(.check){grid-template-columns:minmax(0,1fr) minmax(0,130px);gap:8px}
}

#order-form .label-parameter-row>label:has(select[name=labelLayers]){grid-template-columns:150px 180px}
#order-form select[name=labelLayers]{width:180px!important}
@media(max-width:600px){#order-form .label-parameter-row>label:has(select[name=labelLayers]){grid-template-columns:116px 180px}}

/* Allow the complete production placeholder, including number spinners. */
#order-form .label-parameter-row>label:first-child{grid-template-columns:150px 180px}
#order-form .label-parameter-row input[type=number],#order-form .label-parameter-row select{width:180px!important}
#order-form .label-parameter-row{flex-wrap:wrap}
@media(max-width:600px){#order-form .label-parameter-row>label:first-child{grid-template-columns:116px 180px}}
@media(max-width:420px){#order-form .label-parameter-row>label:first-child{grid-template-columns:minmax(0,1fr);width:100%}#order-form .label-parameter-row>.check{margin-left:0}}

@media(max-width:420px){#order-form .label-parameter-row>label:has(select[name=labelLayers]){grid-template-columns:minmax(0,1fr)}}

/* Align production totals below the clear button. */
.new-order-layout .order-product-card>.section{display:grid;grid-template-columns:minmax(0,1fr) 180px;gap:0 20px;align-items:start;min-width:0}
.new-order-layout .order-product-card .product-card-header{grid-column:1/-1}
.new-order-layout .order-product-card .section>.fields{grid-column:1;grid-row:2;min-width:0}
.new-order-layout #order-form .order-product-card .order-calculation-card{grid-column:2;grid-row:2;padding:18px 16px}
@media(max-width:1100px){.new-order-layout .order-product-card>.section{grid-template-columns:minmax(0,1fr)}.new-order-layout #order-form .order-product-card .order-calculation-card{grid-column:1;grid-row:3;margin-top:20px}}
/* Show perforation distance beside the yes/no selector. */
#order-form .perforation-group{flex-direction:row;align-items:center;flex-wrap:wrap;gap:10px 14px}
#order-form .perforation-group>label:first-child{grid-template-columns:minmax(0,170px) 96px;flex:0 1 278px;min-width:0}
#order-form .perforation-group>.perforation-distance-field{display:flex;flex-direction:row;align-items:center;gap:8px;white-space:nowrap}
#order-form .perforation-distance-field input{flex:0 0 96px}

#order-form .perforation-group>.perforation-sheet-count{display:flex;flex-direction:row;align-items:center;gap:8px;white-space:nowrap}
#order-form .perforation-sheet-count output{min-width:38px;font-weight:600;font-variant-numeric:tabular-nums;color:#172238}

.orders-table .order-number .muted{width:auto;white-space:nowrap}

.orders-table td.client{width:176px;min-width:176px;max-width:176px;text-align:left}
.orders-table .client-name{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;width:152px;line-height:1.25;max-height:2.5em;overflow:hidden;white-space:normal;word-break:normal;overflow-wrap:normal;hyphens:none}

/* Keep the order list in the viewport with one scroll area for the table. */
body:has(.orders-table){height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
body:has(.orders-table)>header{flex-shrink:0}
body:has(.orders-table)>main{flex:1;min-height:0;display:flex;flex-direction:column}
body:has(.orders-table)>main>.panel{flex:1;min-height:0;display:flex;flex-direction:column}
.orders-toolbar{flex-shrink:0}
.orders-table{flex:1;max-height:none}
body:has(.orders-table) #empty{flex-shrink:0}

/* Preview belongs to the label editor, beside its controls. */
#order-form .label-section{container-type:inline-size}
#order-form .label-editor{display:grid;grid-template-columns:minmax(0,1fr);gap:24px;align-items:start}
#order-form .label-controls{min-width:0}
#order-form .label-editor>.label-preview{min-width:0;margin:0;padding:0;border:0;border-radius:0;background:transparent}
@container(min-width:780px){
 #order-form .label-editor{grid-template-columns:minmax(450px,1.2fr) minmax(280px,1fr)}
}
/* Use the full form width for label controls and preview. */
.new-order-layout{width:100%;max-width:none}
.new-order-layout #order-form.panel{grid-template-columns:300px minmax(0,1fr) 200px}
.new-order-layout #order-form>.order-label-card{grid-column:1/-1}
#order-form .label-parameter-row{flex-wrap:nowrap}
#order-form .label-parameter-row>.check{flex-shrink:0;white-space:nowrap;margin-left:0}
@container(min-width:780px){
 #order-form .label-editor{grid-template-columns:minmax(480px,1fr) minmax(280px,1fr)}
}
@media(max-width:1400px){.new-order-layout #order-form.panel{grid-template-columns:260px minmax(0,1fr) 170px}}
@media(max-width:1100px){.new-order-layout #order-form.panel{grid-template-columns:260px minmax(0,1fr)}}
@media(max-width:800px){.new-order-layout #order-form.panel{grid-template-columns:minmax(0,1fr)}}
@media(max-width:600px){
 #order-form .label-parameter-row>label:first-child,
 #order-form .label-parameter-row>label:has(select[name=labelLayers]){grid-template-columns:minmax(0,1fr);width:auto;flex:1;min-width:0}
 #order-form .label-parameter-row input[type=number],#order-form .label-parameter-row select{max-width:100%}
}
#order-form .label-type-row>.label-placement-field{flex:0 1 240px;min-width:0;max-width:100%}
#order-form .label-placement-field select{width:240px;max-width:100%}

.orders-table .order-number-line{display:flex;align-items:center;gap:6px;white-space:nowrap}
.orders-table .order-copy{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:4px;border:0;border-radius:6px;background:transparent;color:#7c8b95;flex:none}
.orders-table .order-copy:hover{background:#eaf1ff;color:#245bce}
.orders-table .order-copy svg{display:block}

/* Approved order-creation layout. Scoped to leave other screens unchanged. */
/* Contain the header margin within the viewport minimum height. */
body:has(:is(.modern-order,.directory,.employees)){display:flow-root}
body:has(:is(.modern-order,.orders-table,.directory,.employees)){background:#f1f1f1;color:#202326}
body:has(:is(.modern-order,.orders-table,.directory,.employees))>header{position:static;margin:12px 24px 0;padding:10px 24px;border:0;border-radius:24px;gap:24px}
body:has(:is(.modern-order,.orders-table,.directory,.employees)) .brand{font-size:18px;color:#25282b}
body:has(:is(.modern-order,.orders-table,.directory,.employees)) .brand span{display:none}
body:has(:is(.modern-order,.orders-table,.directory,.employees)) nav a{padding:7px 18px;border:1.5px solid transparent;border-radius:24px;color:#43474b}
body:has(:is(.modern-order,.orders-table,.directory,.employees)) nav a.active{background:transparent;border-color:#0785ff;color:#202326;font-weight:600}
body:has(:is(.modern-order,.orders-table,.directory,.employees)) #page-heading{display:none}
main:has(.modern-order){padding:20px 24px 24px}
.modern-order .new-order-title{font-size:30px;margin:0 0 20px;color:#202326;letter-spacing:-.7px}
.modern-order.new-order-layout #order-form.panel{display:grid;grid-template-columns:minmax(0,1.58fr) minmax(0,1fr);gap:20px;align-items:stretch;background:none;padding:0;border:0}
.modern-order #order-form .order-client-card,.modern-order #order-form .order-product-card,.modern-order #order-form .order-label-card{margin:0;padding:22px 24px;background:#fff;border:0;border-radius:24px;box-shadow:none;min-width:0}
.modern-order #order-form .order-client-card{grid-column:1/-1;align-self:auto;padding:16px 22px}
.modern-order #order-form .order-product-card{grid-column:1;display:flex;flex-direction:column}
.modern-order #order-form .order-label-card{grid-column:2;grid-row:2;container-type:normal;display:flex;flex-direction:column}
.modern-order #order-form .customer-row{display:grid;grid-template-columns:1.35fr 1fr 1fr 1.15fr .8fr;gap:22px}
.modern-order #order-form label{font-size:14px;color:#303437;gap:7px;min-width:0}
.modern-order #order-form label:has([name=invoice]){grid-column:auto}
.modern-order #order-form input:not([type=checkbox]),.modern-order #order-form select,.modern-order #order-form textarea{width:100%!important;max-width:100%;height:38px;min-height:38px;padding:8px 12px;border:1px solid transparent;border-radius:9px;background:#f1f2f4;color:#25282b;font-size:14px;align-self:stretch}
.modern-order #order-form input:focus,.modern-order #order-form select:focus,.modern-order #order-form textarea:focus{background:#f7faff;border-color:#0785ff;outline:2px solid #0785ff33;outline-offset:1px}
.modern-order #order-form input::placeholder{color:#858b91;font-size:12px}
.modern-order #order-form input:disabled{color:#92979c}
.modern-order #order-form h2{display:block;font-size:21px;font-weight:650;letter-spacing:-.4px;color:#202326;margin:0 0 24px}
.modern-order #order-form h2:before{content:none}
.modern-order #order-form h3{font-size:16px;margin:0 0 23px;font-weight:600;color:#202326}
.modern-order #order-form .production-grid{display:grid;grid-template-columns:1fr 1.08fr 1fr;gap:20px;flex:1}
.modern-order #order-form .production-grid>section{min-width:0;display:flex;flex-direction:column;gap:17px}
.modern-order #order-form .production-grid>section+section{border-left:1px solid #eceef0;padding-left:20px}
.modern-order #order-form .production-grid h3{margin-bottom:4px}
.modern-order #order-form .check{display:flex;flex-direction:row;gap:9px;align-items:center;align-self:auto;padding:0;line-height:1.35}
.modern-order #order-form input[type=checkbox]{width:18px!important;height:18px;min-height:18px;flex:0 0 18px;padding:0;margin:0;accent-color:#0785ff}
.modern-order #order-form .perforation-details{display:flex;flex-direction:column;gap:12px;background:transparent;border-left:2px solid #dfe3e8;border-radius:0;padding:12px;margin:-5px 0 0 10px}
.modern-order #order-form .perforation-details>label{display:flex;flex-direction:column;align-items:stretch;gap:6px;white-space:normal;font-size:12px}
.modern-order #order-form .perforation-details output{padding:8px 12px;min-height:34px;background:#eeeff1;border-radius:8px;color:#777e84;font-weight:400}
.modern-order #order-form .order-volume input{font-size:25px;font-weight:600;height:48px;min-height:48px}
.modern-order #order-form .order-volume .order-metrics{display:flex;flex-direction:column;gap:0;padding:0;margin-top:9px;border:0;background:none;border-radius:0}
.modern-order #order-form .order-metrics label{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:10px;padding:14px 0;border:0;border-bottom:1px solid #eceef0;font-size:12px}
.modern-order #order-form .order-metrics output{color:#202326;font-size:17px;font-weight:600;white-space:nowrap}
.modern-order #order-form .new-order-notes{border-top:1px solid #eceef0;padding-top:14px;margin-top:20px}
.modern-order #order-form .new-order-notes textarea{height:64px;min-height:64px;resize:none}
.modern-order #order-form .label-editor{display:flex;flex-direction:column;gap:20px;flex:1}
.modern-order #order-form .label-controls{width:100%;display:flex;flex-direction:column;gap:12px}
.modern-order #order-form .label-type-row{display:grid;grid-template-columns:1fr 1fr;gap:12px 18px;align-items:start}
.modern-order #order-form .label-type-row>label{width:auto;min-width:0;max-width:none}
.modern-order #order-form .label-type-row>.check{grid-column:1/-1;min-height:0;align-self:auto}
.modern-order #order-form [data-label-modified]{display:flex;flex-direction:column;gap:8px;width:100%}
.modern-order #order-form .label-parameter-row{display:grid;grid-template-columns:minmax(0,1fr) 112px;gap:12px;width:100%}
.modern-order #order-form .label-parameter-row>label:first-child{display:grid;grid-template-columns:minmax(100px,.85fr) minmax(0,1fr);gap:10px;align-items:center;width:auto;font-size:13px}
.modern-order #order-form .label-parameter-row .check{font-size:12px;white-space:nowrap}
.modern-order #order-form .label-parameter-row input,.modern-order #order-form .label-parameter-row select{height:32px;min-height:32px;padding:5px 10px;font-size:13px}
.modern-order #order-form .label-mark-field{display:grid;grid-template-columns:minmax(100px,.85fr) minmax(0,1fr);align-items:center;gap:10px;margin-right:124px;font-size:13px}
.modern-order #order-form .label-mark-field input{height:32px;min-height:32px;padding:5px 10px}
.modern-order #order-form .label-preview{align-self:center;width:100%;max-width:460px;margin:auto 0 0;padding:0;border:0;background:none}
.modern-order #order-form .label-a4-sheet{width:100%;aspect-ratio:2/1}
.modern-order #order-form .order-submit-actions{display:flex;flex-direction:row;justify-content:flex-end;gap:12px;margin:22px 0 0;padding:0;border:0}
.modern-order #order-form .order-submit-actions button{width:auto;min-height:40px;padding:10px 20px;border:0;border-radius:10px;font-size:14px;font-weight:500;white-space:nowrap}
.modern-order #order-form .order-submit-actions #clear-order-form{order:0;color:#43484e;background:#f1f2f4;align-self:auto}
.modern-order #order-form .order-submit-actions .primary{order:1;background:#0785ff;color:#fff}
.modern-order #order-form #form-error:empty{display:none}
@media(min-width:1400px) and (min-height:850px){
 .modern-order #order-form .order-product-card,.modern-order #order-form .order-label-card{min-height:650px}
 .modern-order #order-form .production-grid>section{gap:23px}
}
@media(max-height:850px) and (min-width:1200px){
 body:has(:is(.modern-order,.orders-table,.directory,.employees))>header{margin-top:8px;padding-top:6px;padding-bottom:6px}
 main:has(.modern-order){padding-top:14px}
 .modern-order .new-order-title{font-size:25px;margin-bottom:12px}
 .modern-order.new-order-layout #order-form.panel{gap:14px}
 .modern-order #order-form .order-client-card{padding-top:12px;padding-bottom:12px}
 .modern-order #order-form .order-product-card,.modern-order #order-form .order-label-card{padding:18px 20px}
 .modern-order #order-form h2{margin-bottom:18px}
 .modern-order #order-form .production-grid>section{gap:12px}
 .modern-order #order-form .label-editor{gap:12px}
 .modern-order #order-form .label-preview{max-width:380px}
 .modern-order #order-form .new-order-notes textarea{height:50px;min-height:50px}
 .modern-order #order-form .order-submit-actions{margin-top:14px}
}
@media(max-width:1199px){
 .modern-order.new-order-layout #order-form.panel{grid-template-columns:1fr}
 .modern-order #order-form .order-label-card{grid-column:1;grid-row:auto}
 .modern-order #order-form .customer-row{grid-template-columns:repeat(3,minmax(0,1fr))}
 body:has(:is(.modern-order,.orders-table,.directory,.employees))>header{flex-wrap:wrap}
}
@media(max-width:650px){
 body:has(:is(.modern-order,.orders-table,.directory,.employees))>header{margin:8px 10px 0;padding:10px 14px;gap:12px}
 main:has(.modern-order){padding:18px 10px}
 .modern-order #order-form .customer-row{grid-template-columns:1fr 1fr;gap:14px}
 .modern-order #order-form .production-grid{grid-template-columns:1fr}
 .modern-order #order-form .production-grid>section+section{border-left:0;border-top:1px solid #eceef0;padding:18px 0 0}
 .modern-order #order-form .label-parameter-row{grid-template-columns:minmax(0,1fr) 100px;gap:6px}
 .modern-order #order-form .label-parameter-row>label:first-child,.modern-order #order-form .label-mark-field{grid-template-columns:minmax(80px,1fr) minmax(0,1fr);gap:6px}
 .modern-order #order-form .label-mark-field{margin-right:106px}
 .modern-order #order-form .order-submit-actions button{padding:10px 12px}
}

.modern-order #order-form .order-warehouse-card{grid-column:1/-1;grid-row:auto;background:#fff;border:0;border-radius:24px;padding:22px 24px;margin:0}
.modern-order #order-form .perforation-details input[name="perforationDistance"]{flex:none;width:88px!important;max-width:100%;height:34px;min-height:34px;align-self:flex-start;padding:6px 10px}
.modern-order #order-form .perforation-details>.perforation-sheet-count{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding-top:10px;border-top:1px solid #e5e7eb}
.modern-order #order-form .perforation-details>.perforation-sheet-count output{background:none;border:0;border-radius:0;padding:0;min-height:0;color:#202326;font-size:17px;font-weight:600;font-variant-numeric:tabular-nums}

/* Highlight fields that can be filled in. */
.modern-order #order-form input:not([type=checkbox]):not([type=hidden]):not([readonly]):not(:disabled),
.modern-order #order-form select:not(:disabled),
.modern-order #order-form textarea:not([readonly]):not(:disabled){background:#fff8cc}
.modern-order #order-form .order-submit-actions .primary{background:#ff9500;color:#202326}

/* Existing orders: keep documents compact and all main sections together. */
.order-detail-heading{display:flex;align-items:center;flex-wrap:wrap;gap:12px 24px;margin-bottom:12px}
.order-detail-heading h1{margin:0;font-size:25px}
.order-detail-heading .order-created-at{color:#74828c;font-size:13px}
.order-detail-heading button{padding:8px 12px;white-space:nowrap}
.order-detail.modern-order #order-form .customer-row{grid-template-columns:minmax(285px,1.1fr) minmax(150px,1.35fr) minmax(100px,1fr) minmax(135px,1fr) minmax(135px,1.15fr) minmax(80px,.65fr);gap:16px;align-items:center}
.customer-row>.order-detail-heading{display:grid;grid-template-columns:max-content max-content;align-items:center;justify-content:start;gap:4px 12px;margin:0;min-width:0}
.customer-row>.order-detail-heading h1{font-size:22px;line-height:1.2}
.customer-row>.order-detail-heading .order-created-at{grid-column:1/-1;grid-row:2;font-size:11px}
.customer-row>.order-detail-heading button{grid-column:2;grid-row:1;padding:3px 0;border:0;background:transparent;color:#245bce;font-size:12px}
@media(max-width:1199px){.order-detail.modern-order #order-form .customer-row{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:650px){.order-detail.modern-order #order-form .customer-row{grid-template-columns:repeat(2,minmax(0,1fr))}.customer-row>.order-detail-heading{grid-column:1/-1}}
main:has(.order-detail){padding:12px 16px 16px}
body:has(.order-detail)>header{margin:10px 16px 0;padding:6px 20px}
main:has(.order-detail)>.toolbar{margin-bottom:10px}
main:has(.order-detail)>.toolbar .button,main:has(.order-detail)>.toolbar button{padding:8px 12px}
.order-detail .new-order-title{font-size:25px;margin-bottom:12px}
.order-detail.modern-order #order-form.panel{gap:12px;align-items:start}
.order-detail.modern-order #order-form .order-client-card{grid-column:1/-1;grid-row:1;padding:12px 18px}
.order-detail.modern-order #order-form .order-warehouse-card{grid-column:1/-1;grid-row:2;padding:12px 18px}
.order-detail.modern-order #order-form .order-warehouse-card .fields{display:grid;grid-template-columns:1fr 1.35fr 1fr 1fr;gap:16px}
.order-detail.modern-order #order-form .order-product-card{grid-column:1;grid-row:3;min-height:0;padding:16px 18px}
.order-detail.modern-order #order-form .order-label-card{grid-column:2;grid-row:3;min-height:0;padding:16px 18px}
.order-detail.modern-order #order-form h2{font-size:18px;margin-bottom:12px}
.order-detail.modern-order #order-form h3{font-size:14px;margin-bottom:2px}
.order-detail.modern-order #order-form label{font-size:13px;gap:5px}
.order-detail.modern-order #order-form input:not([type=checkbox]),.order-detail.modern-order #order-form select{height:34px;min-height:34px;padding:6px 10px}
.order-detail.modern-order #order-form .production-grid{gap:16px}
.order-detail.modern-order #order-form .production-grid>section{gap:10px}
.order-detail.modern-order #order-form .production-grid>section+section{padding-left:16px}
.order-detail.modern-order #order-form .order-metrics label{padding:10px 0;font-size:12px}
.order-detail.modern-order #order-form .order-volume input{font-size:21px}
.order-detail.modern-order #order-form .new-order-notes{width:calc((100% - 32px)/3.08);margin-top:12px;padding-top:10px}
.order-detail.modern-order #order-form .new-order-notes textarea{height:88px;min-height:88px;resize:vertical}
.order-detail.modern-order #order-form .order-product-bottom{display:grid;grid-template-columns:1fr 1.08fr 1fr;gap:16px;align-items:start;margin-top:12px}
.order-detail.modern-order #order-form .order-product-bottom .new-order-notes{width:100%;margin:0}
.order-detail.modern-order #order-form .order-format-block{grid-column:2/-1;justify-self:end;width:max-content;max-width:100%;display:grid;grid-template-columns:88px minmax(0,max-content);gap:16px;margin-top:10px;padding:14px 16px;border:1px solid #e4e9ec;border-radius:12px;background:#f7f9fa;min-width:0}
.order-detail.modern-order #order-form .order-format-block input,.order-detail.modern-order #order-form .order-format-block output{width:88px!important;max-width:100%}
.order-detail.modern-order #order-form .order-format-block output{display:flex;align-items:center;justify-content:flex-end;width:100%!important;min-height:34px;padding:0;background:transparent;border:0;border-radius:0;font-size:17px;font-weight:600;font-variant-numeric:tabular-nums}
.order-detail.modern-order #order-form .label-editor{gap:12px}
.order-detail.modern-order #order-form .label-preview{max-width:320px;margin:0;align-self:center}
.order-detail.modern-order #order-form .note{margin:10px 0 0;padding-top:8px;font-size:11px}
.order-detail.modern-order #order-form .order-submit-actions{margin-top:10px}
@media(max-width:1199px){
 .order-detail.modern-order #order-form .order-product-card{grid-column:1/-1;grid-row:3}
 .order-detail.modern-order #order-form .order-label-card{grid-column:1/-1;grid-row:4}
 .order-detail.modern-order #order-form .order-warehouse-card .fields{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:650px){
 .order-detail.modern-order #order-form .order-product-bottom{grid-template-columns:1fr}
 .order-detail.modern-order #order-form .order-format-block{grid-column:1;grid-template-columns:1fr;margin-top:0}
 .order-detail.modern-order #order-form .new-order-notes{width:100%}
 .order-detail.modern-order #order-form .order-warehouse-card .fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 .order-detail.modern-order #order-form .order-warehouse-card label:has([name=readyAt]){grid-column:1/-1}
}

/* Fit the complete order list on common desktop screens. */
body:has(.orders-table)>main{padding:16px}
body:has(.orders-table)>main>.panel{padding:12px}
.orders-table table{table-layout:fixed;width:1730.86px;min-width:0;font-size:12px}
.orders-table th,.orders-table td{padding:5px 3px;white-space:normal;overflow-wrap:anywhere}
.orders-table th{font-size:11px;line-height:1.2}
.orders-table .order-sort{gap:2px;align-items:flex-start}
.orders-table .sort-indicator{font-size:9px}
.orders-table td.client{width:auto;min-width:0;max-width:none}
.orders-table .client-name{display:block;width:auto;max-height:none;overflow:visible;overflow-wrap:anywhere}
.orders-table td.order-notes{white-space:pre-wrap;overflow-wrap:anywhere}
.orders-table .order-number-line{gap:2px;flex-wrap:wrap}
.orders-table .order-number .muted{font-size:10px;white-space:normal}
.orders-table .order-copy{width:20px;height:22px;padding:2px}
.orders-table .badge{max-width:100%;padding:3px 4px;font-size:11px;white-space:normal}
.orders-table select[data-order-status]{width:100%;max-width:100%;padding:5px 0;font-size:11px}
@media(max-width:600px){body:has(.orders-table)>main{padding:10px}body:has(.orders-table)>main>.panel{padding:8px}}

.orders-table th:nth-child(4){white-space:nowrap;overflow-wrap:normal}

.orders-table td:nth-child(12),.orders-table td:nth-child(13){white-space:nowrap;overflow-wrap:normal;font-variant-numeric:tabular-nums}


.orders-table select[data-order-status]{field-sizing:fixed;width:100%;max-width:100%;padding:5px 0}
.orders-table td:nth-child(11)>.badge{display:block;width:100%;text-align:center}

.orders-table th{overflow-wrap:normal;word-break:normal;hyphens:none}
.orders-table .order-sort{position:relative;display:block;padding-right:9px}
.orders-table .sort-indicator{position:absolute;right:0;top:0}

.orders-table td:nth-child(n+3):nth-child(-n+9),
.orders-table td:nth-child(n+19):nth-child(-n+22){text-align:center}

/* Compact controls keep their width instead of stretching across the column. */
.order-detail.modern-order #order-form .order-warehouse-card .fields{display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:flex-end;gap:14px 20px}
.order-detail.modern-order #order-form .order-warehouse-card .fields>label{flex:0 1 auto;width:max-content;max-width:100%;min-width:0}
.modern-order #order-form .customer-row{display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:flex-end;gap:14px 20px}
.modern-order #order-form .customer-row>label{flex:0 1 auto;width:max-content;max-width:100%;min-width:0}
.modern-order #order-form .customer-row>label:has([name="client"]){flex:0 1 440px;width:440px}
.modern-order #order-form .customer-row>.order-detail-heading{flex:0 1 285px;max-width:100%}
.modern-order #order-form select[name="status"]{width:180px!important;max-width:100%;align-self:flex-start}
.modern-order #order-form input[name="readyAt"]{width:230px!important;max-width:100%;align-self:flex-start}
.modern-order #order-form input[name="upd"],
.modern-order #order-form input[name="ariaUpd"]{width:170px!important;max-width:100%;align-self:flex-start}
.modern-order #order-form select[name="managerId"]{width:170px!important;max-width:100%;align-self:flex-start}
.modern-order #order-form input[name="shippingDate"]{width:160px!important;max-width:100%;align-self:flex-start}
.modern-order #order-form select[name="delivery"]{width:170px!important;max-width:100%;align-self:flex-start}
.modern-order #order-form input[name="invoice"]{width:120px!important;max-width:100%;align-self:flex-start}
.modern-order #order-form select[name="layers"],
.modern-order #order-form input[name="width"],
.modern-order #order-form input[name="winding"],
.modern-order #order-form input[name="density"]{width:120px!important;max-width:100%;align-self:flex-start}
.modern-order #order-form select[name="labelPlacement"]{width:260px!important;max-width:100%;align-self:flex-start}
.modern-order #order-form select[name="bagColor"]{width:170px!important;max-width:100%;align-self:flex-start}
.modern-order #order-form .order-volume input[name="quantity"]{width:120px!important;max-width:100%;align-self:flex-start;font-size:37.5px;height:72px;min-height:72px}
.order-detail.modern-order #order-form .order-volume input[name="quantity"]{font-size:31.5px;height:51px;min-height:51px}

/* New order comment matches the main parameter column. */
.modern-order:not(.order-detail) #order-form .new-order-notes{width:calc((100% - 40px)/3.08)}
.modern-order:not(.order-detail) #order-form .new-order-notes textarea{height:76.8px;min-height:76.8px}
@media(max-height:850px) and (min-width:1200px){
 .modern-order:not(.order-detail) #order-form .new-order-notes textarea{height:60px;min-height:60px}
}
@media(max-width:650px){
 .modern-order:not(.order-detail) #order-form .new-order-notes{width:100%}
}

/* Shared workspace design for orders and directory. */
body:has(:is(.orders-table,.directory))>main{padding:20px 24px 24px}
.workspace-title{font-size:30px;margin:0 0 20px;color:#202326;letter-spacing:-.7px}
body:has(.orders-table)>main>.panel,.directory>.panel{background:#fff;border:0;border-radius:24px;box-shadow:none;padding:22px 24px;min-width:0}
.orders-toolbar{gap:12px;margin-bottom:22px}
.orders-toolbar input,.orders-toolbar select,.directory .manager-form input{min-height:38px;padding:8px 12px;border:1px solid transparent;border-radius:9px;background:#fff8cc;color:#25282b}
.orders-toolbar input:focus,.orders-toolbar select:focus,.directory .manager-form input:focus{border-color:#0785ff;outline:2px solid #0785ff33;outline-offset:1px}
.orders-toolbar>.button.primary,.directory button.primary{background:#ff9500;border-color:#ff9500;color:#202326;font-weight:600;border-radius:10px;padding:10px 20px}
.shipping-months{gap:4px}.shipping-months button{padding:8px 10px;border:1px solid transparent;border-radius:9px;background:#f1f2f4;color:#43484e}
.shipping-months button[aria-pressed="true"]{background:#fff;border-color:#0785ff;color:#202326;font-weight:600}
.month-totals{background:#f1f2f4;border:0;border-radius:12px;padding:10px 16px}.month-totals span{color:#697078}.month-totals strong{color:#202326;font-size:17px}
.orders-table{border:1px solid #eceef0;border-radius:12px}.orders-table th{background:#f1f2f4;color:#626970}.orders-table td{border-bottom-color:#eceef0}.orders-table tbody tr:last-child td{border-bottom:0}.orders-table tbody tr:hover{background:#fafbfc}.orders-table a{color:#0878df}.orders-table .order-copy{border:0;background:#f1f2f4;border-radius:6px}
.directory{max-width:1000px;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:20px}.directory>.panel:last-child{width:auto;max-width:100%}
.directory h2{font-size:21px;font-weight:650;letter-spacing:-.4px;color:#202326;margin-bottom:24px}.directory .manager-form{align-items:center;gap:12px;margin-bottom:22px}.directory .manager-form input{min-width:0}
.directory th{background:#f1f2f4;color:#626970}.directory th,.directory td{padding:12px 10px}.directory th:first-child{border-radius:9px 0 0 9px}.directory th:last-child{border-radius:0 9px 9px 0}.directory td{white-space:normal;overflow-wrap:anywhere}.directory .row-actions{flex-wrap:wrap}.directory .row-actions button{background:#f1f2f4;border:0;border-radius:8px;color:#43484e}.directory input[type=color]{border:1px solid #e5e7eb;border-radius:9px;background:#f1f2f4}.directory .note{line-height:1.5;border-color:#eceef0;margin-bottom:0}
@media(max-height:850px) and (min-width:1200px){body:has(:is(.orders-table,.directory))>main{padding-top:14px}.workspace-title{font-size:25px;margin-bottom:12px}}
@media(max-width:800px){.directory{grid-template-columns:minmax(0,1fr);max-width:600px}}
@media(max-width:650px){body:has(:is(.orders-table,.directory))>main{padding:18px 10px}.workspace-title{font-size:25px}.directory>.panel,body:has(.orders-table)>main>.panel{padding:18px 14px}.orders-toolbar{align-items:stretch}.orders-toolbar #search{max-width:none;flex-basis:auto}.orders-toolbar #shipping-year{width:100%}.orders-toolbar>.button{margin-left:0;text-align:center}.shipping-months button{flex:1 0 40px}.month-totals{flex-basis:auto}.directory .manager-form{flex-wrap:wrap}.directory .manager-form input{flex-basis:100%}}

.modern-order #order-form .label-print-row{display:flex;align-items:flex-start;justify-content:flex-start;gap:24px;width:100%;flex-wrap:wrap}
.modern-order #order-form .label-print-row>.label-preview{align-self:flex-start;flex:0 1 320px;width:320px;max-width:100%;margin:0}
.modern-order #order-form .label-print-quantity{flex:0 1 220px;min-width:0}

.modern-order #order-form .label-print-quantity{display:flex;flex-direction:column;align-items:flex-start;gap:12px}

.perforated-label-details{display:flex;align-items:flex-end;justify-content:space-between;gap:1cqw;font-size:4.4cqw;line-height:1.15;white-space:nowrap}
.perforated-label-sheet{display:grid;grid-template-columns:auto auto;column-gap:2cqw;font-size:2.9cqw;align-items:center}
.perforated-label-sheet>span{text-align:right}
.perforated-label-rolls{font-size:4.2cqw}
[data-label-preview]>.label-a4-sheet+.label-a4-sheet{margin-top:12px}

@media(min-width:1100px){.directory{max-width:1000px;grid-template-columns:minmax(0,320px) minmax(0,320px) minmax(0,240px);gap:20px}.directory .manager-form{flex-wrap:wrap}.directory .manager-form input{width:100%;flex-basis:100%}}

.task-print-dialog{width:min(620px,calc(100vw - 32px));max-height:90vh;overflow:auto;border:0;border-radius:16px;padding:24px;color:#17212b;box-shadow:0 20px 70px #0004}
.task-print-dialog::backdrop{background:#0006}
.task-print-dialog h2{margin:0 0 20px}
.task-print-dialog .fields{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.task-print-dialog label{display:flex;flex-direction:column;gap:6px}
.task-print-dialog .actions{margin-top:20px;justify-content:flex-end}
@media(max-width:480px){.task-print-dialog .fields{grid-template-columns:1fr}}

.orders-table .order-selection{width:16px;height:16px;min-width:16px;flex:0 0 16px;margin:0 5px 0 0;padding:0;accent-color:#245bce;cursor:pointer}
.orders-toolbar #print-selected-tasks{white-space:nowrap}

.history-table td:last-child{white-space:pre-line}
.order-warehouse-card .fields{display:flex!important;flex-wrap:wrap;align-items:flex-start;gap:20px}
.order-warehouse-card .fields>label{flex:0 1 190px;min-width:150px}
.order-warehouse-card .production-summary{flex:1 1 520px;min-width:0;border-left:1px solid #e2e8f0;padding-left:20px}
.production-summary>small{display:block;color:#718096;font-size:11px}.production-summary p{margin:8px 0}.production-summary-values{display:flex;flex-wrap:wrap;gap:10px 24px;margin:6px 0}.production-summary-values>div{display:flex;flex-direction:column;gap:5px}.production-summary-values small{font-size:11px;color:#718096}.production-summary-values strong{font-size:13px;font-weight:500}

.orders-table td.missing-roll-format{background:#fee2e2;box-shadow:inset 0 0 0 3px #fff}
.production-summary-heading{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 20px}.production-summary-heading small{color:#718096;font-size:11px}

.directory .row-actions button{white-space:nowrap;overflow-wrap:normal;flex-shrink:0}

.directory .row-actions{flex-wrap:nowrap}
.directory td:has(>.row-actions){width:1%;white-space:nowrap}

.directory td:first-child{white-space:nowrap;overflow-wrap:normal}

/* Independent order texts share one row and the same dimensions. */
.modern-order #order-form .order-text-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;min-width:0}
.modern-order #order-form .order-text-fields .new-order-notes{width:100%;min-width:0;margin:12px 0 0;padding-top:10px}
.modern-order:not(.order-detail) #order-form .order-text-fields{width:calc((100% - 20px)*2/3)}
.order-detail.modern-order #order-form .order-product-bottom{grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.order-detail.modern-order #order-form .order-product-bottom .order-text-fields{grid-column:1/3}
.order-detail.modern-order #order-form .order-product-bottom .new-order-notes{margin:0}
.order-detail.modern-order #order-form .order-product-bottom .order-format-block{grid-column:3;margin-top:0;justify-self:stretch;width:100%;grid-template-columns:88px minmax(0,1fr)}
@media(max-width:650px){
 .modern-order:not(.order-detail) #order-form .order-text-fields{width:100%}
 .order-detail.modern-order #order-form .order-product-bottom{grid-template-columns:minmax(0,1fr)}
 .order-detail.modern-order #order-form .order-product-bottom .order-text-fields,
 .order-detail.modern-order #order-form .order-product-bottom .order-format-block{grid-column:1}
}

/* Align the format card with the text entry areas below their labels. */
.order-detail.modern-order #order-form .order-product-bottom .order-format-block{margin-top:33px}

.order-detail.modern-order #order-form .order-product-bottom .order-format-block{width:max-content;max-width:100%;justify-self:end;grid-template-columns:88px minmax(0,max-content);gap:12px;padding:12px}

/* Employee accounts share the workspace design. */
body:has(.employees)>main{padding:20px 24px 24px}
.employees{max-width:1200px;display:grid;gap:20px;min-width:0}
.employees>.panel{background:#fff;border:0;border-radius:24px;padding:22px 24px;min-width:0}
.employees .employee-list{margin-top:0}
.employees h2{font-size:21px;font-weight:650;letter-spacing:-.4px;color:#202326;margin-bottom:24px}
.employees .fields{grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}
.employees .fields>.wide{grid-column:auto}
.employees input,.employees select{min-height:38px;padding:8px 12px;border:1px solid transparent;border-radius:9px;background:#fff8cc;color:#25282b}
.employees input:focus,.employees select:focus{border-color:#0785ff;outline:2px solid #0785ff33;outline-offset:1px}
.employees button.primary{background:#ff9500;border-color:#ff9500;color:#202326;font-weight:600;border-radius:10px;padding:10px 20px}
.employees .actions{margin-top:18px}
.employees .muted{font-size:12px;line-height:1.5;color:#697078}
.employees .error:empty{display:none}
.employees th{background:#f1f2f4;color:#626970}
.employees th,.employees td{padding:12px 10px}
.employees th:first-child{border-radius:9px 0 0 9px}
.employees th:last-child{border-radius:0 9px 9px 0}
.employees td{white-space:normal;overflow-wrap:anywhere;border-bottom-color:#eceef0}
.employees tbody tr:last-child td{border-bottom:0}
.employees tbody tr:hover{background:#fafbfc}
.employees .row-actions{flex-wrap:wrap;gap:8px}
.employees .row-actions button{background:#f1f2f4;border:0;border-radius:8px;color:#43484e;white-space:nowrap}
.employees .table-wrap{border:1px solid #eceef0;border-radius:12px}
@media(max-height:850px) and (min-width:1200px){body:has(.employees)>main{padding-top:14px}}
@media(max-width:1000px){.employees .fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){body:has(.employees)>main{padding:18px 10px}.employees>.panel{padding:18px 14px}.employees .fields{grid-template-columns:1fr}.employees table{min-width:660px}}

.directory .production-people .manager-form select{background:#fff8cc;border-color:transparent;border-radius:9px;min-height:38px}
.directory .production-people{width:100%;max-width:430px}
@media(min-width:1100px){.directory{max-width:1030px;grid-template-columns:minmax(280px,320px) minmax(400px,430px) 240px}}
