/* facility-shell.css — director-app shell layout (module-owned, Rule 15).
 * Colors come ONLY from facility-tokens.css var()s — a raw hex here is a
 * design-gate failure. Desktop-first, degrades to tablet (§12c). */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
}

/* ── shell grid ── */
.fx-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── sidebar (the board) ── */
.fx-side {
  background: var(--board);
  color: var(--board-text-idle);
  display: flex;
  flex-direction: column;
  padding: 18px 0;
}
.fx-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.04em;
  color: var(--board-text-active);
  padding: 4px 18px 14px;
  border-bottom: 1px solid var(--board-line);
}
.fx-brand small {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--board-text-idle);
  margin-top: 2px;
}
.fx-nav { flex: 1; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.fx-nav-item {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--board-text-idle);
  text-decoration: none;
  font-weight: 500;
  border: 0;
  background: transparent;
  text-align: left;
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
}
.fx-nav-item:hover { color: var(--board-text-active); background: var(--board-line); }
.fx-nav-item.active {
  color: var(--board-text-active);
  background: var(--board-line);
  box-shadow: inset 3px 0 0 var(--accent);
}
.fx-side-foot { padding: 10px 18px 0; border-top: 1px solid var(--board-line); }
.fx-user { font-size: 12px; color: var(--board-text-idle); margin-bottom: 8px; }
.fx-user b { color: var(--board-text-active); font-weight: 600; display: block; }

/* ── main column ── */
.fx-main { padding: 26px 32px; max-width: 1180px; }
.fx-topbar { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.fx-topbar h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0.01em;
  margin: 0;
}
.fx-topbar .fx-sub { color: var(--ink-2); font-size: 13px; font-weight: 500; }

/* ── cards / KPIs ── */
.fx-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
}
.fx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.fx-kpi .fx-kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.fx-kpi .fx-kpi-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  color: var(--ink);
  margin-top: 4px;
}
.fx-kpi .fx-kpi-value.flag { color: var(--flag); }
.fx-kpi-note { font-size: 12px; color: var(--bronze); font-weight: 500; margin-top: 2px; }

/* ── generic buttons ── */
.fx-btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--surface);
  cursor: pointer;
}
.fx-btn:hover { background: var(--ink-2); border-color: var(--ink-2); }
.fx-btn.ghost { background: var(--surface); color: var(--accent); }
.fx-btn.ghost:hover { background: var(--accent-tint); }
.fx-btn:disabled { opacity: 0.45; cursor: not-allowed; }  /* reduced opacity on the green base (§12c disabled rule) */
.fx-btn:focus-visible, .fx-nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── placeholder screens ── */
.fx-placeholder p { color: var(--ink-2); margin: 6px 0 0; }
.fx-placeholder .fx-sprint-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bronze);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 10px;
}

/* ── stubbed login ── */
.fx-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
}
.fx-login-card { width: 380px; text-align: center; }
.fx-login-card h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  margin: 0 0 4px;
}
.fx-login-card .fx-login-sub { color: var(--ink-2); font-size: 13px; margin-bottom: 18px; }
.fx-login-card .fx-btn { width: 100%; margin-top: 8px; }
.fx-stub-note { margin-top: 14px; font-size: 12px; color: var(--bronze); }

/* ── tablet degrade ── */
@media (max-width: 900px) {
  .fx-shell { grid-template-columns: 64px 1fr; }
  .fx-brand, .fx-brand small { font-size: 0; padding-bottom: 8px; }
  .fx-nav-item { font-size: 12px; padding: 8px 6px; text-align: center; }
  .fx-main { padding: 18px; }
  .fx-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ══ A2 — setup wizard, demo-data chrome, tour skin ══
 * Same rule as everything above: var() tokens only. */

/* ── sidebar logo (branding step) ── */
.fx-logo { display: block; max-width: 120px; max-height: 44px; margin-bottom: 6px; }

/* ── demo banner + badge ── */
.fx-demo-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--accent-tint);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
}
.fx-demo-banner .fx-btn { margin-left: auto; white-space: nowrap; }
.fx-badge-demo {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--surface);
  background: var(--bronze);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
}

/* ── wizard layout: checklist rail + step card ── */
.fx-wiz-grid { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.fx-wiz-steps { display: flex; flex-direction: column; gap: 8px; }
.fx-wiz-step {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 14px;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--ink);
}
.fx-wiz-step:hover { border-color: var(--accent); }
.fx-wiz-step.now { border: 2px solid var(--accent); background: var(--accent-tint); }
.fx-wiz-step .fx-wiz-num {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.fx-wiz-step.done .fx-wiz-num { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.fx-wiz-text { display: flex; flex-direction: column; min-width: 0; }
.fx-wiz-text b { font-size: 13.5px; font-weight: 600; }
.fx-wiz-text small { font-size: 11.5px; color: var(--ink-2); }
.fx-wiz-state { margin-left: auto; flex: none; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bronze); }
.fx-wiz-step.now .fx-wiz-state { color: var(--accent); }

.fx-wiz-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 18px; margin: 0 0 10px; }
.fx-wiz-foot { display: flex; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.fx-sub { color: var(--ink-2); font-size: 13px; margin: 0 0 12px; }
.fx-note { display: block; color: var(--bronze); font-size: 12px; margin-top: 6px; }
.fx-error { color: var(--flag); font-size: 13px; font-weight: 600; margin: 0 0 8px; }
.fx-error:empty { display: none; }
.fx-row-gap { margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.fx-launched { color: var(--accent); font-weight: 700; }

/* ── form fields ── */
.fx-field { margin-bottom: 12px; }
.fx-field label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-2); margin-bottom: 4px; }
.fx-field input[type="text"], .fx-field input[type="email"], .fx-field input[type="number"], .fx-field select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
.fx-field input:focus-visible, .fx-field select:focus-visible, .fx-table input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fx-logo-row { display: flex; align-items: center; gap: 12px; }
.fx-logo-preview { max-height: 40px; max-width: 120px; border: 1px solid var(--line); border-radius: 6px; padding: 2px; background: var(--surface); }

/* ── accent swatches ── */
.fx-swatches { display: flex; gap: 10px; }
.fx-swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.fx-swatch.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface) inset; }

/* ── packages table ── */
.fx-table { width: 100%; border-collapse: collapse; }
.fx-table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); }
.fx-table td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); }
.fx-table input { width: 100%; font-family: var(--font-body); font-size: 13.5px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }

/* ── data-step doors + demo callout ── */
.fx-doors { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.fx-door { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.fx-door b { font-size: 14px; }
.fx-door p { color: var(--ink-2); font-size: 12.5px; margin: 6px 0 12px; }
.fx-demo-callout { border: 1px solid var(--line); border-radius: var(--radius); background: var(--accent-tint); padding: 13px 16px; font-size: 13px; }
.fx-demo-callout b { font-weight: 700; }
.fx-demo-callout span { color: var(--ink-2); font-weight: 600; }
.fx-demo-callout-act { margin-top: 10px; }

/* ── trainer list + invite ── */
.fx-member-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.fx-member-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; }
.fx-member-email { color: var(--ink-2); font-size: 12.5px; }
.fx-member-row .fx-chip { margin-left: auto; }
.fx-chip { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; border-radius: 999px; padding: 2px 9px; border: 1px solid var(--line); color: var(--ink-2); }
.fx-chip.st-active { color: var(--accent); border-color: var(--accent); }
.fx-chip.st-invited { color: var(--bronze); border-color: var(--bronze); }
.fx-chip.st-suspended, .fx-chip.st-removed { color: var(--flag); border-color: var(--flag); }
.fx-invite-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* ── feature toggles ── */
.fx-feature-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.fx-feature-row b { display: block; font-size: 13.5px; }
.fx-feature-row small { color: var(--ink-2); font-size: 12px; }
.fx-toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.fx-toggle input { opacity: 0.001; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.fx-toggle .fx-slider { position: absolute; inset: 0; pointer-events: none; border-radius: 999px; background: var(--line); transition: background 120ms; }
.fx-toggle .fx-slider::before { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; top: 3px; left: 3px; background: var(--surface); transition: transform 120ms; }
.fx-toggle input:checked + .fx-slider { background: var(--accent); }
.fx-toggle input:checked + .fx-slider::before { transform: translateX(18px); }
.fx-toggle input:focus-visible + .fx-slider { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── launch recap ── */
.fx-recap { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.fx-recap-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.fx-recap-row.done { color: var(--ink); }
.fx-recap-row.todo { color: var(--bronze); }
.fx-recap-row .fx-wiz-num { width: 22px; height: 22px; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); }
.fx-recap-row.done .fx-wiz-num { background: var(--accent); border-color: var(--accent); color: var(--surface); }

/* ── tour skin: facility tokens over the vendored Driver.js popover ──
 * driver.css stays byte-verbatim (third-party); every visible tour color is
 * re-declared here so rendered popover text passes the §12c walks. */
.fx-tour.driver-popover { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); font-family: var(--font-body); }
.fx-tour .driver-popover-title { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--ink); }
.fx-tour .driver-popover-description { color: var(--ink); font-size: 13.5px; }
.fx-tour .driver-popover-progress-text { color: var(--bronze); font-size: 12px; font-weight: 600; }
.fx-tour .driver-popover-close-btn { color: var(--ink-2); }
.fx-tour .driver-popover-navigation-btns button {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  text-shadow: none;
  background: var(--accent);
  color: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 6px 12px;
}
.fx-tour .driver-popover-navigation-btns button:hover { background: var(--ink-2); border-color: var(--ink-2); }
.fx-tour .driver-popover-arrow { display: none; } /* flat card — skip re-coloring 16 arrow variants */

/* ══ A3 — import flow ══ */
.fx-flow { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.fx-flow-pill {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
  color: var(--ink-2); background: var(--surface);
}
.fx-flow-pill.now { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
.fx-flow-pill.done { border-color: var(--accent); color: var(--surface); background: var(--accent); }

.fx-chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.fx-chip-btn {
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px;
  background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.fx-chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.fx-chip-btn.on { border-color: var(--accent); background: var(--accent); color: var(--surface); }
.fx-chip-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.fx-map-row { display: grid; grid-template-columns: 1fr 24px 1fr; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.fx-map-src { font-weight: 600; font-size: 13.5px; }
.fx-map-arrow { color: var(--bronze); text-align: center; }
.fx-map-dst select {
  width: 100%; font-family: var(--font-body); font-size: 13px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px;
}
.fx-map-dst select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.fx-err-table { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 4px; }
.fx-err-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.fx-err-head b { font-size: 13px; color: var(--flag); }
.fx-err-row { display: flex; gap: 10px; font-size: 12.5px; padding: 4px 0; border-top: 1px solid var(--line); }
.fx-err-num { color: var(--flag); font-weight: 700; flex: none; }
.fx-err-field { color: var(--bronze); font-weight: 600; flex: none; }
.fx-csv-link { color: var(--accent); font-weight: 600; font-size: 12.5px; text-decoration: underline; }
.fx-csv-link:hover { color: var(--ink-2); }

/* ══ A4 — roster + hours view ══ */
.fx-roster-grid { display: grid; grid-template-columns: minmax(340px, 5fr) 7fr; gap: 16px; align-items: start; }
.fx-roster-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px; font-family: var(--font-body); color: var(--ink);
}
.fx-roster-row:hover { border-color: var(--accent); }
.fx-roster-row.on { border: 2px solid var(--accent); background: var(--accent-tint); }
.fx-roster-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fx-roster-name b { font-size: 13.5px; }
.fx-roster-name small { color: var(--ink-2); font-size: 12px; }
.fx-h-split { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.fx-note-inline { font-family: var(--font-body); font-weight: 500; font-size: 11.5px; color: var(--bronze); text-transform: none; letter-spacing: 0; }
.fx-btn.danger { border-color: var(--flag); background: var(--flag); color: var(--surface); }
.fx-btn.danger:hover { background: var(--ink); border-color: var(--ink); }
.fx-btn.ghost.danger { background: var(--surface); color: var(--flag); border-color: var(--flag); }
.fx-btn.ghost.danger:hover { background: var(--accent-tint); }

.fx-av-grid { display: grid; grid-template-columns: 44px repeat(7, 1fr); gap: 3px; margin-top: 10px; }
.fx-av-hd { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); text-align: center; }
.fx-av-hr { font-size: 11px; font-weight: 600; color: var(--bronze); align-self: center; }
.fx-av-cell { height: 18px; border-radius: 4px; background: var(--paper); border: 1px solid var(--line); }
.fx-av-cell.on { background: var(--accent); border-color: var(--accent); }

.fx-slot-days { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.fx-slot-day { display: flex; gap: 12px; align-items: baseline; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.fx-slot-day b { color: var(--bronze); flex: none; }
.fx-slot-times { color: var(--ink); font-weight: 500; }

@media (max-width: 1100px) { .fx-roster-grid { grid-template-columns: 1fr; } }

/* ══ A5 — intake queue + public form ══ */
.fx-fact { margin: 0; font-size: 13.5px; color: var(--ink); }
.fx-choice-row { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.fx-choice { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); cursor: pointer; }
.fx-choice input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; cursor: pointer; }
.fx-choice input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.fx-intake-page { min-height: 100vh; display: flex; justify-content: center; padding: 32px 16px; background: var(--paper); }
.fx-intake-card { max-width: 720px; width: 100%; align-self: flex-start; }
.fx-intake-card h1 { font-family: var(--font-display); font-weight: 600; font-size: 22px; margin: 0 0 6px; }

/* ══ A6 — client portal ══ */
.fx-portal-page { min-height: 100vh; display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; padding: 28px 16px; background: var(--paper); }
.fx-portal-col { width: 100%; max-width: 480px; }
.fx-portal-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.fx-portal-head h1 { font-family: var(--font-display); font-weight: 600; font-size: 22px; margin: 0; }
.fx-portal-head .fx-btn { margin-left: auto; }
.fx-portal-card { margin-bottom: 12px; }
.fx-portal-card b { font-size: 14px; }
.fx-portal-strong { font-size: 13px; color: var(--ink-2); margin: 6px 0 10px; }
.fx-remaining { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--accent); }
.fx-prog-bar { height: 8px; border-radius: 999px; background: var(--accent-tint); border: 1px solid var(--line); margin-top: 9px; overflow: hidden; }
.fx-prog-fill { height: 100%; background: var(--accent); }
.fx-info { color: var(--accent); font-size: 13px; font-weight: 600; margin: 0 0 8px; }
.fx-upcoming-row { flex-wrap: wrap; }
.fx-window-note { color: var(--bronze); }
.fx-slotgrid { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.fx-slot {
  font-family: var(--font-body); font-weight: 600; font-size: 12.5px;
  border: 1px solid var(--accent); border-radius: 8px; padding: 6px 11px;
  background: var(--accent-tint); color: var(--ink); cursor: pointer;
}
.fx-slot:hover { background: var(--accent); color: var(--surface); }
.fx-slot:disabled { opacity: 0.45; cursor: not-allowed; }
.fx-slot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fx-slot-day-block { margin-top: 8px; }

/* ══ A7 — director views ══ */
.fx-tabs { margin-bottom: 14px; }
