/* ==============================================================
   POLARIS PATHWAYS — DESIGN SYSTEM
   Extracted from polaris-pathways-design-system/project/softr-header-v2.html
   Sections: TOKENS, BASE, CHROME, COMPONENTS, UTILITIES, RESPONSIVE+MOTION
   DO NOT EDIT - regenerate from source on design-system updates.
   ============================================================== */

/* =========== TOKENS =========== */
:root {
  /* ─── BRAND COLORS ─────────────────────────────────────────── */
  --brand-primary: #499c57;
  --brand-primary-dark: #3a7d46;
  --brand-primary-light: #5fb86d;
  --brand-primary-subtle: #e8f5ea;
  --brand-primary-ghost: rgba(73, 156, 87, 0.08);

  --brand-accent: #fd5e02;
  --brand-accent-dark: #d44e01;
  --brand-accent-light: #ff8a3d;
  --brand-accent-subtle: #fff1e8;

  --brand-highlight: #ffad01;
  --brand-highlight-dark: #e09500;
  --brand-highlight-subtle: #fff7e0;

  --brand-blue: #1575e8;
  --brand-blue-dark: #1060c0;
  --brand-blue-light: #4d94f0;
  --brand-blue-subtle: #edf4fe;
  --brand-blue-ghost: rgba(21, 117, 232, 0.08);

  /* ─── NEUTRALS (warm) ──────────────────────────────────────── */
  --neutral-50: #f7f5f0;
  --neutral-100: #f0ede1;
  --neutral-200: #e3ded6;
  --neutral-300: #d6d1ca;
  --neutral-400: #c2beb8;
  --neutral-500: #9e9997;
  --neutral-600: #7d7877;
  --neutral-700: #5f5b5a;
  --neutral-800: #333130;
  --neutral-900: #181817;

  /* ─── SEMANTIC ─────────────────────────────────────────────── */
  /* 3-tier warm surface system (mirrors LMS portal /dashboard).
       page bg → outer card → inner tile, each one a quarter-step
       lighter, so card content visually pops off the canvas. The
       old harsh #e9e3d5 page-bg was retired 2026-05-12. */
  --color-surface: #ffffff; /* outer card */
  --color-surface-alt: #f4f4f4;
  --color-surface-soft: var(--neutral-50); /* inner tile, warm cream */
  --color-background: var(--neutral-100); /* page bg (was #e9e3d5) */
  --color-border: var(--neutral-200);
  --color-border-strong: var(--neutral-300);

  --text-primary: var(--neutral-900);
  --text-secondary: var(--neutral-700);
  --text-tertiary: var(--neutral-600);
  --text-muted: var(--neutral-500);
  --text-inverse: #ffffff;

  --status-success: #22c55e;
  --status-success-bg: #f0fdf4;
  --status-warning: #f59e0b;
  --status-warning-bg: #fffbeb;
  --status-error: #ed2e19;
  --status-error-bg: #fef2f2;
  --status-info: #1575e8;
  --status-info-bg: #edf4fe;

  /* ─── TYPOGRAPHY ───────────────────────────────────────────── */
  --font-heading: "Montserrat", sans-serif;
  --font-body:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family: var(--font-body);

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.05em;

  /* ─── SPACING ──────────────────────────────────────────────── */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* ─── RADIUS ───────────────────────────────────────────────── */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* ─── SHADOWS ──────────────────────────────────────────────── */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16), 0 8px 16px rgba(0, 0, 0, 0.08);

  --shadow-primary: 0 4px 14px rgba(73, 156, 87, 0.25);
  --shadow-primary-lg: 0 8px 24px rgba(73, 156, 87, 0.3);

  /* ─── MOTION ───────────────────────────────────────────────── */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* ─── Z-INDEX ──────────────────────────────────────────────── */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-popover: 400;
  --z-toast: 500;

  /* ─── COMPONENT TOKENS ─────────────────────────────────────── */
  --card-padding: var(--space-5);
  --card-radius: var(--radius-lg);
  --card-border: 1px solid var(--color-border);
  --card-shadow: var(--shadow-sm);

  --btn-height: 44px;
  --btn-padding: var(--space-4) var(--space-6);
  --btn-radius: var(--radius-md);

  --input-height: 44px;
  --input-padding: var(--space-3) var(--space-4);
  --input-radius: var(--radius-md);
}

/* =========== BASE =========== */
/* Apply Montserrat to all headings across Softr native + Vibe Code */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading, "Montserrat", sans-serif) !important;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

/* Body font default (doesn't override Softr's own layout frames) */
[data-block-id] {
  font-family: var(--font-body);
  color: var(--text-primary);
}

/* Smooth in-page scroll */
html {
  scroll-behavior: smooth;
}

/* Screen-reader-only utility (a11y) */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========== CHROME =========== */
/* Top bar */
.softr-topbar {
  background: var(--color-surface-alt) !important;
  border-bottom: 1px solid var(--color-border) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}
.softr-topbar .softr-nav-logo {
  transform: scale(1.1);
}
.softr-topbar .softr-nav-link > span {
  color: var(--text-secondary) !important;
  font-family: var(--font-body) !important;
  font-weight: 500 !important;
  font-size: 15px !important;
  transition: color 150ms ease !important;
}
.softr-topbar .softr-nav-link:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  border-radius: 8px !important;
}
.softr-topbar .softr-nav-link:hover > span {
  color: var(--text-primary) !important;
}
.softr-topbar .softr-nav-link[data-active="true"] > span {
  color: var(--brand-primary) !important;
  font-weight: 600 !important;
}
.softr-topbar .softr-nav-link[data-active="true"] {
  background: var(--brand-primary-ghost) !important;
  border-radius: 8px !important;
}

/* Sidebar */
.softr-sidebar {
  background: var(--color-surface) !important;
  border-right: 1px solid var(--color-border) !important;
}
.softr-sidebar .softr-nav-link {
  font-family: var(--font-body) !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  color: var(--text-secondary) !important;
  border-radius: 8px !important;
  margin: 2px 8px !important;
  transition: all 150ms ease !important;
}
.softr-sidebar .softr-nav-link:hover {
  background: var(--brand-primary-ghost) !important;
  color: var(--text-primary) !important;
}
.softr-sidebar .softr-nav-link[data-active="true"] {
  background: var(--brand-primary-ghost) !important;
  color: var(--brand-primary) !important;
  font-weight: 600 !important;
}
.softr-sidebar .softr-nav-link[data-active="true"] svg {
  color: var(--brand-primary) !important;
}

/* Form focus states — scoped to content blocks only */
[data-block-id] input:focus,
[data-block-id] textarea:focus,
[data-block-id] select:focus,
[data-block-id] [role="combobox"]:focus {
  border-color: var(--brand-primary) !important;
  box-shadow: 0 0 0 3px var(--brand-primary-subtle) !important;
  outline: none !important;
}
[data-block-id] input:focus-visible,
[data-block-id] textarea:focus-visible,
[data-block-id] select:focus-visible,
[data-block-id] button:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* =========== COMPONENTS =========== */
/* ────────────────────────────────────────────────────────────────
     5.1 BUTTONS
     <button class="btn btn--primary">Label</button>
     Variants: --primary --secondary --ghost --danger --link
     Sizes:    --sm --lg --icon
     State:    [disabled], .is-loading
     ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--btn-height);
  padding: var(--btn-padding);
  border-radius: var(--btn-radius);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
  user-select: none;
}
.btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}
.btn[disabled],
.btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary */
.btn--primary {
  background: var(--brand-primary);
  color: var(--text-inverse);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-primary);
}
.btn--primary:hover {
  background: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
  box-shadow: var(--shadow-primary-lg);
  transform: translateY(-1px);
}
.btn--primary:active {
  transform: translateY(0);
}

/* Secondary (outline) */
.btn--secondary {
  background: var(--color-surface);
  color: var(--text-primary);
  border-color: var(--color-border-strong);
}
.btn--secondary:hover {
  background: var(--neutral-50);
  border-color: var(--neutral-400);
}

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn--ghost:hover {
  background: var(--brand-primary-ghost);
  color: var(--brand-primary);
}

/* Danger */
.btn--danger {
  background: var(--status-error);
  color: var(--text-inverse);
  border-color: var(--status-error);
}
.btn--danger:hover {
  background: #c9261a;
  border-color: #c9261a;
}

/* Link-style button */
.btn--link {
  height: auto;
  padding: 0;
  background: transparent;
  color: var(--brand-primary);
  font-weight: var(--weight-semibold);
}
.btn--link:hover {
  color: var(--brand-primary-dark);
  text-decoration: underline;
}

/* Sizes */
.btn--sm {
  height: 36px;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}
.btn--lg {
  height: 52px;
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}
.btn--icon {
  width: var(--btn-height);
  padding: 0;
}
.btn--icon.btn--sm {
  width: 36px;
}
.btn--icon.btn--lg {
  width: 52px;
}

/* Loading state */
.btn.is-loading {
  color: transparent !important;
  pointer-events: none;
  position: relative;
}
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: mc-spin 700ms linear infinite;
  color: inherit;
}

/* ────────────────────────────────────────────────────────────────
     5.2 BADGES & CHIPS
     <span class="badge badge--success">Active</span>
     <span class="chip">Filter</span>
     ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1.4;
  letter-spacing: 0.01em;
  background: var(--neutral-100);
  color: var(--text-secondary);
  white-space: nowrap;
}
.badge--success {
  background: var(--status-success-bg);
  color: #15803d;
}
.badge--warning {
  background: var(--status-warning-bg);
  color: #b45309;
}
.badge--error {
  background: var(--status-error-bg);
  color: #b91c1c;
}
.badge--info {
  background: var(--status-info-bg);
  color: var(--status-info);
}
.badge--primary {
  background: var(--brand-primary-subtle);
  color: var(--brand-primary-dark);
}
.badge--accent {
  background: var(--brand-accent-subtle);
  color: var(--brand-accent-dark);
}
.badge--solid {
  background: var(--neutral-800);
  color: var(--text-inverse);
}

/* Chip — larger, clickable filter/tag */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  background: var(--neutral-100);
  color: var(--text-secondary);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.chip:hover {
  background: var(--neutral-200);
  color: var(--text-primary);
}
.chip--active,
.chip.is-active {
  background: var(--brand-primary-ghost);
  color: var(--brand-primary-dark);
  border-color: var(--brand-primary);
}
.chip__remove {
  display: inline-flex;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-secondary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
}

/* ────────────────────────────────────────────────────────────────
     5.3 CARDS
     <div class="card">
       <div class="card__header">…</div>
       <div class="card__body">…</div>
       <div class="card__footer">…</div>
     </div>
     ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition:
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}
.card--hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card--interactive {
  cursor: pointer;
}
.card--flat {
  box-shadow: none;
}
.card--raised {
  box-shadow: var(--shadow-md);
}
.card--accent {
  border-top: 3px solid var(--brand-primary);
}

.card__header {
  padding: var(--card-padding);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.card__body {
  padding: var(--card-padding);
}
.card__footer {
  padding: var(--card-padding);
  border-top: 1px solid var(--color-border);
  background: var(--neutral-50);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}
.card__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin: 0;
}
.card__subtitle {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin: 0;
}
.card__media {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

/* ────────────────────────────────────────────────────────────────
     5.4 INPUTS & FORMS
     <label class="label">Name</label>
     <input class="input" type="text" />
     <p class="help-text">Optional hint</p>
     ──────────────────────────────────────────────────────────────── */
.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.form-row {
  display: grid;
  gap: var(--space-4);
}
.form-row--2 {
  grid-template-columns: repeat(2, 1fr);
}
.form-row--3 {
  grid-template-columns: repeat(3, 1fr);
}

.label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  line-height: 1.4;
}
.label--required::after {
  content: " *";
  color: var(--status-error);
}

.input,
.textarea,
.select {
  width: 100%;
  height: var(--input-height);
  padding: var(--input-padding);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--input-radius);
  line-height: 1.4;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}
.textarea {
  height: auto;
  min-height: 96px;
  padding: var(--space-3) var(--space-4);
  resize: vertical;
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%235f5b5a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--text-muted);
}
.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--neutral-400);
}
.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-subtle);
  outline: none;
}
.input[disabled],
.textarea[disabled],
.select[disabled] {
  background: var(--neutral-50);
  color: var(--text-muted);
  cursor: not-allowed;
}
.input.is-error,
.textarea.is-error,
.select.is-error {
  border-color: var(--status-error);
}
.input.is-error:focus,
.textarea.is-error:focus,
.select.is-error:focus {
  box-shadow: 0 0 0 3px var(--status-error-bg);
}

/* Input with leading/trailing icon */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.input-group .input {
  padding-left: var(--space-10);
}
.input-group__icon {
  position: absolute;
  left: var(--space-3);
  color: var(--text-muted);
  pointer-events: none;
  display: inline-flex;
}
.input-group__icon--trailing {
  left: auto;
  right: var(--space-3);
}
.input-group:has(.input-group__icon--trailing) .input {
  padding-left: var(--space-4);
  padding-right: var(--space-10);
}

/* Help + error text */
.help-text {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: 1.4;
}
.error-text {
  font-size: var(--text-xs);
  color: var(--status-error);
  line-height: 1.4;
  font-weight: var(--weight-medium);
}

/* Checkbox + Radio */
.checkbox,
.radio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.checkbox input,
.radio input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch__track {
  position: absolute;
  inset: 0;
  background: var(--neutral-300);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
  cursor: pointer;
}
.switch__track::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}
.switch input:checked + .switch__track {
  background: var(--brand-primary);
}
.switch input:checked + .switch__track::before {
  transform: translateX(18px);
}

/* ────────────────────────────────────────────────────────────────
     5.5 TABLES
     <table class="table table--striped">…</table>
     ──────────────────────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--color-surface);
}
.table thead th {
  text-align: left;
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-tertiary);
  padding: var(--space-3) var(--space-4);
  background: var(--neutral-50);
  border-bottom: 1px solid var(--color-border);
}
.table tbody td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.table tbody tr:hover {
  background: var(--neutral-50);
}

.table--striped tbody tr:nth-child(even) {
  background: var(--neutral-50);
}
.table--striped tbody tr:nth-child(even):hover {
  background: var(--neutral-100);
}
.table--bordered {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.table--compact thead th,
.table--compact tbody td {
  padding: var(--space-2) var(--space-3);
}

/* Empty state (placed inside a card or table wrapper) */
.table-empty {
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--text-tertiary);
}
.table-empty__icon {
  font-size: 32px;
  margin-bottom: var(--space-3);
}
.table-empty__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.table-empty__desc {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  max-width: 420px;
  margin: 0 auto var(--space-4);
}

/* ────────────────────────────────────────────────────────────────
     5.6 TABS
     <div class="tabs" role="tablist">
       <button class="tab tab--active">Overview</button>
       <button class="tab">Details</button>
     </div>
     ──────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--color-border);
  padding: 0 var(--space-1);
}
.tab {
  background: transparent;
  border: none;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-tertiary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast);
}
.tab:hover {
  color: var(--text-primary);
}
.tab--active,
.tab[aria-selected="true"] {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}
.tab[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Pill-style tabs */
.tabs--pills {
  border-bottom: none;
  gap: var(--space-2);
  padding: 0;
}
.tabs--pills .tab {
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  margin: 0;
}
.tabs--pills .tab--active,
.tabs--pills .tab[aria-selected="true"] {
  background: var(--brand-primary-ghost);
  border-color: var(--brand-primary);
  color: var(--brand-primary-dark);
}

/* ────────────────────────────────────────────────────────────────
     5.7 CALLOUTS / ALERTS
     <div class="callout callout--warning">
       <div class="callout__icon">⚠️</div>
       <div class="callout__body">
         <p class="callout__title">Heads up</p>
         <p class="callout__desc">…</p>
       </div>
     </div>
     ──────────────────────────────────────────────────────────────── */
.callout {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--neutral-50);
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: var(--leading-normal);
}
.callout__icon {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
}
.callout__body {
  flex: 1 1 auto;
}
.callout__title {
  font-weight: var(--weight-semibold);
  margin: 0 0 var(--space-1);
}
.callout__desc {
  margin: 0;
  color: var(--text-secondary);
}

.callout--info {
  background: var(--status-info-bg);
  border-color: #bfdbfe;
}
.callout--info .callout__icon {
  color: var(--status-info);
}
.callout--success {
  background: var(--status-success-bg);
  border-color: #bbf7d0;
}
.callout--success .callout__icon {
  color: var(--status-success);
}
.callout--warning {
  background: var(--status-warning-bg);
  border-color: #fde68a;
}
.callout--warning .callout__icon {
  color: var(--status-warning);
}
.callout--error {
  background: var(--status-error-bg);
  border-color: #fecaca;
}
.callout--error .callout__icon {
  color: var(--status-error);
}

/* ────────────────────────────────────────────────────────────────
     5.8 MODALS / DRAWERS / TOASTS  (presentation only; open/close = JS)
     Structure for modal:
       <div class="overlay">
         <div class="modal">
           <div class="modal__header">…</div>
           <div class="modal__body">…</div>
           <div class="modal__footer">…</div>
         </div>
       </div>
     ──────────────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 24, 23, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  z-index: var(--z-modal);
  animation: mc-fade 180ms var(--ease-out);
}
@keyframes mc-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - var(--space-12));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: mc-rise 220ms var(--ease-out);
}
@keyframes mc-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal--sm {
  max-width: 400px;
}
.modal--lg {
  max-width: 720px;
}
.modal--xl {
  max-width: 960px;
}

.modal__header {
  padding: var(--space-5);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.modal__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin: 0;
}
.modal__close {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
}
.modal__close:hover {
  background: var(--neutral-100);
  color: var(--text-primary);
}
.modal__body {
  padding: var(--space-5);
  overflow-y: auto;
  flex: 1;
}
.modal__footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border);
  background: var(--neutral-50);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* Drawer — right-side sheet */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: var(--color-surface);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  z-index: var(--z-modal);
  animation: mc-slide-in 260ms var(--ease-out);
}
@keyframes mc-slide-in {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}
.drawer--left {
  left: 0;
  right: auto;
  animation-name: mc-slide-in-left;
}
@keyframes mc-slide-in-left {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.drawer__header {
  padding: var(--space-5);
  border-bottom: 1px solid var(--color-border);
}
.drawer__body {
  padding: var(--space-5);
  overflow-y: auto;
  flex: 1;
}
.drawer__footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border);
  background: var(--neutral-50);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* Toast */
.toast-stack {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  z-index: var(--z-toast);
  max-width: 380px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--neutral-900);
  color: var(--text-inverse);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  animation: mc-rise 220ms var(--ease-out);
}
.toast--success {
  background: var(--status-success);
}
.toast--warning {
  background: var(--status-warning);
  color: var(--neutral-900);
}
.toast--error {
  background: var(--status-error);
}
.toast--info {
  background: var(--status-info);
}
.toast__close {
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}
.toast__close:hover {
  opacity: 1;
}

/* ────────────────────────────────────────────────────────────────
     5.9 NAVIGATION HELPERS
     Breadcrumbs, in-page section nav
     ──────────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  list-style: none;
  padding: 0;
  margin: 0;
}
.breadcrumb a {
  color: var(--text-tertiary);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}
.breadcrumb__separator {
  color: var(--text-muted);
}
.breadcrumb__item--current {
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}

/* ────────────────────────────────────────────────────────────────
     5.10 PROGRESS & STEPS
     <div class="progress"><div class="progress__bar" style="width:64%"></div></div>
     <ol class="steps">…</ol>
     ──────────────────────────────────────────────────────────────── */
.progress {
  width: 100%;
  height: 8px;
  background: var(--neutral-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: var(--brand-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow) var(--ease-out);
}
.progress--accent .progress__bar {
  background: var(--brand-accent);
}
.progress--thin {
  height: 4px;
}
.progress--thick {
  height: 12px;
}

.steps {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
  margin: 0;
}
.steps__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-weight: var(--weight-medium);
}
.steps__dot {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--neutral-200);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
}
.steps__item--current .steps__dot {
  background: var(--brand-primary);
  color: var(--text-inverse);
}
.steps__item--current {
  color: var(--text-primary);
}
.steps__item--done .steps__dot {
  background: var(--brand-primary-subtle);
  color: var(--brand-primary-dark);
}
.steps__item--done {
  color: var(--text-secondary);
}
.steps__connector {
  flex: 1;
  height: 2px;
  background: var(--color-border);
}

/* ────────────────────────────────────────────────────────────────
     5.11 TOOLTIPS  (CSS-only, trigger via [data-tooltip])
     <span data-tooltip="Helpful hint">Hover me</span>
     ──────────────────────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--neutral-900);
  color: var(--text-inverse);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast);
  z-index: var(--z-popover);
}
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========== UTILITIES =========== */
/* Layout primitives */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.stack--sm {
  gap: var(--space-2);
}
.stack--lg {
  gap: var(--space-6);
}
.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Typography utilities */
.text-primary {
  color: var(--text-primary);
}
.text-secondary {
  color: var(--text-secondary);
}
.text-tertiary {
  color: var(--text-tertiary);
}
.text-muted {
  color: var(--text-muted);
}
.text-brand {
  color: var(--brand-primary);
}
.text-danger {
  color: var(--status-error);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-tertiary);
}
.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}
.small {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}
.micro {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Heading utility classes (when semantic tag isn't appropriate) */
.h1 {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}
.h2 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}
.h3 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}
.h4 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
}
.h5 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}
.h6 {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

/* =========== RESPONSIVE + MOTION =========== */
@keyframes mc-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .mc-root {
    padding: 16px 12px !important;
  }
  .mc-table-grid {
    grid-template-columns: 1fr !important;
  }
  .mc-detail-layout {
    grid-template-columns: 1fr !important;
  }

  .form-row--2,
  .form-row--3 {
    grid-template-columns: 1fr;
  }
  .card__header {
    flex-direction: column;
    align-items: flex-start;
  }
  .drawer {
    max-width: 100%;
  }
  .toast-stack {
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
    max-width: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-normal: 0ms;
    --transition-slow: 0ms;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
