#orders-list{display:block;border:1px solid var(--border);border-radius:12px;overflow-x:auto;background:var(--surface);max-width:100%}.orders-table{width:100%;min-width:790px;border-collapse:collapse;font-size:.8rem;line-height:1.45}.orders-table thead th{padding:13px 14px;text-align:left;font-weight:650;color:var(--muted);background:var(--surface-alt);white-space:nowrap}.orders-table td,.orders-table tbody th{padding:14px;border-top:1px solid var(--border);vertical-align:middle;text-align:left}.orders-table tbody th{white-space:nowrap;font-weight:650;color:var(--text);background:transparent}.orders-table tbody tr:hover td,.orders-table tbody tr:hover th{background:var(--surface-alt)}.orders-customer,.orders-equipment{min-width:150px;max-width:280px;overflow-wrap:anywhere}.orders-equipment small{margin-top:4px;font-size:.7rem;color:var(--muted)}.orders-table td.orders-date{white-space:nowrap}.orders-table td.orders-amount,.orders-table thead th:nth-child(6){text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:650}.orders-table button{padding:7px 12px;min-height:36px;font-size:.75rem;white-space:nowrap}.orders-status{display:inline-block;padding:4px 9px;border-radius:20px;font-size:.72rem;font-weight:550;white-space:nowrap;background:var(--surface-alt);color:var(--muted)}.orders-status[data-status=approved],.orders-status[data-status=ready],.orders-status[data-status=delivered]{background:var(--success-soft);color:var(--accent-text)}.orders-status[data-status=awaiting],.orders-status[data-status=servicing],.orders-status[data-status=analysis]{background:var(--accent-soft);color:var(--accent-text)}.orders-status[data-status=declined]{background:var(--danger-soft);color:var(--danger-text)}.orders-empty{padding:18px;margin:0;color:var(--muted)}.orders-scroll-hint{display:none;font-size:.75rem;margin:0 0 12px}@media(max-width:900px){.orders-scroll-hint{display:block}.orders-table td,.orders-table tbody th,.orders-table thead th{padding:11px}.orders-table button{min-height:44px}}
.orders-status[data-status=approved],.orders-status[data-status=ready],.orders-status[data-status=delivered]{color:#217255}:root[data-theme=dark] .orders-status[data-status=approved],:root[data-theme=dark] .orders-status[data-status=ready],:root[data-theme=dark] .orders-status[data-status=delivered]{color:#9ad9ba}
.orders-table td:last-child{white-space:nowrap}.orders-table .order-actions-trigger{margin-left:6px;font-size:20px;line-height:1;min-width:36px}.order-status-top{padding:14px 18px;background:var(--surface-alt);border:1px solid var(--border);border-radius:12px;margin:18px 0}.order-status-top>label{margin:0 0 6px}.order-status-top>small{margin-bottom:8px}.order-status-top details{font-size:.8rem}.order-status-top textarea{min-height:64px}#order-form>.order-extra{border:1px solid var(--border);border-radius:10px;padding:12px 16px;margin:18px 0}#order-form>.order-extra>summary{cursor:pointer;font-size:.85rem;font-weight:600}.order-quick-actions{display:flex;gap:10px;flex-wrap:wrap;margin:20px 0}#order-actions-dialog #order-sharing{border-top:1px solid var(--border);padding-top:12px}#order-actions-dialog{width:min(700px,calc(100vw - 24px))}#order-actions-dialog h2{font-size:1.1rem}#order-actions-notice:not(:empty){padding:10px;background:var(--accent-soft);border-radius:8px}.orders-status[data-status=waiting_parts]{background:var(--accent-soft);color:var(--accent-text)}
@media(max-width:600px){.order-quick-actions{display:grid;grid-template-columns:1fr}.order-status-top{padding:12px}#order-actions-dialog .actions{display:flex;flex-direction:column;align-items:stretch}}
.order-customer-line{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:12px}.order-customer-line>button{margin-bottom:16px}.order-customer-inline{min-width:0}@media(max-width:600px){.order-customer-line{grid-template-columns:1fr;gap:0}.order-customer-line>button{justify-self:start;margin-bottom:8px}}
.order-editor-heading{align-items:flex-start;gap:20px;padding-bottom:12px;border-bottom:1px solid var(--border)}.order-heading-info{min-width:0;flex:1}.order-heading-info h2{margin:0 0 4px!important}.order-heading-info p{margin:0 0 4px;font-size:.85rem;overflow-wrap:anywhere}.order-heading-info small{font-size:.72rem;color:var(--muted)}.order-heading-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}.order-status-control{margin:0;font-size:.78rem}.order-status-control select{width:260px;max-width:100%;min-height:38px;padding:8px 30px 8px 12px;font-size:.78rem;border-radius:20px;background:var(--surface-alt);color:var(--text);font-weight:600}.order-heading-actions>button{min-height:38px;padding:8px 14px}.order-status-control select[data-status=approved],.order-status-control select[data-status=ready],.order-status-control select[data-status=delivered]{background:var(--success-soft)}.order-status-control select[data-status=declined],.order-status-control select[data-status=cancelled]{background:var(--danger-soft)}.order-status-control option{background:var(--surface);color:var(--text)}.order-status-control option:disabled{color:var(--muted)}.order-status-hint{font-size:.7rem;color:var(--muted);margin:7px 0 12px}.order-status-top{margin:10px 0;padding:10px 14px;background:transparent}.order-status-top details{font-size:.78rem}@media(max-width:760px){.order-editor-heading{flex-wrap:wrap;gap:12px}.order-heading-info{flex-basis:100%}.order-heading-actions{width:100%;justify-content:space-between}.order-status-control{flex:1;min-width:0}.order-status-control select{width:100%}.order-heading-actions>button{flex-shrink:0}}
.order-status-control>.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.order-row-menu{position:fixed;inset:auto;margin:0;padding:5px;width:238px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow-y:auto;border:1px solid var(--border);border-radius:9px;background:var(--surface);color:var(--text);box-shadow:0 8px 28px #0002;font-size:.8rem}.order-row-menu button,.order-row-menu summary{display:block;width:100%;min-height:36px;margin:0;padding:8px 11px;border:0;border-radius:5px;background:transparent;color:var(--text);font:inherit;text-align:left;cursor:pointer}.order-row-menu summary{list-style:none}.order-row-menu summary::-webkit-details-marker{display:none}.order-row-menu summary::after{content:'›';float:right;color:var(--muted)}.order-row-menu details[open]>summary::after{content:'⌄'}.order-row-menu details button{padding-left:25px}.order-row-menu button:hover,.order-row-menu summary:hover{background:var(--surface-alt)}.order-row-menu button:focus-visible,.order-row-menu summary:focus-visible{outline:2px solid var(--accent-text);outline-offset:-2px}.order-row-menu button:disabled{color:var(--muted);opacity:.6;cursor:default}.order-row-menu>details{border-top:1px solid var(--border)}.orders-table .order-open-trigger,.orders-table .order-actions-trigger{padding:5px 9px;min-width:34px;min-height:34px;border-radius:6px}.orders-table .order-actions-trigger{font-size:21px}#order-actions-dialog .order-quick-actions{display:none}@media(pointer:coarse){.order-row-menu button,.order-row-menu summary,.orders-table .order-open-trigger,.orders-table .order-actions-trigger{min-height:44px}}

.orders-table button.order-status-trigger{width:auto;min-height:30px;padding:5px 9px;border:1px solid transparent;font:inherit;font-size:.8rem;line-height:1.4;cursor:pointer}.orders-table .order-status-trigger:hover,.orders-table .order-status-trigger:focus-visible{border-color:currentColor;outline-offset:3px}.order-quick-status-dialog{width:min(520px,calc(100vw - 32px))}.order-quick-status-dialog form{display:grid;gap:14px;width:100%;max-width:none}.order-quick-status-dialog .checkbox{display:flex;align-items:flex-start;gap:8px}.order-quick-status-dialog .checkbox input{width:20px;flex-shrink:0}

/* OS workspace: visible intake fields and compact item lines. */
#order-dialog{width:min(1320px,97vw);max-height:96vh;padding:20px}
#order-form h3{margin:14px 0 8px;font-size:1rem}
#order-form .form-grid{gap:10px 14px}
#order-form label{font-size:.86rem;gap:4px;margin:0}
#order-form input,#order-form select{padding:8px 10px;min-height:38px;font-size:.9rem}
#order-form textarea{padding:8px 10px;min-height:68px;font-size:.9rem}
#order-form button{padding:8px 12px;min-height:36px;font-size:.86rem}
#order-fields{grid-template-columns:repeat(4,minmax(0,1fr))}
#order-fields .order-customer-inline{grid-column:span 2}
#order-fields label:has([name=defect]){grid-column:span 2}
#order-extra-fields{grid-template-columns:repeat(4,minmax(0,1fr))}
#order-extra-fields label:has([name=accessories]),#order-extra-fields label:has([name=condition]),#order-extra-fields label:has([name=diagnosis]){grid-column:span 2}
#order-dialog #order-items .order-item{border-bottom:1px solid #dde1e8;padding:10px 0;margin:0;grid-template-columns:120px minmax(160px,1fr) 90px 150px auto;align-items:end}
#order-dialog #order-items .order-item>button{grid-column:5;grid-row:1}
#order-dialog #order-items .order-item details{grid-column:1/-1;margin:0;font-size:.85rem}
#order-dialog #order-items .order-item details[open]{padding:8px;background:#f5f6f8;border-radius:6px}
#order-dialog #order-items .order-item details summary{cursor:pointer;color:#586273}
#order-dialog #order-items .order-item details p{margin:6px 0}
#order-dialog #order-quote-fields{margin-top:14px;grid-template-columns:180px minmax(0,1fr)}
#order-quote-fields label:has([name=terms]){grid-column:2;grid-row:1}
#order-total{background:#f2f5f7;padding:12px;border-radius:6px;font-size:1rem}
#order-integration:empty{display:none}
#order-form .order-extra{margin-top:12px}
@media(max-width:760px){#order-fields,#order-extra-fields{grid-template-columns:repeat(2,minmax(0,1fr))}#order-dialog #order-items .order-item{grid-template-columns:1fr 1fr}#order-dialog #order-items .order-item>button{grid-column:auto;grid-row:auto}#order-dialog #order-items .order-item>label:nth-child(2){grid-column:1/-1}#order-dialog #order-quote-fields{grid-template-columns:1fr}#order-quote-fields label:has([name=terms]){grid-column:auto;grid-row:auto}}
#order-extra-fields label:has([name=defect]){grid-column:span 2}
#order-form textarea:not([name=warrantyTerms]){min-height:54px;height:54px}

#order-form .order-customer-line>button{margin-bottom:0}

.os-product-popup{position:fixed;margin:0;padding:4px;border:1px solid #cbd2dd;border-radius:7px;background:white;color:#222;box-shadow:0 8px 26px #0003;overflow:auto;box-sizing:border-box}
.os-product-popup .os-product-option{display:block;width:100%;text-align:left;border:0;border-radius:0;background:white;color:#243146;padding:9px 10px;cursor:pointer}
.os-product-popup .os-product-option:nth-child(even){background:#f4f5f7}
.os-product-popup .os-product-option:hover,.os-product-popup .os-product-option:focus-visible{background:#e8edf3;outline:2px solid #b32430;outline-offset:-2px}
.os-product-option strong,.os-product-option small{display:block;overflow-wrap:anywhere}.os-product-option small{margin-top:3px;font-size:.75rem;color:#647082}
.os-product-popup p{margin:8px;font-size:.85rem}.os-product-actions{position:sticky;bottom:0;background:white;padding:4px 0 0}
.os-product-popup .os-product-new{display:block;width:100%;padding:10px;border:0;background:#21864c;color:white;border-radius:4px;font-weight:600;cursor:pointer}
.os-product-pages{display:flex;justify-content:space-between;padding:4px}.os-product-pages button{padding:5px 8px}
.os-product-create{width:min(580px,94vw)}.os-product-create .form-grid{gap:12px}.os-product-create button{margin-top:14px}.os-product-create small{display:block;margin-top:8px}
.record-contact-link{border:0!important;padding:0!important;min-height:0!important;background:none!important;color:#285b92!important;text-align:left;font:inherit!important;cursor:pointer;text-decoration:underline;text-underline-offset:3px;white-space:normal}.record-contact-link:hover{color:#b32430!important}.record-contact-link:focus-visible{outline:2px solid #b32430;outline-offset:3px}
#order-fields>label:has([name=customerId]){grid-column:span 2}

#order-form .order-item-group{margin:14px 0;border:1px solid #dfe3eb;border-radius:8px;padding:0 12px 8px}
#order-form .order-item-group>.list-heading{margin:0 -12px 8px;padding:9px 12px;background:#f5f6f8;border-bottom:1px solid #dfe3eb;border-radius:8px 8px 0 0}
#order-form .order-item-group h3{margin:0}
#order-dialog #order-items .order-item{grid-template-columns:minmax(160px,1fr) 90px 150px auto}
#order-dialog #order-items .order-item>button{grid-column:4;grid-row:1}
#order-form .order-item-group>p{margin:12px 0;font-size:.86rem}
#order-dialog #order-quote-fields{grid-template-columns:180px minmax(0,1fr)}
@media(max-width:760px){#order-dialog #order-items .order-item{grid-template-columns:1fr 1fr}#order-dialog #order-items .order-item>label:first-of-type{grid-column:1/-1}#order-dialog #order-items .order-item>button{grid-column:auto;grid-row:auto}#order-dialog #order-quote-fields{grid-template-columns:1fr}}

.order-heading-actions{flex-wrap:wrap;justify-content:flex-end}.order-save-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}.order-save-actions button{min-height:38px;padding:8px 12px;white-space:nowrap}@media(max-width:1100px){.order-editor-heading{flex-wrap:wrap}.order-heading-actions{max-width:100%}}@media(max-width:760px){.order-save-actions{width:100%}.order-save-actions button{flex:1}}

.order-save-menu{position:relative;margin:0}
.order-save-menu>summary{list-style:none;cursor:pointer;border:1px solid var(--border);border-radius:8px;padding:9px 14px;font-weight:600;font-size:.78rem;background:var(--surface);white-space:nowrap}
.order-save-menu>summary::-webkit-details-marker{display:none}
.order-save-menu>summary:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.order-save-menu .order-save-actions{position:absolute;right:0;top:calc(100% + 6px);z-index:20;display:flex;flex-direction:column;align-items:stretch;gap:2px;width:190px;max-width:calc(100vw - 50px);padding:6px;background:var(--surface);border:1px solid var(--border);border-radius:8px;box-shadow:0 6px 20px #0002}
.order-save-menu:not([open]) .order-save-actions{display:none}
.order-save-menu .order-save-actions button{width:100%;text-align:left;justify-content:flex-start;border:0;border-radius:5px;min-height:38px;background:transparent;color:var(--text)}
.order-save-menu .order-save-actions button:hover{background:var(--surface-alt)}
.unsaved-dialog .actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}

.order-save-split{display:inline-flex;align-items:stretch;gap:0}
.order-save-split[hidden]{display:none}
.order-save-split>#order-save{min-height:38px;padding:9px 14px;border-radius:8px 0 0 8px;white-space:nowrap}
.order-save-split>.order-save-menu>summary{box-sizing:border-box;height:100%;min-height:38px;display:flex;align-items:center;justify-content:center;min-width:36px;padding:9px 10px;border-radius:0 8px 8px 0;border-left:1px solid #ffffff55;background:var(--accent);color:#fff}

.orders-table select.orders-status{max-width:190px;width:100%;padding:7px 26px 7px 9px;font-size:.78rem;cursor:pointer;border:1px solid var(--border);border-radius:8px;background-color:var(--surface-alt);color:var(--text)}

.order-quick-status-dialog{width:min(620px,calc(100vw - 24px));padding:18px}.order-quick-status-dialog h2{font-size:1rem;margin:0 0 14px;padding-bottom:12px;border-bottom:1px solid var(--border)}.order-quick-status-dialog form{gap:12px}.order-status-top{display:grid;grid-template-columns:minmax(150px,.85fr) minmax(0,1.25fr);gap:10px}.order-status-top label{font-size:.78rem;margin:0}.order-quick-status-dialog .order-status-top input,.order-quick-status-dialog .order-status-top select{min-height:36px;padding:7px 9px;font-size:.8rem}.order-status-hint{font-size:.75rem;margin:0}.order-situation-history summary{font-size:.8rem;font-weight:600;padding:10px;border:1px solid var(--border);border-radius:6px;cursor:pointer}.order-situation-history-table{overflow:auto;max-height:230px;border:1px solid var(--border);border-top:0}.order-situation-history table{width:100%;border-collapse:collapse;font-size:.72rem}.order-situation-history th,.order-situation-history td{text-align:left;padding:9px 8px;border-bottom:1px solid var(--border);overflow-wrap:anywhere}.order-situation-history th{background:var(--surface-alt);position:sticky;top:0}.order-situation-history td:first-child{min-width:110px}.order-quick-status-dialog .actions{justify-content:space-between;margin:0}.order-quick-status-dialog .actions button{width:auto;min-width:80px}.order-quick-status-dialog .checkbox{font-size:.78rem}@media(max-width:480px){.order-status-top{grid-template-columns:1fr}.order-quick-status-dialog{padding:14px}.order-situation-history table{min-width:430px}}
.order-situation-badge,.orders-table button.order-situation-badge{display:inline-flex;align-items:center;gap:5px;width:auto;min-height:0;max-width:100%;padding:3px 7px;border:1px solid color-mix(in srgb,var(--situation-color) 55%,white);border-radius:4px;background:color-mix(in srgb,var(--situation-color) 9%,white);color:#263442;font-size:11px;font-weight:500;line-height:1.3;text-align:left;white-space:normal;overflow-wrap:anywhere;box-shadow:none}
.order-situation-badge::before{content:'';width:5px;height:5px;flex:0 0 5px;border-radius:50%;background:var(--situation-color)}
button.order-situation-badge:hover{filter:brightness(.95);cursor:pointer}
button.order-situation-badge:focus-visible{outline:2px solid var(--situation-color);outline-offset:3px}
#situation-form input[type=color]{width:72px;height:36px;padding:3px;cursor:pointer}

#order-save-split[hidden],#order-reopen[hidden]{display:none!important}.order-reopen-warning{padding:10px 12px;border-left:3px solid #b7791f;border-radius:5px;background:var(--surface-alt);line-height:1.5}

/* Keep short situations readable inside the horizontally scrollable OS list. */
@media screen{
 body.app-signed-in .orders-table td:has(.order-situation-badge){min-width:110px}
 body.app-signed-in .orders-table button.order-situation-badge{min-width:90px;overflow-wrap:normal;word-break:normal}
}

.equipment-history-dialog{width:min(820px,calc(100vw - 24px));max-height:90dvh;padding:20px}.equipment-history-dialog form{display:flex;gap:10px;align-items:end}.equipment-history-dialog form label{flex:1;min-width:0}.equipment-history-card{border:1px solid #dce2eb;border-radius:8px;padding:14px;margin:12px 0;overflow-wrap:anywhere}.equipment-history-card p{white-space:pre-wrap}.equipment-history-card .heading{gap:12px}.equipment-history-card small{color:#64748b}@media(max-width:600px){.equipment-history-dialog{padding:12px}.equipment-history-dialog form{flex-wrap:wrap}.equipment-history-dialog form label{flex-basis:100%}}

.equipment-history-dialog form>label{flex:1 1 240px;min-width:0}.equipment-history-dialog form>button{flex:0 0 auto;width:auto;min-width:140px;margin:0}.equipment-history-dialog form input{width:100%}.equipment-history-dialog form{padding:0;margin:16px 0}@media(max-width:600px){.equipment-history-dialog form>button{width:100%}}
