.orders-workbench {
  --line: #ded7e9;
  --muted: #514a5f;
  --purple: #5028ae;
  --accent: #5028ae;
  --soft: #f0eaf8;
}

.orders-workbench button, .orders-workbench select { font-family: inherit; }
.orders-workbench button { cursor: pointer; }
.orders-workbench h3, .orders-workbench h4, .orders-workbench p { margin: 0; }
.orders-workbench [hidden] { display: none !important; }
.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}

.workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; border-top: 1px solid var(--line); }
.card { min-width: 0; }
.detail { border-inline-start: 1px solid var(--line); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem 0.85rem; min-width: 0; padding: 1.2rem 1.25rem 0.85rem; flex-wrap: wrap; }
.orders-workbench .card-head h3, .orders-workbench .inventory h3 { font-size: clamp(1.12rem, 2.2vw, 1.4rem); line-height: 1.2; letter-spacing: -0.025em; font-family: inherit; font-weight: 700; }
.card-head p, .inventory-title p { font-size: 0.875rem; color: var(--muted); margin-top: 0.35rem; }
.button { min-height: 2.75rem; border: 1px solid transparent; border-radius: 10px; padding: 0.5rem 0.8rem; font-size: 0.875rem; font-weight: 720; line-height: 1.3; }
.button-quiet { background: transparent; color: var(--purple); }
.button-quiet:hover { background: var(--soft); }
.button-outline { background: #fff; border-color: #d9cfe7; color: var(--purple); }
.button-outline:hover { background: #f5efff; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: #52269f; }
.button:disabled { background: #f0eef5; color: #6a6479; border-color: #e4e0ea; cursor: default; }
.queue-tools { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.55rem; padding: 0 1.25rem 0.9rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.2rem; }
.filter { min-height: 2.75rem; border: 1px solid transparent; border-radius: 0.54rem; padding: 0.37rem 0.56rem; background: none; color: var(--muted); font-size: 0.875rem; font-weight: 680; white-space: nowrap; }
.filter span { font-variant-numeric: tabular-nums; margin-left: 0.16rem; }
.filter[aria-pressed="true"] { color: var(--purple); background: #fff; border-color: #d9cfe7; }
.select-field { position: relative; }
.select-field::after { content: ""; position: absolute; inset-inline-end: 0.85rem; top: 44%; border: solid var(--purple); border-width: 0 1.5px 1.5px 0; width: 0.43rem; height: 0.43rem; transform: rotate(45deg); pointer-events: none; }
.select-field:has(:disabled)::after { opacity: 0.45; }
.orders-workbench select { appearance: none; border: 1px solid #ddd7eb; border-radius: 9px; min-height: 2.75rem; width: 100%; padding: 0.6rem 1.95rem 0.6rem 0.7rem; font-size: 0.875rem; color: #302544; background: #fff; }
.orders-workbench select:disabled { background: #f6f4f9; color: #534b63; }
.queue-feedback { margin: 0 1.25rem 0.8rem; border-radius: 0.5rem; padding: 0.55rem 0.7rem; background: var(--soft); color: #442b72; font-size: 0.875rem; line-height: 1.45; }
.queue-empty, .detail-empty { padding: 1rem 1.25rem 1.35rem; color: var(--muted); line-height: 1.45; }

.order-table { border-spacing: 0; width: 100%; table-layout: auto; }
.order-table th { padding: 0.58rem 0.65rem; background: #f4eef8; border-block: 1px solid var(--line); font-size: 0.875rem; color: var(--muted); font-weight: 650; text-align: left; }
.order-table td { border-bottom: 1px solid var(--line); padding: 0.42rem 0.65rem; font-size: 0.875rem; line-height: 1.35; }
.order-table :is(td, th):first-child { padding-left: 1.25rem; }
.order-table :is(td, th):last-child { padding-right: 1.25rem; }
.order-table tbody tr:last-child td { border-bottom: 0; }
.order-table tr[data-selected="true"] { background: #eee7f6; }
.order-table tr[data-selected="true"] td:first-child { box-shadow: inset 3px 0 var(--accent); }
.order-link { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0; border: 0; background: none; text-align: left; font-weight: 780; color: #473174; white-space: nowrap; }
.order-link:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.channel { color: #4d485f; overflow-wrap: anywhere; }
.point-name { color: #4d485f; }
.point-name span { display: block; font-size: 0.8125rem; }
.status { display: inline-block; max-width: 100%; width: max-content; padding: 0.25rem 0.55rem; border-radius: 0.4rem; font-weight: 700; font-size: 0.875rem; line-height: 1.32; background: #efedf4; color: #50495f; }
.status-reserved { background: #eae2fb; color: #57368e; }
.status-exception { background: #fff1d7; color: #744700; }
.status-sent { background: #e4f4eb; color: #175838; }
.status-canceled { background: #f4e8eb; color: #793b49; }

.detail-head { align-items: start; border-bottom: 1px solid #eeebf4; }
#detail-content { padding: 1rem 1.25rem 0; }
.order-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.65rem; margin-bottom: 1rem; }
.item-name { min-width: 0; font-size: 0.9375rem; line-height: 1.35; overflow-wrap: anywhere; }
.item-name span { display: block; margin-top: 0.1rem; font-size: 0.875rem; color: var(--muted); }
.item-quantity { color: #514561; white-space: nowrap; font-size: 0.9375rem; }
.point-block { display: grid; gap: 0.4rem; }
.point-block label { font-size: 0.875rem; font-weight: 730; }
.point-block p, .exception-note, .event-line { font-size: 0.875rem; line-height: 1.4; }
.point-block p { color: var(--muted); }
.exception-note { margin-bottom: 0.85rem; border-left: 3px solid #a77934; padding: 0.6rem 0.75rem; background: #fbf1e3; color: #6e460b; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 0.3rem 0.55rem; padding-block: 0.9rem; }
.button-cancel { padding-inline: 0.5rem; }
.order-history { border-top: 1px solid #eeebf4; }
.order-history summary, .behavior summary { cursor: pointer; color: var(--purple); font-size: 0.875rem; font-weight: 700; padding-block: 0.8rem; min-height: 2.75rem; }
.order-history ol { margin: 0 0 0.8rem; padding-inline-start: 1.35em; }
.order-history li { list-style: decimal; }
.event-line { color: var(--muted); padding-block: 0.18rem; }

.inventory { display: grid; grid-template-columns: 0.8fr 1fr 1fr; border-top: 1px solid var(--line); margin-top: 1rem; }
.inventory-title, .stock-point { padding: 1rem 1.25rem; }
.stock-point { border-inline-start: 1px solid var(--line); }
.stock-point h4 { font-size: 0.9375rem; line-height: 1.3; margin-bottom: 0.42rem; }
.stock-products { display: grid; gap: 0.3rem; }
.stock-product { display: flex; justify-content: space-between; gap: 0.4rem; font-size: 0.875rem; color: var(--muted); }
.stock-product strong { white-space: nowrap; color: #40315d; font-variant-numeric: tabular-nums; }
.behavior { margin-top: 0.75rem; color: var(--muted); }
.behavior ul { font-size: 0.9375rem; line-height: 1.5; margin: 0 0 1rem; padding-inline-start: 1.25rem; }
.behavior li { list-style: disc; }
.behavior li + li { margin-top: 0.4rem; }
.no-js { padding: 1rem; }

@media (max-width: 62rem) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .detail { border-inline-start: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 43.75rem) {
  .inventory { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-title { grid-column: 1 / -1; border-bottom: 1px solid #eeebf4; }
  .inventory-title + .stock-point { border-inline-start: 0; }
  .inventory-title, .stock-point { padding: 0.85rem 0.9rem; }
}

@media (max-width: 32rem) {
  .card-head { padding: 1rem 0.85rem 0.7rem; }
  .queue-tools { padding: 0 0.85rem 0.8rem; }
  .queue-feedback { margin-inline: 0.85rem; }
  .order-table { table-layout: fixed; }
  .order-table th:nth-child(1) { width: 24%; }
  .order-table th:nth-child(2) { width: 25%; }
  .order-table th:nth-child(3) { width: 18%; }
  .order-table th:nth-child(4) { width: 33%; }
  .order-table :is(td, th) { padding-inline: 0.23rem; overflow-wrap: anywhere; }
  .order-table :is(td, th):first-child { padding-left: 0.28rem; }
  .order-table :is(td, th):last-child { padding-right: 0.22rem; }
  .status { padding-inline: 0.26rem; }
  .channel { overflow-wrap: normal; }
  .point-name span { overflow-wrap: normal; }
  #detail-content { padding-inline: 0.85rem; }
  .inventory { grid-template-columns: minmax(0, 1fr); }
  .stock-point { border-inline-start: 0; }
  .stock-point + .stock-point { border-top: 1px solid #eeebf4; }
}

@media (max-width: 360px) {
  .order-table :is(td, th), .order-link, .status { font-size: .75rem; }
  .order-table th:nth-child(1) { width: 26.5%; }
  .order-table th:nth-child(2) { width: 25%; }
  .order-table th:nth-child(3) { width: 17.5%; }
  .order-table th:nth-child(4) { width: 31%; }
  .point-name span { display: none; }
  .card-head, .queue-tools, #detail-content { padding-inline: .5rem; }
}
