/* MT Review Host dashboards. Tokens and Hanken Grotesk come from the design
   system's colors_and_type.css (loaded first, served as-is). Buttons, forms,
   cards, badges, and states follow the design system (README "States",
   preview/buttons.html, forms.html, cards.html, badges.html); the nav and
   footer follow the public website. No hex values here: every color is a
   token, and hover shades are mixed from tokens. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg-2); min-height: 100vh; display: flex; flex-direction: column; }
body.rh-plain { background: var(--bg-1); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
input[type="checkbox"] { accent-color: var(--mt-orange); width: 16px; height: 16px; }
[hidden] { display: none !important; }

.rh-skip { position: absolute; left: -9999px; top: 0; }
.rh-skip:focus { left: var(--space-4); top: var(--space-4); z-index: 100; background: var(--bg-1); padding: var(--space-2) var(--space-3); }

/* ----- Nav (website .mt-nav) ----- */
.mt-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}
.mt-nav__inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-5);
  padding: 0 40px; height: 76px; max-width: 1440px; margin: 0 auto;
}
.mt-nav__logo { display: block; flex: none; }
.mt-nav__logo img { height: 44px; width: auto; display: block; }
.rh-nav-right { display: flex; align-items: center; gap: var(--space-4); font-weight: var(--fw-medium); font-size: 15px; min-width: 0; }
.rh-nav-right .rh-who { color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-nav-right a { color: var(--fg-1); text-decoration: none; }
.rh-nav-right a:hover, .rh-nav-right a:focus-visible { color: var(--mt-orange); }

/* ----- Buttons (design system preview/buttons.html + README "States") -----
   primary: orange; hover darkens it about 10% and lifts 1px; press returns
   to the base color at 98% scale. secondary: solid navy, same states.
   ghost: white with a strong hairline; hover turns the border orange.
   link: a text button; hover turns it orange. Focus: the orange ring.
   Disabled: 40% opacity, no pointer. Each hover sets its own text color,
   so the design system's a:hover can never recolor a button. */
.mt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-display); font-weight: var(--fw-bold); font-size: 15px; line-height: 1.2;
  text-decoration: none; white-space: nowrap; border-radius: var(--radius-sm); cursor: pointer;
  padding: 10px 18px; border: 1px solid transparent; background-color: transparent;
  transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.mt-btn:hover { transform: translateY(-1px); }
.mt-btn:active { transform: scale(0.98); }
.mt-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.mt-btn--primary, .mt-btn--primary:hover, .mt-btn--primary:focus-visible, .mt-btn--primary:active { color: var(--mt-white); }
.mt-btn--primary { background-color: var(--mt-orange); }
.mt-btn--primary:hover {
  background-color: var(--mt-orange);   /* browsers without color-mix keep the base color */
  background-color: color-mix(in srgb, var(--mt-orange) 90%, var(--mt-ink));
}
.mt-btn--primary:active { background-color: var(--mt-orange); }

.mt-btn--secondary, .mt-btn--secondary:hover, .mt-btn--secondary:focus-visible, .mt-btn--secondary:active { color: var(--mt-white); }
.mt-btn--secondary { background-color: var(--mt-navy); }
.mt-btn--secondary:hover {
  background-color: var(--mt-navy);
  background-color: color-mix(in srgb, var(--mt-navy) 85%, var(--mt-ink));
}
.mt-btn--secondary:active { background-color: var(--mt-navy); }

.mt-btn--ghost, .mt-btn--ghost:hover, .mt-btn--ghost:focus-visible, .mt-btn--ghost:active { color: var(--mt-navy); background-color: var(--mt-white); }
.mt-btn--ghost { border-color: var(--border-strong); }
.mt-btn--ghost:hover, .mt-btn--ghost:focus-visible { border-color: var(--mt-orange); }

.mt-btn--link { color: var(--fg-link); padding-left: var(--space-1); padding-right: var(--space-1); }
.mt-btn--link:hover, .mt-btn--link:focus-visible { color: var(--mt-orange); transform: none; }

.mt-btn--sm { font-size: 14px; padding: 8px 14px; }
.mt-btn--link.mt-btn--sm { padding: 8px var(--space-1); }
.mt-btn[disabled] { opacity: 0.4; pointer-events: none; box-shadow: none; transform: none; }

/* A file picker that looks like a ghost button (the input stays reachable by keyboard) */
.rh-file { position: relative; }
.rh-file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.rh-file:focus-within { box-shadow: var(--shadow-focus); border-color: var(--mt-orange); }

.mt-eyebrow {
  font-family: var(--font-display); font-size: 13px; font-weight: var(--fw-black);
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-2); margin: 0 0 var(--space-3);
}

/* ----- Layout ----- */
.rh-shell {
  flex: 1; width: 100%; max-width: 1440px; margin: 0 auto;
  display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: var(--space-6);
  padding: var(--space-6) 40px var(--space-8);
}
.rh-main:focus { outline: none; }
.rh-loading, .rh-empty { color: var(--fg-2); }

/* Branching navigation: all courses, each client, Modern Training */
.rh-side { position: sticky; top: 100px; align-self: start; display: flex; flex-direction: column; gap: var(--space-5); }
.rh-side h2 { font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-2); margin: 0 0 var(--space-2); font-weight: var(--fw-black); }
.rh-side ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rh-side a {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: 9px var(--space-3); border-radius: var(--radius-sm);
  color: var(--fg-1); text-decoration: none; font-weight: var(--fw-medium); font-size: 15px;
}
.rh-side a:hover { background: var(--bg-3); color: var(--fg-1); }
.rh-side a[aria-current="page"] { background: var(--mt-white); box-shadow: var(--shadow-1); color: var(--mt-navy); }
.rh-count { font-size: 13px; color: var(--fg-2); font-variant-numeric: tabular-nums; }

/* ----- Page head ----- */
.rh-head { display: flex; align-items: center; gap: var(--space-5); margin-bottom: var(--space-5); flex-wrap: wrap; }
.rh-head h1 { font-size: var(--fs-h2); margin: 0; }
.rh-head__logo { height: 48px; width: auto; max-width: 180px; object-fit: contain; }
.rh-head__meta { color: var(--fg-2); font-size: var(--fs-small); margin: var(--space-1) 0 0; }
.rh-tools { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-5); }
.rh-search {
  width: 100%; max-width: 520px; padding: 12px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--mt-white);
}
.rh-search:focus-visible { border-color: var(--mt-orange); }
.rh-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.rh-chip {
  border: 1px solid var(--border-subtle); background: var(--mt-white); border-radius: var(--radius-pill);
  padding: 7px 14px; font-size: 14px; font-weight: var(--fw-medium); cursor: pointer;
}
.rh-chip:hover { border-color: var(--border-strong); }
.rh-chip[aria-pressed="true"] { background: var(--mt-navy); border-color: var(--mt-navy); color: var(--mt-white); }
.rh-toggle { display: inline-flex; gap: var(--space-2); align-items: center; font-size: 14px; color: var(--fg-2); margin-left: var(--space-2); cursor: pointer; }

/* ----- The backup warning and the backup line -----
   (docs/decisions/2026-11-15-mn-t-review-backup-split.md) The warning is a
   white panel with the danger color on its left edge; its words carry the
   meaning, in ink on white. The line under the courses is quiet: it's
   there on a good day. */
.rh-alert {
  background: var(--mt-white); color: var(--fg-1); border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--mt-danger);
  border-radius: var(--radius-sm); padding: var(--space-4) var(--space-5); margin-bottom: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.rh-alert h2 { font-size: var(--fs-h4); margin: 0; }
.rh-alert p { margin: 0; max-width: 80ch; overflow-wrap: anywhere; }
.rh-backup { color: var(--fg-2); font-size: var(--fs-small); margin: var(--space-5) 0 0; }

/* ----- Course cards (website .mt-card) ----- */
.rh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--space-5); }
/* Cards are all-shadow (design system): shadow-1, raising to shadow-2 on hover */
.rh-card {
  background: var(--mt-white); border-radius: var(--radius-md); box-shadow: var(--shadow-1);
  padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3);
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.rh-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.rh-card__eyebrow { font-size: 12px; font-weight: var(--fw-black); letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-2); margin: 0; }
.rh-card__title { font-size: 24px; font-weight: var(--fw-black); letter-spacing: -0.01em; line-height: var(--lh-snug); margin: 0; }
/* Version tags: which audience, industry, state, and language a card is */
.rh-tags { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; }
.rh-tag {
  display: inline-flex; align-items: baseline; gap: 6px; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill); padding: 3px 10px 4px; font-size: 13px; line-height: 1.2;
  background: var(--mt-white); color: var(--fg-1);
}
.rh-tag__key { font-size: 10px; font-weight: var(--fw-black); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-2); }
.rh-tag__value { font-weight: var(--fw-bold); }
.rh-card__meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center; color: var(--fg-2); font-size: var(--fs-small); margin: 0; }
.rh-card__facts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: var(--fs-small); color: var(--fg-1); margin: 0; }
.rh-card__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-top: auto; padding-top: var(--space-2); }
.rh-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--fg-3); }

/* Status pills: ClickUp names for staff, four plain ones for clients */
.rh-status {
  display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-pill);
  padding: 4px 10px 5px; font-family: var(--font-display); font-size: 11px; font-weight: var(--fw-black);
  line-height: 1; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
}
.rh-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rh-status--internal { background: var(--mt-gray-cool); color: var(--mt-navy); }
.rh-status--design { background: var(--mt-warm); color: var(--mt-ink); }
.rh-status--design::before { background: var(--mt-orange); }
.rh-status--ready { background: var(--mt-cyan-soft); color: var(--mt-navy); }
.rh-status--client { background: var(--mt-navy); color: var(--mt-white); }
.rh-status--approved { background: var(--mt-forest); color: var(--mt-white); }

/* Version history, collapsed by default */
.rh-history { border-top: 1px solid var(--border-subtle); padding-top: var(--space-3); font-size: var(--fs-small); }
.rh-history summary { cursor: pointer; font-weight: var(--fw-bold); color: var(--fg-link); }
.rh-history summary:hover { color: var(--mt-orange); }
.rh-history ol { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.rh-history ol > li > strong { display: block; }
.rh-history ul { list-style: none; margin: var(--space-1) 0 0; padding: 0 0 0 var(--space-3); border-left: 2px solid var(--border-subtle); color: var(--fg-2); }
.rh-history ul li { padding: 2px 0; }

/* Version milestones: small badges (design system preview/badges.html) */
.rh-version { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.rh-version a { font-weight: var(--fw-bold); }
.rh-badge {
  display: inline-flex; align-items: center; border-radius: var(--radius-pill); padding: 2px 8px 3px;
  font-family: var(--font-display); font-size: 10px; font-weight: var(--fw-black); line-height: 1.2;
  letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; border: 1px solid transparent;
}
.rh-badge--sent { color: var(--mt-navy); border-color: var(--mt-navy); background: var(--mt-white); }
.rh-badge--approved { color: var(--mt-white); background: var(--mt-forest); }
.rh-badge--update { color: var(--mt-ink); background: var(--mt-warm); border-color: var(--mt-orange); }
.rh-badge--withdrawn { color: var(--fg-2); background: var(--bg-3); }

/* ----- Admin ----- */
/* Admin panels are all-border cards with an even rhythm between their parts */
.rh-panel {
  background: var(--mt-white); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  padding: var(--space-5); margin-bottom: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4);
}
.rh-panel h2 { font-size: var(--fs-h4); margin: 0; }
.rh-panel > p { color: var(--fg-2); font-size: var(--fs-small); margin: 0; max-width: 72ch; }
.rh-panel > .rh-row { padding-top: var(--space-1); }
.rh-subhead { font-size: 15px; font-weight: var(--fw-bold); margin: var(--space-2) 0 0; }
.rh-table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.rh-table th { text-align: left; color: var(--fg-2); font-weight: var(--fw-bold); padding: var(--space-2); border-bottom: 1px solid var(--border-subtle); }
.rh-table td { padding: 6px var(--space-2); height: 48px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.rh-table .mt-btn--sm { padding-top: 6px; padding-bottom: 6px; }
.rh-table tr.is-off td { color: var(--fg-2); }
.rh-table-wrap { overflow-x: auto; }
/* Forms (design system preview/forms.html): fields line up at the top, the
   label over the input and the hint under it. Hints use --fg-2 so they pass
   AA contrast. */
.rh-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4) var(--space-5); align-items: start; }
.rh-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rh-field > span { font-family: var(--font-display); font-size: 13px; font-weight: var(--fw-bold); color: var(--fg-1); }
.rh-field small { font-size: 12px; line-height: 1.4; color: var(--fg-2); font-weight: var(--fw-regular); }
.rh-field input, .rh-field select, .rh-field textarea, dialog.rh-dialog textarea {
  font-family: var(--font-body); font-size: 14px; font-weight: var(--fw-regular); line-height: 1.3; color: var(--fg-1);
  padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--mt-white);
  width: 100%; min-width: 0; transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.rh-field textarea { resize: vertical; }
.rh-field input:focus, .rh-field select:focus, .rh-field textarea:focus { outline: none; border-color: var(--mt-orange); box-shadow: var(--shadow-focus); }
.rh-field input[readonly] { background: var(--bg-3); color: var(--fg-2); }
.rh-check { display: flex; align-items: flex-start; gap: var(--space-2); font-size: 14px; line-height: 1.4; color: var(--fg-1); max-width: 72ch; }
.rh-check input { accent-color: var(--mt-orange); width: 16px; height: 16px; margin: 2px 0 0; flex: none; }
.rh-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.rh-table .rh-row { gap: var(--space-2); flex-wrap: nowrap; }
.rh-link-box { display: flex; flex-direction: column; gap: var(--space-3); align-items: stretch; }
.rh-link-box code {
  display: block; background: var(--bg-2); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  padding: 10px 12px; font-family: var(--font-mono); font-size: 13px; line-height: 1.4; word-break: break-all;
}
.rh-logo-preview { height: 56px; flex: none; width: auto; max-width: 200px; object-fit: contain; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: var(--space-2); background: var(--mt-white); }
.rh-error { color: var(--mt-danger); font-size: var(--fs-small); font-weight: var(--fw-medium); }
.rh-hint { color: var(--fg-2); font-size: var(--fs-small); }
.rh-suggest { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); align-items: center; }

/* Dialogs (course fields, a link shown once) */
dialog.rh-dialog {
  border: 0; border-radius: var(--radius-md); padding: 0; width: min(560px, calc(100vw - 32px));
  box-shadow: var(--shadow-3); color: var(--fg-1); max-height: calc(100vh - 32px);
}
dialog.rh-dialog[open] { display: flex; flex-direction: column; }
dialog.rh-dialog::backdrop { background: rgba(33, 32, 38, 0.45); }
.rh-dialog__body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); overflow-y: auto; min-height: 0; }
.rh-dialog__body h2 { font-size: var(--fs-h4); margin: 0; }
.rh-dialog__foot { display: flex; justify-content: flex-end; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); background: var(--bg-2); border-radius: 0 0 var(--radius-md) var(--radius-md); }

.rh-toast {
  position: fixed; left: 50%; bottom: var(--space-5); transform: translateX(-50%);
  background: var(--mt-ink); color: var(--mt-white); border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4); font-size: var(--fs-small); box-shadow: var(--shadow-3);
  opacity: 0; pointer-events: none; transition: opacity var(--dur-base) var(--ease-out); max-width: calc(100vw - 32px);
}
.rh-toast.is-on { opacity: 1; }

/* ----- Client pages: co-branded nav, gate ----- */
.rh-cobrand { display: flex; align-items: center; gap: var(--space-4); text-decoration: none; min-width: 0; }
.rh-cobrand__mt { height: 44px; width: auto; display: block; }
.rh-cobrand__client { height: 36px; width: auto; max-width: 160px; object-fit: contain; display: block;
  padding-left: var(--space-4); border-left: 1px solid var(--border-subtle); }
.rh-shell--single { grid-template-columns: minmax(0, 1fr); }
.rh-head__action { margin-left: auto; }
.rh-gate__form { display: flex; flex-direction: column; gap: var(--space-4); max-width: 460px; }
.rh-gate__form .rh-field input { padding: 12px 14px; font-size: var(--fs-body); }

/* ----- Welcome page ----- */
.rh-welcome { flex: 1; max-width: 720px; margin: 0 auto; padding: var(--space-9) 40px; }
.rh-welcome h1 { font-size: var(--fs-h1); }
.rh-lead { font-size: 20px; color: var(--fg-2); }
.rh-muted { color: var(--fg-2); font-size: var(--fs-small); }

/* ----- Footer (website .mt-footer, slim) ----- */
.rh-footer { background: var(--mt-navy); color: rgba(255, 255, 255, 0.82); font-size: var(--fs-small); }
.rh-footer__inner { max-width: 1440px; margin: 0 auto; padding: var(--space-5) 40px; display: flex; align-items: center; gap: var(--space-4); }
.rh-footer__logo { height: 32px; width: auto; }
.rh-footer__note { margin-left: auto; }

/* ----- Phones (the website's single 768px breakpoint) ----- */
@media (max-width: 768px) {
  .mt-nav__inner { padding: 0 16px; height: 64px; }
  .mt-nav__logo img, .rh-cobrand__mt { height: 36px; }
  .rh-cobrand__client { height: 28px; max-width: 110px; }
  .rh-head__action { margin-left: 0; }
  .rh-nav-right .rh-who { display: none; }
  .rh-shell { grid-template-columns: minmax(0, 1fr); padding: var(--space-4) 16px var(--space-7); gap: var(--space-4); }
  .rh-side { position: static; flex-direction: row; gap: var(--space-2); overflow-x: auto; padding-bottom: var(--space-1); }
  .rh-side section { display: contents; }
  .rh-side h2 { display: none; }
  .rh-side ul { flex-direction: row; gap: var(--space-2); }
  .rh-side a { white-space: nowrap; background: var(--mt-white); border: 1px solid var(--border-subtle); }
  .rh-grid { grid-template-columns: minmax(0, 1fr); }
  .rh-card { padding: var(--space-4); }
  .rh-welcome { padding: var(--space-7) 16px; }
  .rh-footer__inner { padding: var(--space-4) 16px; flex-direction: column; align-items: flex-start; }
  .rh-footer__note { margin-left: 0; }
}
