/* ═══════════════════════════════════════════════════════════════════════════
   FLARE · DESIGN SYSTEM  —  flare.css
   The shared component layer for the Org portal and Admin "Mission Control".
   Navy + orange on warm cream. System fonts. No external resources.
   Port target: this maps 1:1 onto your real flare.css; org.css / admin.css
   then add only their shell + screen-specific rules.

   CONTENTS
     1. Tokens            5. Buttons          9. Tables
     2. Reset + base      6. Status pills    10. Empty state
     3. Type helpers      7. Match bands     11. Notes / callouts
     4. Cards             8. Form fields     12. Toolbar + utilities
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1 · TOKENS ──────────────────────────────────────────────────────────── */
:root{
  /* Brand — navy (ink / structure) */
  --navy:#16294C; --navy-700:#1E3666; --navy-300:#5B6B8C; --navy-900:#0F1E3A;

  /* Brand — orange (accent + the one primary action) */
  --accent:#EE7A1E; --accent-lite:#F4A63A; --accent-deep:#C65A12; --accent-deeper:#A8470C;
  --accent-050:#FDEFD9; --accent-100:#FAD9AE;
  --flare-glow:linear-gradient(180deg,#F4A63A 0%,#EE7A1E 52%,#C65A12 100%);

  /* Surfaces — warm cream */
  --bg:#FBF6EE; --surface:#FFFFFF; --surface-2:#F7F1E7; --bg-sunk:#F0E8DA;
  --ink:#16294C; --ink-2:#45506B; --ink-3:#5E6880;       /* ink-2 / ink-3 are AA on cream */
  --line:#E7DECF; --line-2:#D8CCB6;

  /* Status — never colour-alone; each carries an icon + text */
  --green:#1F7A52; --green-050:#E6F3EC; --green-100:#BFE0CD;   /* available / verified / strong  */
  --amber:#8A6A1C; --amber-050:#F7EFD8; --amber-100:#E6D5A6;   /* pending / possible / limited    */
  --red:#B23128;   --red-050:#FBE9E7;   --red-100:#F3CDC8;     /* full / urgent / blocked         */
  --good:#1E3666;  --good-050:#E9EEF7;  --good-line:#C7D3E8;   /* informational navy / partner    */

  /* Shape */
  --r-card:16px; --r-md:12px; --r-sm:9px; --r-pill:999px;

  /* Elevation — navy-tinted so it stays warm, never cold-grey */
  --sh-1:0 1px 2px rgba(15,30,58,.05), 0 1px 1px rgba(15,30,58,.04);
  --sh-2:0 2px 8px rgba(15,30,58,.06), 0 8px 22px rgba(15,30,58,.07);
  --sh-3:0 10px 30px rgba(15,30,58,.14);
  --sh-pop:0 14px 38px rgba(15,30,58,.18), 0 4px 10px rgba(15,30,58,.10);

  --font:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans", sans-serif;
  --mono:ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ── 2 · RESET + BASE ────────────────────────────────────────────────────── */
*{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:var(--font); font-size:15px; line-height:1.5;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
h1,h2,h3,h4{ margin:0; font-weight:800; letter-spacing:-.02em; line-height:1.18; text-wrap:balance; }
p{ margin:0; text-wrap:pretty; }
ul,ol{ margin:0; padding:0; } li{ list-style:none; }
a{ color:var(--navy); text-decoration:none; }
img,svg{ display:block; }
button{ font-family:inherit; cursor:pointer; }
input,select,textarea{ font-family:inherit; }

/* Visible keyboard focus — AA, shows on cream, white and orange */
:focus-visible{ outline:3px solid var(--navy-700); outline-offset:2px; border-radius:5px; }

.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
.skip-link{ position:absolute; left:10px; top:-100px; z-index:200; background:var(--navy); color:#fff; padding:12px 18px; border-radius:var(--r-sm); font-weight:700; transition:top .15s ease; }
.skip-link:focus{ top:10px; }

/* Icons — reference your sprite by name: <svg class="ic"><use href="#i-bed"/></svg> */
.ic{ width:22px; height:22px; flex:none; }
.ic-sm{ width:17px; height:17px; flex:none; }
.ic-lg{ width:27px; height:27px; flex:none; }

/* ── 3 · TYPE HELPERS ────────────────────────────────────────────────────── */
.t-sec{ color:var(--ink-2); }
.t-muted{ color:var(--ink-3); }
.t-sm{ font-size:13.5px; }
.t-xs{ font-size:12px; }
.num,.tnum{ font-variant-numeric:tabular-nums; font-feature-settings:"tnum"; }
.mono{ font-family:var(--mono); font-variant-numeric:tabular-nums; }
.eyebrow{ font-size:11.5px; font-weight:800; letter-spacing:.09em; text-transform:uppercase; color:var(--ink-3); }
.divider{ height:1px; background:var(--line); border:0; margin:16px 0; }

/* ── 4 · CARDS ───────────────────────────────────────────────────────────── */
.card{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-card); box-shadow:var(--sh-1);
}
.card-pad{ padding:18px; }
.card-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:14px 18px; border-bottom:1px solid var(--line);
}
.card-head h2,.card-title{ font-size:15px; font-weight:800; letter-spacing:-.01em; color:var(--ink); margin:0; }
.card-head .sub{ font-size:12px; color:var(--ink-3); font-weight:600; }
.card-foot{ padding:13px 18px; border-top:1px solid var(--line); background:var(--surface-2); border-radius:0 0 var(--r-card) var(--r-card); }

/* ── 5 · BUTTONS ─────────────────────────────────────────────────────────── */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:9px;
  border:1.5px solid transparent; border-radius:var(--r-md);
  font-weight:750; font-size:14.5px; letter-spacing:-.01em; line-height:1.2;
  padding:0 17px; min-height:46px; text-align:center; color:var(--ink);
  transition:background .15s ease, transform .08s ease, box-shadow .15s ease, filter .15s ease;
  white-space:nowrap;
}
.btn:active{ transform:translateY(1px); }
.btn:disabled,.btn[aria-disabled="true"]{ cursor:not-allowed; }
.btn-block{ display:flex; width:100%; }
.btn-lg{ min-height:52px; font-size:15.5px; padding:0 22px; }
.btn-sm{ min-height:38px; font-size:13.5px; padding:0 13px; border-radius:var(--r-sm); }
.btn svg{ width:17px; height:17px; flex:none; }
.btn-sm svg{ width:15px; height:15px; }

/* THE primary action — the glossy flare CTA. One per screen (Respond / Save / Verify). */
.btn-flare{
  background:var(--flare-glow); color:var(--navy); border-color:var(--accent-deep); font-weight:800;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.55), 0 1px 1px rgba(168,71,12,.18), 0 3px 10px rgba(238,122,30,.26);
}
.btn-flare:hover{ filter:brightness(1.04) saturate(1.03); }
.btn-flare:active{ filter:brightness(.98); transform:translateY(1px); }

.btn-navy{ background:var(--navy); color:#fff; box-shadow:var(--sh-1); }
.btn-navy:hover{ background:var(--navy-700); }
.btn-ghost{ background:var(--surface); color:var(--navy); border-color:var(--line-2); }
.btn-ghost:hover{ background:var(--surface-2); border-color:var(--navy-300); }
.btn-quiet{ background:transparent; color:var(--ink-2); }
.btn-quiet:hover{ background:rgba(22,41,76,.06); color:var(--ink); }
.btn-success{ background:var(--green); color:#fff; }
.btn-success:hover{ filter:brightness(1.06); }
.btn-danger{ background:var(--red-050); color:var(--red); border-color:var(--red-100); }
.btn-danger:hover{ background:var(--red-100); }
.btn-danger-solid{ background:var(--red); color:#fff; }
.btn-danger-solid:hover{ filter:brightness(1.05); }
/* disabled-by-design (e.g. flare unavailable for unverified) — visibly inert, honest */
.btn-greyed{ background:var(--bg-sunk); color:var(--ink-3); border-color:var(--line-2); cursor:not-allowed; font-weight:700; }
.btn-greyed svg{ opacity:.6; }

/* ── 6 · STATUS PILLS  (ONE system, reused everywhere) ───────────────────────
   Verification tiers · match quality · capacity — all share this component.
   ALWAYS icon + text + colour (never colour-alone). All combos are AA.
     pill--green  Verified · Strong · Open now
     pill--navy   Partner  · Good   · (informational)
     pill--amber  Registered·call to confirm · Possible · Limited · Pending
     pill--red    Full · Urgent · Blocked
     pill--grey   Unverified · Paused · neutral / muted
   ────────────────────────────────────────────────────────────────────────── */
.pill{
  display:inline-flex; align-items:center; gap:6px;
  padding:5px 11px; border-radius:var(--r-pill);
  font-size:12.5px; font-weight:750; line-height:1.15; white-space:nowrap;
  border:1px solid transparent;
}
.pill svg{ width:14px; height:14px; flex:none; }
.pill .dot{ width:8px; height:8px; border-radius:50%; flex:none; background:currentColor; }
.pill-lg{ padding:7px 13px; font-size:13.5px; }
.pill-lg svg{ width:16px; height:16px; }

.pill--green{ background:var(--green-050); color:var(--green); border-color:var(--green-100); }
.pill--navy{  background:var(--good-050);  color:var(--good);  border-color:var(--good-line); }
.pill--amber{ background:var(--amber-050); color:var(--amber); border-color:var(--amber-100); }
.pill--red{   background:var(--red-050);   color:var(--red);   border-color:var(--red-100); }
.pill--grey{  background:var(--bg-sunk);   color:var(--ink-2); border-color:var(--line-2); }
.pill--solid-green{ background:var(--green); color:#fff; border-color:transparent; }
.pill--solid-red{ background:var(--red); color:#fff; border-color:transparent; }

/* ── 7 · MATCH BANDS  (ordinal — reads without colour) ───────────────────────
   Strong / Good / Possible. The meter fills 3 / 2 / 1 bars so rank survives
   greyscale. Same status hues as the pills above. */
.band{
  display:inline-flex; align-items:center; gap:7px;
  padding:6px 12px; border-radius:var(--r-pill);
  font-size:12.5px; font-weight:800; letter-spacing:.01em; white-space:nowrap;
  border:1px solid transparent;
}
.band-strong{   background:var(--green-050); color:var(--green); border-color:var(--green-100); }
.band-good{     background:var(--good-050);  color:var(--good);  border-color:var(--good-line); }
.band-possible{ background:var(--amber-050); color:var(--amber); border-color:var(--amber-100); }
.meter{ display:inline-flex; align-items:flex-end; gap:2px; height:12px; }
.meter i{ width:3px; border-radius:1px; background:currentColor; opacity:.26; }
.meter i:nth-child(1){ height:5px; } .meter i:nth-child(2){ height:8px; } .meter i:nth-child(3){ height:11px; }
.band-strong .meter i{ opacity:1; }
.band-good .meter i:nth-child(-n+2){ opacity:1; }
.band-possible .meter i:nth-child(1){ opacity:1; }

/* Tags — plain descriptive chips (not status) */
.tags{ display:flex; flex-wrap:wrap; gap:7px; }
.tag{ font-size:12.5px; font-weight:700; color:var(--ink-2); background:var(--surface-2); border:1px solid var(--line); padding:5px 11px; border-radius:var(--r-pill); white-space:nowrap; }

/* ── 8 · FORM FIELDS ─────────────────────────────────────────────────────── */
.field{ display:block; }
.field > .label{ display:block; font-weight:750; font-size:14px; margin-bottom:6px; color:var(--ink); }
.field .hint{ font-size:13px; color:var(--ink-3); margin-bottom:8px; }
.field .optional{ font-weight:600; color:var(--ink-3); font-size:13px; }
.input,.textarea,.select{
  width:100%; background:var(--surface); border:1.5px solid var(--line-2);
  border-radius:var(--r-md); padding:12px 13px; color:var(--ink);
  min-height:48px; line-height:1.4; font-size:15px;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.textarea{ min-height:96px; resize:vertical; }
.input::placeholder,.textarea::placeholder{ color:var(--ink-3); }
.input:focus,.textarea:focus,.select:focus{
  outline:none; border-color:var(--navy); box-shadow:0 0 0 3px var(--good-050);
}
.input[aria-invalid="true"],.textarea[aria-invalid="true"]{ border-color:var(--red); box-shadow:0 0 0 3px var(--red-050); }
.field-error{ display:flex; align-items:center; gap:6px; font-size:13px; color:var(--red); font-weight:700; margin-top:6px; }
.field-error svg{ width:15px; height:15px; flex:none; }
.select{
  appearance:none; -webkit-appearance:none; padding-right:36px; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2316294C' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 12px center;
}
/* Checkbox — generous hit target, brand accent */
.check{ width:22px; height:22px; flex:none; accent-color:var(--navy); cursor:pointer; }

/* Switch — accessible toggle (real checkbox under the hood) */
.switch{ position:relative; flex:none; width:52px; height:30px; }
.switch input{ position:absolute; inset:0; opacity:0; margin:0; cursor:pointer; }
.switch .track{ position:absolute; inset:0; background:var(--line-2); border-radius:999px; transition:background .18s ease; }
.switch .knob{ position:absolute; top:3px; left:3px; width:24px; height:24px; background:#fff; border-radius:50%; box-shadow:0 1px 3px rgba(15,30,58,.3); transition:transform .2s cubic-bezier(.3,1.3,.5,1); }
.switch input:checked ~ .track{ background:var(--green); }
.switch input:checked ~ .knob{ transform:translateX(22px); }
.switch input:focus-visible ~ .track{ outline:3px solid var(--navy-700); outline-offset:2px; }

/* Segmented control — equal options (e.g. capacity Open/Limited/Full/Paused) */
.segment{ display:inline-flex; background:var(--surface-2); border:1px solid var(--line-2); border-radius:var(--r-md); padding:4px; gap:4px; }
.segment .seg{ display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:42px; padding:0 16px; border-radius:var(--r-sm); font-weight:750; font-size:14px; color:var(--ink-2); border:1px solid transparent; background:transparent; }
.segment .seg svg{ width:16px; height:16px; }
.segment .seg:hover{ color:var(--ink); }

/* ── 9 · TABLES  (scannable — sticky head, hairline rows, aligned numerals) ── */
.table-wrap{ width:100%; overflow-x:auto; }
table.data{ width:100%; border-collapse:collapse; font-size:13.5px; }
table.data thead th{
  text-align:left; font-size:10.5px; font-weight:800; letter-spacing:.06em; text-transform:uppercase;
  color:var(--ink-3); padding:10px 14px; background:var(--surface-2);
  border-bottom:1px solid var(--line-2); position:sticky; top:0; z-index:1; white-space:nowrap;
}
table.data thead th.right{ text-align:right; }
table.data tbody td{ padding:11px 14px; border-bottom:1px solid var(--line); vertical-align:middle; color:var(--ink-2); }
table.data tbody tr:last-child td{ border-bottom:0; }
table.data tbody tr:hover td{ background:var(--surface-2); }
table.data tbody tr.is-selected td{ background:var(--good-050); }
table.data td.strong{ color:var(--ink); font-weight:700; }
table.data td.right{ text-align:right; }
table.data .id{ font-family:var(--mono); font-size:12px; color:var(--ink-3); }
/* row emphasis — paired with a status pill in-row, never colour-alone */
table.data tr.row-flag td{ background:var(--red-050); }
table.data tr.row-flag:hover td{ background:var(--red-100); }
table.data tr.row-warn td{ background:var(--amber-050); }
table.data tr.row-warn:hover td{ background:var(--amber-100); }
/* compact density (admin worklists) */
table.data.dense tbody td{ padding:8px 12px; }
table.data.dense thead th{ padding:8px 12px; }

/* in-table action buttons */
.rowact{ display:inline-flex; gap:6px; flex-wrap:wrap; }
.tact{ font-size:12.5px; font-weight:700; padding:6px 11px; border-radius:var(--r-sm); background:var(--surface); border:1px solid var(--line-2); color:var(--ink-2); white-space:nowrap; display:inline-flex; align-items:center; gap:6px; }
.tact:hover{ background:var(--surface-2); color:var(--ink); border-color:var(--navy-300); }
.tact svg{ width:14px; height:14px; }
.tact.primary{ background:var(--navy); border-color:var(--navy); color:#fff; }
.tact.primary:hover{ background:var(--navy-700); }
.tact.danger{ color:var(--red); border-color:var(--red-100); background:var(--red-050); }
.tact.danger:hover{ background:var(--red-100); }

/* ── 10 · EMPTY STATE  (calm: icon + one line + the next action) ──────────── */
.empty{ display:flex; flex-direction:column; align-items:center; text-align:center; gap:14px; padding:48px 28px; }
.empty-ic{ width:64px; height:64px; border-radius:18px; display:flex; align-items:center; justify-content:center; background:var(--good-050); color:var(--good); border:1px solid var(--good-line); }
.empty-ic svg{ width:30px; height:30px; }
.empty h3{ font-size:18px; color:var(--ink); }
.empty p{ font-size:14.5px; color:var(--ink-2); max-width:46ch; line-height:1.55; }
.empty .empty-act{ margin-top:4px; }

/* ── 11 · NOTES / CALLOUTS ───────────────────────────────────────────────── */
.note{ display:flex; gap:11px; align-items:flex-start; padding:13px 15px; border-radius:var(--r-md); font-size:13.5px; line-height:1.5; border:1px solid; }
.note svg{ width:18px; height:18px; flex:none; margin-top:1px; }
.note b{ font-weight:750; }
.note--info{ background:var(--good-050); border-color:var(--good-line); color:var(--good); }
.note--info span{ color:var(--ink-2); }
.note--warn{ background:var(--amber-050); border-color:var(--amber-100); color:var(--amber); }
.note--warn span{ color:var(--ink-2); }
.note--danger{ background:var(--red-050); border-color:var(--red-100); color:var(--red); }
.note--danger span{ color:var(--ink-2); }

/* Redacted / consent-gated content chip (sober, never reveals) */
.redacted{ font-family:var(--mono); font-size:12.5px; color:var(--ink-3); background:repeating-linear-gradient(135deg, var(--surface-2) 0 7px, var(--bg-sunk) 7px 14px); border:1px dashed var(--line-2); border-radius:var(--r-sm); padding:4px 10px; display:inline-flex; align-items:center; gap:7px; }
.redacted svg{ width:13px; height:13px; }

/* ── 12 · TOOLBAR + UTILITIES ────────────────────────────────────────────── */
.toolbar{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.search{ display:inline-flex; align-items:center; gap:9px; background:var(--surface); border:1.5px solid var(--line-2); border-radius:var(--r-md); padding:0 13px; min-height:44px; flex:1; min-width:220px; }
.search svg{ width:17px; height:17px; color:var(--ink-3); flex:none; }
.search input{ background:transparent; border:0; outline:none; color:var(--ink); font-size:14px; width:100%; min-width:0; }
.search input::placeholder{ color:var(--ink-3); }
.filter{ display:inline-flex; align-items:center; gap:8px; background:var(--surface); border:1.5px solid var(--line-2); border-radius:var(--r-md); min-height:44px; padding:0 12px; color:var(--ink-2); font-size:14px; font-weight:650; }
.filter select{ appearance:none; -webkit-appearance:none; background:transparent; border:0; outline:none; color:inherit; font:inherit; font-weight:650; cursor:pointer; padding-right:18px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235E6880' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right center; }

.stack > * + *{ margin-top:14px; }
.stack-sm > * + *{ margin-top:9px; }
.row{ display:flex; align-items:center; gap:10px; }
.row.between{ justify-content:space-between; }
.row.wrap{ flex-wrap:wrap; }
.grow{ flex:1; min-width:0; }
.wrap-gap{ display:flex; flex-wrap:wrap; gap:8px; }
.grid-2{ display:grid; gap:16px; }
@media (min-width:760px){ .grid-2{ grid-template-columns:1fr 1fr; } }

/* Glyph tile — coloured icon container used in cards / list rows */
.glyph{ width:46px; height:46px; border-radius:12px; flex:none; display:flex; align-items:center; justify-content:center; }
.glyph svg{ width:22px; height:22px; }
.glyph-sm{ width:38px; height:38px; border-radius:10px; }
.glyph-sm svg{ width:18px; height:18px; }
.glyph--navy{  background:var(--good-050);  color:var(--good); }
.glyph--accent{ background:var(--accent-050); color:var(--accent-deeper); }
.glyph--green{ background:var(--green-050); color:var(--green); }
.glyph--amber{ background:var(--amber-050); color:var(--amber); }
.glyph--red{   background:var(--red-050);   color:var(--red); }
.glyph--grey{  background:var(--bg-sunk);   color:var(--ink-3); }

@media (prefers-reduced-motion:reduce){ *{ animation:none !important; transition:none !important; } }
