/* SR Customer Portal — the same editorial paper language as the staff platform.
 *
 * Tokens are declared HERE and nowhere else. On the staff platform 171 var()
 * calls pointed at tokens that had never been defined and silently rendered
 * their fallbacks — an entire second palette that nobody could see was wrong.
 * Every custom property this file uses is defined in this block. */
:root {
  --paper: #f4efe3;
  --paper-2: #efe9db;
  --panel: #fffaf0;
  --ink: #14130f;
  --ink-2: #3a352b;
  --muted: #6e685b;
  --faint: #a8a294;
  --line: rgba(20, 19, 15, 0.12);
  --line-strong: rgba(20, 19, 15, 0.2);
  --brass: #8b6f2a;
  --brass-tint: rgba(139, 111, 42, 0.08);
  --ok: #4f7a3f;
  --ok-tint: rgba(79, 122, 63, 0.12);
  --warn: #a5762a;
  --warn-tint: rgba(165, 118, 42, 0.12);
  --danger: #9a3b2f;
  --danger-tint: rgba(154, 59, 47, 0.1);
  --font-ui: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --radius: 9px;
  --radius-lg: 13px;
}

* { box-sizing: border-box; min-width: 0; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-ui); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brass); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 28px 20px 64px; }
.eyebrow {
  font-size: 10.5px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint);
}
h1 { font-family: var(--font-display); font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); margin: 4px 0 6px; }
h2 { font-family: var(--font-display); font-size: 1.2rem; margin: 0 0 10px; }
.lead { color: var(--muted); margin: 0 0 18px; }
.rule { height: 1px; background: var(--line); border: 0; margin: 18px 0; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px; margin-bottom: 14px;
}

.btn {
  appearance: none; border: 1px solid var(--ink); background: var(--ink);
  color: var(--paper); border-radius: 999px; padding: 11px 20px;
  font: inherit; font-weight: 600; cursor: pointer;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }

/* ---- The stage / approval list ----------------------------------------
 *
 * Used by BOTH the 14 manufacturing stages and the 7 approval groups. They
 * are the same shape — a numbered sequence with one current position — so
 * they share one set of rules rather than drifting into two looks.
 *
 * Mobile first (Brian is phone-primary): the row wraps by default and only
 * goes single-line on a wide screen. No max-width override anywhere. */
.stages { list-style: none; margin: 14px 0 0; padding: 0; }
.stage {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px;
  padding: 11px 0; border-top: 1px solid var(--line);
  min-height: 44px;                      /* touch target, measured not assumed */
}
.stage:first-child { border-top: none; }
.stage-n {
  flex: none; width: 26px; height: 26px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--paper-2); color: var(--muted); border: 1px solid var(--line);
}
.stage-t { font-weight: 600; }
.stage-act { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.stage-act .btn { padding: 9px 16px; font-size: 14px; }

/* done — settled, so it recedes. */
.stage.done .stage-n { background: var(--ok-tint); color: var(--ok); border-color: transparent; }
.stage.done .stage-t { color: var(--muted); font-weight: 500; }

/* current — the one thing worth looking at. */
.stage.current { background: var(--brass-tint); margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.stage.current .stage-n { background: var(--brass); color: var(--panel); border-color: transparent; }

/* upcoming — visible, but plainly not yet. Hiding it would lose the shape of
 * the whole process, which is the reassuring part. */
.stage.upcoming .stage-n,
.stage.upcoming .stage-t { color: var(--faint); }

.stage.changes-requested .stage-n { background: var(--warn-tint); color: var(--warn); border-color: transparent; }

@media (min-width: 720px) {
  .stage { flex-wrap: nowrap; }
  .stage-t { flex: 1; }
  .stage-act { flex-basis: auto; margin-top: 0; }
}

/* Staff console. Mobile first — the row stacks by default and only goes
 * side-by-side on a wide screen, because a rep issuing a login is usually
 * doing it on a phone standing next to the coach. */
.row { display: flex; flex-direction: column; gap: 0; }
@media (min-width: 620px) {
  .row { flex-direction: row; gap: 12px; }
  .row .field { flex: 1; }
}

/* The one-time password block. Deliberately loud and deliberately monospaced
 * — it is shown once and cannot be looked up again. */
.cred { display: grid; gap: 10px; margin: 10px 0; }
.cred code {
  display: inline-block; padding: 7px 10px; margin-top: 2px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-size: 14px; word-break: break-all; user-select: all;
}
.issued:empty { display: none; }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.input {
  width: 100%; padding: 12px 14px; font: inherit;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--panel); color: var(--ink);
}

.notice { padding: 12px 14px; border-radius: var(--radius); font-size: 13.5px; margin-bottom: 14px; }
.notice.bad { background: var(--danger-tint); border: 1px solid var(--danger); color: var(--danger); }
.notice.warn { background: var(--warn-tint); border: 1px solid rgba(165,118,42,.4); }
.notice.ok { background: var(--ok-tint); border: 1px solid rgba(79,122,63,.4); }

/* The order matrix. A person is a row, a product family is a column. */
.matrix { width: 100%; border-collapse: collapse; font-size: 14px; }
.matrix th {
  text-align: left; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.matrix td { padding: 10px; border-bottom: 1px solid rgba(20,19,15,.07); }
.matrix .yes { color: var(--ok); font-weight: 700; }
.matrix .no { color: var(--faint); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tile b { display: block; font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile span { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.tile.ok { border-top-color: var(--ok); } .tile.ok b { color: var(--ok); }
.tile.warn { border-top-color: var(--warn); } .tile.warn b { color: var(--warn); }

.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--brass-tint); color: var(--brass); font-size: 12px; font-weight: 600;
}
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

.signin { max-width: 400px; margin: 12vh auto; padding: 0 20px; }
.mark { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: .02em; }

@media (max-width: 620px) {
  .wrap { padding: 20px 16px 48px; }
  .matrix { font-size: 13px; }
  .matrix th, .matrix td { padding: 8px 6px; }
  .signin { margin: 6vh auto; }
}
