.operations { background: var(--canvas); }
.ops-wrap { margin-inline: 1.25rem; }
.operations .masthead { border-bottom: 1px solid var(--edge); }
.operations .masthead-inner { padding-block: .65rem; }
.customer-link { font-size: .87rem; font-weight: 700; text-underline-offset: .22em; }
.ops-intro { display: flex; justify-content: space-between; align-items: end; gap: .55rem 1.5rem; flex-wrap: wrap; margin-block: 1rem .85rem; }
.ops-intro h1 { max-width: none; font-size: clamp(2.4rem, 4.5vw, 3.6rem); line-height: .98; }
.ops-intro p { margin: .3rem 0 0; color: var(--muted); font-size: .9rem; }
.ops-intro .sample-label { padding: .45rem 0 .45rem .85rem; border-left: 2px solid var(--blue); font-size: .83rem; }
.sample-label strong { color: var(--deep-blue); }

.queue-overview { display: grid; grid-template-columns: minmax(16rem, 1.15fr) 2fr; gap: .7rem; margin-bottom: .95rem; }
.queue-exposure { padding: .7rem 1rem; border-radius: .45rem; background: var(--deep-blue); color: white; }
.queue-exposure-values { display: flex; justify-content: space-between; align-items: end; gap: .6rem; }
.queue-exposure-values > div { display: grid; gap: .15rem; }
.queue-exposure-values > div:last-child { text-align: right; }
.queue-exposure-values span { color: #e5e9ff; font-size: .75rem; font-weight: 650; }
.queue-exposure-values strong { font: 700 1.9rem/.95 "Barlow Condensed", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.queue-exposure-values > div:last-child strong { font-size: 1.55rem; }
.queue-exposure meter, .row-value-meter { --meter-track: #5f70e5; --meter-fill: #eff2ff; display: block; width: 100%; height: .4rem; margin: .55rem 0 0; appearance: none; border: 0; border-radius: 99rem; overflow: hidden; background: var(--meter-track); }
.queue-exposure meter::-webkit-meter-bar, .row-value-meter::-webkit-meter-bar { height: 100%; border: 0; border-radius: 99rem; background: var(--meter-track); }
.queue-exposure meter::-webkit-meter-optimum-value, .row-value-meter::-webkit-meter-optimum-value { background: var(--meter-fill); border-radius: 99rem; }
.queue-exposure meter::-moz-meter-bar, .row-value-meter::-moz-meter-bar { background: var(--meter-fill); border-radius: 99rem; }
.ops-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: .45rem; border: 1px solid var(--edge); border-radius: .45rem; background: white; }
.ops-totals > div { display: grid; align-content: center; gap: .22rem; padding: .1rem clamp(.4rem, 1.5vw, 1rem); }
.ops-totals > div + div { border-left: 1px solid var(--edge); }
.ops-totals dt { font-size: .75rem; font-weight: 650; color: var(--muted); }
.ops-totals dd { order: -1; font: 700 1.9rem/.95 "Barlow Condensed", system-ui, sans-serif; margin: 0; font-variant-numeric: tabular-nums; }

.ops-ledger { padding: .78rem 0 .25rem; margin-bottom: 1.5rem; border: 1px solid var(--edge); border-radius: .45rem; background: white; overflow: hidden; }
.workflow-filters, .ops-filters, .queue-navigation, .empty-queue { margin-inline: .85rem; }
.table-policy { color: var(--muted); font-size: .76rem; margin: 0; }
.queue-heading { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.workflow-filters { display: flex; gap: .35rem; padding: .12rem .1rem .48rem; margin-bottom: .5rem; border-bottom: 1px solid var(--edge); overflow: auto; scrollbar-width: thin; }
.workflow-button { display: inline-flex; align-items: center; gap: .36rem; min-height: 34px; padding: .25rem .55rem; border: 1px solid transparent; border-radius: .33rem; color: var(--ink); background: transparent; white-space: nowrap; cursor: pointer; font: 680 .76rem system-ui, sans-serif; }
.workflow-button:hover { border-color: #aeb9e7; background: #f1f4ff; }
.workflow-button[aria-pressed="true"] { border-color: #9dacfa; background: #ecf0ff; color: var(--deep-blue); }
.workflow-count { margin-left: auto; padding: .09rem .28rem; border-radius: .2rem; background: #eeeff4; color: #454969; font-size: .72rem; font-variant-numeric: tabular-nums; }
.workflow-button[aria-pressed="true"] .workflow-count { background: var(--deep-blue); color: white; }
.workflow-button.review:not([aria-pressed="true"]) .workflow-count { background: #fae7dc; color: #772b18; }

.ops-filters { display: grid; grid-template-columns: minmax(8rem, 1.4fr) repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: .55rem; }
.ops-filters label { display: grid; gap: .2rem; font-size: .76rem; font-weight: 720; min-width: 0; }
.ops-filters input, .ops-filters select, .queue-navigation select, #page-number { width: 100%; min-width: 0; min-height: 35px; border: 1px solid #a5a199; border-radius: .3rem; background: white; color: var(--ink); font: 500 .82rem system-ui, sans-serif; }
.ops-filters input { padding: .38rem .58rem; }
.ops-filters select, .queue-navigation select { appearance: none; padding: .33rem 1.85rem .33rem .6rem; cursor: pointer; }
.clear-queue { border: 0; border-radius: .25rem; min-height: 35px; padding: .25rem .48rem; background: #f0f2ff; color: var(--deep-blue); cursor: pointer; font: 720 .76rem system-ui, sans-serif; white-space: nowrap; }
.queue-navigation { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: .35rem .85rem; margin-block: .5rem; font-size: .77rem; }
.row-count { color: var(--muted); margin: 0; font-variant-numeric: tabular-nums; }
.queue-navigation .table-policy { margin: 0 auto 0 0; }
.page-size, .queue-pages, .queue-pages label { display: flex; align-items: center; gap: .35rem; }
.queue-navigation select, #page-number { min-height: 30px; font-size: .78rem; }
#page-number { width: 3.35rem; padding: .12rem .3rem; }
.page-button { min-width: 32px; padding: 0 .45rem; min-height: 30px; border: 1px solid var(--edge); border-radius: .3rem; background: white; color: var(--blue); cursor: pointer; font: 700 1.16rem/1 system-ui, sans-serif; }
.page-button:enabled:hover { border-color: var(--blue); }
.queue-footer { display: none; }

.table-scroll { overflow: auto; max-height: clamp(25rem, calc(100dvh - 23rem), 68rem); }
.table-scroll:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.ops-table { width: 100%; min-width: 56rem; border-collapse: separate; border-spacing: 0; text-align: left; }
.ops-table th { position: sticky; top: 0; z-index: 1; background: #edf0fa; color: #3a436c; border-bottom: 1px solid #cdd4ef; font-size: .77rem; font-weight: 750; }
.ops-table th button { border: 0; padding: .12rem .04rem; background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: inherit; white-space: nowrap; }
.ops-table th button span { color: var(--deep-blue); }
.ops-table :is(th, td) { padding: .41rem .58rem; }
.ops-table :is(th, td):first-child { padding-left: .85rem; }
.ops-table :is(th, td):last-child { padding-right: .85rem; }
.ops-table td { border-bottom: 1px solid #e7e5df; font-size: .81rem; vertical-align: middle; }
.ops-table .queue-order { width: 18%; }
.ops-table .queue-rank { width: 9%; white-space: nowrap; }
.ops-table .queue-impact { width: 28%; }
.ops-table .queue-revenue { width: 17%; }
.ops-table .queue-loyalty { width: 15%; }
.ops-table .queue-state { width: 13%; }
.ops-table tr:last-child td { border-bottom: 0; }
.ops-table tr:nth-child(even) { background: #fbfaf8; }
.ops-table tr:hover, .ops-table tr.is-selected { background: #edf1ff; }
.ops-table tr.is-selected td:first-child { box-shadow: inset 3px 0 var(--blue); }
.rank { color: var(--deep-blue); font-weight: 790; font-variant-numeric: tabular-nums; }
.rank.empty { color: var(--muted); font-weight: 500; }
.mobile-rank-label, .queue-mobile-label { display: none; }
.order-button { padding: .08rem 0; font: 770 .9rem system-ui, sans-serif; color: var(--deep-blue); text-decoration: underline; text-underline-offset: .19em; border: 0; background: transparent; cursor: pointer; }
.order-name { margin-left: .36rem; color: var(--ink); font-size: .8rem; font-weight: 650; }
.cell-note { display: block; color: var(--muted); font-size: .73rem; font-weight: 400; }
.queue-placed { font-size: .69rem; }

.queue-product { display: flex; align-items: center; gap: .55rem; }
.queue-product-photos { display: flex; flex: 0 0 auto; isolation: isolate; }
.queue-product-image { display: block; width: 38px; height: 38px; background: #f1f1f1; border: 1px solid #e0ded9; border-radius: .28rem; object-fit: contain; }
.queue-product-image + .queue-product-image { margin-left: -.55rem; }
.queue-impact-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: .06rem .42rem; }
.queue-impact-reason { grid-column: 1; font-weight: 720; }
.queue-impact-copy .cell-note { grid-column: 1 / -1; grid-row: 2; }
.queue-quantity { grid-column: 2; grid-row: 1; padding: .07rem .35rem; border-radius: .2rem; color: #694126; background: #f3e9dc; font-size: .7rem; font-weight: 720; white-space: nowrap; }

.queue-row-value { color: var(--ink); font-size: .89rem; font-variant-numeric: tabular-nums; }
.row-value-meter { --meter-track: #e2e7f7; --meter-fill: #475edf; width: min(100%, 8.5rem); height: .28rem; margin: .22rem 0 .15rem; }
.queue-affected-value { color: var(--deep-blue); font-variant-numeric: tabular-nums; }
.queue-history { display: flex; align-items: center; gap: .42rem; }
.queue-history > div > strong { font-size: .77rem; font-weight: 720; }
.queue-prior { display: grid; place-items: center; min-width: 1.72rem; height: 1.65rem; padding-inline: .2rem; border-radius: .25rem; background: #f0efec; color: #56534e; font-size: .85rem; font-variant-numeric: tabular-nums; }
.queue-history.repeat .queue-prior { background: #e9edff; color: var(--deep-blue); }
.queue-history.frequent .queue-prior { background: #2b3bb3; color: white; }

.state { display: inline-block; padding: .16rem .38rem; border-radius: .25rem; color: #3f4356; background: #eef0f5; font-size: .73rem; font-weight: 720; line-height: 1.35; }
.state.ready { color: #1826af; background: #dee6ff; }
.state.review { color: #772b18; background: #fae7dc; }
.state.invited { color: #145879; background: #e2f1f8; }
.state.allocating { color: #543983; background: #eee6f8; }
.state.confirmed { color: #195341; background: #e0f0e6; }
.queue-steps { display: flex; gap: .18rem; margin: .3rem 0 .1rem; }
.queue-steps > span { width: .72rem; height: .22rem; border-radius: 99rem; background: #e1e5f1; }
.queue-steps > .complete { background: #6375e9; }
.queue-steps > .current { background: var(--deep-blue); }
.queue-steps.review > .current { background: #a45739; }
.queue-steps.waiting > .current { background: #848da4; }
.queue-steps.confirmed > span { background: #52977f; }
.empty-queue { margin-block: 1rem; color: var(--muted); }

.order-detail { --detail-gutter: 1.45rem; width: min(100%, 33.5rem); height: 100%; max-width: none; max-height: 100%; margin: 0 0 0 auto; padding: 0; border: 0; background: var(--canvas); color: var(--ink); overflow-y: auto; overscroll-behavior: contain; }
.order-detail::backdrop { background: rgb(25 28 52 / 39%); }
.detail-header { position: sticky; top: 0; z-index: 1; background: #fff; border-top: 4px solid var(--blue); border-bottom: 1px solid var(--edge); padding: .8rem var(--detail-gutter) 1.1rem; }
.detail-heading-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.detail-heading-bar p { margin: 0; color: var(--deep-blue); font-size: .85rem; font-weight: 770; font-variant-numeric: tabular-nums; }
.detail-close { border: 1px solid var(--edge); border-radius: 50%; background: white; color: var(--ink); width: 42px; height: 42px; font: 500 1.6rem/1 system-ui, sans-serif; display: grid; place-items: center; cursor: pointer; }
.detail-close:hover { border-color: var(--blue); color: var(--blue); }
.detail-header h2 { font-size: clamp(2.05rem, 5vw, 2.85rem); line-height: .98; margin: 0 0 .65rem; overflow-wrap: anywhere; }
.detail-header h2:focus { outline: none; }
.detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .65rem; color: var(--muted); font-size: .82rem; }
.detail-meta .state { padding: .26rem .52rem; border-radius: .3rem; }
.detail-body { display: grid; gap: 1.25rem; padding: 1.25rem var(--detail-gutter) 1.65rem; }
.detail-body h3 { margin: 0; }
.detail-section-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .35rem .65rem; margin-bottom: .6rem; }
.detail-section-heading h3, .detail-customer h3 { font: 700 1.55rem/1 "Barlow Condensed", "Arial Narrow", sans-serif; }
.detail-impact { background: #f3e9dc; color: #723b20; border-radius: .3rem; padding: .22rem .5rem; font-size: .75rem; font-weight: 720; }
.detail-impact[data-status="allocating"] { color: var(--deep-blue); background: var(--ice); }
.detail-impact[data-status="confirmed"] { color: #195341; background: #e0f0e6; }
.detail-product-list { display: grid; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.detail-product { display: grid; grid-template-columns: 5.1rem minmax(0, 1fr) auto; align-items: center; gap: .7rem; background: white; padding: .42rem .75rem .42rem .42rem; border: 1px solid var(--edge); border-radius: .45rem; }
.detail-product-image { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: .25rem; background: #f2f2f2; }
.detail-product-copy, .detail-product-price { display: grid; gap: .1rem; }
.detail-product-copy strong { font-size: .94rem; line-height: 1.2; }
.detail-product-copy span { font-size: .82rem; }
.detail-product small { color: var(--muted); font-size: .7rem; overflow-wrap: anywhere; }
.detail-product-price { text-align: right; white-space: nowrap; font-size: .84rem; }

.detail-money { background: var(--deep-blue); color: white; border-radius: .45rem; padding: .9rem 1rem .85rem; }
.detail-value-heading { display: flex; align-items: end; justify-content: space-between; gap: .5rem; }
.detail-value-heading h3 { color: #e3e6ff; font-size: .78rem; font-weight: 650; }
.detail-total { margin: .18rem 0 0; font: 700 2.55rem/.95 "Barlow Condensed", "Arial Narrow", sans-serif; font-variant-numeric: tabular-nums; }
.detail-value-share { padding: .2rem .45rem; margin: 0; border-radius: .25rem; background: #3849c6; color: white; font-size: .77rem; font-weight: 750; white-space: nowrap; }
.detail-money meter { display: block; width: 100%; height: .6rem; margin: .75rem 0 .55rem; appearance: none; border: 0; border-radius: 99rem; overflow: hidden; background: #5967d6; }
.detail-money meter::-webkit-meter-bar { height: .6rem; border: 0; border-radius: 99rem; background: #5967d6; }
.detail-money meter::-webkit-meter-optimum-value { background: #f2f5ff; border-radius: 99rem; }
.detail-money meter::-moz-meter-bar { background: #f2f5ff; border-radius: 99rem; }
.detail-value-breakdown { display: flex; flex-wrap: wrap; gap: .25rem .95rem; justify-content: space-between; margin: 0; }
.detail-value-breakdown > div { display: flex; align-items: baseline; gap: .35rem; }
.detail-value-breakdown dt { color: #e3e6ff; font-size: .79rem; }
.detail-value-breakdown dd { margin: 0; font-size: .88rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.detail-value-note { margin: .55rem 0 0; color: #d5dcff; font-size: .69rem; }

.detail-rank { color: var(--deep-blue); font-size: .76rem; font-weight: 720; }
.detail-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; padding: .65rem 0 .55rem; margin: 0 0 .65rem; background: #e9edff; border-radius: .4rem; }
.detail-steps > li { position: relative; display: grid; justify-items: center; text-align: center; gap: .32rem; color: #505373; font-size: .75rem; font-weight: 650; }
.detail-steps > li + li::before { content: ""; position: absolute; inset: .49rem auto auto -50%; width: 100%; height: 2px; background: #b8c2ef; }
.detail-steps > li.is-complete + li::before { background: var(--blue); }
.detail-step-mark { position: relative; z-index: 1; display: grid; place-items: center; width: 1.1rem; height: 1.1rem; border: 2px solid #6f79b1; border-radius: 50%; background: #e9edff; }
.detail-steps li[aria-current="step"] { color: var(--deep-blue); font-weight: 800; }
.detail-steps li[aria-current="step"] .detail-step-mark { border-color: var(--blue); }
.detail-steps li[aria-current="step"] .detail-step-mark::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: var(--blue); }
.detail-steps .is-complete .detail-step-mark { border-color: var(--blue); background: var(--blue); color: white; }
.detail-steps .is-complete .detail-step-mark::before { content: "✓"; font-size: .72rem; line-height: 1; }
.step-state { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.detail-update, .detail-next { font-size: .82rem; }
.detail-update { padding: .1rem 0 .65rem; }
.detail-update strong, .detail-next strong { display: block; font-size: .78rem; }
.detail-update p, .detail-next p { margin: .15rem 0 0; color: var(--muted); }
.detail-next { background: white; border-left: 3px solid var(--blue); padding: .58rem .7rem; }
.detail-result { display: grid; gap: .28rem; padding: .65rem .7rem 0; margin: 0; font-size: .8rem; }
.detail-result > div { display: grid; grid-template-columns: 5.9rem minmax(0, 1fr); gap: .4rem; }
.detail-result dt { color: var(--muted); }
.detail-result dd { margin: 0; font-weight: 650; }

.detail-customer { display: flex; align-items: center; justify-content: space-between; gap: .55rem; padding-top: .8rem; border-top: 1px solid var(--edge); }
.detail-customer p { margin: .2rem 0 0; color: var(--muted); font-size: .8rem; }
.detail-customer .detail-prior { margin: 0; color: var(--deep-blue); font-weight: 720; text-align: right; }

@media (max-width: 420px) {
  .order-detail { --detail-gutter: .9rem; }
  .detail-body { gap: 1.02rem; padding-top: 1rem; }
  .detail-product { grid-template-columns: 3.65rem minmax(0, 1fr) auto; gap: .45rem; padding-right: .5rem; }
  .detail-product-copy strong { font-size: .85rem; }
  .detail-product-price { font-size: .77rem; }
}

@media (min-width: 49rem) and (max-width: 67rem) {
  .ops-table :is(th, td):first-child { position: sticky; left: 0; border-right: 1px solid var(--edge); }
  .ops-table th:first-child { z-index: 2; }
  .ops-table td:first-child { background: white; }
  .ops-table tr:nth-child(even) td:first-child { background: #fbfaf8; }
  .ops-table tr:hover td:first-child, .ops-table tr.is-selected td:first-child { background: #edf1ff; }
}
@media (max-width: 48.99rem) {
  .ops-wrap { margin-inline: .75rem; }
  .operations .masthead-inner { padding-block: .65rem; }
  .ops-intro { margin-top: 1rem; }
  .ops-intro .sample-label { margin: 0; padding-block: .15rem; }
  .sample-label br { display: none; }
  .sample-label time { margin-left: .4rem; }
  .queue-overview { grid-template-columns: 1fr; gap: .45rem; }
  .queue-exposure { padding: .62rem .72rem; }
  .ops-totals dd { font-size: 1.55rem; }
  .ops-totals dt { font-size: .69rem; line-height: 1.3; }
  .ops-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .36rem .5rem; }
  .clear-queue { justify-self: start; }
  .queue-navigation { justify-content: space-between; }
  .row-count { width: 100%; }
  .queue-navigation .table-policy { display: none; }
  .queue-footer { display: flex; align-items: center; justify-content: space-between; gap: .3rem; padding: .1rem .65rem .65rem; font-size: .73rem; }
  .queue-footer .page-button { padding-inline: .36rem; font-size: .72rem; }
  .table-scroll { max-height: none; overflow: visible; }
  .ops-table, .ops-table tbody { display: block; min-width: 0; }
  .ops-table thead { display: none; }
  .ops-table tbody { display: grid; gap: .55rem; padding: .25rem .65rem .65rem; }
  .ops-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "order state" "rank state" "impact impact" "revenue loyalty"; gap: .18rem .65rem; align-items: start; padding: .6rem .65rem; border: 1px solid var(--edge); border-radius: .4rem; background: white; }
  .ops-table tbody tr:hover, .ops-table tbody tr.is-selected { background: #f5f7ff; }
  .ops-table tr.is-selected td:first-child { box-shadow: none; }
  .ops-table :is(th, td):first-child, .ops-table :is(th, td):last-child, .ops-table td { padding: 0; }
  .ops-table :is(.queue-order, .queue-rank, .queue-impact, .queue-revenue, .queue-loyalty, .queue-state) { width: auto; min-width: 0; }
  .ops-table td { border: 0; }
  .ops-table .queue-order { grid-area: order; }
  .queue-order .order-name { display: block; margin-left: 0; }
  .ops-table .queue-rank { grid-area: rank; font-size: .72rem; }
  .ops-table .queue-state { grid-area: state; justify-self: end; text-align: right; }
  .queue-state .queue-steps { justify-content: flex-end; }
  .ops-table .queue-impact { grid-area: impact; padding-block: .43rem; margin-block: .16rem; border-block: 1px solid #eeeae3; }
  .ops-table .queue-revenue { grid-area: revenue; }
  .ops-table .queue-loyalty { grid-area: loyalty; align-self: center; }
  .mobile-rank-label, .queue-mobile-label { display: inline; color: var(--muted); font-size: .68rem; }
  .queue-mobile-label { display: block; }
  .queue-placed { display: none; }
}
.ops-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .3rem 1.15rem; }
