/* bcw-admin additions to the design's components.css (keep this small;
   design changes belong in design/components.css first). */

/* Components set display, which beats the hidden attribute; Stimulus
   controllers show and hide panels with it. */
[hidden] { display: none !important; }

/* A wrapper for a Stimulus controller that leaves the page's grid alone. */
.contents { display: contents; }

/* Choice rows that are links (Labels: pick the stock item), selected like
   the design's radio rows. */
a.choice-row { color: inherit; text-decoration: none; }
.choice-row.is-selected { background: var(--accent-tint); border-color: var(--accent); }

/* Search results and printings are links (Buy). */
.search__option a, a.printing { color: inherit; text-decoration: none; }

/* A table column that holds card names: never squeezed to a few letters
   (the table scrolls inside its frame instead). */
.table .col-card { min-width: 14rem; }

/* Scan-field suggestions: the note under the list (more matches, or none).
   It stays in view at the bottom while the list scrolls. */
.search__more {
  position: sticky; bottom: calc(-1 * var(--space-1)); margin-bottom: calc(-1 * var(--space-1));
  padding: var(--space-2) var(--space-3); font-size: var(--text-sm); color: var(--muted);
  background: var(--surface); border-top: 1px solid var(--border);
}

/* Card image, full size on click (zoom_controller.js). */
img[data-zoom-src] { cursor: zoom-in; }
:is(a, button, label, [role="option"]) img[data-zoom-src] { cursor: inherit; }
.zoom { padding: 0; border: 0; background: transparent; max-width: none; max-height: none; overflow: visible; cursor: zoom-out; }
.zoom:focus, .zoom:focus-visible { outline: none; }
.zoom::backdrop { background: rgb(0 0 0 / 0.72); }
.zoom__image { display: block; width: min(92vw, 64vh, 672px); aspect-ratio: 672 / 936; border-radius: 4.75% / 3.5%; background: var(--surface-sunken); box-shadow: var(--shadow-pop); }

/* Home's printer status opens the Printer Test; the Label dialog's printer line. */
.status-line__link { display: inline-flex; align-items: center; gap: var(--space-2); color: inherit; }
.printer-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--text-sm); }

/* Look Up's card header: the finishes the printing was made in, top right. */
.card-head:has(.card-head__printed) { grid-template-columns: auto minmax(0, 1fr) auto; }
.card-head__printed { display: grid; gap: var(--space-1); justify-items: end; }
@media (max-width: 700px) {
  .card-head:has(.card-head__printed) { grid-template-columns: auto minmax(0, 1fr); }
  .card-head__printed { grid-column: 2; justify-items: start; }
}

/* Item details: an ID with a copy button and an open-elsewhere link. */
.copyable code { overflow-wrap: anywhere; margin-right: var(--space-1); }
.icon-action { display: inline-grid; vertical-align: middle; place-items: center; width: 1.78rem; height: 1.78rem; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--accent); cursor: pointer; }
.icon-action:hover { background: var(--accent-tint); }
.icon-action:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.icon-action svg { width: 1rem; height: 1rem; }
.icon-action.is-copied { color: var(--ok); }

/* Item details: the item's history, scrolling inside the dialog. */
.details-history { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
.details-history .table-wrap { max-height: 18rem; overflow: auto; }

/* Current Inventory: the set finder is wider than the other filters. */
.filters__field.search { width: min(26rem, 100%); }

/* A button at the far end of a filter row (Current Inventory's All Sets). */
.filters__end { margin-left: auto; }

/* A warning flag after a name in a table cell (Current Inventory's sets). */
td > .line-card__flag { margin-left: var(--space-2); font-size: var(--text-sm); }

/* Needs Attention: the optional note over Mark Done, at a fixed width, so
   the details column (not the input) takes the row's spare room. The title
   links to the card in Look Up. */
.attention { grid-template-columns: auto minmax(0, 1fr) auto; }
/* The note box spans the buttons under it, and is at least 13rem wide. */
.attention__done { display: grid; grid-template-columns: minmax(13rem, max-content); gap: var(--space-2); }
.attention__done .input { width: 100%; }
.attention__buttons { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }
.attention__title a { color: inherit; }

/* An admin on a counter: the device name opens its sign-out dialog. */
.topbar__device--button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.topbar__device--button:hover { color: var(--on-navy); }

/* Price Review: the old and new price on one line, the change and market under them. */
.price-move { white-space: nowrap; }
.price-move__prices, .price-move .card-cell__meta { display: block; }
.table .col-why { min-width: 7rem; }
/* Approve over Reject, so the table fits without scrolling. */
.table--held .row-actions { flex-direction: column; align-items: flex-end; gap: var(--space-1); }
.table--held .col-card { min-width: 11rem; }

/* Admin → Background Jobs */
.table--jobs .col-job { min-width: 14rem; }
.table--jobs .col-state { white-space: nowrap; }
.error-text { color: var(--error); }
/* System Status: an error's full report, ready to copy and send (admin/jobs/_error). */
.error-summary { margin-right: var(--space-2); white-space: nowrap; }
.error-report {
  margin: 0; max-height: 50vh; overflow: auto; padding: var(--space-3);
  background: var(--surface-sunken); color: var(--text); border-radius: var(--radius-sm);
  font: var(--text-sm)/1.45 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere;
}
.button.is-copied .copy-label { display: none; }
.button.is-copied::after { content: "Copied"; }
.nowrap { white-space: nowrap; }
