/* Screen-only density layer. Printed documents retain their own layout. */
@media screen {
 body{font-size:14px;line-height:1.6}
 .primary,.secondary,.danger,.text-button{font-size:13px;padding:7px 12px;min-height:34px;border-radius:7px}
 label{font-size:13px;gap:5px}input,select{font-size:14px;padding:7px 10px;min-height:36px;height:36px}textarea{font-size:14px;padding:8px 10px}
 .sidebar{width:210px;padding:20px 14px}.main{margin-right:210px;width:calc(100% - 210px)}.sidebar .brand-logo{width:76px;height:76px}.sidebar .workspace-label{padding:12px 10px 8px}.nav-item{padding:9px 10px;font-size:13px;gap:8px;margin-bottom:3px}.nav-item>span{font-size:18px}.sidebar-bottom{padding-top:12px}.topbar{height:54px;padding:0 24px}.content{padding:24px}.page-heading{margin-bottom:18px}.page-heading h1{font-size:25px}.toolbar{padding:14px;gap:10px}.product-filter-label{margin:0 14px 12px}.panel-heading{padding:16px}
 .product-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start}
 .product-card{display:grid;grid-template-columns:94px minmax(0,1fr);padding:12px;gap:12px;border-radius:12px;align-items:start}
 .product-card .product-visual{width:94px;height:94px;border-radius:8px;overflow:hidden;position:relative;background:#f4f6f2}
 .product-card .product-visual img{position:static;display:block;width:100%!important;height:100%!important;max-height:94px;object-fit:contain!important;object-position:center}
 .product-card .product-visual>.category{position:absolute;inset:auto 3px 3px;max-width:88px;padding:2px 4px;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:#fffffff0}
 .product-card .product-body{padding:0;min-width:0}.product-card .product-body h3{font-size:15px;line-height:1.5;margin:3px 0 6px}.product-card .product-body>p{font-size:12px;margin:0 0 7px;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.product-card .sku{font-size:11px}.product-card .product-price{margin:6px 0;display:flex;flex-wrap:wrap;gap:6px;align-items:center}.product-card .product-price strong{font-size:15px}.product-card .product-price small{font-size:11px}.product-card .product-bottom{padding:8px 0;margin:0 0 4px;font-size:11px;gap:8px;justify-content:flex-start}.product-card .attachment-button{width:auto;min-height:32px;font-size:12px;padding:5px 10px;margin:4px 0 0 5px}
 dialog.order-editor{width:min(1080px,calc(100vw - 32px));max-width:1080px;padding:20px;max-height:94dvh;border-radius:14px}.order-editor .modal-heading{margin-bottom:16px;padding-bottom:12px}.order-editor .modal-heading h2{font-size:18px}.order-editor .form-grid{gap:14px}.order-context{display:grid;grid-template-columns:minmax(220px,2fr) minmax(130px,1fr) minmax(130px,1fr);gap:14px;align-items:start}.order-context .contact-picker>input[type=search]{min-height:36px;margin-top:5px;height:36px}.order-context .contact-picker>small{font-size:11px;margin-top:3px}.order-context>label input,.order-context>label select{margin-top:5px}.order-context .contact-results button{padding:9px 12px;min-height:38px}
 .order-editor .order-catalog{padding:12px;border:1px solid #e1e7de;border-radius:10px}.order-catalog>h3{font-size:14px;margin-bottom:10px}.catalog-controls{gap:12px;margin-bottom:10px}.order-editor #order-products{max-height:270px;overflow:auto;overscroll-behavior:contain}.order-product-grid{gap:8px;grid-template-columns:repeat(2,minmax(0,1fr))}.order-editor .order-product{grid-template-columns:58px minmax(0,1fr);padding:10px;gap:10px;border-radius:8px}.order-editor .order-product-image{width:58px;height:58px}.order-editor .order-product-image img{height:58px!important;object-fit:contain!important}.order-product-info h3{font-size:14px;margin:3px 0}.order-product-info>p{display:none}.order-product-info>small{font-size:11px}.order-product-info>strong{font-size:14px}.order-product-actions{margin-top:6px;gap:6px;flex-wrap:wrap}.order-product-actions .primary,.order-product-actions .secondary{padding:5px 9px;min-height:32px;font-size:12px}
 .draft-row.order-item-card{padding:12px;margin-bottom:12px;border-radius:10px}.order-item-heading{grid-template-columns:minmax(0,1fr) 78px 125px 32px;gap:10px;margin-bottom:12px}.order-item-heading strong{font-size:15px}.order-item-heading small{font-size:11px}.order-item-heading>.danger{padding:4px;min-height:32px}.combo-editor{padding:10px;border-radius:8px}.combo-heading{margin-bottom:10px;gap:8px}.combo-heading h4{font-size:14px;margin:0}.combo-heading small{font-size:11px}.combo-heading button{font-size:12px;min-height:32px;padding:5px 9px}.combo-part{padding:8px 10px;margin-bottom:6px;border-radius:7px}.combo-part-main{grid-template-columns:minmax(130px,1.25fr) 66px minmax(110px,1fr) minmax(110px,1fr) 30px;gap:10px;align-items:center}.combo-part-title{grid-column:auto;grid-row:auto;padding-top:0}.combo-part-title strong{font-size:13px}.combo-part-title small{font-size:11px}.combo-part-main>label{grid-column:auto;grid-row:auto}.combo-part-main>.danger{grid-column:auto;grid-row:auto;margin-top:20px;padding:4px;min-height:30px}.combo-part-main>.fabric-picker:nth-of-type(2),.combo-part-main>.fabric-picker:nth-of-type(3){grid-column:auto;grid-row:auto}.combo-part label{font-size:11px}.combo-part input{height:34px;min-height:34px;font-size:13px;padding:5px 8px}.component-price-fields{padding-top:8px;margin-top:8px;gap:12px}.combo-add-search{margin-top:10px;font-size:12px}.combo-results:empty{display:none}.item-specifications{gap:10px;margin-top:12px}.draft-row .line-spec textarea{height:54px;min-height:54px;padding:7px 9px;line-height:1.6}.order-editor .form-grid>label.wide textarea{height:60px;min-height:60px}.discount-controls{padding:10px;gap:12px}.order-editor .totals{padding:12px;gap:12px;margin:12px 0}.order-editor .form-footer{bottom:-20px;padding:10px 0;margin-top:14px;gap:8px}.order-editor #sticky-order-total{font-size:16px}.order-editor .fabric-results{max-height:170px;padding:6px}.fabric-results button{font-size:12px;min-height:32px;padding:6px}
}
@media screen and (min-width:1600px){.product-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media screen and (max-width:900px){.product-grid{grid-template-columns:1fr}.order-context{grid-template-columns:2fr 1fr}.order-context>label:last-child{max-width:220px}.combo-part-main{grid-template-columns:minmax(100px,1fr) 60px minmax(90px,1fr) minmax(90px,1fr) 28px;gap:8px}}
@media screen and (max-width:720px){.sidebar{position:relative;width:100%;padding:12px}.main{margin:0;width:100%}.sidebar .brand-logo{width:48px;height:48px}.sidebar .workspace-label{padding:0}.sidebar nav{margin-top:8px}.nav-item{padding:7px 9px;min-height:36px}.sidebar-bottom{top:12px}.content{padding:16px}.topbar{padding:0 16px}.product-card{grid-template-columns:76px minmax(0,1fr)}.product-card .product-visual{width:76px;height:76px}.product-card .product-visual img{max-height:76px}.product-card .product-visual>.category{max-width:70px}.order-product-grid{grid-template-columns:1fr}}
@media screen and (max-width:600px){dialog.order-editor{padding:14px;width:calc(100vw - 16px);max-height:96dvh}.order-context{grid-template-columns:1fr 1fr;gap:10px}.order-context .contact-picker{grid-column:1/-1}.order-context>label:last-child{max-width:none}.combo-part-main{grid-template-columns:minmax(0,1fr) 62px 28px;gap:8px}.combo-part-main>.combo-part-title{grid-column:1;grid-row:1}.combo-part-main>label{grid-column:2;grid-row:1}.combo-part-main>.danger{grid-column:3;grid-row:1}.combo-part-main>.fabric-picker:nth-of-type(2){grid-column:1/2!important;grid-row:2!important}.combo-part-main>.fabric-picker:nth-of-type(3){grid-column:2/4!important;grid-row:2!important}.order-item-heading{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 28px}.order-item-heading>div{grid-column:1/3;grid-row:1}.order-item-heading>label{grid-row:2}.order-item-heading>.danger{grid-column:3;grid-row:1}.order-editor .form-footer{bottom:-14px}.component-price-fields{grid-template-columns:1fr 1fr}.discount-controls{grid-template-columns:1fr 1fr}.order-editor #order-products{max-height:230px}}

@media screen{.order-context{grid-template-columns:1fr 1fr}.order-context>label:last-child{max-width:none}}

@media screen {
 .order-editor #order-products, #order-products .order-product-grid { max-height:none; overflow:visible; height:auto; }
 #order-products .order-product-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
 #order-products .order-product { display:flex; flex-direction:column; min-width:0; }
 #order-products .order-product-image { width:100%; height:150px; flex:auto; }
 #order-products .order-product-image button { width:100%; height:100%; border:0; padding:0; background:#f2f4ed; cursor:pointer; }
 #order-products .order-product-image img { width:100%; height:100%!important; object-fit:contain; }
 #order-products .order-product-info { padding:10px; width:100%; box-sizing:border-box; }
 #order-products .order-product-actions { flex-wrap:wrap; }
 .discount-controls { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .order-delivery { display:grid; grid-template-columns:1fr 1fr; gap:14px; align-items:start; }
 .order-delivery .wide { grid-column:auto; }
 #product-preview { width:min(850px,90vw); max-height:85dvh; overflow:auto; border:1px solid #d8ded2; border-radius:16px; padding:24px; color:#214d40; }
 #product-preview::backdrop { background:#193d3666; }
 @media(max-width:700px) { #order-products .order-product-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .discount-controls,.order-delivery { grid-template-columns:1fr; } }
}

@media screen {
 .product-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
 .product-card { display:flex; flex-direction:column; padding:10px; gap:10px; }
 .product-card .product-visual { width:100%; height:160px; }
 .product-card .product-visual img { max-height:none; }
 .product-card .product-body { width:100%; }
 .product-card .product-body>p { display:none; }
 .product-card .product-visual>.category { max-width:calc(100% - 12px); }
 #order-products .order-product-image { flex:0 0 150px; }
 @media(max-width:1100px) { .product-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
 @media(max-width:700px) { .product-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
}

@media screen { #order-products .order-product-image button { font-size:44px; color:#a9b99b; border-radius:8px; } }

.category-tree {list-style:none;padding-inline-start:20px;border-inline-start:1px solid #dce4d8}.category-tree li{margin:8px 0}.category-tree summary{cursor:pointer;padding:8px;font-weight:bold}.category-row{flex-wrap:wrap;gap:8px}.category-row strong{margin-inline-end:auto}.extra-expenses{margin-top:16px;padding:14px;border:1px solid #dde5d7;border-radius:10px}.expense-row{display:grid;grid-template-columns:minmax(0,1fr) 150px 38px;gap:12px;align-items:end;margin:10px 0}.expense-summary{padding:12px;margin:12px 0;border:1px solid #dce4d8}.expense-summary p{white-space:pre-wrap;overflow-wrap:anywhere}.expense-summary b{margin-inline-start:16px}@media(max-width:600px){.expense-row{grid-template-columns:minmax(0,1fr) 95px 32px;gap:7px}}
.supplier-extra-choice{display:flex;align-items:center;gap:10px;padding:10px 12px;margin:8px 0;border:1px solid #dce4d8;border-radius:8px}.supplier-extra-choice input{width:18px;height:18px;min-height:0}.supplier-extra-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:10px;margin:8px 0}.supplier-document-extras{margin-top:18px;padding:14px;border:1px solid #cfdacc;border-radius:8px}.supplier-document-extras li{margin:7px 0}.supplier-combo{padding:6px 8px;background:#f3f5ef;border-inline-start:3px solid #537b69}.document-index{width:34px;text-align:center!important}
.supplier-components{margin:10px 0;padding:10px 12px;background:#f3f5ef;border-inline-start:3px solid #537b69}.supplier-components ol{margin:8px 0 0;padding-inline-start:24px}.supplier-components li{margin:8px 0}.supplier-components li p{margin:3px 0;color:#596b63}
.component-supplier-fields{display:flex;align-items:end;justify-content:space-between;gap:12px;padding:7px 4px;border-top:1px dashed #dce4d8}.component-supplier-fields span{font-size:12px}.component-supplier-fields label{width:min(230px,100%)}@media(max-width:600px){.component-supplier-fields{align-items:stretch;flex-direction:column}.component-supplier-fields label{width:100%}}
.permission-list{border:1px solid #dce4d8;border-radius:10px;padding:14px}.permission-list legend{font-weight:700;padding:0 8px}.permission-list label{display:flex;align-items:center;gap:9px;margin:8px 0}.permission-list input{width:18px;height:18px;min-height:0}
.document-index{width:72px;text-align:center!important}.document-product-details{display:grid;gap:5px}.document-product-details p{margin:0;white-space:pre-wrap}.document-product-label{display:block;color:#718078;font-size:11px;font-weight:bold}.document-product-name{display:block;font-size:14px!important;font-weight:bold!important}.document-product-specs{border-inline-start:3px solid #dce4d8;padding-inline-start:10px;margin-top:7px}.document-product-specs:empty{display:none}
.date-filters{display:flex;align-items:end;gap:10px;flex-wrap:wrap;padding:0 22px 14px}.date-filters label{min-width:150px}.date-filters input{height:38px}.balance-due{font-weight:bold}.balance-due.has-balance,.outstanding-total b{color:#a0523f}.cash-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:18px}.cash-summary article{background:#fff;border:1px solid #dfe6dc;border-radius:12px;padding:18px}.cash-summary span{display:block;color:#718078;font-size:12px}.cash-summary strong{display:block;font-size:22px;margin-top:8px}.cash-in{color:#427b5e;font-weight:bold}.cash-out{color:#a0523f;font-weight:bold}.delivery-warning{padding:14px;border:1px solid #e1d3a8;background:#fff9e8;border-radius:10px}.delivery-warning p{margin:5px 0 0}.delivery-receipt,.invoice-returns,.document-meta{padding:12px 14px;border:1px solid #dce4d8;border-radius:9px;margin:12px 0}.delivery-receipt p,.invoice-returns p,.document-meta p{margin:5px 0;white-space:pre-wrap}.outstanding-total{padding:8px;border-radius:7px;background:#fff5ef}@media(max-width:600px){.date-filters{padding:0 12px 12px}.date-filters label{min-width:120px;flex:1}.cash-summary{grid-template-columns:1fr}}
.component-price-fields[hidden]{display:none!important}.combo-heading-actions{display:flex;gap:8px;flex-wrap:wrap}.order-item-heading label small{display:block;margin-top:4px;color:#718078;font-size:10px}
.order-item-heading{grid-template-columns:minmax(0,1fr) auto 32px;align-items:start}.order-line-values{display:grid;grid-template-columns:90px 160px;gap:10px;align-items:start}.order-line-values label{min-width:0}.order-line-product{min-width:0}.order-item-heading>.danger{margin-top:20px}
@media screen and (max-width:600px){.order-item-heading{grid-template-columns:minmax(0,1fr) 28px}.order-line-product{grid-column:1;grid-row:1}.order-item-heading>.danger{grid-column:2;grid-row:1;margin-top:0}.order-line-values{grid-column:1/-1;grid-row:2;grid-template-columns:82px minmax(0,1fr);width:100%}}
.date-filters small{flex-basis:100%;color:#718079}
