/* Apple Fest · CIDER — Festival Operations Platform
 * Design system v4, implementing the Cider design handoff.
 *
 *   Source: specs/brand-standards-v1.4 + /tmp/af-design/fop-portal
 *   Platform name: Cider (tenant: Saint Lawrence Apple Fest)
 *   Shell: hybrid icon rail (76px) + secondary nav (240px) + main
 *   Topbar: navy 56px + red 3px underline, brand lockup + search + phase + alerts + theme + user
 *   EOC bar: phase-gated, between topbar and nav row
 *
 * Rules enforced:
 *   - Red is brand + primary action + active. Gold = warning. Sky = healthy.
 *   - No green in UI (brand rule §09 — green is logo-leaf only).
 *   - Oswald display, Montserrat body, DM Mono (Google Fonts for now).
 *   - Square corners (--radius-sm 3px). Capsule shapes avoided.
 */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Montserrat:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  /* ---------- BRAND PALETTE ---------- */
  --af-red:         #e51e25;
  --af-red-dark:    #a01515;
  --af-red-screen:  #CC1B1B;
  --af-black:       #231f20;
  --af-white:       #ffffff;

  --af-sky:         #41b6e6;
  --af-royal:       #0047bb;
  --af-green:       #31b700;      /* logo leaf only — never in UI */
  --af-brown:       #3f1310;
  --af-gold:        #ffc72c;
  --af-gray:        #8c959d;

  --af-navy:        #1B2A4A;
  --af-navy-900:    #12192F;
  --af-cream:       #F7F3EE;
  --af-parchment:   #EDE8DF;
  --af-rule:        #D9D0C4;

  /* ---------- FOUNDATION (semantic) ---------- */
  --fg-1:           #1C1C1C;
  --fg-2:           #5A5A5A;
  --fg-3:           #8B8B8B;
  --fg-inverse:     #ffffff;

  --bg-1:           var(--af-cream);      /* cards, panels, secondary nav */
  --bg-2:           var(--af-parchment);  /* page background */
  --bg-3:           #ECE6DC;              /* deeper tint */

  --border-1:       #D9D0C4;
  --border-2:       #A8A39A;

  --accent:         var(--af-red);
  --link:           var(--af-royal);
  --success:        var(--af-sky);
  --warning:        var(--af-gold);
  --danger:         var(--af-red);
  --info:           var(--af-royal);

  /* ---------- TYPE ---------- */
  --font-display:   'Oswald', 'Impact', 'Arial Narrow Bold', sans-serif;
  --font-body:      'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:      'DM Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-sans:      var(--font-body);

  /* Scale (aligns with design) */
  --text-hero:      52px;
  --text-h1:        40px;
  --text-h2:        32px;
  --text-h3:        22px;
  --text-h4:        16px;
  --text-label:     13px;
  --text-body:      15px;
  --text-small:     13px;
  --text-caption:   12px;
  --text-micro:     11px;

  --leading-tight:  1.05;
  --leading-snug:   1.3;
  --leading-normal: 1.55;
  --leading-loose:  1.78;

  --track-display:  0.04em;
  --track-label:    0.12em;
  --track-eyebrow:  0.18em;

  /* ---------- SPACING (4px grid) ---------- */
  --space-1:  4px;   --space-2:  8px;   --space-3: 12px;
  --space-4: 16px;   --space-5: 20px;   --space-6: 24px;
  --space-8: 32px;   --space-10:40px;   --space-12:48px;
  --space-16:64px;

  /* ---------- RADIUS (square-ish per brand) ---------- */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;

  /* ---------- SHADOWS ---------- */
  --shadow-sm: 0 1px 2px rgba(27, 42, 74, 0.06);
  --shadow-md: 0 2px 10px rgba(27, 42, 74, 0.08);
  --shadow-lg: 0 8px 24px rgba(27, 42, 74, 0.12);

  --ring: 0 0 0 3px rgba(229, 30, 37, 0.18);

  /* Legacy aliases so pre-existing pages don't break while we migrate */
  --af-font-display: var(--font-display);
  --af-font-body:    var(--font-body);
  --af-font-mono:    var(--font-mono);
  --af-font-sans:    var(--font-body);
  --af-bg:           var(--bg-1);
  --af-bg-muted:     var(--bg-2);
  --af-bg-inset:     var(--bg-3);
  --af-surface:      var(--bg-1);
  --af-surface-muted:var(--bg-2);
  --af-surface-inset:var(--bg-3);
  --af-fg:           var(--fg-1);
  --af-fg-muted:     var(--fg-2);
  --af-fg-subtle:    var(--fg-3);
  --af-border:       var(--border-1);
  --af-border-soft:  var(--border-1);
  --af-border-strong:var(--border-2);
  --af-link:         var(--link);
  --af-accent:       var(--accent);
  --af-danger:       var(--danger);
  --af-warning:      var(--warning);
  --af-success:      var(--success);
  --af-info:         var(--info);
  --af-red-quiet:    rgba(229,30,37,0.08);
  --af-sky-quiet:    rgba(65,182,230,0.14);
  --af-gold-quiet:   rgba(255,199,44,0.18);
  --af-text-xs:      var(--text-caption);
  --af-text-sm:      var(--text-small);
  --af-text-base:    var(--text-body);
  --af-text-md:      var(--text-h4);
  --af-text-lg:      1.1875rem;
  --af-text-xl:      1.375rem;
  --af-text-2xl:     1.75rem;
  --af-text-3xl:     2.25rem;
  --af-text-4xl:     3rem;
  --af-space-1:      var(--space-1);
  --af-space-2:      var(--space-2);
  --af-space-3:      var(--space-3);
  --af-space-4:      var(--space-4);
  --af-space-5:      var(--space-5);
  --af-space-6:      var(--space-6);
  --af-space-8:      var(--space-8);
  --af-space-10:     var(--space-10);
  --af-space-12:     var(--space-12);
  --af-radius-sm:    var(--radius-sm);
  --af-radius-md:    var(--radius-md);
  --af-radius-lg:    var(--radius-lg);
  --af-shadow-sm:    var(--shadow-sm);
  --af-shadow-md:    var(--shadow-md);
  --af-shadow-lg:    var(--shadow-lg);
  --af-ring:         var(--ring);
}

/* ---------- DARK MODE ---------- */
:root[data-theme="dark"] {
  --fg-1:       #EEF1F6;
  --fg-2:       #CCCCCC;
  --fg-3:       #8F95A4;
  --bg-1:       #12151C;
  --bg-2:       #0A0D14;
  --bg-3:       #1A1F2B;
  --border-1:   #2A3142;
  --border-2:   #3B4256;
  --link:       #7ABBE7;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  color: var(--fg-1);
  background: var(--bg-2);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--track-display);
  text-transform: uppercase;
  color: var(--fg-1);
  margin: 0;
  line-height: var(--leading-tight);
}
h1 { font-size: var(--text-hero); letter-spacing: 0.03em; }
h2 { font-size: var(--text-h2); letter-spacing: 0.05em; }
h3 { font-size: var(--text-h3); font-weight: 600; letter-spacing: 0.05em; }
h4 { font-size: var(--text-h4); font-weight: 600; letter-spacing: 0.08em; }
h5 { font-size: var(--text-small); font-weight: 600; letter-spacing: var(--track-label); color: var(--af-red); }

p  { font-size: var(--text-body); line-height: var(--leading-loose); color: var(--fg-2); margin: 0 0 var(--space-4); }
a  { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, pre { font-family: var(--font-mono); font-size: 0.9em; }

.eyebrow, .af-eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-micro);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--af-red);
}

.af-label {
  font-family: var(--font-display);
  font-size: var(--text-micro);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--fg-2);
}
.af-meta   { font-size: var(--text-caption); color: var(--fg-3); line-height: 1.45; }
.af-body   { font-size: var(--text-body); color: var(--fg-1); }
.af-muted  { color: var(--fg-2); }
.af-subtle { color: var(--fg-3); }
.af-danger-text { color: var(--danger); }
.af-success-text { color: var(--success); }
.mono { font-family: var(--font-mono); }

/* ---------- buttons ---------- */
button, .fop-btn, .af-btn {
  --_bg: var(--bg-1);
  --_fg: var(--fg-1);
  --_bd: var(--border-1);
  appearance: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-small);
  line-height: 1.2;
  padding: 8px 14px;
  background: var(--_bg);
  color: var(--_fg);
  border: 1px solid var(--_bd);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms, box-shadow 120ms;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
button:hover:not(:disabled), .fop-btn:hover:not(:disabled), .af-btn:hover:not(:disabled) {
  --_bg: var(--bg-2);
  --_bd: var(--border-2);
}
button:focus-visible, .fop-btn:focus-visible, .af-btn:focus-visible { outline: none; box-shadow: var(--ring); }
button:disabled, .fop-btn:disabled, .af-btn:disabled { opacity: 0.45; cursor: not-allowed; }

button.primary, .fop-btn.primary, .af-btn.primary {
  --_bg: var(--af-red); --_fg: #fff; --_bd: var(--af-red);
}
button.primary:hover, .fop-btn.primary:hover, .af-btn.primary:hover {
  --_bg: var(--af-red-dark); --_bd: var(--af-red-dark);
}
button.ghost, .fop-btn.ghost, .af-btn.ghost {
  --_bg: transparent; --_fg: var(--fg-2); --_bd: transparent;
  padding: 6px 10px;
}
button.ghost:hover, .fop-btn.ghost:hover, .af-btn.ghost:hover { --_bg: var(--bg-2); --_fg: var(--fg-1); }
button.danger, .af-btn.danger {
  --_bg: transparent; --_fg: var(--af-red); --_bd: var(--border-1);
}
button.danger:hover, .af-btn.danger:hover { --_bg: var(--af-red); --_fg: #fff; --_bd: var(--af-red); }

/* ---------- inputs ---------- */
input, select, textarea {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  padding: 9px 12px;
  background: var(--bg-1);
  color: var(--fg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
  width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--fg-3); }
input:focus, select:focus, textarea:focus { border-color: var(--af-red); box-shadow: var(--ring); }

label {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--fg-2);
  margin-bottom: 6px;
}
label.af-plain { font-family: var(--font-body); font-size: var(--text-small); text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--fg-1); }

/* ============================================================
 * SHELL — hybrid variant from design
 * ============================================================ */

.fop-shell {
  display: grid;
  grid-template-columns: 76px 240px 1fr;
  grid-template-rows: 56px auto 1fr;
  grid-template-areas:
    "top top top"
    "eoc eoc eoc"
    "rail secondary main";
  height: 100vh;
  background: var(--bg-2);
  transition: grid-template-columns .22s ease;
  position: relative;   /* so .fop-nav-handle anchors to the shell, not to main */
}
.fop-shell.collapsed { grid-template-columns: 76px 0 1fr; }
.fop-shell.collapsed .fop-secondary { transform: translateX(-100%); pointer-events: none; opacity: 0; }

/* ===== TOPBAR ===== */
.fop-topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--af-navy);
  color: #fff;
  padding: 0 16px;
  border-bottom: 3px solid var(--af-red);
  position: relative;
  z-index: 100;
}
.fop-topbar .brand {
  display: flex; align-items: center; gap: 12px;
  padding-right: 14px; border-right: 1px solid rgba(255,255,255,0.14);
  min-width: 0;
}
.fop-topbar .brand img { height: 28px; width: auto; flex-shrink: 0; }
.fop-topbar .brand .wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.14em;
  color: #fff;
  line-height: 1;
  text-transform: uppercase;
}
.fop-topbar .brand .tenant {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.62);
  text-transform: none;
  margin-top: 3px;
  white-space: nowrap;
}
.fop-topbar .brand-wordmark { display: flex; flex-direction: column; min-width: 0; }

.fop-search-btn {
  flex: 1; max-width: 560px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.68);
  text-align: left;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  border-radius: var(--radius-sm);
  cursor: text;
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.fop-search-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.fop-search-btn kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
}

.fop-topbar-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
}

.phase-chip {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: #fff;
  background: rgba(229,30,37,0.28);
  border: 1px solid rgba(229,30,37,0.4);
  padding: 4px 10px;
  border-radius: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}

.tb-iconbtn {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  position: relative;
}
.tb-iconbtn:hover { background: rgba(255,255,255,0.14); color: #fff; border-color: rgba(255,255,255,0.25); }
.tb-iconbtn-glyph { font-size: 16px; line-height: 1; }

/* Alerts bell dot */
.tb-bell-dot {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--af-red); color: #fff;
  font-family: var(--font-display); font-size: 9px; font-weight: 700;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--af-navy);
}

/* Bell menu */
.tb-bell-wrap { position: relative; }
.tb-bell-menu {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 380px;
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-top: 3px solid var(--af-red);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 9500;
  display: none;
  overflow: hidden;
}
.tb-bell-menu.show { display: block; }
.tb-bell-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-1);
  background: var(--bg-2);
}
.tb-bell-title {
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-1);
}
.tb-bell-sub { font-size: 11px; color: var(--fg-2); margin-top: 2px; }
.tb-bell-mark {
  font-family: var(--font-display); font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--af-red); background: transparent; border: none; cursor: pointer;
  padding: 0;
}
.tb-bell-list { max-height: 420px; overflow-y: auto; }
.tb-alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-1);
  cursor: pointer;
  transition: background 120ms;
}
.tb-alert:hover { background: var(--bg-2); }
.tb-alert.read { opacity: 0.65; }
.tb-alert-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--af-red); margin-top: 5px; flex-shrink: 0;
}
.tb-alert-dot.warn { background: #c27500; }
.tb-alert-dot.info { background: var(--af-sky); }
.tb-alert-body { flex: 1; min-width: 0; }
.tb-alert-title { font-size: 13px; font-weight: 600; color: var(--fg-1); line-height: 1.35; }
.tb-alert-meta {
  font-family: var(--font-display); font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-3); margin-top: 4px;
}
.tb-bell-empty { padding: 40px 20px; text-align: center; }
.tb-bell-empty-title {
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  letter-spacing: 0.04em; color: var(--af-sky);
}
.tb-bell-empty-sub { font-size: 12px; color: var(--fg-2); margin-top: 6px; }

/* User chip */
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding-left: 10px; border-left: 1px solid rgba(255,255,255,0.14);
  color: #fff;
}
.user-ava {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  background: var(--af-red);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-family: var(--font-display); font-weight: 700;
  font-size: 11px; letter-spacing: 0.04em;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.user-role { font-size: 10px; color: rgba(255,255,255,0.6); letter-spacing: 0.06em; text-transform: uppercase; }

.fop-signout {
  background: transparent; border: 1px solid rgba(255,255,255,0.2); color: #fff;
  padding: 5px 12px; font-size: 11px; cursor: pointer;
  font-family: var(--font-body); font-weight: 600;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
}
.fop-signout:hover { background: rgba(255,255,255,0.08); }

/* ===== EOC BAR ===== */
.eoc-bar {
  grid-area: eoc;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  background: linear-gradient(180deg, #12151C 0%, #1a1e28 100%);
  color: #fff;
  padding: 10px 20px;
  border-bottom: 2px solid var(--af-red);
  border-top: 1px solid rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}
.eoc-bar::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg,
    transparent 0, transparent 18px,
    rgba(229,30,37,0.04) 18px, rgba(229,30,37,0.04) 19px);
  pointer-events: none;
}
.eoc-bar.hidden { display: none; }
.eoc-bar.collapsed {
  display: flex; gap: 12px; align-items: center; justify-content: center;
  padding: 6px 16px;
  background: #12151C;
  border: none; border-bottom: 1px solid rgba(229,30,37,0.3);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  font-family: var(--font-display); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 600;
}
.eoc-bar.collapsed:hover { background: #1a1e28; color: #fff; }

.eoc-lead {
  display: flex; align-items: center; gap: 10px;
  padding-right: 16px; border-right: 1px solid rgba(255,255,255,0.1);
  position: relative;
}
.eoc-pulse {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--af-red);
  box-shadow: 0 0 0 0 rgba(229,30,37,0.7);
  animation: eoc-pulse 1.8s infinite;
  flex-shrink: 0;
}
@keyframes eoc-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(229,30,37,0.6); }
  70%  { box-shadow: 0 0 0 12px rgba(229,30,37,0); }
  100% { box-shadow: 0 0 0 0 rgba(229,30,37,0); }
}
.eoc-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 12px; letter-spacing: 0.16em;
  color: #fff; line-height: 1;
}
.eoc-sub {
  font-size: 10px; color: rgba(255,255,255,0.55);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-top: 3px;
}
.eoc-cells {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  position: relative;
}
.eoc-cell {
  padding: 2px 14px;
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column; gap: 1px;
  min-width: 0;
}
.eoc-cell:last-child { border-right: none; }
.eoc-cell-lbl {
  font-family: var(--font-display); font-weight: 600;
  font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  line-height: 1;
}
.eoc-cell-val {
  font-family: var(--font-display); font-weight: 700;
  font-size: 15px; letter-spacing: 0.02em; color: #fff;
  line-height: 1.1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.eoc-cell-sub {
  font-size: 10px; color: rgba(255,255,255,0.55);
  line-height: 1.1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.eoc-cell.live .eoc-cell-val { color: var(--af-sky); }
.eoc-cell.warn .eoc-cell-val { color: #ffa940; }
.eoc-cell.urgent .eoc-cell-val { color: #ff5560; }
.eoc-cell.ok .eoc-cell-val { color: #fff; }
.eoc-actions { display: flex; gap: 6px; align-items: center; }
.eoc-action {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 3px;
  background: rgba(229,30,37,0.15);
  border: 1px solid rgba(229,30,37,0.35);
  color: #fff; cursor: pointer;
  font-family: var(--font-display); font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.eoc-action:hover { background: var(--af-red); border-color: var(--af-red); }
.eoc-collapse {
  width: 28px; height: 28px; border-radius: 3px;
  background: transparent; border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7); cursor: pointer;
  font-size: 10px; padding: 0;
}
.eoc-collapse:hover { color: #fff; border-color: rgba(255,255,255,0.4); }

/* ===== ICON RAIL (left) ===== */
.fop-rail {
  grid-area: rail;
  background: var(--af-navy);
  padding: 12px 0;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.05);
}
.fop-rail-btn {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 0;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.12s;
  text-decoration: none;
  width: 100%;
}
.fop-rail-btn:hover { color: #fff; background: rgba(255,255,255,0.05); text-decoration: none; }
.fop-rail-btn.active {
  color: #fff;
  border-left-color: var(--af-red);
  background: rgba(229,30,37,0.12);
}
.fop-rail-icon {
  font-size: 20px; line-height: 1;
  color: rgba(255,255,255,0.5);
}
.fop-rail-btn.active .fop-rail-icon { color: var(--af-red); }
.fop-rail-glyph {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}
.fop-rail-dot {
  position: absolute; top: 8px; right: 10px;
  background: var(--af-red); color: #fff;
  font-family: var(--font-display); font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* ===== SECONDARY NAV ===== */
.fop-secondary {
  grid-area: secondary;
  background: var(--bg-1);
  border-right: 1px solid var(--border-1);
  overflow-y: auto;
  transition: transform .22s ease, opacity .15s ease;
  overflow-x: hidden;
  position: relative;
}
.fop-sec-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border-1);
  position: relative;
}
.fop-sec-icon {
  width: 36px; height: 36px;
  background: var(--bg-2); border: 1px solid var(--border-1);
  display: flex; align-items: center; justify-content: center;
  color: var(--af-red); font-size: 18px;
  border-radius: var(--radius-sm);
}
.fop-sec-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--af-navy);
}
:root[data-theme="dark"] .fop-sec-title { color: #fff; }
.fop-sec-sub {
  font-size: 10px; color: var(--fg-2);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-top: 2px;
}
/* The in-header close button is retired — the single shell-level
   .fop-nav-handle (below) owns collapse/expand. Kept as a no-op rule
   so any stray markup still renders invisibly. */
.fop-sec-collapse { display: none; }

.fop-sec-items { padding: 8px 0; }
.fop-sec-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-1);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.fop-sec-item:hover { background: var(--bg-2); color: var(--af-navy); text-decoration: none; }
:root[data-theme="dark"] .fop-sec-item:hover { color: #fff; }
.fop-sec-item.active {
  background: var(--bg-2);
  color: var(--af-red);
  border-left-color: var(--af-red);
  font-weight: 600;
}
.fop-sec-item.stub { opacity: 0.55; cursor: not-allowed; }
.fop-sec-label { flex: 1; }
.fop-sec-soon, .fop-sec-ext {
  font-family: var(--font-display); font-size: 9px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--af-red); background: rgba(229,30,37,0.1);
  padding: 2px 5px; border-radius: 2px;
}
.fop-sec-urgent {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--af-red); color: #fff;
  font-family: var(--font-display); font-size: 10px; font-weight: 700;
  border-radius: 9px; letter-spacing: 0.02em; line-height: 1;
}

/* ===== Collapse / expand handle =====
 *
 * A single shell-level control that docks to the seam between whichever
 * pane is to its left (rail when collapsed, secondary when expanded) and
 * the main content on its right. Positioned against .fop-shell, not main,
 * so it tracks the grid's column geometry and never drifts into content.
 *
 * Rounded corners only on the right side so it reads as a tab fused to
 * the pane on its left. Subtle red shadow opens rightward into main.
 * The shell's grid-template-columns transition (.22s) and the handle's
 * `left` transition run in lockstep, so it animates with the pane.
 */
.fop-nav-handle {
  position: absolute;
  top: 50%;
  left: calc(76px + 240px);    /* expanded: flush with secondary's right edge */
  transform: translateY(-50%);
  width: 26px;
  height: 80px;
  padding: 0;
  background: var(--af-red);
  color: #fff;
  border: none;
  border-radius: 0 6px 6px 0;
  box-shadow: 2px 0 10px rgba(229, 30, 37, 0.22);
  cursor: pointer;
  z-index: 60;

  display: flex;
  align-items: center;
  justify-content: center;

  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;

  transition:
    left 0.22s ease,
    width 0.15s ease,
    background 0.12s ease,
    box-shadow 0.15s ease;
}
.fop-nav-handle:hover {
  background: var(--af-red-dark);
  width: 32px;
  box-shadow: 3px 0 14px rgba(229, 30, 37, 0.32);
}
.fop-nav-handle:focus-visible {
  outline: none;
  box-shadow:
    2px 0 10px rgba(229, 30, 37, 0.32),
    0 0 0 3px rgba(229, 30, 37, 0.35);
}
.fop-shell.collapsed .fop-nav-handle {
  left: 76px;                   /* collapsed: flush with rail's right edge */
}

/* Glyph swap — tells you what the next click will do */
.fop-nav-handle .glyph-expanded,
.fop-nav-handle .glyph-collapsed { display: block; }
.fop-nav-handle .glyph-collapsed { display: none; }
.fop-shell.collapsed .fop-nav-handle .glyph-expanded { display: none; }
.fop-shell.collapsed .fop-nav-handle .glyph-collapsed { display: block; }

@media (max-width: 900px) {
  .fop-nav-handle { display: none !important; }
}

/* ===== MAIN ===== */
.fop-main {
  grid-area: main;
  overflow-y: auto;
  padding: 28px 36px 48px;
  background: var(--bg-2);
  position: relative;
}
.fop-main > .page-fade { max-width: 1340px; margin: 0 auto; animation: pageFade 0.18s ease-out; }
@keyframes pageFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
 * PAGE HEAD + KPI STRIP + ALERT BANNER (shared primitives)
 * ============================================================ */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--af-red);
  flex-wrap: wrap;
}
.page-head .title-block { min-width: 0; }
.page-head .eyebrow-row {
  display: flex; align-items: baseline; gap: 12px;
  font-family: var(--font-display); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--af-red); font-weight: 600;
  margin-bottom: 6px;
}
.page-head .eyebrow-row .sep { color: var(--fg-3); }
.page-head .eyebrow-row .crumb { color: var(--fg-3); letter-spacing: 0.12em; }
.page-head h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 32px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--fg-1);
  margin: 0; line-height: 1;
}
.page-head .page-sub {
  font-size: 13px; color: var(--fg-2); margin-top: 6px; max-width: 640px;
  line-height: 1.55;
}
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* KPI strip */
.page-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border-1);
  border: 1px solid var(--border-1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 24px;
}
.pkpi-cell {
  background: var(--bg-1);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
  border-top: 2px solid transparent;
}
.pkpi-cell.green  { border-top-color: var(--af-sky); }
.pkpi-cell.amber  { border-top-color: var(--af-gold); }
.pkpi-cell.red    { border-top-color: var(--af-red); }
.pkpi-cell.navy   { border-top-color: var(--af-navy); }
.pkpi-val {
  font-family: var(--font-display); font-weight: 700;
  font-size: 22px; letter-spacing: 0.02em;
  color: var(--fg-1); line-height: 1;
  display: flex; align-items: baseline; gap: 6px;
}
.pkpi-cell.green .pkpi-val { color: var(--af-sky); }
.pkpi-cell.amber .pkpi-val { color: #c27500; }
.pkpi-cell.red   .pkpi-val { color: var(--af-red); }
.pkpi-delta {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--fg-2); letter-spacing: 0;
}
.pkpi-delta.up   { color: var(--af-sky); }
.pkpi-delta.down { color: var(--af-red); }
.pkpi-lbl {
  font-family: var(--font-display); font-weight: 600;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-2);
}
.pkpi-sub { font-size: 11px; color: var(--fg-3); line-height: 1.3; }

/* Alert banner */
.alert-banner {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-radius: 4px;
  border: 1px solid;
  margin-bottom: 16px;
}
.alert-banner.urgent {
  background: rgba(229,30,37,0.08);
  border-color: rgba(229,30,37,0.4);
  border-left: 4px solid var(--af-red);
}
.alert-banner.warn {
  background: rgba(194,117,0,0.08);
  border-color: rgba(194,117,0,0.4);
  border-left: 4px solid #c27500;
}
.alert-banner.info {
  background: rgba(41,151,219,0.08);
  border-color: rgba(41,151,219,0.4);
  border-left: 4px solid var(--af-sky);
}
.alert-icon {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}
.alert-banner.urgent .alert-icon { background: var(--af-red); color: #fff; }
.alert-banner.warn   .alert-icon { background: #c27500; color: #fff; }
.alert-banner.info   .alert-icon { background: var(--af-sky); color: #fff; }
.alert-body { flex: 1; }
.alert-title { font-weight: 600; font-size: 13px; color: var(--fg-1); }
.alert-text { font-size: 12px; color: var(--fg-2); margin-top: 3px; line-height: 1.45; }
.alert-dismiss {
  background: transparent; border: none; cursor: pointer;
  color: var(--fg-3); font-size: 14px; padding: 2px 6px;
}
.alert-dismiss:hover { color: var(--fg-1); }

/* ============================================================
 * PANEL + STATS primitives
 * ============================================================ */
.fop-panel {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: 6px;
  overflow: hidden;
}
.fop-panel.accent { border-top: 3px solid var(--af-red); }
.fop-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--border-1);
  background: var(--bg-2);
}
.fop-panel-title {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--af-red);
}
.fop-panel-title-sub { font-size: 11px; color: var(--fg-3); font-weight: 500; margin-top: 2px; letter-spacing: 0; text-transform: none; }
.fop-panel-body { padding: 16px 18px; }
.fop-panel-actions { display: flex; gap: 8px; align-items: center; }

.fop-panel-list > * {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-1);
}
.fop-panel-list > *:last-child { border-bottom: none; }

/* Stats ribbon */
.fop-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: 6px;
  overflow: hidden;
}
.fop-stat {
  padding: 18px 20px;
  border-right: 1px solid var(--border-1);
  display: flex; flex-direction: column; gap: 4px;
}
.fop-stat:last-child { border-right: none; }
.fop-stat .num {
  font-family: var(--font-display); font-weight: 700;
  font-size: 30px; line-height: 1; letter-spacing: 0.02em;
  color: var(--fg-1);
}
.fop-stat .num.sky { color: var(--af-sky); }
.fop-stat .num.amb { color: #c27500; }
.fop-stat .num.red { color: var(--af-red); }
.fop-stat .num.blu { color: var(--af-royal); }
.fop-stat .lbl {
  font-family: var(--font-display); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg-2);
}
.fop-stat .sub { font-size: 11px; color: var(--fg-3); }

/* Badges */
.fop-badge, .af-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  font-family: var(--font-display); font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: 2px;
  background: var(--af-parchment);
  color: var(--fg-2);
  border: 1px solid var(--border-1);
  white-space: nowrap;
  line-height: 1.55;
}
.fop-badge.red, .af-badge.red       { background: rgba(229,30,37,0.12); color: var(--af-red);    border-color: rgba(229,30,37,0.3); }
.fop-badge.sky, .af-badge.sky       { background: rgba(65,182,230,0.14); color: #1f7ba1;         border-color: rgba(65,182,230,0.35); }
.fop-badge.gold, .af-badge.gold     { background: rgba(255,199,44,0.18); color: #7a5a00;         border-color: rgba(255,199,44,0.45); }
.fop-badge.royal, .af-badge.royal   { background: rgba(0,71,187,0.12);  color: var(--af-royal); border-color: rgba(0,71,187,0.25); }
.af-badge.gray                      { background: var(--af-parchment);  color: var(--fg-2); }
.fop-badge.filled.red, .af-badge.solid-red   { background: var(--af-red);  color: #fff; border-color: var(--af-red); }
.fop-badge.filled.navy, .af-badge.solid-navy { background: var(--af-navy); color: #fff; border-color: var(--af-navy); }

.af-badge-dot { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-caption); color: var(--fg-2); font-weight: 500; }
.af-badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--fg-3); }
.af-badge-dot.red::before   { background: var(--af-red); }
.af-badge-dot.sky::before   { background: var(--af-sky); }
.af-badge-dot.gold::before  { background: var(--af-gold); }
.af-badge-dot.royal::before { background: var(--af-royal); }

/* ============================================================
 * KV, TABLE, TABS, MODAL, EMPTY (shared, reused by pages)
 * ============================================================ */
.fop-kv, .af-kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 6px 16px;
  font-size: 13px;
  margin: 0;
}
.fop-kv dt, .af-kv dt { color: var(--fg-2); font-weight: 500; }
.fop-kv dd, .af-kv dd { margin: 0; color: var(--fg-1); font-weight: 500; }

.fop-table, .af-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.fop-table th, .af-table thead th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-2);
  font-family: var(--font-display);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-2);
  border-bottom: 1px solid var(--border-1);
}
.fop-table td, .af-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-1);
  color: var(--fg-1);
  vertical-align: middle;
}
.fop-table tr:last-child td, .af-table tbody tr:last-child td { border-bottom: none; }
.fop-table tbody tr:hover, .af-table tbody tr:hover { background: var(--bg-2); }

/* Tabs (underline) */
.af-tabs, .tabs {
  display: flex; gap: 24px;
  border-bottom: 1px solid var(--border-1);
  padding: 0 20px;
  overflow-x: auto;
}
.af-tab, .tabs .tab {
  appearance: none;
  background: transparent; border: none;
  padding: 14px 0 13px;
  margin-bottom: -1px;
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--fg-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
  transition: color 120ms, border-color 120ms;
}
.af-tab:hover, .tabs .tab:hover { color: var(--fg-1); }
.af-tab.active, .tabs .tab.active { color: var(--fg-1); border-bottom-color: var(--af-red); }

/* Empty */
.af-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--fg-2);
}
.af-empty h3 { color: var(--fg-3); margin-bottom: 8px; letter-spacing: 0.12em; }
.af-empty p { font-size: 13px; max-width: 38ch; margin: 0 auto; }
.af-empty.dashed { border: 1px dashed var(--border-1); border-radius: 6px; background: var(--bg-1); }

/* Modal */
.fop-modal-scrim, .af-modal-scrim {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 18, 32, 0.55);
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  animation: af-fade-in 120ms ease;
}
.fop-modal-scrim.show, .af-modal-scrim.show { display: flex; }
.fop-modal, .af-modal {
  background: var(--bg-1);
  border-top: 3px solid var(--af-red);
  border-radius: var(--radius-md);
  max-width: 420px; width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  animation: af-pop-in 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes af-fade-in { from { opacity: 0; } }
@keyframes af-pop-in {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
 * LOGIN + STATUS CARDS
 * ============================================================ */
.af-login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--af-parchment) radial-gradient(ellipse at 20% 50%, rgba(229,30,37,0.05) 0%, transparent 60%);
}
.af-login-card {
  max-width: 440px; width: 100%;
  padding: 36px 36px 28px;
  border: 1px solid var(--border-1);
  border-top: 3px solid var(--af-red);
  border-radius: 10px;
  background: var(--bg-1);
  text-align: center;
  box-shadow: var(--shadow-md);
}
.af-login-card img { height: 120px; margin: 0 auto 20px; display: block; }
.af-login-card h1 {
  font-family: var(--font-display);
  font-size: 26px; text-transform: uppercase; letter-spacing: 0.04em;
  margin: 0 0 6px; font-weight: 700;
  color: var(--fg-1);
}

/* Stack utility */
.af-stack > * + * { margin-top: 16px; }
.af-stack-sm > * + * { margin-top: 10px; }

/* ============================================================
 * RESPONSIVE
 * ============================================================ */
@media (max-width: 1100px) {
  .eoc-cells { grid-template-columns: repeat(3, 1fr); }
  .eoc-cell { padding: 4px 10px; }
  .eoc-cell-val { font-size: 13px; }
}
@media (max-width: 900px) {
  .fop-shell {
    grid-template-columns: 0 0 1fr !important;
    grid-template-rows: 52px auto 1fr;
    grid-template-areas: "top top top" "eoc eoc eoc" "main main main";
  }
  .fop-rail, .fop-secondary {
    position: fixed; left: 0; top: 52px; bottom: 0; z-index: 1000;
    transition: transform 0.2s ease;
  }
  .fop-rail { width: 76px; transform: translateX(-100%); }
  .fop-secondary { left: 76px; width: 240px; transform: translateX(-320px); }
  .fop-shell.mobile-open .fop-rail { transform: translateX(0); }
  .fop-shell.mobile-open .fop-secondary { transform: translateX(0); }
  .fop-expand-btn { display: none !important; }
  .fop-search-btn { display: none; }
  .user-meta { display: none; }
  .tb-iconbtn { width: 32px; height: 32px; }
  .fop-main { padding: 20px; }
  .eoc-bar { grid-template-columns: 1fr; padding: 8px 12px; }
  .eoc-lead { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); padding-right: 0; padding-bottom: 8px; }
  .eoc-cells { grid-template-columns: repeat(2, 1fr); gap: 1px; background: rgba(255,255,255,0.06); }
  .eoc-cell { background: #12151C; border: none; padding: 6px 10px; }
  .page-head h1 { font-size: 22px; }
  .page-kpi { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .user-chip { display: none; }
  .phase-chip { font-size: 9px; padding: 3px 7px; }
  .tb-iconbtn { width: 30px; height: 30px; }
}

/* ============================================================
 * SHARED PRIMITIVES — toolbar, bar, impl-note, detail-card
 * ============================================================ */

.af-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.af-toolbar-left, .af-toolbar-right {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.af-toolbar-right { margin-left: auto; }
.af-toolbar input[type="search"],
.af-toolbar input[type="text"],
.af-toolbar select {
  font-size: 13px; padding: 7px 10px; min-width: 160px;
}
.af-toolbar .count {
  font-family: var(--font-display); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-2); font-weight: 600;
}

/* Filter chips */
.af-chip {
  font-family: var(--font-body); font-weight: 600; font-size: 12px;
  padding: 5px 10px; border-radius: 3px;
  border: 1px solid var(--border-1);
  background: var(--bg-1); color: var(--fg-2);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 120ms;
}
.af-chip:hover { border-color: var(--af-red); color: var(--fg-1); }
.af-chip.on { background: var(--af-red); color: #fff; border-color: var(--af-red); }
.af-chip .n { opacity: 0.7; font-size: 11px; font-family: var(--font-mono); }

.af-bar {
  height: 6px; background: var(--af-parchment);
  border-radius: 2px; overflow: hidden;
  min-width: 80px;
}
.af-bar > i { display: block; height: 100%; background: var(--af-red); }
.af-bar.sky  > i { background: var(--af-sky); }
.af-bar.gold > i { background: var(--af-gold); }
.af-bar.navy > i { background: var(--af-navy); }

.af-empty-icon {
  font-size: 28px; color: var(--fg-3); margin-bottom: 10px;
}

.impl-note {
  margin-top: 24px;
  font-size: 12px; line-height: 1.55; color: var(--fg-3);
  padding: 12px 16px;
  border-left: 2px solid var(--border-1);
  background: var(--bg-1);
  border-radius: 0 3px 3px 0;
  display: flex; flex-direction: column; gap: 4px;
}
.impl-note strong { color: var(--fg-2); font-weight: 600; }

/* Two-column detail (main table + drawer) */
.af-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1200px) { .af-split { grid-template-columns: 1fr; } }
.af-split .af-drawer { position: sticky; top: 8px; }

/* Initials avatar used by rosters/chairs */
.af-ava {
  width: 32px; height: 32px;
  background: var(--af-navy);
  color: #fff;
  font-family: var(--font-display); font-weight: 700;
  font-size: 12px; letter-spacing: 0.02em;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.af-ava.red   { background: var(--af-red); }
.af-ava.sky   { background: var(--af-sky); color: #fff; }
.af-ava.gold  { background: var(--af-gold); color: var(--af-black); }
.af-ava.royal { background: var(--af-royal); }
.af-ava.sm    { width: 24px; height: 24px; font-size: 10px; }
.af-ava.lg    { width: 48px; height: 48px; font-size: 17px; }

/* Cell helpers */
.af-table td.num  { font-family: var(--font-mono); font-size: 12.5px; text-align: right; }
.af-table td.muted { color: var(--fg-3); }
.af-table .avatar-cell { display: flex; align-items: center; gap: 10px; }

/* Shift grid (commitments + shifts) */
.shift-grid {
  display: grid;
  grid-template-columns: 150px repeat(var(--cols, 4), 1fr);
  background: var(--border-1);
  gap: 1px;
  border: 1px solid var(--border-1);
  border-radius: 6px;
  overflow: hidden;
  font-size: 12px;
}
.shift-grid .hd {
  background: var(--af-navy); color: #fff;
  padding: 10px 8px;
  font-family: var(--font-display); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
  text-align: center;
}
.shift-grid .hd.area { text-align: left; padding-left: 14px; }
.shift-grid .area-cell {
  background: var(--af-parchment);
  padding: 10px 14px;
  display: flex; flex-direction: column; justify-content: center;
}
.shift-grid .area-name {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  color: var(--fg-1); letter-spacing: 0.02em; text-transform: uppercase;
}
.shift-grid .area-meta { font-size: 10px; color: var(--fg-3); margin-top: 2px; }
.shift-grid .cell { background: var(--bg-1); padding: 4px; min-height: 50px; position: relative; }
.shift-cell-inner {
  height: 100%; padding: 6px 8px;
  display: flex; flex-direction: column; justify-content: center;
  font-family: var(--font-body); font-size: 11px; line-height: 1.3;
  cursor: pointer;
}
.shift-cell-inner.staffed  { background: var(--af-sky);  color: #fff; }
.shift-cell-inner.open     { background: var(--af-gold); color: var(--af-black); }
.shift-cell-inner.critical { background: var(--af-red);  color: #fff; }
.shift-cell-inner.empty {
  border: 2px dashed var(--af-red); color: var(--af-red);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 10px; text-align: center; justify-content: center;
}
.shift-cell-inner .n {
  font-family: var(--font-display); font-weight: 700;
  font-size: 14px; letter-spacing: 0.02em;
}
.shift-cell-inner .sub { opacity: 0.85; font-size: 10px; }
.shift-cell-inner:hover { outline: 2px solid var(--af-red); outline-offset: -2px; }

/* Kanban-esque task list */
.kanban {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.kanban-col {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: 6px;
  padding: 10px;
  min-height: 220px;
}
.kanban-col-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 4px 8px 10px;
  font-family: var(--font-display); font-size: 11px;
  font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-2);
  border-bottom: 1px solid var(--border-1);
  margin-bottom: 8px;
}
.kanban-card {
  background: var(--bg-card, #FFFDF9);
  border: 1px solid var(--border-1);
  border-left: 3px solid var(--af-navy);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 120ms, transform 60ms;
}
.kanban-card:hover { border-color: var(--af-red); }
.kanban-card.high    { border-left-color: var(--af-red); }
.kanban-card.med     { border-left-color: var(--af-gold); }
.kanban-card.low     { border-left-color: var(--af-sky); }
.kanban-card.blocked { border-left-color: var(--af-red); background: rgba(229,30,37,0.04); }
.kanban-card-title { font-weight: 600; color: var(--fg-1); line-height: 1.35; }
.kanban-card-meta  { font-size: 11px; color: var(--fg-2); margin-top: 4px; }

/* Dark mode tweaks for transparent overlays */
:root[data-theme="dark"] .alert-banner.urgent { background: rgba(229,30,37,0.14); }
:root[data-theme="dark"] .alert-banner.warn   { background: rgba(194,117,0,0.15); }
:root[data-theme="dark"] .alert-banner.info   { background: rgba(41,151,219,0.14); }
:root[data-theme="dark"] .page-head .eyebrow-row { color: #ff6b71; }
:root[data-theme="dark"] .fop-panel-title         { color: #ff6b71; }
