/* ============================================================================
   ORION TOKENS — "The Chart Room" (docs/audit/02-design-directions.md)
   Single source of truth for colour, type, space, radius, elevation, motion.
   Loaded AFTER styles.css; defines only --t-* names (no legacy collisions —
   the alias approach in the design doc was dropped: legacy vars are re-pointed
   inside styles.css rule-by-rule instead, because [data-theme="dark"] blocks in
   styles.css would cascade-fight :root aliases here).
   THE FOUR STATUS TOKENS ARE FOR STATUS ONLY — never decoration (audit §2).
   ========================================================================== */
:root {
  /* ink & surface */
  --t-ink:        #0A1128;   /* Void Navy */
  --t-ink-soft:   #4A5468;
  --t-surface:    #F7F5EF;   /* Ivory */
  --t-panel:      #FFFFFF;
  --t-line:       #E3DFD2;

  /* brand signal */
  --t-action:     #1B3B6F;   /* Regal Blue — primary actions/links */
  --t-action-ink: #FFFFFF;
  --t-focus:      #C9A24D;   /* Sovereign Gold — focus/selection/"you are here" ONLY */

  /* the four states — AA-checked ink on tint */
  --t-overdue:        #B3261E;  --t-overdue-tint:   #FAE7E4;
  --t-open:           #8A6100;  --t-open-tint:      #F6EED8;
  --t-scheduled:      #2C5490;  --t-scheduled-tint: #E7EEF7;
  --t-complete:       #1F7A4D;  --t-complete-tint:  #E2F1E8;

  /* type scale (Onest heads / Work Sans body unchanged) */
  --t-fs-caption: 12px; --t-fs-table: 14px; --t-fs-body: 16px;
  --t-fs-h3: 19px; --t-fs-h2: 24px; --t-fs-h1: 32px; --t-fs-display: 44px;

  /* space / radius / elevation / motion */
  --t-s1: 4px; --t-s2: 8px; --t-s3: 12px; --t-s4: 16px;
  --t-s5: 24px; --t-s6: 32px; --t-s7: 48px;
  --t-r-sm: 4px; --t-r-md: 10px; --t-r-lg: 16px; --t-r-pill: 999px;
  --t-shadow-rest:   0 1px 3px rgba(10,17,40,.08);
  --t-shadow-raised: 0 6px 24px rgba(10,17,40,.14);
  --t-ease: cubic-bezier(.2,.8,.2,1); --t-fast: 120ms; --t-move: 200ms;
}

[data-theme="dark"] {
  --t-ink: #EEF2F8; --t-ink-soft: #9FB0CC;
  --t-surface: #070B18; --t-panel: #0F1D3B; --t-line: #22314F;
  --t-action: #6F94D4; --t-focus: #E4C878;
  --t-overdue:   #FF6B5E; --t-overdue-tint:   rgba(179,38,30,.24);
  --t-open:      #E4C878; --t-open-tint:      rgba(138,97,0,.24);
  --t-scheduled: #7FA6E0; --t-scheduled-tint: rgba(44,84,144,.28);
  --t-complete:  #5BC894; --t-complete-tint:  rgba(31,122,77,.24);
  --t-shadow-rest:   0 1px 3px rgba(0,0,0,.42);
  --t-shadow-raised: 0 8px 28px rgba(0,0,0,.55);
}

/* ---- status glyphs: the "status fix" — status is never colour alone ---- */
.badge--Overdue::before   { content: "● "; }
.badge--Open::before      { content: "◐ "; }
.badge--Scheduled::before { content: "○ "; }
.badge--Complete::before  { content: "✦ "; }

/* ---- non-status tag chips (T1.6) — replaces badge--* misuse ---- */
.tagchip { font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  display: inline-block; white-space: nowrap; }
.tagchip--warn { background: var(--t-overdue-tint); color: var(--t-overdue); }
.tagchip--gold { background: #F3E9D2; color: #7A5B16; }
.tagchip--navy { background: var(--t-scheduled-tint); color: var(--t-action); }
.tagchip--ok   { background: var(--t-complete-tint); color: var(--t-complete); }
[data-theme="dark"] .tagchip--gold { background: rgba(201,162,77,.22); color: #E4C878; }

/* ---- focus visibility (T0.5) ---- */
:focus-visible { outline: 2px solid var(--t-focus); outline-offset: 2px; }
.pill:focus-visible, .rowbook:focus-visible, .rowedit:focus-visible,
.fchip:focus-visible, .segmented button:focus-visible {
  outline: 2px solid var(--t-focus); outline-offset: 2px;
}

/* ---- reduced motion (T0.5) ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ---- per-portal identity tint on the topbar (T0.6; body[data-portal] set by app.js) ---- */
body[data-portal="staff"]   .topbar { background: linear-gradient(90deg, #1F7A4D, #2E7D5B 45%, #C9A24D); }
body[data-portal="manager"] .topbar { background: linear-gradient(90deg, #8A6100, #C9A24D 45%, #E4C878); }
/* admin keeps the navy default from styles.css */

/* ---- hit targets (T0.7) ---- */
.attchip__set { width: 24px; height: 24px; font-size: 12px; }
.attchip__x, .courseitem__x, .comp-chip__x, .acl__delrole {
  min-width: 24px; min-height: 24px; display: inline-grid; place-items: center;
}
@media (pointer: coarse) {
  .attchip__set { width: 32px; height: 32px; }
  .attchip__x, .courseitem__x, .comp-chip__x { min-width: 36px; min-height: 36px; }
}

/* ---- sticky table headers (T0.8) ---- */
.table-card .table__scroll { max-height: 70vh; overflow-y: auto; }
.table thead th { position: sticky; top: 0; z-index: 2; }

/* ---- contrast: fchip off-state was opacity .55 (audit §10) ---- */
.fchip { opacity: .78; }
.fchip.is-on { opacity: 1; }
