/* Alfredo brand system — shell-owned design tokens (ADR-004 §7 · Memo 15 item 6).
 *
 * This is the ONE place color, type, and spacing are defined for the whole shell. Every
 * surface — the launcher here, the Returns dashboard (Memo 14), Family Logistics later —
 * inherits these custom properties and NEVER declares its own palette (§7: "brand system is
 * shell-owned; every domain inherits it; no per-domain brand work"). A module that hardcodes
 * a hex is a bug the theming-gate test catches.
 *
 * Values are TRANSCRIBED, not authored: the palette is ADR-004 §7's locked hexes
 * (parchment #efe7d6/#f6f0e3, navy tailcoat #22314f, camel/gold #b78a4e), and the fuller
 * token set (inks, hairlines, warm status greens/ambers/reds, radius, serif) is lifted
 * verbatim from the already-rebranded reference mockup at
 * .pm-workflows/wf-20260706-a1b2c3d4/mockups/returns-ux.html (§7 names it the reference impl).
 * Re-theming the whole shell = changing a value here (the item-6 acceptance test).
 */
:root {
  /* Grounds — warm parchment (ADR-004 §7) */
  --bg: #efe7d6;          /* warm parchment page */
  --appbg: #f6f0e3;       /* app screen ground */
  --card: #fffdf7;        /* warm white card */

  /* Ink ladder — warm near-black → faint brown */
  --ink: #2a2620;
  --ink2: #6d6555;
  --ink3: #9c9384;

  /* Hairlines on parchment */
  --line: #e6ddc9;
  --line2: #efe9db;

  /* Primary — Alfredo's tailcoat navy (ADR-004 §7) */
  --navy: #22314f;
  --navy2: #33456a;
  --navy-soft: #e7ebf3;

  /* Accent — camel/gold trim (ADR-004 §7) */
  --gold: #b78a4e;
  --gold2: #caa66a;
  --gold-soft: #f3ead8;

  /* Warm status set (ADR-004 §7: "warm status greens/ambers/reds") */
  --green: #3f7d4f;  --green-bg: #e6f0e5;
  --amber: #b0801f;  --amber-bg: #f6ecd3;
  --red: #b1443c;    --red-bg: #f6e3e0;
  --blue: #2f6ea3;   --blue-bg: #e6eff6;

  /* Elevation, shape, type (§7: refined serif wordmark + titles; system sans body) */
  --shadow: 0 1px 2px rgba(42, 38, 32, .06), 0 8px 22px rgba(42, 38, 32, .08);
  --radius: 18px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Type scale + spacing (tokens-first; component library grows in later sprints) */
  --fs-wordmark: 24px;
  --fs-title: 19px;
  --fs-body: 14.5px;
  --fs-small: 12.5px;
  --sp-1: 6px;
  --sp-2: 10px;
  --sp-3: 16px;
  --sp-4: 24px;
}

/* Base frame — everything below reads tokens only, never literals. */
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  -webkit-font-smoothing: antialiased;
}

.alfredo-wordmark {
  font-family: var(--serif);
  font-size: var(--fs-wordmark);
  color: var(--navy);
  letter-spacing: .01em;
  margin: 0;
}
.alfredo-wordmark .v { color: var(--ink3); font-weight: 400; font-size: 15px; }

.surface-title {
  font-family: var(--serif);
  font-size: var(--fs-title);
  color: var(--navy);
  margin: 0 0 var(--sp-2);
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--sp-3);
  background: var(--appbg);
  min-height: 100vh;
  box-sizing: border-box;
}

/* Launcher tile grid — one tile per module the loaded role may see. */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); margin-top: var(--sp-3); }
.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--sp-3);
  text-decoration: none;
  color: var(--ink);
  display: block;
}
.tile .tile-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--navy-soft); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 18px;
  margin-bottom: var(--sp-2);
}
.tile .tile-name { font-family: var(--serif); font-size: 17px; color: var(--navy); }
.tile .tile-surfaces { color: var(--ink2); font-size: var(--fs-small); margin-top: 2px; }

.empty {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: var(--sp-4); text-align: center; color: var(--ink2);
  margin-top: var(--sp-3);
}

.rolebar { display: flex; gap: var(--sp-1); flex-wrap: wrap; margin-top: var(--sp-2); }
.rolebar .role { font-size: var(--fs-small); color: var(--ink2); border: 1px solid var(--line);
  background: var(--card); border-radius: 9px; padding: 5px 9px; }
.rolebar .role.on { background: var(--navy); color: var(--appbg); border-color: var(--navy); }

.offline-note { color: var(--amber); background: var(--amber-bg); border-radius: 10px;
  padding: 8px 12px; font-size: var(--fs-small); margin-top: var(--sp-2); }

/* Returns dashboard surface (Memo 14 §4) — three zones + color-coded rows. Reads tokens ONLY; the
 * row color class (.ret-red/.ret-amber/.ret-green) is chosen by the projection, never here. */
.ret-zone { margin-top: var(--sp-4); }
.ret-zone .surface-title { display: flex; align-items: center; gap: var(--sp-2); }
.ret-count { font-family: var(--sans); font-size: var(--fs-small); color: var(--ink2);
  background: var(--navy-soft); border-radius: 9px; padding: 1px 8px; }
.ret-empty { color: var(--ink2); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--sp-3); }

.ret-row { display: flex; gap: var(--sp-2); align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: var(--sp-3); margin-bottom: var(--sp-2); }
.ret-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; }
.ret-red   .ret-dot { background: var(--red); }
.ret-amber .ret-dot { background: var(--amber); }
.ret-green .ret-dot { background: var(--green); }
.ret-red   { background: var(--red-bg); }
.ret-amber { background: var(--amber-bg); }
.ret-green { background: var(--card); }

.ret-body { flex: 1 1 auto; min-width: 0; }
.ret-top { display: flex; justify-content: space-between; gap: var(--sp-2); align-items: baseline; }
.ret-vendor { font-family: var(--serif); font-size: 16px; color: var(--navy); }
.ret-status { font-size: var(--fs-small); color: var(--ink2); text-transform: capitalize;
  white-space: nowrap; }
.ret-meta { color: var(--ink2); font-size: var(--fs-small); margin-top: 2px; }

/* Single-return "Domino's-style" tracker (Memo 14 C6) — 8 stages, current highlighted. */
.ret-tracker { display: flex; gap: var(--sp-1); margin-top: var(--sp-3); flex-wrap: wrap; }
.ret-stage { font-size: var(--fs-small); color: var(--ink3); border: 1px solid var(--line);
  background: var(--card); border-radius: 9px; padding: 4px 9px; }
.ret-stage.done { color: var(--green); border-color: var(--green); }
.ret-stage.current { background: var(--navy); color: var(--appbg); border-color: var(--navy); }
