/* The operator console (admin.html).  Loaded last, after theme.css and scene.css.

   Dense but clean: one cream sheet that holds the whole queue, one thin row per order with a fixed-width status
   badge so the columns line up, and an opened order that unfolds as a card inside its row. js/admin.js and
   app-admin.js build the rows and use these classes; this sheet only dresses them. */

.page-admin main { z-index: auto; }
.container.app-main { max-width: 1280px; padding-inline: clamp(16px, 3vw, 32px); padding-block: 28px 88px; }

.app-head { margin-bottom: 28px; align-items: center; }
.app-head h1 { font-size: clamp(2rem, 1.4rem + 2vw, 2.9rem); margin: 0 0 .15rem; }

/* messages outside a card need a solid ground (funnel.css makes the error wash see-through) */
.page-admin .form-msg { margin: 0 0 16px; }
.page-admin .form-msg.is-error { background: color-mix(in srgb, var(--flag) 9%, var(--cream-2)) !important; }

/* the line above the filters: a slip of paper, not loose text on the sky */
.adm-intro {
  background: var(--cream); border-radius: 12px; box-shadow: 5px 5px 0 var(--edge);
  padding: 14px 20px; margin: 0 0 20px !important; max-width: none; font: 500 var(--step--1)/1.5 var(--font-ui); color: var(--ink-dim);
}

/* ---------------------------------------------------------------- filters + the gang bar */
.adm-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 20px; }
.adm-filter { margin-bottom: 0; gap: 8px; padding: 10px; }
.adm-refresh { display: flex; align-items: center; gap: 12px; background: var(--cream); border-radius: 12px; box-shadow: 5px 5px 0 var(--edge); padding: 8px 10px 8px 16px; }
.adm-updated:empty { display: none; }
.adm-updated { font: 500 .875rem var(--font-ui); color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.adm-refresh .btn { min-height: 44px; }
.adm-filter button { min-height: 44px; padding: 7px 16px; font-size: .9375rem; }
.adm-gang {
  background: var(--cream); border-radius: 12px; box-shadow: 5px 5px 0 var(--edge); padding: 10px 16px; margin: 0 0 20px;
  gap: 10px 14px; font: 700 .9375rem var(--font-ui); color: var(--ink); align-items: center;
}
.adm-gang #adm-gang-sheet { width: auto; min-width: 12.5rem; min-height: 40px; padding-block: 6px; }
.adm-gang[hidden] { display: none; }

/* ---------------------------------------------------------------- the queue: one sheet, thin rows */
.adm-list {
  gap: 0; background: var(--cream); border-radius: 14px; box-shadow: 8px 8px 0 var(--edge);
  outline: 2px dashed rgb(var(--ink-rgb) / .2); outline-offset: -9px; padding: 14px 0;
}
.adm-list > p.card-sub { margin: 0; padding: 22px 28px; max-width: none; }
.adm-list > .skeleton-card { margin: 8px 24px; }

.adm-card {
  background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  padding: 0 !important; margin: 0 24px;
  border-bottom: 2px dotted rgb(var(--ink-rgb) / .25) !important;
}
.adm-card:last-child { border-bottom: 0 !important; }
.adm-row { gap: 10px 16px; min-height: 56px; padding: 8px 0; flex-wrap: nowrap; }
.adm-pick, .adm-pick-gap { flex: none; width: 22px; height: 22px; margin: 0; }
.adm-pick-gap { display: block; }
.adm-row > .ord-status { flex: 0 0 9.25rem; text-align: center; padding-inline: 8px; }
.adm-no { flex: 0 0 4.5rem; font: 700 .9375rem var(--font-mono, var(--font-ui)); color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.adm-list > .adm-more { align-self: center; margin: 14px auto 6px; display: block; }
.adm-to { flex: 1 1 auto; min-width: 0; font: 700 1rem/1.3 var(--font-ui); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-hold { flex: none; font: 700 .8125rem var(--font-ui); color: var(--terra-deep); background: var(--cream-2); border-radius: 6px; padding: 5px 8px; box-shadow: 2px 2px 0 var(--edge); }
.adm-date { flex: 0 0 5.5rem; font: 500 .9375rem var(--font-ui); color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.adm-row > .ord-price { flex: 0 0 4.2rem; text-align: right; font-size: 1.1rem; }
.adm-row .link-btn { flex: none; margin-left: 0; min-width: 3.4rem; text-align: right; }

/* an opened order lifts out of the list a little */
.adm-card:has(.adm-detail:not(.hidden)) { background: var(--cream-2) !important; margin-inline: 12px; padding-inline: 12px !important; border-radius: 10px !important; box-shadow: 3px 3px 0 var(--edge) !important; border: 2px solid rgb(var(--terra-rgb) / .45) !important; margin-block: 8px; }

/* ---------------------------------------------------------------- an opened order */
.adm-detail { border-top: 2px dotted rgb(var(--ink-rgb) / .25); margin: 4px 0 0; padding: 16px 0 14px; }
.adm-detail-grid { gap: 22px 36px; }
.adm-detail h4 { font: 700 .75rem/1.2 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); margin: 16px 0 4px; }
.adm-detail h4:first-child { margin-top: 0; }
.adm-detail p { font: 500 1rem/1.5 var(--font-ui); color: var(--ink); }
.adm-addr, .adm-note { font-family: var(--font-body) !important; font-size: 1.0625rem !important; line-height: 1.5; }
.adm-note { background: var(--cream); border: 2px dotted rgb(var(--ink-rgb) / .25); border-radius: 8px; padding: 10px 14px; color: var(--ink) !important; }
.adm-detail .kv { font: 500 .9375rem/1.5 var(--font-ui); }
.adm-detail .kv span { color: var(--ink-dim); }
.adm-detail .btn { margin: 4px 0 6px; }

.adm-files { gap: 0; margin-bottom: 10px; border: 2px dotted rgb(var(--ink-rgb) / .25); border-radius: 8px; background: var(--cream); }
.adm-files li { font: 500 .9375rem var(--font-ui); padding: 7px 12px; border-bottom: 2px dotted rgb(var(--ink-rgb) / .2); }
.adm-files li:last-child { border-bottom: 0; }
.adm-files a { color: var(--pen); font-weight: 700; }
.adm-files .is-muted { color: var(--ink-faint); }

.adm-actions { margin-top: 18px; padding-top: 16px; border-top: 2px dotted rgb(var(--ink-rgb) / .25); gap: 12px 22px; }
.adm-log { margin-top: 14px; font: 500 .9375rem var(--font-ui); }
.adm-log summary { color: var(--ink); min-height: 40px; display: flex; align-items: center; gap: 8px; }
.adm-log summary::before { content: ""; width: 0; height: 0; border-left: 7px solid var(--terra); border-block: 5px solid transparent; transition: transform .15s; }
.adm-log[open] summary::before { transform: rotate(90deg); }
.adm-log ul { color: var(--ink-dim); }
.adm-log code { font-size: .8125rem; background: var(--pen-wash); padding: 1px 6px; border-radius: 4px; color: var(--ink); }

/* ---------------------------------------------------------------- narrow screens: three short lines per order
   status, price and Open on the first; who it goes to on the second; date (and the hold note) on the third */
@media (max-width: 760px) {
  .adm-list { padding-block: 10px; outline-offset: -7px; }
  .adm-card { margin-inline: 16px; }
  .adm-row {
    display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; column-gap: 0; row-gap: 2px; align-items: center; padding: 12px 0 8px;
    grid-template-areas: "pick status price open" "no to to to" "date date date hold";
  }
  .adm-no { grid-area: no; margin-right: 10px; }
  .adm-pick { grid-area: pick; margin-right: 12px; }
  .adm-pick-gap { display: none; }
  .adm-row > .ord-status { grid-area: status; }
  .adm-row > .ord-price { grid-area: price; text-align: left; margin-left: 14px; }
  .adm-row .link-btn { grid-area: open; }
  .adm-to { grid-area: to; white-space: normal; padding: 4px 0 2px; }
  .adm-date { grid-area: date; }
  .adm-hold { grid-area: hold; justify-self: end; }
  .adm-card:has(.adm-detail:not(.hidden)) { margin-inline: 8px; padding-inline: 10px !important; }
  .adm-actions .btn { width: 100%; }
}
