/* ==========================================================================
   Outfitter demo — dashboard (Lane B)
   Register: TOOL (~/tools/design/languages/dankmire-tool.md) — a review
   queue Michael lives in for a working session, not a 40-second landing
   page. Tokens below are the tool register's, copied verbatim, plus ONE
   project-identity color (--gold) added per the registry recipe
   (~/tools/design/languages/README.md step 3): a precedented brand gold
   (see JUSTIN-CREATIVE-TASTE-PROFILE.md "gold-on-dark register" from the
   stankydanko-ident build), used ONLY in the header brand lockup — never
   as a state color. Every other color in this file is a token with a
   stated meaning; see the "color semantics" comment block below.
   ========================================================================== */

:root {
  /* Layers — near-black navy family (brand constant, dark-native only) */
  --bg:        #0a0a0f;
  --surface:   #12121a;
  --surface-2: #1a1a25;
  --surface-3: #232330;   /* inputs, pressed */
  --border:    #2a2a3a;
  --border-hi: #3a3a4e;

  /* Text — three tiers, never more */
  --text:       #e6e9f0;
  --text-dim:   #8888a0;
  --text-faint: #55556a;

  /* THE brand pair */
  --green:      #4ade80;  --green-dim:  #2d7a4a;
  --purple:     #a78bfa;  --purple-dim: #4c3d78;

  /* Fixed state/data set — never invented per-feature */
  --blue:   #60a5fa;   /* info */
  --teal:   #5eead4;   /* done / delivered */
  --amber:  #fbbf24;   /* caution / no consent yet */
  --danger: #f87171;   /* blocked / destructive */

  /* Glow = live state ONLY (D5) */
  --glow-green: 0 0 12px #4ade8055, 0 0 32px #4ade8022;

  /* ONE project-identity color — Travel First Horizons brand lockup only.
     Meaning: "this is TFH's brand," never a state. Kept out of the
     interactive/semantic set entirely (C2: accent stays ≤10% of screen). */
  --gold: #d4a437;

  --radius-s: 6px; --radius-m: 8px; --radius-l: 12px; --radius-pill: 999px;
  --fast: 0.15s ease;  /* ALL hover/state color */
  --slow: 0.3s ease;   /* sheet/crossfade/progress ONLY */

  /* JetBrains Mono = the brand texture: chrome, labels, data, buttons.
     Message BODY copy (the actual marketing SMS text Michael is judging)
     uses a system sans instead — a deliberate T8 exception: mono is for
     data/labels, sans is for reading prose, and legibility is the taste
     profile's non-negotiable ("style never outranks read"). */
  --font:      'JetBrains Mono','Fira Code',ui-monospace,monospace;
  --font-read: -apple-system, 'Segoe UI', system-ui, Roboto, sans-serif;
}

/* Color semantics (every color below traces to one of these rows — C1/C3)
   green   — interactive / approve / opted-in consent / live-sending
   purple  — message class (content classification)
   blue    — info / invited-not-yet-consented
   teal    — delivered / done
   amber   — caution / no-consent-yet
   danger  — blocked / opted-out / destructive, always with a confirm
   gold    — TFH brand lockup ONLY, never state
*/

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 13px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  height: 100%;
}
body { min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) var(--bg); }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: var(--bg); }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--radius-pill); }
::selection { background: #4ade8033; }
button, input, textarea { font-family: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ============ banner ============ */
.banner {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; font-size: 12px;
  border-bottom: 1px solid var(--border);
}
.banner-danger { background: #f8717122; color: var(--danger); }
.banner-msg { flex: 1; }
.banner-action {
  background: none; border: 1px solid var(--danger); color: var(--danger);
  border-radius: var(--radius-s); padding: 6px 10px; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em; min-height: 32px;
  transition: background var(--fast);
}
.banner-action:hover { background: #f8717122; }
.banner-action:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--danger); }

/* ============ shell / header ============ */
.app-shell { max-width: 720px; margin: 0 auto; padding: 16px 16px 12px; }
.app-header { margin-bottom: 4px; }
.brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.brand-mark {
  font-weight: 700; font-size: 13px; letter-spacing: 0.04em;
  color: var(--gold); border: 1px solid #d4a43755; background: #d4a43714;
  border-radius: var(--radius-s); padding: 6px 8px; line-height: 1;
}
.brand-name { font-size: 14px; font-weight: 600; }
.eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); font-weight: 500; margin-top: 2px;
}

/* campaign switcher: horizontal chip row, scrolls on mobile */
.campaign-switcher {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px;
  scrollbar-width: none;
}
.campaign-switcher::-webkit-scrollbar { display: none; }
.campaign-chip {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 8px 12px; min-height: 44px; justify-content: center;
  color: var(--text-dim); transition: border-color var(--fast), color var(--fast), background var(--fast);
  white-space: nowrap;
}
.campaign-chip:hover { border-color: var(--border-hi); color: var(--text); }
.campaign-chip:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); border-color: var(--green); }
.campaign-chip.active { border-color: var(--green); color: var(--text); background: #4ade8014; }
.campaign-chip .cc-name { font-size: 12px; font-weight: 600; }
.campaign-chip .cc-sub { font-size: 10px; color: var(--text-faint); letter-spacing: 0.04em; }
.campaign-chip.active .cc-sub { color: var(--green); }

/* stats strip */
.stats-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 2px;
}
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); font-weight: 500;
}

/* ============ tabs ============ */
.tab-bar {
  display: flex; gap: 2px; border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none; margin-bottom: 12px;
  position: sticky; top: 0; background: var(--bg); z-index: 20;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab {
  font-family: var(--font); font-size: 12px; background: none; border: none;
  border-bottom: 2px solid transparent; color: var(--text-dim);
  padding: 10px 12px; min-height: 44px; white-space: nowrap;
  transition: color var(--fast), border-color var(--fast);
}
.tab:hover { color: var(--text); }
.tab:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--green); }
.tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.tab .tab-count { color: var(--text-faint); margin-left: 4px; }
.tab.active .tab-count { color: var(--green); }

/* ============ batch bar ============ */
.batch-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--border-hi); border-radius: var(--radius-m);
  padding: 10px 12px; margin-bottom: 12px;
}
.batch-select-all { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); min-height: 32px; }
.batch-select-all input { width: 16px; height: 16px; accent-color: var(--green); }
.batch-count { font-size: 11px; color: var(--text-faint); }
.batch-actions { display: flex; gap: 8px; margin-left: auto; }

/* ============ buttons (idiom copied verbatim from component-standards) ============ */
.btn {
  font-family: var(--font); font-size: 12px; line-height: 1.2;
  padding: 10px 16px; min-height: 44px; border-radius: var(--radius-s);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-dim); white-space: nowrap;
  transition: border-color var(--fast), color var(--fast), background var(--fast);
}
.btn:hover { border-color: var(--border-hi); color: var(--text); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); border-color: var(--green); }
.btn:active { background: var(--surface-3); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--green-dim); border-color: var(--green-dim); color: #eafff2; font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--green); border-color: var(--green); color: #06140b; }
.btn-danger { color: var(--danger); }
.btn-danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); background: #f8717111; }
.btn-ghost { background: none; border-color: transparent; }
.btn-ghost:hover { border-color: var(--border); color: var(--text); }
.btn-sm { padding: 8px 12px; font-size: 11px; min-height: 40px; }
.btn-block { width: 100%; }

/* ============ chips ============ */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 8px; border-radius: 4px; font-weight: 600; line-height: 1;
  white-space: nowrap;
}
.chip .cdot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.chip.green  { background: #4ade8026; color: var(--green); }
.chip.green .cdot { background: var(--green); }
.chip.purple { background: #a78bfa22; color: var(--purple); }
.chip.purple .cdot { background: var(--purple); }
.chip.blue   { background: #60a5fa22; color: var(--blue); }
.chip.blue .cdot { background: var(--blue); }
.chip.teal   { background: #5eead422; color: var(--teal); }
.chip.teal .cdot { background: var(--teal); }
.chip.amber  { background: #fbbf2422; color: var(--amber); }
.chip.amber .cdot { background: var(--amber); }
.chip.danger { background: #f8717122; color: var(--danger); }
.chip.danger .cdot { background: var(--danger); }
.chip.idle   { background: #8888a022; color: var(--text-dim); }
.chip.idle .cdot { background: var(--text-faint); }
/* live-sending: the ONE earned glow in this app — an in-flight delivery */
.chip.sending .cdot { background: var(--green); box-shadow: var(--glow-green); animation: pulse 2s ease-in-out infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ============ queue main / cards ============ */
.queue-main { min-height: 240px; margin-bottom: 16px; }
.card-list { display: flex; flex-direction: column; gap: 12px; }

.msg-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  transition: border-color var(--fast), opacity var(--fast);
}
.msg-card:hover { border-color: var(--border-hi); }
.msg-card.busy { opacity: 0.55; pointer-events: none; }

.card-top { display: flex; align-items: flex-start; gap: 10px; }
.card-select { display: flex; align-items: center; padding: 6px; margin: -6px; }
.card-select input { width: 18px; height: 18px; accent-color: var(--green); }
.card-id-block { flex: 1; min-width: 0; }
.card-name { font-size: 15px; font-weight: 600; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.card-top .chip.class-chip { margin-left: auto; flex: none; }

.card-trip { font-size: 11px; color: var(--text-faint); letter-spacing: 0.02em; }
.card-trip b { color: var(--text-dim); font-weight: 500; }

/* the compliance-story banner — must be impossible to miss */
.block-reason {
  display: flex; align-items: flex-start; gap: 8px;
  background: #f8717118; border: 1px solid #f8717144; border-radius: var(--radius-s);
  padding: 10px 12px; color: var(--danger); font-size: 12px; line-height: 1.4;
}
.block-reason .br-glyph { font-weight: 700; flex: none; }

/* message body — sans, reading-optimized (T8 exception, see header comment) */
.card-body {
  font-family: var(--font-read); font-size: 15px; line-height: 1.55; color: var(--text);
  background: var(--surface-2); border-radius: var(--radius-s); padding: 12px 14px;
  max-width: 68ch;
}

.card-edit textarea {
  font-family: var(--font-read); font-size: 15px; line-height: 1.5; color: var(--text);
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-s);
  padding: 12px 14px; width: 100%; min-height: 120px; resize: vertical;
  caret-color: var(--green);
}
.card-edit textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.card-edit-actions { display: flex; gap: 8px; margin-top: 8px; }

.card-actions { display: flex; gap: 8px; }
.card-actions .btn { flex: 1; }

.card-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-meta-row .dim { color: var(--text-faint); font-size: 11px; }

/* ============ empty / loading / error states ============ */
.state-panel {
  min-height: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 32px 20px; text-align: center;
}
.state-panel .glyph { font-size: 22px; color: var(--text-faint); letter-spacing: 0.1em; }
.state-panel .msg { font-size: 13px; color: var(--text-dim); max-width: 34ch; }
.state-panel .msg b { color: var(--text); font-weight: 600; }
.state-panel.state-error .glyph { color: var(--danger); }

.skel-cards { display: flex; flex-direction: column; gap: 12px; }
.skel-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.skel-card i, .skel-row i {
  display: block; height: 12px; border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
.skel-card i:nth-child(1) { width: 45%; height: 16px; }
.skel-card i:nth-child(2) { width: 80%; }
.skel-card i:nth-child(3) { width: 60%; height: 40px; }
.skel-row { display: flex; gap: 8px; }
.skel-row i { width: 90px; height: 44px; border-radius: var(--radius-m); flex: none; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============ consent ledger table ============ */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-m); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); font-weight: 500; text-align: left;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0;
}
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { background: var(--surface); transition: background var(--fast); }
tbody tr:hover { background: var(--surface-2); }
td .dim { color: var(--text-faint); }

/* ============ send bar (sticky bottom, thumb zone) ============ */
.send-bar {
  position: sticky; bottom: 0; z-index: 25;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 12px 16px; margin: 0 -16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.send-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.send-campaign { font-size: 12px; font-weight: 600; color: var(--text); }
.send-sub { font-size: 10px; color: var(--text-faint); }
.btn-send { flex: none; }

.app-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 0 8px; flex-wrap: wrap;
}
.footer-link {
  background: none; border: none; color: var(--text-faint); font-size: 11px;
  text-decoration: underline; text-underline-offset: 2px; min-height: 32px;
}
.footer-link:hover { color: var(--text-dim); }
.footer-link:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); border-radius: var(--radius-s); }
.footer-note { font-size: 10px; color: var(--text-faint); }

/* ============ modal / scrim ============ */
.scrim {
  position: fixed; inset: 0; background: rgba(10,10,15,0.6); backdrop-filter: blur(12px);
  z-index: 90;
}
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 380px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: var(--radius-l); padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  z-index: 100; max-height: calc(100vh - 32px); overflow-y: auto;
}
.modal.modal-wide { width: 480px; }
.modal h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.modal p { color: var(--text-dim); font-size: 12px; margin-bottom: 16px; line-height: 1.5; }
.modal p b { color: var(--text); font-weight: 600; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.results-summary { display: flex; gap: 16px; margin-bottom: 14px; }
.results-summary .rs-num { font-size: 22px; font-weight: 700; }
.results-summary .rs-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); }
.results-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; max-height: 220px; overflow-y: auto; }
.results-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--radius-s); font-size: 12px; }
.results-row.blocked { background: #f8717114; }
.results-row.sent { background: #4ade8014; }
.results-row .rr-name { font-weight: 600; }
.results-row.blocked .rr-name { color: var(--danger); }
.results-row.sent .rr-name { color: var(--green); }
.results-row .rr-reason { color: var(--text-dim); font-size: 11px; }
.results-heading { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 8px; }

/* ============ toasts ============ */
.toast-stack {
  position: fixed; bottom: calc(80px + env(safe-area-inset-bottom)); left: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 8px; z-index: 120; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-s); padding: 10px 14px; font-size: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toast-in var(--slow);
}
.toast.err { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============ mobile-first sizing already the default above; desktop bonus ============ */
@media (min-width: 640px) {
  .app-shell { padding: 32px 24px 24px; }
  .stats-strip { grid-template-columns: repeat(4, 1fr); }
  .card-actions .btn { flex: initial; min-width: 120px; }
  .card-actions { justify-content: flex-end; }
  .send-bar { margin: 0; border-radius: var(--radius-m) var(--radius-m) 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .chip.sending .cdot { box-shadow: none; outline: 1px solid var(--green); animation: none; }
  .toast { animation: none; }
}
