/*
 * supplier-orders-grid.css — plain CSS on Filament's own colour tokens, because
 * the panel theme ships no arbitrary Tailwind utilities. Sizes and colours follow
 * fi-ta tables, so the grid reads as part of the ERP in both themes.
 */
.so-grid { display: grid; gap: 0.75rem; min-width: 0; }
.so-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.so-field { display: grid; gap: 0.25rem; min-width: 8.5rem; font-size: 0.875rem; font-weight: 500; color: var(--gray-950); }
.so-field--grow { flex: 1 1 14rem; }
/*
 * The Supplier dropdown with its pencil joined on (owner 2026-11-11), and the plus beside it. The pencil takes the
 * box's own ring and sits 1px off it, so the two rings meet as one line; the box loses its end corners only when a
 * pencil follows it.
 */
.so-supplier { display: flex; align-items: stretch; }
.so-supplier__select { flex: 1 1 auto; min-width: 0; }
.so-supplier__select:has(+ .so-supplier__edit) { border-start-end-radius: 0; border-end-end-radius: 0; }
.so-supplier__edit { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; margin-inline-start: 1px; cursor: pointer;
    color: var(--gray-500); background: #fff; border-start-end-radius: 0.5rem; border-end-end-radius: 0.5rem; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.so-supplier__edit:hover { color: var(--gray-950); background: var(--gray-50); }
.so-supplier__edit:focus-visible, .so-supplier__add:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 2px; }
.dark .so-supplier__edit { color: var(--gray-400); background: rgb(255 255 255 / 0.05); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.2); }
.dark .so-supplier__edit:hover { color: #fff; background: rgb(255 255 255 / 0.1); }
.so-supplier__icon { width: 1.25rem; height: 1.25rem; }
/* In the box's row, so it stretches to the box's height whatever that is; Filament's button padding would make it taller. */
.so-supplier__add { flex: none; cursor: pointer; margin-inline-start: 0.5rem; min-height: 0; padding-block: 0; padding-inline: 0.625rem; --text: var(--color-800); --dark-text: var(--color-950); }
/*
 * The list's own bar, right above the grid (owner 2026-11-10): Search on the left at 40% of the list's width, and
 * Age, Show and Export pushed to the right. It wraps on a narrow screen, where Search takes the whole row.
 */
.so-bar--list { justify-content: space-between; margin-bottom: -0.25rem; }
.so-field--search { flex: 0 0 40%; min-width: 14rem; }
.so-bar__right { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; justify-content: flex-end; margin-inline-start: auto; }
@media (max-width: 40rem) { .so-field--search { flex-basis: 100%; } }
/* One Export button, coloured as the page's own primary buttons are (Filament's classes), opening its two formats. */
.so-export { position: relative; }
/* Filament sets a button's text shade inline from PHP; a hand-written one names the same shades (800, and 950 in dark). */
.so-export__button { cursor: pointer; list-style: none; user-select: none; --text: var(--color-800); --dark-text: var(--color-950); }
.so-export__button::-webkit-details-marker { display: none; }
.so-export__icon { width: 1.25rem; height: 1.25rem; }
.so-export__button:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 2px; }
.so-export[data-disabled] .so-export__button { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.so-export__menu { position: absolute; z-index: 20; top: calc(100% + 0.25rem); right: 0; display: grid; min-width: 11rem; padding: 0.25rem; border-radius: 0.5rem; background: #fff; box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); outline: 1px solid rgb(3 7 18 / 0.1); }
.dark .so-export__menu { background: var(--gray-900); outline-color: rgb(255 255 255 / 0.15); }
.so-export__item { padding: 0.5rem 0.625rem; border: 0; border-radius: 0.375rem; background: transparent; color: inherit; font-size: 0.875rem; text-align: start; cursor: pointer; }
.so-export__item:hover, .so-export__item:focus-visible { background: var(--gray-100); outline: none; }
.dark .so-export__item:hover, .dark .so-export__item:focus-visible { background: rgb(255 255 255 / 0.08); }
.so-export__item[disabled] { opacity: 0.5; cursor: not-allowed; }
.dark .so-field { color: #fff; }
.so-status { margin: 0; font-size: 0.8125rem; color: var(--gray-500); }
.dark .so-status { color: var(--gray-400); }
.so-status--bad, .dark .so-status--bad { color: var(--danger-600); font-weight: 500; }
.so-status b { font-weight: 600; }
.so-banner { margin: 0; padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-size: 0.8125rem; font-weight: 600; color: var(--gray-700); background: var(--gray-100); }
.so-banner[data-state="ok"] { color: var(--success-700); background: var(--success-50); }
.so-banner[data-state="warn"] { color: var(--warning-700); background: var(--warning-50); }
.so-banner[data-state="down"] { color: var(--danger-700); background: var(--danger-50); }
.dark .so-banner { color: var(--gray-200); background: rgb(255 255 255 / 0.05); }
.dark .so-banner[data-state="ok"] { color: var(--success-400); }
.dark .so-banner[data-state="warn"] { color: var(--warning-400); }
.dark .so-banner[data-state="down"] { color: var(--danger-400); }
.so-card { background: #fff; border-radius: 0.75rem; box-shadow: 0 1px 2px rgb(0 0 0 / 0.05); outline: 1px solid rgb(3 7 18 / 0.05); overflow: hidden; min-width: 0; }
.dark .so-card { background: var(--gray-900); outline-color: rgb(255 255 255 / 0.1); }
.so-scroll { overflow-x: auto; }
.so-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; line-height: 1.25rem; color: var(--gray-950); }
.dark .so-table { color: #fff; }
.so-table th { padding: 0.75rem; text-align: start; font-weight: 600; white-space: nowrap; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
.dark .so-table th { background: rgb(255 255 255 / 0.05); border-bottom-color: rgb(255 255 255 / 0.1); }
.so-table th[data-sort] { cursor: pointer; user-select: none; }
.so-table th[data-sort]:hover { color: var(--primary-600); }
.so-table td { padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.dark .so-table td { border-bottom-color: rgb(255 255 255 / 0.05); }
.so-table tbody tr:hover td { background: var(--gray-50); }
.dark .so-table tbody tr:hover td { background: rgb(255 255 255 / 0.03); }
.so-table small { display: block; color: var(--gray-500); font-size: 0.6875rem; }
.dark .so-table small { color: var(--gray-400); }
.so-table b { font-weight: 600; }
.so-table hr { margin: 0.25rem 0; border-color: var(--gray-200); }
.dark .so-table hr { border-color: rgb(255 255 255 / 0.1); }
.so-table a { color: var(--primary-600); text-decoration: underline; overflow-wrap: anywhere; }
.dark .so-table a { color: var(--primary-400); }
.so-table .so-center, .so-table th.so-center { text-align: center; }
.so-table td { font-size: 0.8125rem; }
.so-empty { padding: 2rem; text-align: center; color: var(--gray-500); }
.so-split { display: flex; gap: 0.75rem; justify-content: space-between; min-width: 19rem; }
.so-left { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; }
.so-right { flex: none; white-space: nowrap; text-align: end; }
.so-overridden { background: var(--warning-50); text-decoration: underline; font-style: italic; }
.so-overridden .so-right, .so-overridden .so-ctl, .so-overridden a { text-decoration: none; font-style: normal; }
/* Legacy's edit icon (.ov-btn): a pencil after a value an override can change, shown on row hover or focus. */
.so-ov-btn { display: inline-block; width: 0.75rem; height: 0.75rem; margin: 0 0 0 0.3125rem; padding: 0; border: 0; vertical-align: -1px; cursor: pointer; opacity: 0; background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.899 528.899'%3E%3Cpath d='M328.883 89.125l107.59 107.589-272.34 272.34L56.604 361.465 328.883 89.125zM518.113 63.177l-47.981-47.981c-18.543-18.543-48.653-18.543-67.259 0l-45.961 45.961 107.59 107.59 53.611-53.611c14.382-14.383 14.382-37.577 0-51.959zM.3 512.69c-1.958 8.812 5.998 16.708 14.811 14.565l119.891-29.069L27.473 390.597.3 512.69z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.899 528.899'%3E%3Cpath d='M328.883 89.125l107.59 107.589-272.34 272.34L56.604 361.465 328.883 89.125zM518.113 63.177l-47.981-47.981c-18.543-18.543-48.653-18.543-67.259 0l-45.961 45.961 107.59 107.59 53.611-53.611c14.382-14.383 14.382-37.577 0-51.959zM.3 512.69c-1.958 8.812 5.998 16.708 14.811 14.565l119.891-29.069L27.473 390.597.3 512.69z'/%3E%3C/svg%3E") center / contain no-repeat; }
tr:hover .so-ov-btn, .so-ov-btn:focus-visible { opacity: 1; }
.so-ov-btn:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 2px; }
.so-ov-btn[disabled] { cursor: not-allowed; }
tr:hover .so-ov-btn[disabled] { opacity: 0.35; }
.so-ov-btn[aria-busy="true"] { cursor: progress; }
@media (hover: none) { .so-ov-btn { opacity: 1; } .so-ov-btn[disabled] { opacity: 0.35; } }
.dark .so-overridden { background: rgb(255 255 255 / 0.05); }
.so-warn { color: var(--danger-600); font-weight: 600; }
.so-rics { color: var(--primary-600); }
.dark .so-rics { color: var(--primary-400); }
.so-cost-off { text-decoration: line-through; color: var(--gray-400); }
.so-profit--good { color: var(--success-600); font-weight: 600; }
.so-profit--ok { color: var(--warning-600); font-weight: 600; }
.so-profit--bad { color: var(--danger-600); font-weight: 600; }
.so-tick { text-align: center; width: 2.5rem; }
.so-tick input { accent-color: var(--primary-600); }
.so-table td.so-stock--good { background: var(--success-500); }
.so-table td.so-stock--mid { background: var(--warning-400); }
.so-table td.so-stock--bad { background: var(--danger-500); }
.so-table td.so-tick small { color: #fff; font-weight: 600; }
.so-table td.so-stock--mid small { color: var(--gray-950); }
.so-flags { white-space: nowrap; }
.so-flag { margin-bottom: 0.125rem; padding: 0 0.375rem; border-radius: 0.25rem; font-size: 0.6875rem; line-height: 1.125rem; text-align: center; color: var(--gray-950); background: var(--gray-100); }
.so-flag--pi-pr { background: #c5ffbe; }
.so-flag--pi-npr { background: #ffb4b4; }
.so-flag--prime { background: #fff3cd; }
.so-flag--fedex { background: #360267; color: #fff; }
.so-flag--fedex span { color: #ffa260; }
.so-flag--usps { background: #164ca2; color: #fff; }
.so-flag--ontrac { background: #fff; color: #ffcd00; outline: 1px solid var(--gray-200); }
.so-flag--ontrac span { color: #022a68; }
.so-flag--ups { background: #351c15; color: #ffb500; }
.so-box { display: inline-block; margin: 1px; padding: 1px 4px; border: 2px solid transparent; border-radius: 5px; font-size: 0.625rem; line-height: 1rem; font-variant-numeric: tabular-nums; background: #c8c8c8; color: #6b6b6b; cursor: default; white-space: nowrap; }
.so-box.edi-sent { background: #3bae61; color: #fff; }
.so-box.edi-received { background: #3f3bb8; color: #fff; }
.so-box.edi-received.t997 { background: #ff5707; color: #fff; }
.so-box.edi-received.t997.err { background: #dc3545; }
.so-box.edi-received.t855 { background: #ffc107; color: #212529; }
.so-box.edi-received.ack { border-color: #3bae61; }
.so-shipped { margin-top: 0.125rem; font-size: 0.6875rem; }
.so-tab-count { margin-inline-start: 0.25rem; font-variant-numeric: tabular-nums; color: var(--gray-500); }
.so-store { display: grid; grid-template-columns: minmax(16rem, 1.4fr) minmax(10rem, 1fr) minmax(11rem, 1fr); gap: 0.75rem; min-width: 38rem; }
.so-row-off td { opacity: 0.55; }
.so-merged { font-weight: 700; color: var(--primary-600); }
.so-merged-po { text-decoration: underline; font-style: italic; }
.so-ship-over { color: var(--warning-700); font-weight: 600; }
.dark .so-ship-over { color: var(--warning-400); }
.so-date-ship { color: var(--success-600); font-weight: 600; }
.so-date-cancel { color: var(--danger-600); font-weight: 600; }
.so-id { display: inline-block; min-width: 1.125rem; margin-inline-end: 0.25rem; border-radius: 0.25rem; text-align: center; font-size: 0.6875rem; line-height: 1.125rem; background: var(--gray-200); color: var(--gray-700); }
.so-id--exact, .so-id--verified { background: var(--success-100); color: var(--success-700); }
.so-id--sibling { background: var(--info-100); color: var(--info-700); }
.so-id--flagged { background: var(--danger-100); color: var(--danger-700); }
.so-id--sent { background: var(--primary-100); color: var(--primary-700); }
.so-docs-filter > div { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; font-weight: 400; min-height: 2.25rem; align-items: center; }
.so-pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; padding: 0.625rem 0.75rem; font-size: 0.875rem; color: var(--gray-600); }
.dark .so-pager { color: var(--gray-300); }
.so-pager-right { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.so-size { display: inline-flex; align-items: center; gap: 0.5rem; }
.so-box--open { cursor: pointer; }
.so-box--open:hover { filter: brightness(0.92); }
.so-view { padding: 0.25rem 0.625rem; border-radius: 0.375rem; font-size: 0.75rem; font-weight: 500; color: var(--gray-700); background: #fff; outline: 1px solid var(--gray-300); }
.so-view:hover { background: var(--gray-50); }
.so-view--on { color: #fff; background: var(--primary-600); outline-color: var(--primary-600); }
.dark .so-view { color: var(--gray-200); background: rgb(255 255 255 / 0.05); outline-color: rgb(255 255 255 / 0.2); }
.dark .so-view--on { color: #fff; background: var(--primary-600); }
/* margin: auto — Tailwind's preflight zeroes every margin, and that is what centres a native <dialog>; without it the box sits top left. */
.so-dialog { margin: auto; width: min(64rem, calc(100vw - 2rem)); max-height: calc(100dvh - 3rem); padding: 0; border: 0; border-radius: 0.75rem; color: var(--gray-950); background: #fff; box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.2); }
.dark .so-dialog { color: #fff; background: var(--gray-900); }
.so-dialog::backdrop { background: rgb(3 7 18 / 0.5); }
.so-dialog-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.875rem 1.25rem; background: inherit; border-bottom: 1px solid var(--gray-200); }
.dark .so-dialog-head { border-bottom-color: rgb(255 255 255 / 0.1); }
.so-dialog-head h2 { font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }
.so-dialog-body { padding: 1rem 1.25rem; display: grid; gap: 0.75rem; font-size: 0.8125rem; }
.so-doc-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; align-items: center; }
.so-doc-tabs { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; }
.so-doc-file { max-width: 100%; min-width: 0; flex: 1 1 18rem; padding: 0.25rem 0.5rem; border-radius: 0.375rem; font-size: 0.75rem; color: inherit; background: transparent; outline: 1px solid var(--gray-300); }
.so-doc-facts { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; padding-block: 0.25rem; }
.so-doc-errors { color: var(--danger-600); }
.so-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.75rem; }
.so-party b { display: block; font-size: 0.6875rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--gray-500); }
.so-raw { margin: 0; padding: 0.75rem; max-height: 60vh; overflow: auto; border-radius: 0.375rem; font-size: 0.75rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--gray-50); }
.dark .so-raw { background: rgb(255 255 255 / 0.05); }
.so-segments span { display: inline-block; margin-inline-end: 0.375rem; padding: 0 0.25rem; border-radius: 0.25rem; background: var(--gray-100); }
.dark .so-segments span { background: rgb(255 255 255 / 0.08); }
.so-seg-name { white-space: nowrap; color: var(--gray-500); }
/* Operator controls (Phase 3 stage 5). They render only for someone with config.actions, on a supplier the ERP runs. */
.so-ctl { max-width: 100%; padding: 0.125rem 0.375rem; border-radius: 0.375rem; font-size: 0.75rem; color: inherit; background: transparent; outline: 1px solid var(--gray-300); }
.dark .so-ctl { outline-color: rgb(255 255 255 / 0.2); }
.dark .so-ctl option { color: var(--gray-950); }
.so-act { margin-top: 0.25rem; }
.so-tick input[aria-busy="true"], .so-ctl[aria-busy="true"], .so-view[aria-busy="true"] { cursor: progress; opacity: 0.6; }
.so-form { display: grid; gap: 0.75rem; }
.so-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.75rem; }
.so-form small { font-weight: 400; color: var(--gray-500); overflow-wrap: anywhere; }
.so-input { width: 100%; padding: 0.375rem 0.5rem; border-radius: 0.375rem; font-size: 0.875rem; font-weight: 400; color: inherit; background: transparent; outline: 1px solid var(--gray-300); }
.so-input[aria-invalid="true"] { outline: 2px solid var(--danger-600); }
.dark .so-input { outline-color: rgb(255 255 255 / 0.2); }
.so-form-bar { display: flex; justify-content: flex-end; gap: 0.5rem; }
.so-toast { position: fixed; z-index: 50; right: 1rem; bottom: 1rem; display: flex; align-items: flex-start; gap: 0.75rem; max-width: min(28rem, calc(100vw - 2rem)); padding: 0.75rem 1rem; border-radius: 0.5rem; font-size: 0.8125rem; font-weight: 500; color: var(--danger-700); background: var(--danger-50); box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.15); }
.so-toast[data-state="ok"] { color: var(--success-700); background: var(--success-50); }
.so-toast[hidden] { display: none; }
.dark .so-toast { color: var(--danger-400); background: var(--gray-800); }
.dark .so-toast[data-state="ok"] { color: var(--success-400); }
/* Recall (Phase 3 stage 6): the modal's warnings, never refusals. */
.so-recall-warn { margin: 0; padding-inline-start: 1.25rem; list-style: disc; font-size: 0.8125rem; font-weight: 500; color: var(--warning-700); }
.so-recall-warn:empty { display: none; }
.dark .so-recall-warn { color: var(--warning-400); }
/* Send via bridge (Phase 3 stage 8): the button in the bar, its banners, the preview, the run panel. Only someone with Send sees them, on a supplier the bridge sends. */
.so-send-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.so-send-bar[hidden], .so-send-notes[hidden] { display: none; }
.so-send-bar .so-view:disabled, .so-send-dialog .so-view:disabled { cursor: not-allowed; opacity: 0.5; }
.so-send-why { font-size: 0.8125rem; color: var(--gray-500); }
.so-send-notes { display: grid; gap: 0.5rem; }
.so-send-notes .so-view { margin-inline-start: 0.5rem; }
.so-send-counts, .so-send-said, .so-send-refusals { margin: 0; padding-inline-start: 1.25rem; list-style: disc; }
.so-send-refusals { font-weight: 500; color: var(--danger-700); }
.dark .so-send-refusals { color: var(--danger-400); }
.so-send-step { display: grid; gap: 0.5rem; padding: 0.75rem; border-radius: 0.5rem; outline: 1px solid var(--gray-200); }
.dark .so-send-step { outline-color: rgb(255 255 255 / 0.1); }
.so-send-step ul { margin: 0; padding-inline-start: 1.25rem; list-style: disc; }
.so-send-head { margin: 0; font-weight: 600; }
.so-send-tick { display: inline-flex; align-items: center; gap: 0.375rem; font-weight: 500; }
.so-send-table .so-num { text-align: end; }
.so-send-outside, .so-send-bo, .so-send-held { display: inline-block; padding: 0 0.25rem; border-radius: 0.25rem; font-size: 0.6875rem; font-weight: 600; color: var(--warning-700); background: var(--warning-50); }
.dark .so-send-outside, .dark .so-send-bo, .dark .so-send-held { color: var(--warning-400); background: rgb(255 255 255 / 0.05); }
.so-send-state { margin: 0; font-size: 0.875rem; }
.so-send-state[data-state="needs_person"], .so-send-state[data-state="refused"], .so-send-state[data-state="not_started"] { color: var(--danger-700); }
.dark .so-send-state[data-state="needs_person"], .dark .so-send-state[data-state="refused"], .dark .so-send-state[data-state="not_started"] { color: var(--danger-400); }
.so-send-facts { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; }
.so-send-facts dt { font-size: 0.6875rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--gray-500); }
.so-send-facts dd { margin: 0; }
.so-send-compare { margin: 0; font-weight: 500; }
.so-send-tally { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.so-send-tally li { padding: 0.25rem 0.5rem; border-radius: 0.375rem; background: var(--gray-100); }
.dark .so-send-tally li { background: rgb(255 255 255 / 0.05); }
.so-send-tally li[data-state="unknown"], .so-send-group[data-state="unknown"] .so-send-head { color: var(--warning-700); }
.so-send-tally li[data-state="failed"], .so-send-group[data-state="failed"] .so-send-head { color: var(--danger-700); }
.dark .so-send-tally li[data-state="unknown"], .dark .so-send-group[data-state="unknown"] .so-send-head { color: var(--warning-400); }
.dark .so-send-tally li[data-state="failed"], .dark .so-send-group[data-state="failed"] .so-send-head { color: var(--danger-400); }
.so-send-group ul { margin: 0; padding-inline-start: 1.25rem; list-style: disc; }
.so-send-group code { font-size: 0.75rem; color: var(--gray-500); }
/*
 * Step 1a, the Sandbox switch per supplier (owner decision 6). While the supplier shown is in Sandbox the page area
 * takes a tint inside a dashed border, and a label sits by the supplier. Only backgrounds change, so text keeps its
 * contrast.
 *
 * ── THE SANDBOX COLOUR LIVES HERE AND NOWHERE ELSE (owner 2026-11-13: purple, and easy to change) ──
 * To change the colour, change the five values in each of the two blocks below (light, then dark) and copy this
 * file to public/css/app/. Nothing else names a sandbox colour. Keep the pairs readable: chip-text on chip, and
 * chip-text on a white switch, must reach 4.5:1 (today 8.0:1 and 10.9:1 light, 7.4:1 and 12.6:1 dark; worked out, not
 * measured on screen); line and on must reach 3:1 against the page.
 * They are written out, not Filament's shades, so a panel colour change cannot turn the sandbox look into the live
 * one. Purple, because the panel's own colour is amber and nothing else on this page is purple. The "Moved" mark
 * stays red: it is a warning, not the sandbox colour.
 */
:root {
    --so-sbx-tint: #f3e8ff;       /* the page area */
    --so-sbx-line: #7e22ce;       /* the dashed outline, and the shared-settings group in the rebase dialog */
    --so-sbx-chip: #e9d5ff;       /* the Sandbox label and the row marks */
    --so-sbx-chip-text: #581c87;  /* their text, and the switch's text when on */
    --so-sbx-on: #7e22ce;         /* the switch's track when on */
}
.dark {
    --so-sbx-tint: #241336;
    --so-sbx-line: #c084fc;
    --so-sbx-chip: #6b21a8;
    --so-sbx-chip-text: #f3e8ff;
    --so-sbx-on: #a855f7;
}

.fi-page.so-sandbox-page { background-color: var(--so-sbx-tint); box-shadow: 0 0 0 0.75rem var(--so-sbx-tint); outline: 3px dashed var(--so-sbx-line); outline-offset: 0.75rem; border-radius: 0.25rem; }
.dark .fi-page.so-sandbox-page { background-color: var(--so-sbx-tint); box-shadow: 0 0 0 0.75rem var(--so-sbx-tint); outline-color: var(--so-sbx-line); }
.so-supplier-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.so-sbx-label { display: inline-flex; align-items: center; padding: 0.0625rem 0.5rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--so-sbx-chip-text); background: var(--so-sbx-chip); }
.so-sbx-label[hidden] { display: none; }
.dark .so-sbx-label { color: var(--so-sbx-chip-text); background: var(--so-sbx-chip); }
.so-sbx-switch { flex: none; display: inline-flex; align-items: center; gap: 0.5rem; margin-inline-start: 0.5rem; padding-inline: 0.625rem; border-radius: 0.5rem; cursor: pointer;
    font-size: 0.875rem; font-weight: 600; color: var(--gray-700); background: #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.so-sbx-switch:disabled { cursor: not-allowed; opacity: 0.6; }
.so-sbx-switch:focus-visible, .so-sbx-rebase:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 2px; }
/* Review 1a MI-8: the off track is #6b7280, 4.8:1 on the white switch and 3.2:1 or more on the dark ones (WCAG 1.4.11 asks 3:1), and the white thumb is 4.8:1 on it. */
.so-sbx-switch__track { position: relative; flex: none; width: 2.25rem; height: 1.25rem; border-radius: 9999px; background: #6b7280; transition: background-color 0.15s; }
.so-sbx-switch__thumb { position: absolute; top: 0.125rem; inset-inline-start: 0.125rem; width: 1rem; height: 1rem; border-radius: 9999px; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.25); transition: inset-inline-start 0.15s; }
.so-sbx-switch[aria-checked="true"] { color: var(--so-sbx-chip-text); }
.so-sbx-switch[aria-checked="true"] .so-sbx-switch__track { background: var(--so-sbx-on); }
.so-sbx-switch[aria-checked="true"] .so-sbx-switch__thumb { inset-inline-start: 1.125rem; }
.dark .so-sbx-switch { color: var(--gray-200); background: rgb(255 255 255 / 0.05); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.2); }
.dark .so-sbx-switch__track { background: #6b7280; }
.dark .so-sbx-switch[aria-checked="true"] { color: var(--so-sbx-chip-text); }
.dark .so-sbx-switch[aria-checked="true"] .so-sbx-switch__track { background: var(--so-sbx-on); }
.so-sbx-rebase { flex: none; margin-inline-start: 0.5rem; }
/*
 * Review 1a MJ-3: on a phone the supplier row holds the select, the pencil, the plus, the switch and Rebase, about
 * 285px of fixed width beside the select. So under 40rem the row wraps: the select and its pencil keep the first line,
 * and the rest go to the next. The field's one column may not grow past the field, so nothing scrolls sideways.
 * Only where the switch is drawn (:has), so the row of anyone the sandbox is not for, and the flag off, are as before
 * (R6). Worked out from the CSS, not seen in a browser.
 */
@media (max-width: 40rem) {
    .so-field--grow:has(.so-sbx-switch) { grid-template-columns: minmax(0, 1fr); }
    .so-supplier:has(.so-sbx-switch) { flex-wrap: wrap; row-gap: 0.5rem; }
    .so-supplier:has(.so-sbx-switch) .so-supplier__select { flex: 1 1 calc(100% - 2.5rem - 1px); }
    .so-supplier:has(.so-sbx-switch) .so-supplier__add { margin-inline-start: 0; }
}
.so-table .so-sbx-mark, .so-table .so-sbx-moved, .so-dialog .so-sbx-mark, .so-dialog .so-sbx-moved { display: block; width: fit-content; margin: 0.125rem auto 0; padding: 0 0.25rem; border-radius: 0.25rem; font-size: 0.6875rem; font-weight: 700; }
.so-dialog .so-sbx-mark, .so-dialog .so-sbx-moved { display: inline-block; margin: 0 0 0 0.25rem; }
.so-table .so-sbx-mark, .so-dialog .so-sbx-mark { color: var(--so-sbx-chip-text); background: var(--so-sbx-chip); }
.so-table .so-sbx-moved, .so-dialog .so-sbx-moved { color: #7f1d1d; background: #fecaca; }
.dark .so-table .so-sbx-mark, .dark .so-dialog .so-sbx-mark { color: var(--so-sbx-chip-text); background: var(--so-sbx-chip); }
.dark .so-table .so-sbx-moved, .dark .so-dialog .so-sbx-moved { color: #fee2e2; background: #991b1b; }
.so-sbx-groups { display: grid; gap: 0.375rem; margin: 0.75rem 0 0; padding: 0.5rem 0.75rem 0.75rem; border: 1px solid var(--gray-200); border-radius: 0.5rem; }
.so-sbx-groups legend { padding-inline: 0.25rem; font-size: 0.8125rem; font-weight: 600; }
.so-sbx-groups--shared { border-color: var(--so-sbx-line); }
.dark .so-sbx-groups { border-color: rgb(255 255 255 / 0.15); }
.dark .so-sbx-groups--shared { border-color: var(--so-sbx-line); }
.so-sbx-group { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; }
.so-sbx-counts { margin: 0.25rem 0 0.5rem; padding-inline-start: 1.25rem; list-style: disc; font-size: 0.875rem; }
.so-sbx-buttons { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
/*
 * Step 1b, Send in Sandbox. Every new part takes the sandbox's colour from the variables above and no other: the
 * Send in Sandbox button, the panel's outline and its "nothing leaves the ERP" line, a line sent in Sandbox on the grid
 * and in the store-lines dialog, and each value of a Sandbox document that came from the sandbox (the value on the
 * chip colour, then the word "Sandbox", so it reads without a pointer). Production moved keeps the red "Moved" mark.
 */
.so-sbx-send.so-view--on { color: var(--so-sbx-chip-text); background: var(--so-sbx-chip); outline-color: var(--so-sbx-line); }
.dark .so-sbx-send.so-view--on { color: var(--so-sbx-chip-text); background: var(--so-sbx-chip); outline-color: var(--so-sbx-line); }
.so-send-dialog--sandbox { outline: 3px dashed var(--so-sbx-line); outline-offset: -3px; }
.so-sbx-banner { margin: 0; padding: 0.5rem 0.75rem; border-inline-start: 4px solid var(--so-sbx-line); border-radius: 0.375rem; font-size: 0.875rem; color: var(--so-sbx-chip-text); background: var(--so-sbx-tint); }
.so-sbx-refused { font-weight: 500; }
.so-sbx-sent { display: grid; justify-items: center; gap: 0.125rem; margin-top: 0.25rem; }
.so-dialog .so-sbx-sent { justify-items: start; margin: 0 0 0.75rem; }
.so-sbx-sent__mark { display: inline-block; padding: 0 0.375rem; border-radius: 0.25rem; font-size: 0.75rem; font-weight: 700; color: var(--so-sbx-chip-text); background: var(--so-sbx-chip); box-shadow: 0 0 0 1px var(--so-sbx-line); }
.so-sbx-sent-count[hidden] { display: none; }
.so-sbx-doc { display: grid; gap: 0.75rem; }
.so-sbx-doc-part { display: grid; gap: 0.375rem; }
.so-sbx-doc-facts dd { overflow-wrap: anywhere; }
.so-sbx-val { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; padding: 0 0.25rem; border-radius: 0.25rem; color: var(--so-sbx-chip-text); background: var(--so-sbx-tint); box-shadow: 0 0 0 1px var(--so-sbx-line); }
.so-dialog .so-sbx-val .so-sbx-mark { margin: 0; }
.so-sbx-rebase-sends { margin: 0 0 0 1.75rem; }
/*
 * Step 2a: posting to the supplier's test link in EDI-SaaS. A post's state reads in words; posted is solid (tint on
 * line), any other state outlined (chip-text on tint). A value the relabel changed for the test reads "Test" on chip,
 * dashed. The EDI text is a block a person can select and copy, one segment per line, wrapped on a phone. Only the
 * --so-sbx-* colours, in the pairs worked out above.
 */
.so-sbx-post { margin: 0; font-size: 0.875rem; overflow-wrap: anywhere; }
.so-sbx-post small { display: block; overflow-wrap: anywhere; }
.so-sbx-post-mark { display: inline-block; margin-inline-start: 0.25rem; padding: 0 0.375rem; border-radius: 0.25rem; font-size: 0.75rem; font-weight: 700; color: var(--so-sbx-chip-text); background: var(--so-sbx-tint); box-shadow: inset 0 0 0 1px var(--so-sbx-line); }
.so-sbx-post-mark[data-sbx-post-mark="posted"] { color: var(--so-sbx-tint); background: var(--so-sbx-line); box-shadow: none; }
.so-sbx-sent .so-sbx-post-mark { margin-inline-start: 0; }
.so-sbx-post-facts, .so-sbx-post-why { display: block; font-size: 0.8125rem; overflow-wrap: anywhere; }
.so-sbx-post-why[role="alert"] { font-weight: 600; }
.so-sbx-val--test { background: var(--so-sbx-chip); outline: 1px dashed var(--so-sbx-line); outline-offset: 1px; }
.so-dialog .so-sbx-mark.so-sbx-mark--test, .dark .so-dialog .so-sbx-mark.so-sbx-mark--test { color: var(--so-sbx-tint); background: var(--so-sbx-line); }
.so-sbx-edi { margin: 0; max-height: 24rem; overflow: auto; padding: 0.5rem 0.75rem; border-radius: 0.375rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8125rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; color: var(--so-sbx-chip-text); background: var(--so-sbx-tint); box-shadow: inset 0 0 0 1px var(--so-sbx-line); user-select: text; -webkit-user-select: text; }
.so-sbx-rebase-posted { margin: 0 0 0 1.75rem; }
/*
 * Store orders in Sandbox (slice C): the stock check in the viewer, the store-lines dialog and the grid. A store order
 * a sandbox send took off the queue reads "Off the sandbox queue" on the tint, where "Sent in Sandbox" sits on the
 * chip; the words tell them apart without a pointer. Each line's words sit under its box. Only the --so-sbx-* colours,
 * in the pairs worked out above.
 */
.so-sbx-gone .so-sbx-sent__mark { background: var(--so-sbx-tint); }
.so-dialog .so-sbx-gate-line { display: block; min-width: 12rem; margin-top: 0.125rem; font-size: 0.75rem; text-align: start; overflow-wrap: anywhere; }
.so-sbx-gate td { overflow-wrap: anywhere; }
/*
 * Replies in Sandbox: a supplier's simulated replies to a purchase order posted in Sandbox. Each document is a small
 * form in its own group; a reply's state reads in words, filed solid (tint on line) like a post, any other state
 * outlined. The parts a press moves focus to show where it went. Only the --so-sbx-* colours, in the pairs worked out
 * above; the fields take the page's own neutral borders.
 */
.so-sbx-reply { margin-top: 0.5rem; }
.so-sbx-reply .so-sbx-buttons { flex-wrap: wrap; align-items: center; margin-top: 0.5rem; }
.so-sbx-reply-fields { display: grid; gap: 0.5rem; margin-top: 0.25rem; }
.so-sbx-reply-field { display: grid; gap: 0.25rem; font-size: 0.875rem; }
.so-sbx-reply-field input, .so-sbx-reply-field select, .so-sbx-reply input[type="number"] { max-width: 100%; min-height: 2rem; padding: 0.125rem 0.375rem; border: 1px solid var(--gray-300); border-radius: 0.375rem; background: transparent; color: inherit; }
.dark .so-sbx-reply-field input, .dark .so-sbx-reply-field select, .dark .so-sbx-reply input[type="number"] { border-color: var(--gray-600); }
.so-sbx-reply input[type="number"] { width: 6rem; }
.so-sbx-post-mark[data-sbx-reply-mark="filed"] { color: var(--so-sbx-tint); background: var(--so-sbx-line); box-shadow: none; }
.so-sbx-reply-one { display: grid; gap: 0.375rem; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px dashed var(--so-sbx-line); }
[data-sbx-reply-preview]:focus-visible, [data-sbx-reply-last]:focus-visible, [data-sbx-reply-cycle-result]:focus-visible, .so-sbx-reply-one:focus-visible { outline: 2px solid var(--so-sbx-line); outline-offset: 2px; }
/*
 * S4: a Status cell a Sandbox reply laid (CONTRACT-S4.md R31), told apart from production's without a pointer: a dashed
 * frame on the tint, and a chip that says so, in the --so-sbx-* colours only, in the pairs worked out above (chip-text on
 * chip, chip-text on tint; line against the page), light and dark. Inside the frame the boxes keep production's own
 * colours and its ack border, so they read as production would show them. Under the cell, the row's detail opens with a
 * press (summary), never a hover; its lines wrap, so a phone never scrolls sideways for them. Worked out from the CSS, not
 * seen in a browser.
 */
.so-sbx-cells { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.125rem; max-width: 100%; margin: 0.125rem 0; padding: 0.25rem; border-radius: 0.375rem; background: var(--so-sbx-tint); outline: 2px dashed var(--so-sbx-line); outline-offset: -2px; }
.so-sbx-cells__chip { flex-basis: 100%; display: block; width: fit-content; margin: 0 auto 0.125rem; padding: 0 0.25rem; border-radius: 0.25rem; font-size: 0.6875rem; font-weight: 700; color: var(--so-sbx-chip-text); background: var(--so-sbx-chip); }
.so-sbx-cells > small, .so-sbx-cells .so-shipped { flex-basis: 100%; color: var(--so-sbx-chip-text); }
.so-sbx-cells .so-shipped input[data-sbx-read-only] { cursor: not-allowed; }
.dark .so-sbx-cells { background: var(--so-sbx-tint); outline-color: var(--so-sbx-line); }
.dark .so-sbx-cells__chip { color: var(--so-sbx-chip-text); background: var(--so-sbx-chip); }
.so-sbx-cells__detail { max-width: 15rem; margin: 0.25rem auto 0; text-align: start; font-size: 0.75rem; overflow-wrap: anywhere; }
.so-sbx-cells__detail summary { width: fit-content; margin: 0 auto; padding: 0 0.375rem; border-radius: 0.25rem; cursor: pointer; font-weight: 700; color: var(--so-sbx-chip-text); background: var(--so-sbx-tint); box-shadow: inset 0 0 0 1px var(--so-sbx-line); }
.so-sbx-cells__detail summary:focus-visible { outline: 2px solid var(--so-sbx-line); outline-offset: 2px; }
.so-sbx-cells__detail p { margin: 0.25rem 0 0; padding-inline-start: 0.375rem; border-inline-start: 2px solid var(--so-sbx-line); }
.dark .so-sbx-cells__detail summary { color: var(--so-sbx-chip-text); background: var(--so-sbx-tint); }
@media (max-width: 40rem) { .so-sbx-cells__detail { max-width: 12rem; } }

/*
 * Owner 2026-11-17, the top of the page. All CSS, on purpose: the markup is as it was, so the flag-off golden
 * page (SupplierSandboxFlagOffTest) still holds and the grid script finds every element where it looks.
 *
 * 1. The Supplier bar and the status lines under it are half the page wide and centred, from 64rem; narrower
 *    than that they keep the full width, as half a phone is too small for the Supplier box. The list bar
 *    (.so-bar--list: Search, Age, Show, Export) is not touched. Status lines are 12px.
 * 2. "Feed file age" sits on the Supplier label's line, at the bar's far end, from 40rem. It is still a later
 *    sibling in the markup: the bar and it are given the same grid cell, and the lines after them flow on.
 * 3. From 80rem the tabs are lifted into Filament's page header, centred between the title and the header
 *    button. They stay inside .so-grid (wire:ignore, the grid's own listeners); they are placed against
 *    .fi-page-header-main-ctn, whose padding-top is the header's top, and 18px is half the title's line.
 *    Below 80rem the title, three tabs and the button do not fit on one line, so the tabs stay where they were.
 */
.so-grid { --so-top-w: 100%; }
.so-grid > .so-bar:not(.so-bar--list), .so-grid > .so-status { width: var(--so-top-w); margin: 0 auto; }
.so-grid > .so-status { font-size: 0.75rem; }
@media (min-width: 40rem) {
    .so-grid > .fi-tabs { grid-row: 1; }
    .so-grid > .so-bar:not(.so-bar--list), .so-grid > .so-status[data-so="file-age"] { grid-area: 2 / 1; }
    .so-grid > .so-status[data-so="file-age"] { justify-self: end; align-self: start; width: auto; margin: 0; margin-inline-end: calc((100% - var(--so-top-w)) / 2); line-height: 1.3125rem; }
}
@media (min-width: 64rem) {
    .so-grid { --so-top-w: 50%; }
}
@media (min-width: 80rem) {
    .fi-page-header-main-ctn:has(.so-grid) { position: relative; }
    .so-grid > .fi-tabs { position: absolute; top: calc(var(--spacing, 0.2rem) * 8 + 18px); left: 50%; margin: 0; transform: translate(-50%, -50%); }
    .so-grid > .so-bar:not(.so-bar--list), .so-grid > .so-status[data-so="file-age"] { grid-area: 1 / 1; }
}

/*
 * Owner 2026-11-17: the supplier profile panel's own buttons (Save, Set username or password, Create profile,
 * Archive profile) sit in the panel's footer, on Close's line, at the right. They used to end the form, a
 * scroll away. CSS only: the buttons belong to the nested SupplierProfileForm and stay in it.
 * How: the content runs 4.125rem (the footer: 1px line + 1rem + a 33px button + 1rem) under the sticky footer,
 * the form's box is stretched to the content's end, and the buttons stick 1rem above the panel's bottom edge,
 * over the footer. From 48rem; on a narrower panel four buttons and Close do not fit on one line.
 */
@media (min-width: 48rem) {
    .fi-modal-window:has([data-so-profile-actions]) > .fi-modal-content { margin-bottom: -4.125rem; padding-bottom: 1rem; }
    .fi-modal-content > div:has(> [data-so-profile] > [data-so-profile-actions]) { flex: 1 1 auto; display: flex; flex-direction: column; }
    [data-so-profile]:has(> [data-so-profile-actions]) { flex: 1 1 auto; display: flex; flex-direction: column; }
    [data-so-profile] > :has(+ [data-so-profile-actions]) { margin-bottom: 1.5rem; }
    [data-so-profile] > [data-so-profile-actions] { position: sticky; bottom: 1rem; z-index: 11; width: fit-content; margin-top: auto; margin-inline-start: auto; justify-content: flex-end; }
    [data-so-profile] > [data-so-profile-actions] ~ * { margin-top: 0; }
}
