/* ================================================================
   PassFirst NCLEX Prep — Main Stylesheet
   main.css

   All reusable components in one file.
   Import AFTER tokens.css.

   CONTENTS:
   1.  Reset & Base
   2.  Typography
   3.  Layout Utilities
   4.  Buttons
   5.  Form Elements
   6.  Navigation
   7.  Cards
   8.  Badges & Chips
   9.  Alerts & Callouts
   10. Progress & Data Visualization
   11. Tables
   12. Modals & Panels
   13. Loading States
   14. Page-level patterns (Hero, Section, Feature Grid)
================================================================ */


/* ── 1. RESET & BASE ──────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--surface-page);
}

img, video {
  display: block;
  max-width: 100%;
}

a {
  color: var(--brand-teal);
  text-decoration: none;
  transition: var(--transition-fast);
}
a:hover { color: #085249; text-decoration: underline; }

button { font-family: var(--font-body); cursor: pointer; }

input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--text-base);
}


/* ── 2. TYPOGRAPHY ────────────────────────────────────────── */

/* Display headings — use for hero / marketing sections */
.display-xl {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

.display-lg {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

.display-md {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

/* Semantic headings — use inside app UI */
h1 { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--weight-bold); line-height: var(--leading-snug); }
h2 { font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--weight-bold); line-height: var(--leading-snug); }
h3 { font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: var(--leading-snug); }
h4 { font-size: var(--text-md); font-weight: var(--weight-semibold); }
h5 { font-size: var(--text-base); font-weight: var(--weight-semibold); }
h6 { font-size: var(--text-sm); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-wide); text-transform: uppercase; }

/* Eyebrow label — small uppercase label above a heading */
.eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--brand-teal);
}

/* Body variants */
.text-lg   { font-size: var(--text-lg); }
.text-md   { font-size: var(--text-md); }
.text-base { font-size: var(--text-base); }
.text-sm   { font-size: var(--text-sm); }
.text-xs   { font-size: var(--text-xs); }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-inverse   { color: var(--text-inverse); }
.text-teal      { color: var(--brand-teal); }
.text-gold      { color: var(--brand-gold); }

.font-display { font-family: var(--font-display); }
.font-mono    { font-family: var(--font-mono); }

.italic   { font-style: italic; }
.bold     { font-weight: var(--weight-bold); }
.semibold { font-weight: var(--weight-semibold); }

/* Stat number — large monospaced numbers for dashboards */
.stat-number {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  line-height: 1;
}

/* Score display — used in sim results */
.score-display {
  font-family: var(--font-mono);
  font-size: var(--text-4xl);
  font-weight: var(--weight-medium);
  line-height: 1;
}


/* ── 3. LAYOUT UTILITIES ──────────────────────────────────── */

.container {
  max-width: var(--max-width-app);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-wide {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-content {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Flex helpers */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-5); }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: var(--space-5); }

/* Spacing helpers */
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }

/* Text alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }


/* ── 4. BUTTONS ───────────────────────────────────────────── */

/* Base button — apply to all buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px var(--space-6);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-base);
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Sizes */
.btn-sm {
  padding: 8px var(--space-4);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 16px var(--space-8);
  font-size: var(--text-md);
  border-radius: var(--radius-md);
}

.btn-xl {
  padding: 18px var(--space-10);
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

/* Full width */
.btn-full { width: 100%; }

/* ──── Button Variants ──── */

/* Primary: Navy — main actions, form submits */
.btn-primary {
  background: var(--brand-navy);
  color: var(--text-inverse);
}
.btn-primary:hover:not(:disabled) {
  background: #0c2440;
  color: var(--text-inverse);
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

/* Action: Teal — CTAs, enrollment, primary UX flow */
.btn-action {
  background: var(--brand-teal);
  color: var(--text-inverse);
}
.btn-action:hover:not(:disabled) {
  background: #0a5a50;
  color: var(--text-inverse);
  text-decoration: none;
  box-shadow: var(--shadow-teal);
  transform: translateY(-1px);
}

/* Ghost: Outline on white backgrounds */
.btn-ghost {
  background: transparent;
  color: var(--brand-navy);
  border: 1.5px solid var(--border-default);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--brand-navy);
  background: var(--semantic-info-bg);
  text-decoration: none;
}

/* Ghost inverse: Outline on dark backgrounds */
.btn-ghost-inverse {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border: 1.5px solid rgba(255,255,255,0.25);
}
.btn-ghost-inverse:hover:not(:disabled) {
  background: rgba(255,255,255,0.10);
  color: white;
  border-color: rgba(255,255,255,0.5);
  text-decoration: none;
}

/* Danger */
.btn-danger {
  background: var(--semantic-error-text);
  color: var(--text-inverse);
}
.btn-danger:hover:not(:disabled) {
  background: #6d1414;
  text-decoration: none;
}

/* Text button — no background */
.btn-text {
  background: none;
  padding-left: var(--space-2);
  padding-right: var(--space-2);
  color: var(--brand-teal);
  font-weight: var(--weight-semibold);
}
.btn-text:hover:not(:disabled) {
  color: #085249;
  text-decoration: underline;
}

/* Loading state */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }


/* ── 5. FORM ELEMENTS ─────────────────────────────────────── */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.form-group:last-child { margin-bottom: 0; }

label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.label-required::after {
  content: ' *';
  color: var(--semantic-error-text);
}

.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 11px var(--space-4);
  background: var(--surface-input);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  transition: var(--transition-fast);
  outline: none;
  appearance: none;
}

.form-input:hover,
input:hover { border-color: var(--border-strong); }

.form-input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  background: var(--surface-input-focus);
  box-shadow: 0 0 0 3px rgba(11, 107, 96, 0.12);
}

.form-input.error,
input.error { border-color: var(--border-error); }

.form-input::placeholder { color: var(--text-disabled); }

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: var(--leading-normal);
}

.form-helper {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: var(--leading-snug);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--semantic-error-text);
  font-weight: var(--weight-semibold);
}

/* Radio & Checkbox */
.radio-group, .checkbox-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.radio-option, .checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}
.radio-option:hover, .checkbox-option:hover {
  border-color: var(--brand-teal);
  background: var(--semantic-info-bg);
}
.radio-option.selected, .checkbox-option.selected {
  border-color: var(--brand-teal);
  background: var(--layer-2-bg);
}

.radio-option input, .checkbox-option input {
  width: auto;
  margin-top: 2px;
  accent-color: var(--brand-teal);
}

/* Range input */
.range-slider {
  width: 100%;
  height: 6px;
  background: var(--border-default);
  border-radius: var(--radius-full);
  appearance: none;
  border: none;
}
.range-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--brand-teal);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}


/* ── 6. NAVIGATION ────────────────────────────────────────── */

/* Top nav */
.topnav {
  height: var(--nav-height);
  background: var(--surface-nav);
  padding: 0 var(--space-7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  box-shadow: var(--shadow-sm);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text-inverse);
  text-decoration: none;
  letter-spacing: var(--tracking-tight);
}
.nav-logo:hover { color: var(--text-inverse); text-decoration: none; }

.nav-tagline {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  color: var(--text-inverse-dim);
  margin-left: var(--space-2);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
}

.nav-link {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-inverse-dim);
  text-decoration: none;
  transition: var(--transition-fast);
}
.nav-link:hover {
  color: var(--text-inverse);
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}
.nav-link.active {
  color: var(--text-inverse);
  background: rgba(255,255,255,0.12);
}

/* Dashboard sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface-sidebar);
  height: calc(100vh - var(--nav-height));
  position: sticky;
  top: var(--nav-height);
  overflow-y: auto;
  padding: var(--space-5) 0;
  flex-shrink: 0;
}

.sidebar-section {
  padding: 0 var(--space-4);
  margin-bottom: var(--space-6);
}

.sidebar-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  padding: 0 var(--space-3);
  margin-bottom: var(--space-2);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-3);
  border: none;
  background: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: rgba(255,255,255,0.60);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-fast);
  margin-bottom: 2px;
}
.sidebar-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
  text-decoration: none;
}
.sidebar-item.active {
  background: rgba(255,255,255,0.12);
  color: white;
}
.sidebar-item-icon { font-size: 1rem; flex-shrink: 0; width: 22px; }

.sidebar-badge {
  margin-left: auto;
  background: var(--semantic-error-text);
  color: white;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  border-radius: var(--radius-full);
  padding: 2px var(--space-2);
  min-width: 20px;
  text-align: center;
}


/* ── 7. CARDS ─────────────────────────────────────────────── */

/* Base card */
.card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  padding: var(--space-5);
}

/* Card with shadow */
.card-elevated {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-5);
}

/* Interactive card — hover effect for clickable cards */
.card-interactive {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  padding: var(--space-5);
  cursor: pointer;
  transition: var(--transition-base);
}
.card-interactive:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Featured card — highlighted with teal border */
.card-featured {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 2px solid var(--brand-teal);
  padding: var(--space-5);
  box-shadow: var(--shadow-teal);
  position: relative;
}

/* Dark card */
.card-dark {
  background: var(--brand-navy);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  color: var(--text-inverse);
}

/* Teal card */
.card-teal {
  background: var(--brand-teal);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  color: var(--text-inverse);
}

/* Card header — label row at top of card */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-default);
}
.card-header-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
}
.card-header-action {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--brand-teal);
  text-decoration: none;
  letter-spacing: 0;
  text-transform: none;
}

/* Stat card — for dashboard numbers */
.stat-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  padding: var(--space-5);
}
.stat-card-value {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--space-1);
}
.stat-card-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.stat-card-urgent .stat-card-value { color: var(--semantic-error-text); }
.stat-card-urgent { border-color: var(--semantic-error-border); }

/* Pricing card */
.pricing-card {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border-default);
  padding: var(--space-7);
  display: flex;
  flex-direction: column;
  transition: var(--transition-base);
}
.pricing-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.pricing-card.featured {
  border-color: var(--brand-teal);
  box-shadow: var(--shadow-teal);
  position: relative;
}
.pricing-tag {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-teal);
  color: white;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  padding: 4px var(--space-4);
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.pricing-price {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 2px;
}
.pricing-period {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}
.pricing-features {
  list-style: none;
  margin-bottom: var(--space-7);
  flex: 1;
}
.pricing-features li {
  font-size: var(--text-base);
  color: var(--text-secondary);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  line-height: var(--leading-snug);
}
.pricing-features li:last-child { border-bottom: none; }
.feature-check { color: var(--brand-teal); flex-shrink: 0; }
.feature-plus  { color: var(--brand-gold); flex-shrink: 0; font-weight: var(--weight-bold); }


/* ── 8. BADGES & CHIPS ────────────────────────────────────── */

/* Base badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Semantic badge variants */
.badge-success { background: var(--semantic-success-bg); color: var(--semantic-success-text); }
.badge-warning { background: var(--semantic-warning-bg); color: var(--semantic-warning-text); }
.badge-error   { background: var(--semantic-error-bg);   color: var(--semantic-error-text); }
.badge-info    { background: var(--semantic-info-bg);    color: var(--semantic-info-text); }
.badge-purple  { background: var(--semantic-purple-bg);  color: var(--semantic-purple-text); }

/* Status badge */
.badge-active   { background: var(--semantic-success-bg); color: var(--semantic-success-text); }
.badge-inactive { background: var(--surface-page); color: var(--text-muted); }
.badge-urgent   { background: var(--semantic-error-bg); color: var(--semantic-error-text); }

/* Layer badges — match the NCJMM colors */
.badge-layer-1 { background: var(--layer-1-bg); color: var(--layer-1-text); }
.badge-layer-2 { background: var(--layer-2-bg); color: var(--layer-2-text); }
.badge-layer-3 { background: var(--layer-3-bg); color: var(--layer-3-text); }
.badge-layer-4 { background: var(--layer-4-bg); color: var(--layer-4-text); }
.badge-layer-5 { background: var(--layer-5-bg); color: var(--layer-5-text); }
.badge-layer-6 { background: var(--layer-6-bg); color: var(--layer-6-text); }

/* Tier badges */
.badge-self-paced  { background: var(--semantic-info-bg); color: var(--semantic-info-text); }
.badge-guided      { background: var(--layer-2-bg); color: var(--layer-2-text); }
.badge-intensive   { background: var(--layer-4-bg); color: var(--layer-4-text); }


/* ── 9. ALERTS & CALLOUTS ─────────────────────────────────── */

/* Inline alert — shown inside forms or pages */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  display: none; /* show with JavaScript */
}
.alert.visible { display: block; }
.alert-error   { background: var(--semantic-error-bg);   color: var(--semantic-error-text);   border: 1px solid var(--semantic-error-border); }
.alert-success { background: var(--semantic-success-bg); color: var(--semantic-success-text); border: 1px solid var(--semantic-success-border); }
.alert-warning { background: var(--semantic-warning-bg); color: var(--semantic-warning-text); border: 1px solid var(--semantic-warning-border); }
.alert-info    { background: var(--semantic-info-bg);    color: var(--semantic-info-text);    border: 1px solid var(--semantic-info-border); }

/* Callout box — larger informational block */
.callout {
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  margin-bottom: var(--space-5);
}
.callout-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 1px; }
.callout-content h4 { font-size: var(--text-base); font-weight: var(--weight-bold); margin-bottom: var(--space-1); }
.callout-content p  { font-size: var(--text-sm); line-height: var(--leading-normal); }
.callout-info    { background: var(--semantic-info-bg);    border-left: 4px solid var(--semantic-info-text); }
.callout-success { background: var(--semantic-success-bg); border-left: 4px solid var(--semantic-success-text); }
.callout-warning { background: var(--semantic-warning-bg); border-left: 4px solid var(--semantic-warning-text); }
.callout-error   { background: var(--semantic-error-bg);   border-left: 4px solid var(--semantic-error-text); }

/* Flag item — used in facilitator dashboard */
.flag-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
}
.flag-item.urgent { background: var(--semantic-error-bg); }
.flag-item.high   { background: var(--semantic-warning-bg); }
.flag-item.normal { background: var(--semantic-info-bg); }
.flag-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.flag-dot.urgent { background: var(--semantic-error-text); }
.flag-dot.high   { background: var(--semantic-warning-text); }
.flag-dot.normal { background: var(--semantic-info-text); }
.flag-text { font-size: var(--text-sm); color: var(--text-primary); line-height: var(--leading-snug); }


/* ── 10. PROGRESS & DATA VISUALIZATION ───────────────────── */

/* Horizontal progress bar */
.progress-bar {
  height: 8px;
  background: var(--border-default);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--brand-teal);
  transition: width 0.6s ease;
}
.progress-fill.warn { background: var(--semantic-warning-text); }
.progress-fill.low  { background: var(--semantic-error-text); }

/* NCJMM Layer bar group */
.layer-bars { display: flex; flex-direction: column; gap: var(--space-4); }

.layer-bar-item { display: flex; flex-direction: column; gap: 5px; }

.layer-bar-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.layer-bar-name { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.layer-bar-pct  { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text-muted); }

.layer-bar-track {
  height: 8px;
  background: var(--border-default);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.layer-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sim progress list */
.sim-list { list-style: none; }
.sim-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-default);
}
.sim-item:last-child { border-bottom: none; }

.sim-num {
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  background: var(--semantic-info-bg);
  color: var(--semantic-info-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sim-num.complete { background: var(--semantic-success-bg); color: var(--semantic-success-text); }
.sim-num.locked   { background: var(--surface-page); color: var(--text-disabled); }
.sim-num.next     { background: var(--brand-navy); color: white; }

.sim-info { flex: 1; min-width: 0; }
.sim-title   { font-size: var(--text-base); font-weight: var(--weight-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-meta    { font-size: var(--text-xs); color: var(--text-muted); margin-top: 1px; }
.sim-score   { font-family: var(--font-mono); font-size: var(--text-base); font-weight: var(--weight-medium); flex-shrink: 0; }
.sim-score.good { color: var(--semantic-success-text); }
.sim-score.warn { color: var(--semantic-warning-text); }
.sim-score.low  { color: var(--semantic-error-text); }
.sim-score.none { color: var(--border-default); }


/* ── 11. TABLES ───────────────────────────────────────────── */

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-default);
}
.data-table th {
  background: var(--brand-navy);
  color: var(--text-inverse-dim);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-align: left;
  padding: var(--space-3) var(--space-4);
}
.data-table td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  border-bottom: 1px solid var(--border-default);
  color: var(--text-primary);
  vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) td { background: #F8FAFB; }
.data-table tbody tr { transition: var(--transition-fast); }
.data-table tbody tr:hover td { background: var(--semantic-info-bg); cursor: pointer; }

/* Row-based layout table (used in dashboard) */
.row-table { list-style: none; }
.row-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-default);
  transition: var(--transition-fast);
}
.row-item:last-child { border-bottom: none; }
.row-item:hover { background: var(--surface-page); cursor: pointer; }


/* ── 12. MODALS & SIDE PANELS ─────────────────────────────── */

.overlay {
  position: fixed; inset: 0;
  background: var(--surface-overlay);
  z-index: var(--z-overlay);
  opacity: 0; pointer-events: none;
  transition: var(--transition-base);
}
.overlay.open { opacity: 1; pointer-events: all; }

.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -48%);
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  width: min(540px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  z-index: var(--z-modal);
  opacity: 0; pointer-events: none;
  transition: var(--transition-slow);
}
.modal.open { opacity: 1; pointer-events: all; transform: translate(-50%, -50%); }

.modal-header {
  background: var(--brand-navy);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  display: flex; align-items: flex-start; justify-content: space-between;
}
.modal-title { font-family: var(--font-display); font-size: var(--text-xl); color: white; }
.modal-close { background: none; border: none; color: var(--text-inverse-dim); font-size: 1.5rem; cursor: pointer; padding: 0; line-height: 1; }
.modal-body { padding: var(--space-6); }

.side-panel {
  position: fixed;
  top: var(--nav-height); right: 0; bottom: 0;
  width: min(480px, 90vw);
  background: var(--surface-card);
  border-left: 1px solid var(--border-default);
  box-shadow: -8px 0 32px rgba(0,0,0,0.12);
  z-index: var(--z-overlay);
  overflow-y: auto;
  transform: translateX(100%);
  transition: var(--transition-slow);
}
.side-panel.open { transform: translateX(0); }

.side-panel-header {
  background: var(--brand-navy);
  padding: var(--space-5) var(--space-6);
  display: flex; align-items: flex-start; justify-content: space-between;
}
.side-panel-body { padding: var(--space-5) var(--space-6); }


/* ── 13. LOADING STATES ───────────────────────────────────── */

/* Skeleton shimmer */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-page) 25%,
    var(--border-default) 50%,
    var(--surface-page) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text  { height: 14px; margin-bottom: var(--space-2); }
.skeleton-title { height: 22px; width: 60%; margin-bottom: var(--space-3); }
.skeleton-card  { height: 120px; border-radius: var(--radius-lg); }

/* Spinner */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.25);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-dark {
  border: 2.5px solid var(--border-default);
  border-top-color: var(--brand-teal);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Page loading overlay */
.page-loader {
  position: fixed; inset: 0;
  background: var(--surface-card);
  display: flex; align-items: center; justify-content: center;
  z-index: var(--z-modal);
}


/* ── 14. PAGE-LEVEL PATTERNS ──────────────────────────────── */

/* Hero section */
.hero {
  background: var(--brand-navy);
  padding: var(--space-14) var(--space-7) var(--space-12);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 25% 50%, rgba(11,107,96,0.22) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 50%, rgba(196,154,42,0.10) 0%, transparent 55%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }

.hero-eyebrow {
  display: inline-block;
  background: rgba(11,107,96,0.22);
  border: 1px solid rgba(11,107,96,0.45);
  border-radius: var(--radius-full);
  padding: 4px var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: rgba(255,255,255,0.70);
  margin-bottom: var(--space-5);
}

.hero-heading {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 5vw, var(--text-5xl));
  color: white;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-4);
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.hero-heading em { color: #D4A04C; font-style: italic; }

.hero-subheading {
  font-size: clamp(var(--text-base), 2vw, var(--text-lg));
  color: rgba(255,255,255,0.62);
  max-width: 560px;
  margin: 0 auto var(--space-8);
  line-height: var(--leading-relaxed);
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

/* Section */
.section {
  padding: var(--space-16) 0;
}
.section-alt {
  padding: var(--space-16) 0;
  background: var(--brand-cream);
}
.section-dark {
  padding: var(--space-16) 0;
  background: var(--brand-navy);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-10);
}
.section-header .eyebrow { margin-bottom: var(--space-3); }
.section-header h2 { margin-bottom: var(--space-3); }
.section-header p {
  font-size: var(--text-md);
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto;
  line-height: var(--leading-relaxed);
}

/* Feature grid item */
.feature-item { display: flex; flex-direction: column; gap: var(--space-3); }
.feature-icon {
  width: 48px; height: 48px;
  background: var(--semantic-info-bg);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.feature-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.feature-desc  { font-size: var(--text-base); color: var(--text-muted); line-height: var(--leading-normal); }

/* Auth card — login/signup container */
.auth-card {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  padding: var(--space-12) var(--space-10);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-2xl);
}

/* Tabs */
.tabs {
  display: flex;
  background: var(--surface-page);
  border-radius: var(--radius-md);
  padding: var(--space-1);
  gap: var(--space-1);
}
.tab-btn {
  flex: 1; text-align: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-muted);
  border: none; background: none;
  font-family: var(--font-body);
}
.tab-btn.active {
  background: var(--surface-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

/* Divider with text */
.divider {
  position: relative;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin: var(--space-5) 0;
}
.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--border-default);
}
.divider::before { left: 0; }
.divider::after  { right: 0; }


/* ── RESPONSIVE OVERRIDES ─────────────────────────────────── */

@media (max-width: 900px) {
  .grid-3  { grid-template-columns: 1fr 1fr; }
  .grid-4  { grid-template-columns: 1fr 1fr; }
  .grid-2-1 { grid-template-columns: 1fr; }
  .grid-1-2 { grid-template-columns: 1fr; }
  .sidebar  { display: none; } /* Hide on mobile — add hamburger nav instead */
}

@media (max-width: 600px) {
  .grid-2  { grid-template-columns: 1fr; }
  .grid-3  { grid-template-columns: 1fr; }
  .hero    { padding: var(--space-10) var(--space-5) var(--space-8); }
  .auth-card { padding: var(--space-8) var(--space-6); }
  .hero-actions { flex-direction: column; align-items: center; }
  .container, .container-wide, .container-content { padding: 0 var(--space-5); }
}
