/* 24staged operator console - styled to the marketing design system
   (warm paper, ink type, single clay accent, Geist). Brand-consistent with
   24staged.com so the internal tool feels like part of the same product. */

:root {
  --paper: #faf9f5;
  --paper-2: #f3f1ea;
  --paper-3: #efece3;
  --ink: #16140f;
  --ink-2: #3a362e;
  --stone: #6f6a5f;
  --stone-2: #a8a299;
  --line: #e4e0d6;
  --line-2: #d6d1c4;
  --clay: #c75b39;
  --clay-dark: #a8462a;
  --clay-tint: #f6e7e0;

  /* semantic status tints (soft bg + readable fg) */
  --ok-fg: #1f7a4d;     --ok-bg: #e6f3ec;
  --warn-fg: #9a6a00;   --warn-bg: #f8eecf;
  --bad-fg: #b23b2e;    --bad-bg: #f6e3df;
  --info-fg: #3a362e;   --info-bg: #eceae2;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 2px rgba(22,20,15,0.04), 0 8px 24px -16px rgba(22,20,15,0.18);
  --shadow-pop: 0 10px 30px -12px rgba(22,20,15,0.28);
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(1200px 600px at 100% -10%, rgba(199,91,57,0.05), transparent 60%);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--clay-dark); text-decoration: none; }
a:hover { color: var(--clay); }

/* ---------- header ---------- */
header.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(250,249,245,0.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: baseline; gap: 1px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand .b-24 { font-family: var(--font-mono); font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.brand .b-staged { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.brand .b-dot { width: 6px; height: 6px; border-radius: 99px; background: var(--clay); margin-left: 3px; transform: translateY(-2px); }
.brand .b-sep { color: var(--line-2); margin: 0 10px; font-weight: 300; }
.brand .b-sub { font-size: 13px; color: var(--stone); font-weight: 500; }
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 99px;
}

main { max-width: 1120px; margin: 28px auto 64px; padding: 0 28px; }

/* ---------- breadcrumb / back ---------- */
.back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--stone); margin-bottom: 18px;
}
.back:hover { color: var(--ink); }

/* ---------- cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-card);
}
.card.flush { padding: 0; overflow: hidden; }

h1, h2, h3 { margin: 0 0 14px; letter-spacing: -0.02em; color: var(--ink); }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay-dark);
  margin: 0 0 8px;
}
.muted { color: var(--stone); }
.hint { color: var(--stone); font-size: 13px; line-height: 1.6; }
.hint b { color: var(--ink-2); font-weight: 600; }

code {
  font-family: var(--font-mono);
  background: var(--paper-2);
  color: var(--ink-2);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 12.5px;
  border: 1px solid var(--line);
}

/* ---------- stat strip ---------- */
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.stat {
  flex: 1 1 0;
  min-width: 120px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
}
.stat .n { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.stat .k { font-size: 12px; color: var(--stone); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.stat.accent .n { color: var(--clay); }

/* ---------- forms ---------- */
.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
}
input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  background: var(--paper);
  border: 1px solid var(--line-2);
  color: var(--ink);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  min-width: 170px;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--stone-2); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--clay);
  box-shadow: 0 0 0 3px var(--clay-tint);
}
input[readonly] { background: var(--paper-2); color: var(--ink-2); }

/* ---------- buttons ---------- */
button, .btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-2);
  padding: 9px 16px;
  border-radius: 99px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .18s ease;
  white-space: nowrap;
}
button:hover, .btn:hover { border-color: rgba(22,20,15,0.4); background: var(--paper-2); transform: translateY(-1px); }
button.primary {
  background: var(--clay); border-color: var(--clay); color: #fff;
  box-shadow: 0 10px 24px -12px rgba(199,91,57,0.8);
}
button.primary:hover { background: var(--clay-dark); border-color: var(--clay-dark); }
button.ink { background: var(--ink); border-color: var(--ink); color: var(--paper); }
button.ink:hover { background: var(--ink-2); border-color: var(--ink-2); }
button.danger { color: var(--bad-fg); border-color: var(--line-2); }
button.danger:hover { color: #fff; background: var(--bad-fg); border-color: var(--bad-fg); }
button.small, .btn.small { font-size: 13px; padding: 6px 12px; }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.actions form { margin: 0; }

/* ---------- status pills ---------- */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
  padding: 4px 11px; border-radius: 99px;
  text-transform: capitalize;
  background: var(--info-bg); color: var(--info-fg);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; opacity: .75; }
.status-delivered { background: var(--clay-tint); color: var(--clay-dark); }
.status-approved, .qc-approved { background: var(--ok-bg); color: var(--ok-fg); }
.status-qc_pending, .qc-pending, .status-generated { background: var(--warn-bg); color: var(--warn-fg); }
.status-flagged, .qc-flagged, .qc-rejected { background: var(--bad-bg); color: var(--bad-fg); }
.status-received { background: var(--info-bg); color: var(--stone); }
.status-awaiting_payment { background: var(--warn-bg); color: var(--warn-fg); }

/* ---------- orders table ---------- */
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--stone);
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--paper-2); }
tbody tr:last-child td { border-bottom: none; }
td .sub { color: var(--stone); font-size: 12.5px; }
.row-link td { cursor: pointer; }

/* ---------- QC image pair ---------- */
.qc-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.qc-head code { font-size: 12px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
figure { margin: 0; }
figcaption {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--stone); margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.pair img {
  width: 100%; border-radius: 12px; border: 1px solid var(--line);
  background: var(--paper-2); display: block;
}
.placeholder {
  display: flex; align-items: center; justify-content: center; min-height: 220px;
  border: 1px dashed var(--line-2); border-radius: 12px; color: var(--stone-2);
  background: var(--paper-2); font-size: 13px;
}
.flag { color: var(--bad-fg); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.critique { color: var(--stone); font-size: 13px; font-style: italic; }

/* ---------- reveal & embed panel ---------- */
.reveal { border-color: var(--line-2); background: linear-gradient(180deg, #fff, var(--paper)); }
.reveal .field { margin-top: 14px; }
.reveal label { margin-bottom: 8px; }
.reveal input, .reveal textarea { width: 100%; min-width: 0; }
.reveal textarea { font-family: var(--font-mono); font-size: 12px; line-height: 1.5; resize: vertical; }
.copy-row { display: flex; gap: 10px; align-items: stretch; }
.copy-row input { flex: 1; }
.preview-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 13px; }

/* ---------- audit timeline ---------- */
.audit { list-style: none; padding: 0; margin: 0; }
.audit li {
  position: relative; padding: 8px 0 8px 22px; font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.audit li:last-child { border-bottom: none; }
.audit li::before {
  content: ""; position: absolute; left: 4px; top: 14px;
  width: 7px; height: 7px; border-radius: 99px; background: var(--clay); opacity: .7;
}
.audit .when { color: var(--stone-2); font-family: var(--font-mono); font-size: 11px; }
.audit .what { font-weight: 600; color: var(--ink-2); }
.audit .who { color: var(--stone); }

/* ---------- toast for copy ---------- */
.copied { color: var(--ok-fg) !important; border-color: var(--ok-fg) !important; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  main { padding: 0 18px; margin-top: 20px; }
  header.topbar { padding: 12px 18px; }
  .brand .b-sub, .brand .b-sep { display: none; }
  .pair { grid-template-columns: 1fr; }
  .row { gap: 12px; }
  input, select, textarea { min-width: 0; width: 100%; }
  label { width: 100%; }
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tbody td { border: none; padding: 4px 16px; }
  tbody tr { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; padding: 10px 0; }
}
