/* Compact is the initial SaleConnector theme. Shared fallback styles stay in public/assets/css/app.css. */

/* Order list: a table at every viewport; long external IDs wrap inside the cell. */
.sc-order-table { width:100%; table-layout:fixed; }
.sc-order-table > :not(caption) > * > * { padding:.65rem .6rem; overflow-wrap:anywhere; vertical-align:top; }
.sc-order-table th { font-size:.8rem; }
.sc-order-table .badge { max-width:100%; white-space:normal; line-height:1.35; text-align:left; }
@media (min-width:992px) {
 .sc-order-table .sc-order-number { width:13%; }
 .sc-order-table .sc-order-customer { width:21%; }
 .sc-order-table .sc-order-amount { width:12%; }
 .sc-order-table .sc-order-status { width:12%; }
}
@media (max-width:991.98px) {
 .sc-order-table .sc-order-number { width:29%; }
 .sc-order-table .sc-order-customer { width:28%; }
 .sc-order-table .sc-order-amount { width:22%; }
 .sc-order-table .sc-order-status { width:21%; }
 .sc-order-table > :not(caption) > * > * { padding:.55rem .35rem; }
}

/* Tenant-defined order status colors; variables are validated by OrderViewHelpers. */
.badge.sc-order-status-badge {
 background-color:var(--sc-status-bg,#EDF0F4);
 color:var(--sc-status-text,#334155);
 border:1px solid var(--sc-status-border,#CBD5E1);
 border-radius:.375rem;
 padding:.3em .55em;
 font-weight:600;
 line-height:1.35;
 white-space:normal;
 overflow-wrap:anywhere;
}

/* Compact order filters and extensible selected-order actions. */
.sc-order-bulk-bar:not([hidden]) { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; }
.sc-order-bulk-bar .form-select { width:auto; min-width:10rem; max-width:100%; }
.sc-order-bulk-bar .btn { white-space:normal; }
.sc-order-table .form-check-input { margin-top:.1rem; vertical-align:middle; }
@media (max-width:991.98px) { .sc-order-table .sc-order-number { width:31%; } .sc-order-table .sc-order-customer { width:26%; } }
/* The former card list width limit must not constrain the orders table. */
.sc-order-list { width:100%; max-width:none; }

/* Unified shipment table; compact is the only theme changed by this feature. */
.sc-shipment-list { width:100%; max-width:none; }
.sc-shipment-table { width:100%; table-layout:fixed; }
.sc-shipment-table > :not(caption) > * > * { padding:.65rem .5rem; overflow-wrap:anywhere; vertical-align:top; }
.sc-shipment-table th { font-size:.8rem; }
.sc-shipment-table .badge { max-width:100%; white-space:normal; line-height:1.35; text-align:left; }
@media (min-width:992px) {
 .sc-shipment-table .sc-shipment-number { width:19%; }
 .sc-shipment-table .sc-shipment-order { width:15%; }
 .sc-shipment-table .sc-shipment-recipient { width:16%; }
 .sc-shipment-table .sc-shipment-state { width:12%; }
}
@media (max-width:991.98px) {
 .sc-shipment-table .sc-shipment-number { width:31%; }
 .sc-shipment-table .sc-shipment-order { width:21%; }
 .sc-shipment-table .sc-shipment-recipient { width:24%; }
 .sc-shipment-table .sc-shipment-state { width:24%; }
 .sc-shipment-table > :not(caption) > * > * { padding:.55rem .35rem; }
 .sc-shipment-table .btn { padding:.2rem .35rem; }
}

/* Small remote thumbnails, shown only where the viewport leaves enough space. */
.sc-product-with-thumbnail { display:flex; align-items:center; gap:.5rem; }
.sc-product-with-thumbnail-text { min-width:0; overflow-wrap:anywhere; }
.sc-product-thumbnail { display:none; flex:0 0 44px; width:44px; height:44px; line-height:0; }
.sc-product-thumbnail img { display:block; width:44px; height:44px; object-fit:contain; background:#fff; border:1px solid var(--bs-border-color,#dee2e6); border-radius:.25rem; }
@media (min-width:576px) { .sc-product-thumbnail { display:block; } }

/* Matching modal uses the available width on landscape phones and tablets. */
@media (min-width:576px) {
  #orderProductLinkModal { --bs-modal-margin:.5rem; }
  #orderProductLinkModal .modal-dialog { max-width:min(1140px,calc(100% - 1rem)); }
  #orderProductLinkModal .sc-product-thumbnail { display:block; }
}

/* One compact table row per order item, with matching details inside its product cell. */
.sc-order-item-table { width:100%; table-layout:fixed; }
.sc-order-item-table .sc-order-item-image { width:3.75rem; display:table-cell; }
.sc-order-item-table .sc-product-thumbnail { display:block; }
.sc-order-item-table .sc-order-item-quantity { width:3.5rem; }
.sc-order-item-table .sc-order-item-price { width:7rem; overflow-wrap:anywhere; }
.sc-order-item-table .sc-order-item-description { overflow-wrap:anywhere; }
.sc-order-item-table > :not(caption) > * > * { padding:.5rem; }
/* Keep the photo column on phones; stock in the picker yields space first. */
#orderProductLinkModal .sc-product-link-table .sc-product-thumbnail { display:block; }
.sc-product-link-table > :not(caption) > * > * { padding:.35rem .25rem; }
.sc-product-link-table .sc-link-image { width:52px; }
@media (max-width:575.98px) {
  .sc-order-item-table .sc-order-item-image { width:52px; }
  .sc-order-item-table .sc-order-item-quantity { width:3rem; }
  .sc-order-item-table .sc-order-item-price { width:5.5rem; }
  .sc-order-item-table > :not(caption) > * > * { padding:.4rem .25rem; }
}

/* Small order warning; accessible focus/tap target without another table column. */
.sc-order-attention { display:inline-flex; width:24px; height:24px; padding:4px; margin:0 0 0 .15rem; vertical-align:middle; align-items:center; justify-content:center; border:0; border-radius:.2rem; background:transparent; color:#a45b00; }
.sc-order-attention:hover,.sc-order-attention:focus-visible { background:#fff3cd; }
.sc-order-attention:focus-visible { outline:2px solid #a45b00; outline-offset:1px; }
.sc-order-attention svg { flex:0 0 16px; }
.sc-order-attention-popover { max-width:min(280px,calc(100vw - 24px)); font-size:.8125rem; }

/* One compact order timeline; the author folds into the event cell on phones. */
.sc-order-history-table { table-layout:fixed; width:100%; }
.sc-order-history-table > :not(caption) > * > * { padding:.55rem .7rem; overflow-wrap:anywhere; }
.sc-order-history-table .sc-history-date { width:11.5rem; }
.sc-order-history-table .sc-history-author { width:11rem; }
.sc-order-history-table .sc-history-text { white-space:pre-wrap; }
@media(max-width:767.98px){ .sc-order-history-table .sc-history-author { display:none; } .sc-order-history-table .sc-history-date { width:6rem; } .sc-order-history-table > :not(caption) > * > * { padding:.5rem; } }

/* Order parties: separate compact cards; wrap long contact values on every device. */
.sc-order-contacts { font-size:.8125rem; }
.sc-order-contacts .card-body { min-width:0; }
.sc-order-contact-row { display:grid; grid-template-columns:minmax(5.5rem,33%) minmax(0,1fr); gap:.25rem .6rem; margin-bottom:.45rem; }
.sc-order-contact-row:last-child { margin-bottom:0; }
.sc-order-contact-row dt { font-weight:400; color:var(--bs-secondary-color,#6c757d); overflow-wrap:anywhere; }
.sc-order-contact-row dd { margin:0; min-width:0; white-space:pre-line; overflow-wrap:anywhere; }

/* Inline contact editor remains within its own order card. */
.sc-contact-form input,.sc-contact-form select { min-width:0; }
.sc-contact-form [data-contact-tax-type] { flex:0 1 36%; }
.sc-contact-form [data-contact-tax-value] { flex:1 1 50%; }
.sc-contact-form [hidden] { display:none !important; }

.sc-order-contacts.sc-contact-editing .card { height:auto !important; }

.sc-order-item-table input[data-item-input] { min-width:0; }

/* Compact order products use all the available content width. */
.sc-order-items { width:100%; max-width:none; }

/* Drafts use the same first-column product thumbnail on every device. */
.sc-draft-table .sc-draft-image{width:52px;min-width:52px}
.sc-draft-table .sc-product-thumbnail{display:block}


/* Same current-location marker for the dashboard and every active submenu link. */
.sc-navigation .sc-nav-submenu-item.active {
 color:#fff;
 background:rgba(255,255,255,.12);
 box-shadow:inset .2rem 0 #7db2ff;
}
/* In the narrow navigation rail the selected item's section remains identifiable. */
.sc-sidebar.is-collapsed .sc-nav-section:has(.sc-nav-submenu-item.active) > .sc-nav-section-toggle {
 color:#fff;
 background:rgba(255,255,255,.12);
 box-shadow:inset .2rem 0 #7db2ff;
}

/* Shared transparent vector branding, sized to each compact layout. */
.sc-brand-logo{display:block;flex:none;width:11.25rem;max-width:100%;line-height:0}
.sc-brand-logo img{display:block;width:100%;height:auto}
.sc-brand-logo--auth{width:15rem}
.sc-auth-brand{display:block;width:fit-content;max-width:100%;margin-inline:auto}
.sc-header .navbar-brand{min-width:0;padding-block:0}
@media(max-width:575.98px){.sc-brand-logo--header{width:9rem}}

/* The real file input receives the tap directly, including on mobile Safari. */
.sc-terms-file-picker{position:relative;display:inline-flex;flex-shrink:0;min-height:44px}
.sc-terms-file-picker .btn{display:flex;align-items:center;min-height:44px}
.sc-terms-file-input{position:absolute;inset:0;display:block;width:100%;height:100%;margin:0;padding:0;opacity:0;cursor:pointer;font-size:16px}
.sc-terms-file-picker:focus-within{outline:2px solid var(--bs-primary,#0d6efd);outline-offset:2px;border-radius:.375rem}
