@import url("./fbs-workspace.css");

/* The accepted workspace styles are in fbs-workspace.css.
   These rules adapt its links and existing server-rendered controls. */
:root { color: var(--shelf-text); background: var(--shelf-bg); }
[hidden] { display: none !important; }
html { min-width: 320px; }
body { min-height: 100vh; }
select { font: inherit; }
a { color: var(--shelf-green-strong); }
select:focus-visible, a:focus-visible { outline: 3px solid var(--shelf-purple); outline-offset: 2px; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }
.brand { min-width: 0; color: inherit; text-decoration: none; }
.brand-mark { flex: 0 0 auto; }
.header-actions, .identity { display: flex; align-items: center; gap: 12px; }
.identity { color: #cae0d1; font-size: 13px; }
.identity form { margin: 0; }
.header-link { min-height: 34px; padding: 6px 8px; border: 1px solid rgb(217 241 223 / 28%); border-radius: 8px; color: #f4fff7; background: transparent; }
.client-card { text-decoration: none; }
.client-navigation-progress { position: fixed; z-index: 100; inset: 72px 12px auto; margin: 0; padding: 10px 14px; border: 1px solid var(--shelf-border); border-radius: 10px; background: var(--shelf-surface); color: var(--shelf-text); }
.client-card strong, .client-card small { min-width: 0; overflow-wrap: anywhere; }
.stage-tabs a { min-height: 42px; padding: 9px 13px; border: 1px solid var(--shelf-border); border-radius: 10px; color: var(--shelf-muted); background: var(--shelf-surface); white-space: nowrap; font-weight: 700; text-decoration: none; }
.stage-tabs a[aria-current="page"] { color: var(--shelf-green-strong); border-color: var(--shelf-green); background: var(--shelf-green-soft); }
.workspace-view { min-width: 0; }
.product-image, .product-image-unavailable { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px; }
.product-image { object-fit: contain; background: var(--shelf-surface-soft); }
.product-image-unavailable { display: grid; place-content: center; text-align: center; color: var(--shelf-muted); background: var(--shelf-surface-soft); font-size: 9px; }
.shortage-action { margin-block-start: 12px; }
.shortage-action > summary { list-style: none; cursor: pointer; }
.shortage-action > summary::-webkit-details-marker { display: none; }
.shortage-action > summary:focus-visible { outline: 3px solid var(--shelf-purple); outline-offset: 2px; }
.pick-row:has([data-shortage][open]) .shortage-action { grid-column: 1 / -1; }
.shortage-action form { margin-top: 10px; padding: 13px; border: 1px solid var(--shelf-orange); border-radius: 10px; background: var(--shelf-surface-soft); }
.shortage-members { display: grid; gap: 7px; margin: 12px 0; }
.shortage-members label { grid-template-columns: 20px minmax(0, 1fr); align-items: center; min-height: 42px; font-weight: 400; }
.shortage-members input { width: 20px; height: 20px; }
.btn { text-decoration: none; }
.operational-panel { min-width: 0; padding: 13px; border-radius: 12px; background: var(--shelf-surface-soft); }
.operational-panel > h2 { margin: 0; font-size: 17px; }


label { display: grid; gap: 7px; font-weight: 650; }
input:not([type="checkbox"]),
select {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid #aebeb4;
  border-radius: 10px;
  color: var(--shelf-text);
  background: var(--shelf-surface);
}
input[type="checkbox"] { padding: 0; accent-color: var(--shelf-green); }
.muted { color: var(--shelf-muted); }

button.primary,
a.primary,
a.secondary {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border: 1px solid var(--shelf-border);
  border-radius: 10px;
  font-weight: 750;
  text-decoration: none;
}
button.primary,
a.primary { color: #fff; border-color: var(--shelf-green); background: var(--shelf-green); }
button.primary:hover,
a.primary:hover { background: var(--shelf-green-strong); }
a.secondary { color: var(--shelf-green-strong); background: var(--shelf-surface); }
.link-button { padding: 6px; border: 0; color: var(--shelf-green-strong); background: none; cursor: pointer; }

.order-row { min-width: 0; font-weight: 400; cursor: pointer; }
.order-row:has(input:checked) { border-color: var(--shelf-green); background: var(--shelf-green-soft); }
.order-row > input { min-height: 20px; }
.order-id, .product-copy, .order-state, .product { min-width: 0; }
.order-id strong, .product-copy strong, .order-state strong { overflow-wrap: anywhere; }
.order-id small, .product-copy small { overflow-wrap: anywhere; }
.product-copy p, .shortage-members span { min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 821px) {
  .order-row { grid-template-columns: 28px minmax(0, .75fr) minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, .9fr); }
}
.order-kind { font-size: 13px; }
.bulk-bar strong { display: block; }
.command-panel:empty { display: none; }
.command-panel .empty-state { margin: 0; }
.queue-empty .secondary { width: fit-content; margin: 10px auto 0; }
.search-empty[hidden] { display: none; }


.receipt { min-width: 0; border-left: 4px solid var(--shelf-green); padding-left: 16px; }
.scan-card { min-width: 0; padding: 13px; border-radius: 12px; background: var(--shelf-surface-soft); }
.scan-card h3 { margin: 0; }
.scan-card dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 12px; margin: 12px 0; font-size: 13px; }
.scan-card dt { color: var(--shelf-muted); }
.scan-card dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.receipt h3,
.scan-card h3,
.scan-card .eyebrow { overflow-wrap: anywhere; }
.receipt-state { margin: 6px 0 0; color: var(--shelf-green-strong); }
.receipt-support { margin: 10px 0 0; font-size: 13px; }
.receipt[data-receipt-state="REJECTED"] { border-color: var(--shelf-red); }
.receipt[data-receipt-state="REJECTED"] .receipt-state { color: var(--shelf-red); }
.receipt[data-receipt-state="RESULT_UNKNOWN"],
.receipt[data-receipt-state="PARTIAL_CONFIRMED"] { border-color: var(--shelf-orange); }
.receipt[data-receipt-state="RESULT_UNKNOWN"] .receipt-state,
.receipt[data-receipt-state="PARTIAL_CONFIRMED"] .receipt-state { color: var(--shelf-orange); }

.alert { display: grid; gap: 5px; padding: 13px 15px; border-radius: 10px; margin: 12px 0; }
.alert.error { color: var(--shelf-red); border: 1px solid #efc1c1; background: #fff0f0; }
.alert.warning { color: var(--shelf-orange); border: 1px solid #efd99e; background: #fff7df; }
.success-line { color: var(--shelf-green-strong); font-weight: 750; }

.scan-layout > * { min-width: 0; }
.scan-panel[data-scan-mode="KIZ"] > form[hx-post="/app/scans/product"] { display: none; }
.scan-panel .scan-message.alert.warning { margin: 7px 0; padding: 8px 10px; font-size: 13px; line-height: 1.25; }
.scan-panel form:not(.scan-form) { display: grid; gap: 14px; }
.scan-panel .muted { margin: 0; }
.scan-result { margin-top: 22px; }
.order-card-panel .scan-result { margin-top: 12px; }

.order-card-panel .empty-state { min-height: 0; margin-bottom: 0; text-align: left; }
.supply-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.supply-grid.control-list { grid-template-columns: 1fr; gap: 8px; }
.control-item > div { min-width: 0; overflow-wrap: anywhere; }
.control-actions .alert { margin: 0; padding: 0; border: 0; background: transparent; }
.control-actions time { color: var(--shelf-muted); font-size: 12px; }
.supply-grid > .pagination, .supply-grid > [data-supply-history-count] { grid-column: 1 / -1; }
.supply-grid[data-ready-supplies] > .empty-state { min-height: 0; margin-top: 0; place-content: start; text-align: left; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.pagination button { min-height: 42px; padding: 9px 13px; border: 1px solid var(--shelf-border); border-radius: 10px; color: var(--shelf-text); background: var(--shelf-surface); }
.supply-card { min-width: 0; padding: 16px; border: 1px solid var(--shelf-border); border-radius: 12px; background: var(--shelf-surface-soft); }
.supply-card li { overflow-wrap: anywhere; }
.supply-order-ref { color: var(--shelf-muted); font-size: 13px; }
.supply-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.supply-title h2 { min-width: 0; margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.state-pill { display: inline-flex; flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: #dfe9e2; font-size: 12px; font-weight: 800; }
.supply-card [data-supply-qr] { margin: 0; flex: 0 0 151px; }
.supply-card [data-supply-qr] img { display: block; width: 151px; max-width: 100%; height: auto; }
.supply-card .qr-card { align-items: center; flex-wrap: wrap; padding: 14px; margin-top: 14px; }
.supply-card .qr-card > div { flex: 1 1 180px; min-width: 0; }
.supply-card .qr-card .btn { display: inline-flex; align-items: center; margin-top: 8px; }
.control-item p { margin: 6px 0 0; font-size: 13px; }
.control-actions { align-items: flex-end; }
.control-actions form { margin-top: 8px; }
.supply-close-form { display: grid; gap: 10px; }
.supply-close-form > .primary { justify-self: start; }
.supply-close-confirmation {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--shelf-orange);
  border-radius: 10px;
  background: var(--shelf-surface-soft);
}
.supply-close-confirmation p { margin: 0; line-height: 1.45; }
.supply-close-confirmation [role="alert"] { color: var(--shelf-text); }
.supply-close-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.supply-close-actions button {
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid var(--shelf-border);
  border-radius: 10px;
  font-weight: 750;
}
.supply-close-actions .secondary { color: var(--shelf-green-strong); background: var(--shelf-surface); }
.page-shell { width: min(760px, calc(100% - 36px)); margin: 0 auto; padding: 40px 0 72px; }
.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-card { display: grid; width: min(430px, 100%); gap: 18px; padding: 34px; border: 1px solid var(--shelf-border); border-radius: 24px; background: var(--shelf-surface); box-shadow: 0 24px 70px rgb(20 60 39 / 12%); }
.login-card h1 { margin: 0; font-size: 42px; }
.login-card p { margin: 0; }
.login-card .eyebrow { text-transform: none; }

.system-print-page { max-width: 760px; margin: 0 auto; }
.system-print-page h1 { margin: 8px 0 12px; font-size: clamp(28px, 5vw, 42px); }
.print-document-frame { margin: 1.5rem 0; padding: 1rem; overflow: auto; border: 1px solid #cfd8d2; border-radius: 12px; background: #fff; }
.print-document-frame img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.print-boundary { color: #52615a; font-size: .9rem; }

.supply-card { display: block; margin-top: 0; }
.ready-deliveries { grid-template-columns: 1fr; gap: 0; }
.ready-delivery.supply-card { display: flex; padding: 16px; margin-top: 16px; border-color: #9bc2ff; background: #eef6ff; }
.ready-delivery:has([data-supply-close-confirmation]:not([hidden])) { align-items: stretch; flex-direction: column; }
.ready-delivery .supply-close-form { flex: 0 0 auto; }
.ready-delivery .supply-close-confirmation { width: 100%; }

.mobile-stage-nav a { display: grid; place-content: center; color: var(--shelf-muted); text-align: center; text-decoration: none; }
.mobile-stage-nav a[aria-current="page"] { color: var(--shelf-green-strong); background: var(--shelf-green-soft); }
@media (max-width: 820px) {
  .ready-delivery.supply-card { align-items: stretch; flex-direction: column; }
  .pick-row .shortage-action { grid-column: 1 / -1; }
  .shortage-action > summary { text-align: center; }
  .identity > span { display: none; }
  .bulk-bar .primary { width: 100%; }
  .supply-close-form > .primary, .supply-close-actions button { width: 100%; }
  .supply-close-actions { display: grid; }
  .supply-title { align-items: stretch; flex-direction: column; }
  .supply-title .state-pill { align-self: flex-start; }
}
@media (max-width: 430px) {
  .header-actions { gap: 5px; }
  .header-link { min-height: 32px; padding: 5px 6px; font-size: 12px; }
  .login-card { padding: 24px; }
}


/* A picking sheet uses ordinary paper; only persisted labels use 58 x 40 mm. */
.picking-print-page h1 { margin: 0 0 6px; font-size: 25px; }
.picking-print-page .section-head { align-items: flex-start; }
.picking-print-table-wrap { overflow-x: auto; }
.picking-print-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 13px; }
.picking-print-table th, .picking-print-table td { padding: 10px 8px; border-bottom: 1px solid var(--shelf-border); text-align: left; vertical-align: top; }
.picking-print-table th { color: var(--shelf-muted); font-weight: 700; }
.picking-print-table small { display: block; margin-top: 4px; color: var(--shelf-muted); }
.picking-print-quantity { font-weight: 800; }
@page { size: A4; margin: 12mm; }
@page picking-sheet {
  size: A4; margin: 12mm;
  @bottom-right { content: counter(page) " / " counter(pages); font: 8pt sans-serif; color: #666; }
}
@page order-label { size: 58mm 40mm; margin: 0; }
body[data-screen="picking-print"] { page: picking-sheet; }
body[data-screen="system-print"] { page: order-label; }
@media print {
  :root { color-scheme: light; color: #000; background: #fff; }
  html, body { min-width: 0; min-height: 0; margin: 0; padding: 0; color: #000; background: #fff; }
  .app-header, .mobile-stage-nav, .picking-print-actions,
  body[data-screen="system-print"] .system-print-page > :not(.print-document-frame) { display: none !important; }
  body[data-screen="system-print"],
  body[data-screen="system-print"] .page-shell,
  .system-print-page, .print-document-frame {
    width: 58mm; height: 40mm; max-width: none; min-height: 0; margin: 0; padding: 0;
    border: 0; border-radius: 0; overflow: hidden; background: #fff;
  }
  .print-document-frame img { display: block; width: 58mm; height: 40mm; max-width: none; margin: 0; }
  body[data-screen="picking-print"] .page-shell { width: auto; max-width: none; margin: 0; padding: 0; }
  body[data-screen="picking-print"] .fbs-app { min-height: 0; }
  .picking-print-page { color: #000; font-size: 10pt; }
  .picking-print-page h1 { font-size: 18pt; }
  .picking-print-page .section-head { margin-bottom: 6mm; }
  .picking-print-page .section-head p { color: #333; }
  .picking-print-table-wrap { overflow: visible; }
  .picking-print-table { min-width: 0; table-layout: fixed; font-size: 10pt; }
  .picking-print-table thead { display: table-header-group; }
  .picking-print-table tr { break-inside: avoid; }
  .picking-print-table th, .picking-print-table td { padding: 3mm 2mm; border-color: #bbb; overflow-wrap: anywhere; }
  .picking-print-table th:nth-child(1) { width: 28%; }
  .picking-print-table th:nth-child(2) { width: 18%; }
  .picking-print-table th:nth-child(3) { width: 22%; }
  .picking-print-table th:nth-child(4) { width: 9%; }
  .picking-print-table th:nth-child(5) { width: 23%; }
  .picking-print-table th, .picking-print-table small { color: #333; }
}

.workspace-print-frame { position: fixed; left: -10000px; top: 0; width: 800px; height: 1000px; border: 0; }

.order-print-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.order-selection-toolbar { position: sticky; top: 8px; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; padding: 8px 0; background: var(--shelf-surface); }
.order-selection-toolbar .pagination { margin: 0; }
.order-selection-toolbar .bulk-bar { flex: 1 0 260px; flex-direction: row; align-items: center; margin: 0; padding: 8px 12px; }
.order-selection-toolbar .primary { width: auto; white-space: nowrap; }
[data-order-selection] .order-row { scroll-margin-top: 140px; }

.label-readiness { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 12px 0; padding: 12px; border-radius: 10px; background: var(--shelf-surface-soft); }
.scan-progress > .label-readiness { grid-column: 1 / -1; margin: 0; }

.supply-card [data-transfer-reprint] { display: inline-block; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

.member-label-status { display: grid; gap: 8px; padding: 0; margin: 8px 0 0; list-style: none; font-size: 13px; }
.member-label-status li { min-width: 0; overflow-wrap: anywhere; }
.member-label-status form { margin-top: 5px; }

/* Compact operational views follow the approved sheet mock. */
#orders-panel .section-head .bulk-bar { margin: 0; padding: 0; background: transparent; flex: 0 0 auto; }
#orders-panel .bulk-bar strong { font-weight: 400; }
#orders-panel .search-row { margin: 10px 0; }
#orders-panel .search-row input { min-height: 36px; padding: 7px 10px; font-size: 13px; }
#orders-panel .order-selection-toolbar:empty { display: none; }
#orders-panel .order-row { grid-template-columns: 26px minmax(110px, .7fr) minmax(180px, 1.4fr) auto; gap: 12px; padding: 12px; }
#orders-panel .order-state { grid-column: 3 / -1; }
#orders-panel .order-row .product-image-unavailable { display: none; }
.workspace-view .supply-grid { grid-template-columns: 1fr; gap: 9px; }
.workspace-view .supply-card:not(.ready-delivery) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 12px; background: var(--shelf-surface); }
.workspace-view .supply-card > .supply-title, .workspace-view .supply-card > p { grid-column: 1; }
.workspace-view .supply-card .supply-title { display: block; }
.workspace-view .supply-card .supply-title h2 { margin: 0 0 6px; font-size: 18px; }
.workspace-view .supply-card .supply-title .state-pill { display: none; }
.workspace-view .supply-card .supply-composition { grid-column: 1 / -1; grid-row: 4; padding-top: 9px; margin-top: 9px; }
.workspace-view .supply-composition h3 { margin: 0; font-size: 13px; }
.workspace-view .supply-members { grid-column: 1 / -1; color: var(--shelf-muted); font-size: 12px; }
.workspace-view .supply-card .qr-card { grid-column: 2; grid-row: 1 / span 3; padding: 0; margin: 0; flex-wrap: nowrap; background: transparent; }
.workspace-view .supply-card .qr-card > div { flex: 0 1 auto; }
.workspace-view .supply-card .qr-card > div > strong, .workspace-view .supply-card .qr-card > div > p { display: none; }
.workspace-view .supply-card [data-supply-qr] { flex: 0 0 110px; }
.workspace-view .supply-card [data-supply-qr] img { width: 110px; height: 86px; object-fit: contain; }
.workspace-view .supply-card .qr-card .btn { margin: 0; }
.workspace-view .ready-delivery.supply-card { background: var(--shelf-green-soft); border-color: var(--shelf-border); }
.delivery-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 18px; }
.delivery-filters .btn { min-height: 38px; padding: 8px 12px; font-size: 13px; text-decoration: none; }
.delivery-filters .btn[aria-current="true"] { color: var(--shelf-green-strong); border-color: var(--shelf-green); background: var(--shelf-green-soft); }
.workspace-view .supply-card.delivery-row { display: block; padding: 0; overflow: clip; }
.delivery-summary { display: grid; grid-template-columns: minmax(170px, 1.1fr) minmax(150px, .8fr) minmax(190px, 1fr); align-items: center; gap: 12px 18px; padding: 15px 16px; list-style: none; }
.delivery-summary::-webkit-details-marker { display: none; }
.delivery-identity { display: block; min-width: 0; }
.delivery-name { display: block; font-size: 16px; overflow-wrap: anywhere; }
.delivery-identity small { display: block; margin-top: 5px; }
.delivery-state { justify-self: start; padding: 5px 8px; color: var(--shelf-green-strong); border-radius: 6px; background: var(--shelf-green-soft); font-size: 13px; }
.delivery-state small { display: block; margin-top: 3px; color: var(--shelf-muted); font-size: 11px; }
.delivery-details { min-width: 0; }
.delivery-progress { color: var(--shelf-green-strong); font-size: 13px; line-height: 1.5; text-decoration: underline; text-underline-offset: 3px; }
.delivery-progress span { color: var(--shelf-muted); white-space: nowrap; }
.delivery-progress::after { content: "⌄"; margin-left: 5px; color: var(--shelf-muted); text-decoration: none; }
.delivery-details[open] .delivery-progress::after { content: "⌃"; }
.delivery-detail { padding: 15px 16px 17px; border-top: 1px solid var(--shelf-border); }
.delivery-freshness { padding: 10px 12px; margin: 0 0 12px; border-radius: 8px; background: var(--shelf-bg); font-size: 12px; }
.delivery-freshness.warning { color: var(--shelf-orange); background: #fff7df; }
.delivery-pending h3 { margin: 12px 0 8px; font-size: 14px; }
.delivery-pending ul { display: grid; max-height: 420px; gap: 6px; padding: 0; margin: 0; overflow: auto; list-style: none; }
.delivery-pending li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 8px; background: var(--shelf-bg); font-size: 13px; }
.delivery-pending li span { color: var(--shelf-muted); font-size: 12px; text-align: right; }
.delivery-cancelled { color: var(--shelf-muted); font-size: 13px; }
.delivery-composition, .delivery-qr { margin-top: 14px; }
.delivery-composition > summary, .delivery-qr > summary { width: fit-content; min-height: 36px; color: var(--shelf-green-strong); font-size: 13px; }
.delivery-composition ul { margin-bottom: 0; }
.delivery-row .qr-card { margin-top: 8px; }
@media(max-width:820px) {
  #orders-panel .order-row { grid-template-columns: 24px minmax(0,1fr); }
  #orders-panel .order-row .product { grid-column: 2; }
  #orders-panel .order-row .order-kind, #orders-panel .order-state { grid-column: 2; }
  #orders-panel .order-row .order-kind:empty { display:none; }
  #orders-panel .section-head .bulk-bar { align-self: stretch; }
  .workspace-view .supply-card:not(.ready-delivery) { grid-template-columns: 1fr; }
  .workspace-view .supply-card .qr-card { grid-column: 1; grid-row: auto; flex-wrap: wrap; }
  .workspace-view .supply-card .supply-composition { grid-row: auto; }
  .delivery-filters { gap: 5px; margin: 10px 0 14px; }
  .delivery-filters .btn { min-height: 36px; padding: 7px 9px; font-size: 12px; }
  .delivery-summary { grid-template-columns: 1fr; gap: 7px; padding: 13px; }
  .delivery-state { grid-column: 1; }
  .delivery-details { grid-column: 1; }
  .delivery-pending li { align-items: flex-start; }
}
@media(max-width:820px) {
  .client-sidebar .client-card { min-height: 54px; padding: 4px; border: 0; background: transparent; }
  .client-sidebar .client-card.is-active { border: 0; }
}
.pick-row > .member-label-status { grid-column: 1 / -1; margin: 0; }
.is-external-changed { border-color: #dfbd83; background: #fffaf0; }
.is-external-changed .state-pill { color: #6d4b18; background: #f9e6bd; }
.pick-row.is-external-changed > .external-progress-status { grid-column: 2 / -1; display: grid; gap: 4px; justify-items: end; text-align: right; }
.ready-order-row.is-external-changed > [data-poll-live] { grid-column: 3 / -1; display: grid; gap: 4px; justify-items: end; text-align: right; }
.external-progress-time { grid-column: 1 / -1; color: var(--shelf-muted); }
.is-external-changed time { font-size: 12px; color: var(--shelf-muted); }
.external-progress-more { grid-column: 1 / -1; margin: 8px 0; font-size: 13px; color: var(--shelf-muted); }
[data-external-progress-notice] { overflow-wrap: anywhere; }
@media(max-width:700px) {
  .pick-row.is-external-changed > .external-progress-status,
  .ready-order-row.is-external-changed > [data-poll-live] { grid-column: 1 / -1; justify-items: start; text-align: left; }
}
@media(max-width:820px) {
  .workspace-view .supply-card .qr-card { grid-row: 4; }
  .workspace-view .supply-card .supply-composition { grid-row: 5; }
  .workspace-view .supply-card .supply-members { grid-row: 6; }
}
.completed-order-row { display: grid; grid-template-columns: minmax(110px,.65fr) minmax(0,1.35fr) auto auto; }
.order-quantity .quantity { color: var(--shelf-green-strong); font-size: 15px; }
.order-quantity small { display: block; margin-top: 3px; }
@media(max-width:820px) {
  .completed-order-row { grid-template-columns: 1fr auto; }
  .completed-order-row .product-copy { grid-column: 1 / -1; grid-row: 2; }
  #orders-panel .order-quantity { grid-column: 2; }
}

.client-add { display:block; margin-top:12px; text-align:center; }
.mobile-client-choice { display:none; }
.client-management { max-width:860px; }
.client-management h1 { margin:0; font-size:24px; }
.client-connect-form { display:grid; gap:10px; max-width:520px; padding:18px; border:1px solid var(--shelf-border); border-radius:12px; background:var(--shelf-surface-soft); }
.client-connect-form h2,.client-connection h2 { margin:0; font-size:17px; }
.client-connect-form p { margin:0; font-size:12px; line-height:1.5; }
.client-connect-form .primary { justify-self:start; }
.client-connection { margin-top:18px; padding:16px; border:1px solid var(--shelf-border); border-radius:12px; }
.client-connection .section-head { margin-bottom:10px; }
.client-connection-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.client-connection-attempt { background:var(--shelf-surface-soft); }
.client-connection-attempt > p { margin:0; }
.client-archive-confirm { margin-top:14px; font-size:13px; }
.client-archive-confirm summary,.archived-clients summary { cursor:pointer; color:var(--shelf-muted); }
.client-archive-confirm p { line-height:1.5; }
.archived-clients { margin-top:22px; font-size:13px; }
.warehouse-settings { max-width:860px; }
.warehouse-settings h1 { margin:0; font-size:24px; overflow-wrap:anywhere; }
.warehouse-settings-heading { align-items:flex-start; }
.warehouse-settings-heading p { margin-bottom:0; }
.warehouse-refresh-form { margin:14px 0; }
.warehouse-list { display:grid; gap:10px; margin:14px 0; }
.warehouse-selection-summary { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px 16px; padding:12px 14px; border-radius:10px; background:var(--shelf-surface-soft); }
.warehouse-option { grid-template-columns:24px minmax(0,1fr); align-items:start; min-height:64px; padding:14px; border:1px solid var(--shelf-border); border-radius:12px; cursor:pointer; }
.warehouse-option:has(input:checked) { border-color:var(--shelf-green); background:var(--shelf-green-soft); }
.warehouse-option > input { width:20px; height:20px; margin-top:2px; }
.warehouse-option-copy { min-width:0; }
.warehouse-option-copy strong,.warehouse-option-copy small { display:block; overflow-wrap:anywhere; }
.warehouse-option-copy small { margin-top:4px; color:var(--shelf-muted); font-weight:400; }
.warehouse-option.is-unavailable { border-style:dashed; }
.warehouse-option-copy .warehouse-unavailable { color:var(--shelf-orange); }
.warehouse-selection-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; }
@media(max-width:820px) {
  .client-add { margin-top:8px; }
  .mobile-client-choice { display:block; margin-top:10px; font-size:13px; }
  .mobile-client-choice summary { padding:8px 0; cursor:pointer; color:var(--shelf-green-strong); }
  .mobile-client-choice a { display:block; padding:10px; overflow-wrap:anywhere; }
  .mobile-client-choice a[aria-current] { background:var(--shelf-green-soft); border-radius:8px; }
  .client-connect-form { padding:14px; }
  .client-connect-form .primary { width:100%; }
  .client-connection .section-head,.warehouse-settings-heading { align-items:stretch; }
  .client-connection-actions { justify-content:stretch; }
  .client-connection-actions > *,.warehouse-settings-heading > .secondary,.warehouse-selection-actions .primary { width:100%; }
  .warehouse-option { padding:12px; }
}
