/* Review Queue section (reviewQueue.js), at the bottom of the Customer
   Service tab.

   Self-contained on purpose, exactly like receipts.css: every rule the view
   needs is defined here with an rq- prefix and scoped under #cs-review-queue,
   so it borrows nothing from admin.css (whose .pill / .report* rules live
   under #panel-admin) and cannot leak into the rest of the CS page.

   Palette tokens come from styles.css; the three queue tints are declared on
   the section itself so the pills stay readable without pulling in the Admin
   tab's status-token block. */

/* The card keeps the 820px content column that the rest of the CS page uses:
   the ten-column table scrolls sideways inside .rq-scroll instead of widening
   the shell. */

#cs-review-queue {
  /* Queue tints (WCAG-AA text contrast on their own backgrounds). */
  --rq-cs-bg: #dbeafe; --rq-cs-ink: #1e40af; --rq-cs-line: #93c5fd;
  --rq-sup-bg: var(--warn-bg); --rq-sup-ink: var(--warn-ink); --rq-sup-line: #fcd34d;
  --rq-unk-bg: #eef2f7; --rq-unk-ink: #475569; --rq-unk-line: #cbd5e1;
}

/* ---------- shell ---------- */
#cs-review-queue .rq-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  /* Same vertical rhythm as the .block cards it follows on the CS page. */
  margin-top: 16px;
}
#cs-review-queue .rq-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
/* Reads as a section heading inside the CS page, not a page title: same size
   as the .block h3 headings above it. */
#cs-review-queue .rq-head h3 { font-size: 14px; margin: 0 0 2px; }
#cs-review-queue .rq-sub {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  max-width: 62ch;
}
#cs-review-queue .rq-status { color: var(--muted); margin: 16px 0; }

/* ---------- queue filters ---------- */
#cs-review-queue .rq-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 4px;
}
#cs-review-queue .rq-filter {
  appearance: none;
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
#cs-review-queue .rq-filter:hover { background: var(--bg); }
#cs-review-queue .rq-filter[aria-pressed="true"] {
  background: #eff6ff;
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
#cs-review-queue .rq-filter:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---------- table ---------- */
#cs-review-queue .rq-scroll {
  max-height: 62vh;
  /* Both axes: down the rows, and sideways across the ten columns, which are
     wider than the 820px content column. */
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
}
/* min-width holds the ten-column layout together; the table scrolls sideways
   inside .rq-scroll rather than squeezing every cell. */
#cs-review-queue .rq-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  font-size: 13.5px;
}
#cs-review-queue .rq-table th,
#cs-review-queue .rq-table td {
  border-bottom: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
#cs-review-queue .rq-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--line);
  white-space: nowrap;
}
#cs-review-queue .rq-table tbody tr:last-child td { border-bottom: 0; }

#cs-review-queue .rq-row { cursor: pointer; }
#cs-review-queue .rq-row:hover { background: var(--bg); }
#cs-review-queue .rq-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: var(--bg);
}

#cs-review-queue .rq-nowrap { white-space: nowrap; }
#cs-review-queue .rq-num,
#cs-review-queue .rq-sc { font-variant-numeric: tabular-nums; }
#cs-review-queue .rq-sc { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
#cs-review-queue .rq-by { font-weight: 600; }
#cs-review-queue .rq-contact { word-break: break-all; }
#cs-review-queue .rq-phone,
#cs-review-queue .rq-delivery {
  display: block;
  color: var(--muted);
  font-size: 12px;
  word-break: normal;
}
/* The excerpt is capped at 140 characters server-side; this keeps a long one
   from stretching the row. The full excerpt is on the cell's title. */
#cs-review-queue .rq-note {
  color: var(--muted);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#cs-review-queue .rq-empty { color: var(--muted); padding: 22px 8px; text-align: center; }
#cs-review-queue .rq-foot { margin: 10px 0 0; }

/* A fortnight without a decision is worth flagging, so the Waiting cell says
   so in words AND in colour, never colour alone. */
#cs-review-queue .rq-stale { color: var(--warn-ink); font-weight: 700; }

/* ---------- queue pills ---------- */
#cs-review-queue .rq-pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 2px 10px;
  border: 1px solid transparent;
  white-space: nowrap;
}
#cs-review-queue .rq-pill-cs {
  background: var(--rq-cs-bg); color: var(--rq-cs-ink); border-color: var(--rq-cs-line);
}
#cs-review-queue .rq-pill-support {
  background: var(--rq-sup-bg); color: var(--rq-sup-ink); border-color: var(--rq-sup-line);
}
#cs-review-queue .rq-pill-unknown {
  background: var(--rq-unk-bg); color: var(--rq-unk-ink); border-color: var(--rq-unk-line);
}
