﻿/**
 * Admin Pages Styles
 * Extracted from: templates/core/admin_*.html
 * 
 * Consolidated styles for admin pages like mock tests, course overview, etc.
 */

/* ============================================
   COURSE STEPPER (Create Course flow)
   Visible 3-step progress: Details â†’ Modules â†’ Publish
   ============================================ */
.course-stepper {
  margin: 0 0 var(--space-5, 24px);
  padding: var(--space-3, 12px) var(--space-4, 16px);
  background: var(--color-bg-subtle, #f6f7fb);
  border: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.08));
  border-radius: 8px;
}
html[data-theme="dark"] .course-stepper {
  background: var(--color-bg-subtle, #111a2b);
  border-color: var(--color-border-subtle, rgba(255, 255, 255, 0.08));
}
.course-stepper__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3, 12px);
}
.course-stepper__step {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  position: relative;
  padding: 4px 0;
}
.course-stepper__step + .course-stepper__step::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(-1 * var(--space-3, 12px) - 16px);
  width: 16px;
  height: 1px;
  background: var(--color-border-subtle, rgba(0, 0, 0, 0.16));
  transform: translateY(-50%);
}
.course-stepper__bullet {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 600;
  font-size: 13px;
  background: var(--color-bg, #fff);
  border: 1.5px solid var(--color-border, rgba(0, 0, 0, 0.2));
  color: var(--color-text-muted, #666);
}
html[data-theme="dark"] .course-stepper__bullet {
  background: #1a2236;
}
.course-stepper__step--active .course-stepper__bullet {
  background: var(--color-primary, #4f46e5);
  border-color: var(--color-primary, #4f46e5);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.18);
}
.course-stepper__step--upcoming .course-stepper__bullet {
  background: var(--color-bg-subtle, #f6f7fb);
  color: var(--color-text-muted, #888);
}
.course-stepper__label {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}
.course-stepper__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text, #111);
}
.course-stepper__step--upcoming .course-stepper__title {
  color: var(--color-text-muted, #888);
  font-weight: 500;
}
.course-stepper__hint {
  font-size: 12px;
  color: var(--color-text-muted, #888);
  margin-top: 2px;
}
@media (max-width: 720px) {
  .course-stepper__steps {
    grid-template-columns: 1fr;
  }
  .course-stepper__step + .course-stepper__step::before {
    display: none;
  }
}

/* ============================================
   COURSE PAGE HEADER + TABS
   The old course admin page had a row of bare <a class="link">
   "tabs" that looked like stray text links and an Edit Course
   button buried at the bottom. The new design:
   - Title + status badge in the top-left
   - Edit Course and Publish buttons in the top-right
   - Real tab bar below the header
   ============================================ */
.course-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3, 12px);
  flex-wrap: wrap;
  margin-bottom: var(--space-3, 12px);
}
.course-page-header__title-block {
  flex: 1;
  min-width: 280px;
}
.course-page-header__title-block h1 {
  margin: 0 0 4px;
}
.course-page-header__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}
.course-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.course-status--live {
  background: rgba(22, 163, 74, 0.14);
  color: var(--color-success, #15803d);
}
.course-status--partial {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}
.course-status--draft {
  background: var(--color-bg-subtle, #f3f4f6);
  color: var(--color-text-muted, #6b7280);
}
.course-status-meta {
  font-size: 13px;
}
.course-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 var(--space-3, 12px);
  border-bottom: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.1));
  flex-wrap: wrap;
}
.course-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted, #6b7280);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 100ms ease, border-color 100ms ease;
}
.course-tab:hover {
  color: var(--color-text, #111);
  text-decoration: none;
}
.course-tab--active {
  color: var(--color-primary, #4f46e5);
  border-bottom-color: var(--color-primary, #4f46e5);
  font-weight: 600;
}
.course-tab--active:hover {
  color: var(--color-primary, #4f46e5);
}
.course-tab__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}
.primary-cta {
  background: var(--color-success, #16a34a);
  color: #fff;
  border-color: var(--color-success, #16a34a);
}
.primary-cta:hover {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
}

/* ============================================
   PUBLISH CHECKLIST (course publish page)
   Green/amber banner that aggregates all publish blockers in
   one place. Replaces the old single-message warning which
   forced the admin to fix one issue, reload, see the next, etc.
   ============================================ */
.publish-checklist {
  border: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.1));
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: var(--space-3, 12px);
}
.publish-checklist--ready {
  background: rgba(22, 163, 74, 0.06);
  border-color: rgba(22, 163, 74, 0.4);
}
.publish-checklist--blocked {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.4);
}
.publish-checklist__header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.publish-checklist--ready .publish-checklist__icon {
  color: var(--color-success, #15803d);
}
.publish-checklist--blocked .publish-checklist__icon {
  color: #b45309;
}
.publish-checklist__sub {
  font-size: 13px;
  margin-top: 2px;
}
.publish-checklist__list {
  list-style: decimal;
  margin: 10px 0 0;
  padding-left: 22px;
  color: #92400e;
  font-size: 14px;
  line-height: 1.5;
}
.publish-checklist__list li {
  padding: 2px 0;
}
.publish-checklist__actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================
   ADMIN PREVIEW BANNER
   Shown at the top of courses/detail.html when an admin is
   previewing via the /dashboard/admin/course/<slug>/preview/ route.
   Surfaces the editing affordances and the publish state so the
   admin always knows they're in preview mode and what the student
   actually sees (vs. what is draft).
   ============================================ */
.admin-preview-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  padding: 10px 14px;
  margin: 0 0 var(--space-3, 12px);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.04) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
  font-size: 14px;
  color: #92400e;
  flex-wrap: wrap;
}
.admin-preview-banner__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}
.admin-preview-banner__body {
  flex: 1;
  min-width: 240px;
  line-height: 1.4;
}
.admin-preview-banner__body strong {
  color: #78350f;
}
.admin-preview-banner__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-preview-banner__btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.5);
  background: rgba(255, 255, 255, 0.6);
  color: #78350f;
}
.admin-preview-banner__btn:hover {
  background: rgba(255, 255, 255, 0.9);
}
.admin-preview-banner__btn--primary {
  background: #f59e0b;
  color: #fff;
  border-color: #f59e0b;
}
.admin-preview-banner__btn--primary:hover {
  background: #d97706;
  border-color: #d97706;
  color: #fff;
}

/* ============================================
   BUILD STATUS WIDGET (course overview)
   Replaces the old 3-card static infographic with a live
   checklist that shows counts, completion marks, and a
   context-aware CTA per step.
   ============================================ */
.build-counts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2, 8px);
}
.build-counts__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--color-bg-subtle, #f6f7fb);
  border: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.08));
  border-radius: 999px;
  font-size: 13px;
  color: var(--color-text, #111);
}
.build-counts__chip strong {
  font-weight: 600;
}

/* ============================================
   EMPTY STATE
   Shown inside tables/cards when there are no rows yet.
   Replaces the old "No items" single-line td.
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-6, 32px) var(--space-4, 16px);
  color: var(--color-text-muted, #6b7280);
}
.empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-bg-subtle, #f6f7fb);
  color: var(--color-text-muted, #888);
  margin-bottom: var(--space-3, 12px);
}
.empty-state__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text, #111);
  margin: 0 0 var(--space-2, 8px);
}
.empty-state__body {
  font-size: 14px;
  line-height: 1.5;
  max-width: 420px;
  margin: 0 0 var(--space-3, 12px);
}

/* ============================================
   FORM HELP TEXT (inline guidance under labels)
   Used for fields that need unit or context hints
   (e.g. "hours", "1200x630 recommended")
   ============================================ */
.field-help {
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
  margin-top: 4px;
  line-height: 1.4;
}
.field-help--warn {
  color: #b45309;
}

/* ============================================
   COVER IMAGE BLOCK (course create form)
   Subtle framed card around the file/URL picker
   ============================================ */
.cover-image-block {
  border: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.1));
  border-radius: 8px;
  padding: 16px;
  background: var(--color-bg-subtle, #fafbfc);
}
.cover-image-block__title {
  font-weight: 600;
}
.cover-image-block__hint {
  margin: 0 0 12px;
}
.cover-image-block__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}
@media (max-width: 600px) {
  .cover-image-block__grid {
    grid-template-columns: 1fr;
  }
}
.cover-img-preview {
  margin-top: 10px;
}
.cover-img-preview img {
  max-width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: 4px;
}
.cover-img-preview--current img {
  border: 1px solid var(--border-subtle);
  height: auto;
  max-height: none;
}
.preview-optional {
  font-weight: 400;
}
.preview-url-label {
  margin-top: 12px;
  display: block;
}

/* ============================================
   ADMIN EDIT PREVIEW (course edit form)
   Constrained preview media for inline review â€”
   the full form column is too wide to leave a
   16:9 video at full width.
   ============================================ */
.admin-edit-preview {
  margin-top: 10px;
  max-width: 360px;
}
.admin-edit-preview__label {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text);
}
.admin-edit-preview video {
  display: block;
  width: 100%;
  max-height: 200px;
  border-radius: 8px;
  background: #000;
}
.admin-edit-preview__embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.admin-edit-preview__embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.admin-edit-preview__fallback {
  color: var(--muted);
  font-size: 14px;
}
/* ============================================
   COURSE OVERVIEW (admin)
   Compact dashboard: hero, 4 stat cards,
   2-column body (curriculum + next-step on the
   left; preview video, about, recent enrollments
   on the right).
   ============================================ */

/* ----- Module/Section/Article manage hero (admin) ----- */
.module-detail-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-4, 16px);
  align-items: center;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border-subtle, #e2e8f0);
  border-radius: var(--radius-lg, 14px);
  padding: var(--space-4, 16px) var(--space-5, 20px);
  margin-bottom: var(--space-3, 12px);
  box-shadow: var(--shadow-xs, 0 1px 2px rgba(0, 0, 0, 0.03));
}
@media (max-width: 720px) {
  .module-detail-hero {
    grid-template-columns: auto 1fr;
  }
  .module-detail-hero__actions {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
  }
}
.module-detail-hero__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 56px;
  padding: 0 var(--space-2, 8px);
  border-radius: 50%;
  background: var(--color-accent-subtle, rgba(99, 102, 241, 0.12));
  color: var(--color-accent, #6366f1);
  font-size: 18px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  flex-shrink: 0;
}
.module-detail-hero__num--article {
  border-radius: var(--radius-md, 10px);
  background: var(--color-bg-subtle, #f1f5f9);
  color: var(--color-text-muted, #64748b);
}
.module-detail-hero__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1, 4px);
  min-width: 0;
}
.module-detail-hero__eyebrow {
  font-size: var(--font-size-xs, 12px);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted, #94a3b8);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.module-detail-hero__eyebrow-link {
  color: var(--color-accent, #6366f1);
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
}
.module-detail-hero__eyebrow-link:hover {
  text-decoration: underline;
}
.module-detail-hero__title {
  margin: 0;
  font-size: clamp(1.25rem, 1vw + 1rem, 1.75rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text, #0c1222);
  word-wrap: break-word;
}
.module-detail-hero__summary {
  margin: 0;
  color: var(--color-text-muted, #64748b);
  font-size: var(--font-size-sm, 14px);
  line-height: 1.5;
}
.module-detail-hero__badges {
  display: flex;
  gap: var(--space-2, 8px);
  flex-wrap: wrap;
  margin-top: var(--space-1, 4px);
}
.module-detail-hero__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 8px);
  align-items: flex-end;
}

/* ----- Alert (pricing blocker / success) ----- */
.overview-alert {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-3, 12px);
  align-items: center;
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-3, 12px) var(--space-4, 16px);
  margin-bottom: var(--space-3, 12px);
}
.overview-alert__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}
.overview-alert__icon svg {
  width: 22px;
  height: 22px;
}
.overview-alert__body strong {
  display: block;
  margin-bottom: 2px;
  font-size: var(--font-size-base, 16px);
}
.overview-alert__body ul {
  margin: 6px 0 0;
  padding-left: 20px;
  font-size: var(--font-size-sm, 14px);
  line-height: 1.5;
}
.overview-alert__actions {
  display: flex;
  gap: var(--space-2, 8px);
  flex-wrap: wrap;
}
.overview-alert--warning {
  background: color-mix(in srgb, var(--color-warning, #f59e0b) 8%, var(--color-surface, #fff));
  border: 1px solid color-mix(in srgb, var(--color-warning, #f59e0b) 35%, var(--color-border-subtle, #e2e8f0));
}
.overview-alert--warning .overview-alert__icon {
  background: color-mix(in srgb, var(--color-warning, #f59e0b) 18%, transparent);
  color: var(--color-warning-text, #92400e);
}
.overview-alert--warning strong,
.overview-alert--warning ul {
  color: var(--color-warning-text, #92400e);
}
.overview-alert--success {
  background: color-mix(in srgb, var(--color-success, #22c55e) 6%, var(--color-surface, #fff));
  border: 1px solid color-mix(in srgb, var(--color-success, #22c55e) 30%, var(--color-border-subtle, #e2e8f0));
}
.overview-alert--success .overview-alert__icon {
  background: color-mix(in srgb, var(--color-success, #22c55e) 18%, transparent);
  color: var(--color-success-text, #166534);
}
.overview-alert--success strong {
  color: var(--color-success-text, #166534);
}
@media (max-width: 720px) {
  .overview-alert {
    grid-template-columns: 1fr;
  }
}

/* ----- Hero (compact action bar: chips + actions, no cover) ----- */
.ov-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3, 12px);
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border-subtle, #e2e8f0);
  border-radius: var(--radius-lg, 14px);
  padding: var(--space-3, 12px) var(--space-4, 16px);
  margin-bottom: var(--space-3, 12px);
  box-shadow: var(--shadow-xs, 0 1px 2px rgba(0, 0, 0, 0.03));
  flex-wrap: wrap;
}
.ov-hero__body {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}
.ov-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-xs, 12px);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent, #6366f1);
  background: var(--color-accent-subtle, rgba(99, 102, 241, 0.12));
  padding: 4px 10px;
  border-radius: var(--radius-full, 9999px);
}
.ov-hero__sep {
  opacity: 0.5;
}
.ov-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ov-hero__chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full, 9999px);
  font-size: var(--font-size-xs, 12px);
  font-weight: 600;
  background: var(--color-bg-subtle, #f1f5f9);
  color: var(--color-text-muted, #64748b);
  border: 1px solid var(--color-border-subtle, #e2e8f0);
}
.ov-hero__chip--muted {
  background: transparent;
  color: var(--color-text-muted, #94a3b8);
  border-style: dashed;
}
.ov-hero__chip--success {
  background: color-mix(in srgb, var(--color-success, #22c55e) 12%, transparent);
  color: var(--color-success-text, #166534);
  border-color: color-mix(in srgb, var(--color-success, #22c55e) 30%, transparent);
}
.ov-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2, 8px);
}
.ov-hero__actions .button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ----- Stat cards row ----- */
.ov-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3, 12px);
  margin-bottom: var(--space-3, 12px);
}
@media (max-width: 720px) {
  .ov-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.ov-stat-card {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border-subtle, #e2e8f0);
  border-radius: var(--radius-lg, 14px);
  padding: var(--space-3, 12px) var(--space-4, 16px);
  box-shadow: var(--shadow-xs, 0 1px 2px rgba(0, 0, 0, 0.03));
}
.ov-stat-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-accent-subtle, rgba(99, 102, 241, 0.12));
  color: var(--color-accent, #6366f1);
  flex-shrink: 0;
}
.ov-stat-card__icon svg {
  width: 20px;
  height: 20px;
}
.ov-stat-card__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ov-stat-card__value {
  font-size: var(--font-size-xl, 20px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-text, #0c1222);
}
.ov-stat-card__label {
  font-size: var(--font-size-xs, 12px);
  color: var(--color-text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* ----- Two-column body grid ----- */
.ov-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: var(--space-3, 12px);
}
@media (max-width: 960px) {
  .ov-grid {
    grid-template-columns: 1fr;
  }
}
.ov-grid__main,
.ov-grid__side {
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 12px);
  min-width: 0;
}

/* ----- Card ----- */
.ov-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border-subtle, #e2e8f0);
  border-radius: var(--radius-xl, 18px);
  padding: var(--space-4, 16px);
  box-shadow: var(--shadow-xs, 0 1px 2px rgba(0, 0, 0, 0.03));
}
.ov-card__head {
  margin: 0 0 var(--space-3, 12px);
  padding-bottom: var(--space-2, 8px);
  border-bottom: 1px solid var(--color-border-subtle, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2, 8px);
  flex-wrap: wrap;
}
.ov-card__head h3 {
  margin: 0;
  font-size: var(--font-size-base, 16px);
  font-weight: 700;
  color: var(--color-text, #0c1222);
}
.ov-card__head-actions {
  display: flex;
  gap: var(--space-2, 8px);
  flex-wrap: wrap;
}
.ov-card__head-link {
  font-size: var(--font-size-sm, 14px);
  font-weight: 500;
  color: var(--color-accent, #6366f1);
  text-decoration: none;
}
.ov-card__head-link:hover {
  text-decoration: underline;
}
.ov-card__lead {
  margin: 0 0 var(--space-2, 8px);
  font-size: var(--font-size-sm, 14px);
  line-height: 1.5;
  color: var(--color-text, #0c1222);
  font-weight: 500;
}
.ov-card__body {
  font-size: var(--font-size-sm, 14px);
  line-height: 1.6;
  color: var(--color-text-muted, #64748b);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.ov-card__meta {
  margin-top: var(--space-2, 8px);
  font-size: var(--font-size-xs, 12px);
  color: var(--color-text-muted, #94a3b8);
  text-align: center;
}

/* ----- Next-step callout ----- */
.ov-card--next-step {
  border: 1px solid color-mix(in srgb, var(--color-accent, #6366f1) 35%, var(--color-border-subtle, #e2e8f0));
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--color-accent, #6366f1) 4%, var(--color-surface, #fff)) 0%,
    var(--color-surface, #fff) 100%);
}
.ov-next-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3, 12px);
}
.ov-next-step__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-accent, #6366f1) 15%, transparent);
  color: var(--color-accent, #6366f1);
  flex-shrink: 0;
}
.ov-next-step__icon svg {
  width: 20px;
  height: 20px;
}
.ov-next-step__title {
  font-size: var(--font-size-xs, 12px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-accent, #6366f1);
}
.ov-next-step__copy {
  font-size: var(--font-size-sm, 14px);
  font-weight: 500;
  color: var(--color-text, #0c1222);
}

/* ----- Cover image (compact, mirrors edit-page preview) ----- */
.ov-cover {
  max-width: 300px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border-subtle, #e2e8f0);
  background: var(--color-bg-subtle, #f1f5f9);
}
.ov-cover img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
}

/* ----- Preview video (compact, max ~300px) ----- */
.ov-preview {
  max-width: 300px;
}
.ov-preview video {
  display: block;
  width: 100%;
  max-height: 170px;
  border-radius: 8px;
  background: #000;
}
.ov-preview__embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.ov-preview__embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ----- Enrollments table (main column, below curriculum) ----- */
.ov-card__meta-inline {
  font-size: var(--font-size-sm, 14px);
  color: var(--color-text-muted, #64748b);
  font-weight: 500;
}
.ov-table-link {
  color: var(--color-text, #0c1222);
  text-decoration: none;
  font-weight: 500;
}
.ov-table-link:hover {
  color: var(--color-accent, #6366f1);
}
.ov-table-sub {
  font-size: var(--font-size-xs, 12px);
  color: var(--color-text-muted, #94a3b8);
  margin-top: 2px;
}
.ov-table-date {
  color: var(--color-text-muted, #64748b);
  font-size: var(--font-size-sm, 14px);
  white-space: nowrap;
}
.ov-table-muted {
  color: var(--color-text-muted, #cbd5e1);
}
.ov-progress {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  min-width: 140px;
}
.ov-progress__bar {
  flex: 1;
  height: 8px;
  background: var(--color-bg-subtle, #f1f5f9);
  border-radius: var(--radius-full, 9999px);
  overflow: hidden;
}
.ov-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent, #6366f1), var(--color-accent-strong, #4f46e5));
  border-radius: var(--radius-full, 9999px);
}
.ov-progress__pct {
  font-size: var(--font-size-xs, 12px);
  color: var(--color-text, #0c1222);
  font-weight: 600;
  min-width: 36px;
  text-align: right;
}

/* ----- Empty states ----- */
.ov-empty {
  text-align: center;
  padding: var(--space-4, 16px) var(--space-3, 12px);
  color: var(--color-text-muted, #64748b);
}
.ov-empty--small {
  padding: var(--space-2, 8px) var(--space-3, 12px);
}
.ov-empty p {
  margin: 0 0 var(--space-2, 8px);
  font-size: var(--font-size-sm, 14px);
}
.ov-empty--small p {
  margin: 0;
}
.ov-empty__icon {
  width: 28px;
  height: 28px;
  margin-bottom: 6px;
  opacity: 0.6;
}

/* ----- Enrollments list (compact) ----- */
.ov-enrollments {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 8px);
}
.ov-enrollments li {
  display: grid;
  grid-template-columns: 1fr 70px 36px;
  align-items: center;
  gap: var(--space-2, 8px);
  font-size: var(--font-size-sm, 14px);
}
.ov-enrollments__name a {
  color: var(--color-text, #0c1222);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.ov-enrollments__name a:hover {
  color: var(--color-accent, #6366f1);
}
.ov-enrollments__bar {
  height: 6px;
  background: var(--color-bg-subtle, #f1f5f9);
  border-radius: var(--radius-full, 9999px);
  overflow: hidden;
}
.ov-enrollments__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent, #6366f1), var(--color-accent-strong, #4f46e5));
  border-radius: var(--radius-full, 9999px);
}
.ov-enrollments__pct {
  font-size: var(--font-size-xs, 12px);
  color: var(--color-text-muted, #64748b);
  text-align: right;
  font-weight: 600;
}


/* ============================================
   VISIBILITY TOGGLES (course create form)
   Two side-by-side checkboxes (Publish / Active)
   laid out as a clean 2-column grid
   ============================================ */
.visibility-toggles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3, 12px);
  margin-top: var(--space-2, 8px);
}
.toggle-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.1));
  border-radius: 8px;
  background: var(--color-bg-subtle, #fafbfc);
  cursor: pointer;
}
.toggle-option input[type="checkbox"] {
  margin-top: 4px;
  cursor: pointer;
}
.toggle-option .field-help {
  margin-top: 2px;
}
@media (max-width: 640px) {
  .visibility-toggles {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   RADIO TILE GROUP (replaces <select> for 2-option
   binary choices like Free / Paid)
   Shows both options inline with descriptions
   ============================================ */
.radio-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2, 8px);
}
.radio-tiles--four {
  grid-template-columns: repeat(4, 1fr);
}
.radio-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1.5px solid var(--color-border-subtle, rgba(0, 0, 0, 0.12));
  border-radius: 8px;
  cursor: pointer;
  background: var(--color-bg, #fff);
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}
html[data-theme="dark"] .radio-tile {
  background: #1a2236;
}
.radio-tile:hover {
  border-color: var(--color-primary, #4f46e5);
}
.radio-tile input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.radio-tile--checked {
  border-color: var(--color-primary, #4f46e5);
  background: rgba(79, 70, 229, 0.06);
  box-shadow: 0 0 0 1px var(--color-primary, #4f46e5) inset;
}
html[data-theme="dark"] .radio-tile--checked {
  background: rgba(79, 70, 229, 0.18);
}
.radio-tile__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text, #111);
  text-transform: none;
  letter-spacing: normal;
}
.radio-tile__desc {
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
  line-height: 1.4;
  text-transform: none;
  letter-spacing: normal;
}
@media (max-width: 600px) {
  .radio-tiles {
    grid-template-columns: 1fr;
  }
  .radio-tiles--four {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 420px) {
  .radio-tiles--four {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   ADMIN PAGE CONTAINER
   ============================================ */
section {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ============================================
   ADMIN ATTEMPTS TABLE
   ============================================ */
.attempts-table-wrapper {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.attempts-table-scroll {
  width: 100%;
  overflow-x: auto;
}

/* ============================================
   ADMIN PAGE LAYOUT
   ============================================ */
.page-header-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
  width: 100%;
  max-width: 100%;
}

.page-header-wrapper h1.page-title,
.page-header-wrapper h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

.page-title-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.page-title-section h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.page-title-section p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 15px;
}

.page-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.page-actions a {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg);
  transition: all var(--duration-fast);
}

.page-actions a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ============================================
   ADMIN STATS GRID
   ----------------------------------------------------
   The standard stat-card markup + .feedback-stats/.stats-grid
   wrappers live in /static/css/components/stat_card.css, which is
   loaded globally by base.html. This file intentionally has NO
   overrides for .stats-grid / .stat-card / .stat-icon so the global
   standard applies everywhere.

   Per-page tweaks for the stat grid (e.g. gap on 1440px+ monitors)
   belong in the page-specific stylesheet.
   ============================================ */

.required-asterisk {
  color: #dc2626;
}

/* ============================================
   ADMIN FORM WRAPPER
   ============================================ */
.admin-form-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding-bottom: var(--space-6);
}

/* Fill-width variant for detail-style pages that need cards to span
   the full content area (not the narrow centered 800px default).
   On wide viewports, let the wrapper fill the available content area
   (after the sidebar) so each .form-section card stretches edge-to-edge
   of the main pane. */
.admin-form-wrapper.is-wide {
  max-width: 100%;
  width: 100%;
}
@media (min-width: 1280px) {
  .admin-form-wrapper.is-wide {
    /* Cap at a generous wide-screen size so cards don't get absurdly
       stretched on ultrawide monitors, but still fill the typical
       1366pxâ€“1920px+ content area (after the 280px admin sidebar). */
    max-width: none;
  }
}

.form-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

/* Tinted variant used for destructive forms (e.g. reset password). */
.form-section.is-danger {
  border-color: rgba(239, 68, 68, 0.25);
}
.form-section.is-danger h2 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-danger);
}
.form-section.is-danger h2::before {
  content: "\26A0";
  font-size: 18px;
}

/* Flat variant â€” inner sub-section without its own card chrome.
   Useful for grouping fields inside a larger form-section. */
.form-section.is-flat {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: var(--space-5);
}
.form-section.is-flat h2 {
  margin: 0 0 var(--space-3) 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.form-header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
}

.form-header h2 {
  margin: 0 0 var(--space-2) 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

.form-header p {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  /* margin-bottom: var(--space-4); */
}

.form-field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

/* ============================================
   TENANT FORM FIELD (used by form_field.html)
   Standardized label + input + hint wrapper for
   the platform tenant editors. Labels render in
   sentence case (the global forms.css uppercases
   every <label> - override here).
   ============================================ */
.tenant-form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.tenant-form-field > label.form-label,
.tenant-form-field .form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  text-transform: none;
  letter-spacing: normal;
  margin: 0;
}
.tenant-form-field .required-mark {
  color: var(--color-danger, #ef4444);
  margin-left: 2px;
  font-weight: 700;
}
.tenant-form-field .server-error {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  padding: 6px 10px;
  background: var(--color-danger-bg-subtle, #fef2f2);
  border: 1px solid color-mix(in srgb, var(--color-danger, #ef4444) 25%, transparent);
  border-radius: 6px;
  color: var(--color-danger-text, #991b1b);
  font-size: 13px;
}
.tenant-form-field .field-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  padding: 0;
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.4;
}
.tenant-form-field .field-hint__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-accent, #6366f1) 12%, var(--color-surface, #ffffff));
  border: 1px solid color-mix(in srgb, var(--color-accent, #6366f1) 35%, transparent);
  color: var(--color-accent, #6366f1);
  font-size: 10px;
  font-weight: 700;
  font-style: italic;
  flex-shrink: 0;
  line-height: 1;
  font-family: serif;
}
.tenant-form-field.has-server-error > input,
.tenant-form-field.has-server-error > select,
.tenant-form-field.has-server-error > textarea {
  border-color: var(--color-danger, #ef4444);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-danger, #ef4444) 12%, transparent);
}

/* form_field.html uses tenant-form-field but the global
   .form-label rule uppercases labels. Override to sentence
   case for every tenant editor (and admin form) - the global
   forms.css applies via `.form-label, label` so we need higher
   specificity than that single class. */
.form-section .tenant-form-field > .form-label,
.form-section .tenant-form-field > label.form-label,
.admin-form-wrapper .tenant-form-field > .form-label,
.admin-form-wrapper .tenant-form-field > label.form-label,
.admin-form-wrapper label.form-label,
.tenant-form-field > label.form-label,
.tenant-form-field > .form-label {
  text-transform: none;
  letter-spacing: normal;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

/* ============================================
   PAGE HEAD (admin_tenant_form.html + the
   Phase-10 platform_tenant_* editor templates
   use this name; previously had no CSS at all,
   so the back-link rendered on its own line
   below the heading). Pair with .page-head__actions
   for the right-aligned button cluster.
   ============================================ */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.page-head > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}
.page-head h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.25;
}
.page-head p.muted {
  margin: 6px 0 0 0;
  color: var(--color-text-muted);
  font-size: 14px;
}
.page-head__actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}
@media (max-width: 720px) {
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head__actions { width: 100%; }
}

/* ============================================
   FORM SECTION GRID
   The Phase-10 platform_tenant_* editor templates
   wrap their fields in .form-section__grid. Default
   is a 2-column responsive grid that collapses to
   one column on narrow viewports.
   ============================================ */
.form-section__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3) var(--space-4);
}
.form-section__grid > .full-width,
.form-section__grid > .form-grid-full,
.form-section__grid > .tenant-form-field--wide {
  grid-column: 1 / -1;
}
.form-section__grid > .form-actions,
.form-section__grid > .admin-info-note {
  grid-column: 1 / -1;
}
@media (max-width: 720px) {
  .form-section__grid { grid-template-columns: 1fr; }
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--duration-fast);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Highlight fields that fail inline validation. */
.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
  border-color: var(--color-danger);
}

.form-field.has-error input:focus,
.form-field.has-error select:focus,
.form-field.has-error textarea:focus {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-field textarea {
  resize: vertical;
  min-height: 80px;
}

.admin-password-field {
  position: relative;
}

.admin-password-field input {
  padding-right: 44px;
}

.admin-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.admin-password-toggle:hover,
.admin-password-toggle:focus-visible {
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
}

.admin-password-icon {
  pointer-events: none;
}

.help-text {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.form-grid.single-col {
  grid-template-columns: 1fr;
}
.form-grid.triple-col {
  grid-template-columns: repeat(3, 1fr);
}
.form-grid textarea {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
}
.form-grid .full-width {
  grid-column: 1 / -1;
}
.form-grid .form-actions {
  grid-column: 1 / -1;
}
.form-grid-full {
  grid-column: 1 / -1;
}

.form-field-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-subtle);
  align-items: center;
}

.form-actions .button,
.form-actions .btn {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.form-actions .button {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  background: var(--color-accent);
  color: white;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.form-actions .button:hover {
  background: var(--color-accent-strong);
}
.form-actions .button.secondary {
  background: var(--color-bg-secondary);
  color: var(--color-text);
}
.form-actions .button.secondary:hover {
  background: var(--color-border-subtle);
}

/* ============================================
   TABLE CELL UTILITIES â€” primary / secondary text
   ============================================ */
.cell-primary {
  font-weight: 600;
  color: var(--color-text);
}
.cell-secondary {
  font-size: 12px;
  color: var(--color-text-muted);
}
.cell-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
}
.admin-identity-hero {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}

.admin-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-text-on-accent, #ffffff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  flex-shrink: 0;
}
.admin-avatar.is-sm {
  width: 56px;
  height: 56px;
  font-size: 22px;
}

.admin-identity-hero__body {
  flex: 1;
  min-width: 0;
}
.admin-identity-hero__name {
  margin: 0 0 var(--space-1) 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}
.admin-identity-hero__handle {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
  word-break: break-word;
}
.admin-identity-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-2);
}

.admin-identity-hero__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: stretch;
  min-width: 180px;
  flex-shrink: 0;
}
@media (max-width: 720px) {
  .admin-identity-hero { flex-direction: column; align-items: flex-start; }
  .admin-identity-hero__actions { width: 100%; flex-direction: row; flex-wrap: wrap; }
}

/* ============================================
   ADMIN CHIPS â€” small pill list (e.g. groups)
   ============================================ */
.admin-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.admin-chip {
  font-size: 12px;
  background: var(--color-bg);
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--color-text);
  border: 1px solid var(--color-border-subtle);
}

/* Compact cell-chip variant used inside list rows. */
.cell-chip {
  font-size: 12px;
  background: var(--color-bg);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 4px;
  display: inline-block;
}

/* ============================================
   ADMIN INFO NOTE â€” soft callout for hints
   ============================================ */
.admin-info-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 13px;
}

/* ============================================
   FORM MESSAGES â€” success / error inline notes
   (Replaces orphan `.success-card` / generic
   `.error-card` usage in detail pages.)
   ============================================ */
.form-message {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-top: var(--space-3);
}
.form-message--success {
  background: var(--color-success-bg-subtle);
  color: var(--color-success-text);
  border: 1px solid color-mix(in srgb, var(--color-success) 30%, transparent);
}
.form-message--error {
  background: var(--color-danger-bg-subtle);
  color: var(--color-danger-text);
  border: 1px solid color-mix(in srgb, var(--color-danger) 30%, transparent);
}

/* ============================================
   ADMIN DATA TABLE
   ============================================ */
.admin-table-wrapper {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border-subtle);
}

.admin-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: var(--color-bg-secondary);
}
.admin-table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================
   ADMIN ALERTS (flash messages + inline status)
   Used by the tenancy routing/domain wizard pages.
   ============================================ */
.admin-form-wrapper .alert,
.form-section .alert,
section > .alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: var(--space-4);
  border: 1px solid transparent;
}

section > .alert { margin-top: var(--space-4); }

.alert--success {
  background: rgba(34, 154, 22, 0.08);
  border-color: rgba(34, 154, 22, 0.35);
  color: #1c6b14;
}

.alert--error,
.alert--danger {
  background: rgba(200, 40, 40, 0.08);
  border-color: rgba(200, 40, 40, 0.35);
  color: #9c2424;
}

.alert--warning,
.alert--warn {
  background: rgba(200, 150, 30, 0.10);
  border-color: rgba(200, 150, 30, 0.4);
  color: #7d5a10;
}

.alert--info {
  background: rgba(30, 120, 200, 0.08);
  border-color: rgba(30, 120, 200, 0.3);
  color: #1c5a8f;
}

/* ============================================
   ADMIN COVER PREVIEW
   ============================================ */
.cover-preview {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
  border: 2px dashed var(--color-border-subtle);
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: var(--space-3);
}

.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
}

/* ============================================
   ADMIN MODULES LIST
   ============================================ */
.modules-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.module-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  transition: border-color 0.2s ease;
}

.module-item:hover {
  border-color: var(--color-accent);
}

.module-order {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.module-content {
  flex: 1;
}
.module-title {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}
.module-meta {
  font-size: 13px;
  color: var(--color-text-muted);
}
.module-actions {
  display: flex;
  gap: var(--space-2);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .page-header-wrapper {
    flex-direction: column;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .filters-grid {
    grid-template-columns: 1fr;
  }
  .admin-table {
    font-size: 13px;
  }
  .admin-table th,
  .admin-table td {
    padding: var(--space-2);
  }
}

/* Tenant checkout order detail: keep the operational content compact and scannable. */
.admin-order-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: var(--space-4);
  align-items: start;
}

.admin-order-page > :not(.section-card) {
  grid-column: 1 / -1;
}

.admin-order-page > .section-card {
  margin: 0;
  padding: var(--space-4);
}

.admin-order-page > .admin-order-items,
.admin-order-page > .admin-order-payments {
  grid-column: 1;
}

.admin-order-page > .admin-order-summary,
.admin-order-page > .admin-order-status {
  grid-column: 2;
}

.admin-order-page > .admin-order-items { order: 1; }
.admin-order-page > .admin-order-summary { order: 2; }
.admin-order-page > .admin-order-payments { order: 3; }
.admin-order-page > .admin-order-status { order: 4; }

.admin-order-page > .admin-order-items {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.admin-order-page > .admin-order-payments {
  margin-top: calc(-1 * var(--space-4));
  border-top-right-radius: 0;
  border-top-left-radius: 0;
}

.admin-order-page .info-grid {
  gap: var(--space-3);
}

.admin-order-page .section-title {
  margin-bottom: var(--space-2);
}

.admin-order-page {
  display: block;
}

.admin-order-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  grid-template-areas: "main sidebar";
  gap: var(--space-4);
  align-items: start;
}

/* Detail pages that stack all cards in one column (e.g. discount
   detail: Applies To → Discount Details → Redemption History). */
.admin-order-content--single {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "main";
}

.admin-order-main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.admin-order-sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.admin-order-sidebar .admin-order-status {
  order: -1;
  border-color: color-mix(in srgb, var(--color-accent) 35%, var(--color-border-subtle));
  display: flex;
  flex-direction: column;
}

.admin-order-status .admin-order-action-controls {
  order: -1;
  margin: 0 0 var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
}

.admin-order-sidebar .admin-order-status > .info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.admin-order-sidebar .admin-order-status > .info-grid > .info-item:first-child {
  grid-column: 1 / -1;
}

.admin-order-sidebar .admin-order-status > .info-grid > .admin-order-coupon {
  color: var(--color-accent);
}

.admin-order-total {
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
  color: var(--color-accent);
  font-size: 16px;
  font-weight: 700;
}

.admin-order-total span {
  color: var(--color-text-muted);
  font-size: 12px;
}

.admin-order-coupon > div:last-child {
  white-space: nowrap;
}

.admin-order-content .section-card {
  margin: 0;
  padding: var(--space-4);
}

.admin-order-main .admin-order-items {
  border-bottom-right-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.admin-order-main .admin-order-payments {
  margin-top: 0;
  border-top-right-radius: var(--radius-md);
  border-top-left-radius: var(--radius-md);
}

.admin-order-items-table-wrap,
.admin-order-payments-table-wrap {
  margin: 0;
}

.admin-order-page .general-table-scroll {
  height: auto !important;
  flex: 0 0 auto;
  overflow-x: auto !important;
  overflow-y: visible !important;
}

.admin-order-page .general-table-scroll > .admin-order-items-table {
  width: 100%;
  min-width: 0 !important;
}

.admin-order-items-table th,
.admin-order-items-table td,
.admin-order-payments-table th,
.admin-order-payments-table td {
  padding: 9px 10px;
  white-space: nowrap;
}

.admin-order-items-table th:first-child,
.admin-order-items-table td:first-child {
  min-width: 180px;
  white-space: normal;
}

.admin-order-quick-action {
  margin: 2px 4px 2px 0;
  padding: 6px 10px;
  font-size: 12px;
}

.admin-order-status-form {
  display: grid;
  gap: var(--space-2);
}

.admin-order-status-form .form-group {
  margin: 0;
  min-width: 0;
}

.admin-order-status-form .btn {
  justify-self: start;
}

.admin-order-status-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  align-items: end;
}

.admin-order-status-controls > form:first-child,
.admin-order-status-controls .admin-order-status-form {
  display: contents;
}

.admin-order-status-controls .admin-order-status-form .btn,
.admin-order-status-controls .admin-order-cancel-form .btn {
  justify-self: stretch;
  white-space: nowrap;
}

.admin-order-status-controls .form-group {
  grid-column: 1 / -1;
}

.admin-order-cancel-form {
  margin: 0;
}

/* ── Reconciliation card (order detail sidebar) ── */
.admin-order-reconciliation {
  margin-top: var(--space-3);
  display: grid;
  gap: var(--space-2);
}

.admin-order-reconciliation-help {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted, var(--muted));
  line-height: 1.5;
}

.admin-order-reconciliation-note {
  margin: 0;
  padding: var(--space-2);
  background: var(--surface, #f6f7f9);
  border-radius: 6px;
  font-size: 12px;
  color: var(--color-text-muted, var(--muted));
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-order-reconciliation-form {
  display: grid;
  gap: var(--space-2);
}

.admin-order-reconciliation-form .form-group {
  margin: 0;
  min-width: 0;
}

.admin-order-reconciliation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.admin-order-reconciliation-actions .btn {
  flex: 1 1 auto;
  white-space: nowrap;
}

.admin-order-payments-list {
  display: grid;
  gap: var(--space-2);
}

.admin-order-payment-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: var(--space-3);
  align-items: start;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-bg);
}

.admin-order-payment-card__details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.admin-order-payment-card__details > div,
.admin-order-payment-card__details > a {
  min-width: 0;
}

.admin-order-payment-card__details span {
  display: block;
  margin-bottom: 3px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.admin-order-payment-card__details strong,
.admin-order-payment-card__details code {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.admin-order-payment-card__review {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
}

.admin-order-payment-card__review-title {
  font-size: 13px;
}

.admin-order-payment-card__review input {
  min-width: 0;
}

.admin-order-payment-card__review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-order-payment-card__review-actions .btn {
  justify-content: center;
}

.admin-order-payment-card__rejection {
  margin: 0;
  color: var(--color-danger, #c53030);
  font-size: 13px;
}

.admin-order-proof-button {
  justify-self: start;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-accent);
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.admin-order-proof-button:hover {
  background: var(--color-accent);
  color: white;
}

.admin-order-proof-modal {
  width: min(92vw, 720px);
  max-height: 90vh;
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

.admin-order-proof-modal::backdrop {
  background: rgba(15, 23, 42, 0.58);
}

.admin-order-proof-modal > div {
  padding: var(--space-3);
}

.admin-order-proof-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.admin-order-proof-modal__header h3 {
  margin: 0;
  font-size: 16px;
}

.admin-order-proof-modal__header button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.admin-order-proof-modal img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 96px);
  margin: 0 auto;
  object-fit: contain;
}

/* â”€â”€ Order activity trail â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.admin-order-activity {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.admin-order-note-form {
  display: flex;
  gap: var(--space-2);
  align-items: stretch;
}

.admin-order-note-form textarea {
  flex: 1;
  min-height: 48px;
  resize: vertical;
  border: 1px solid var(--color-border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.admin-order-note-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
  background: var(--color-surface);
}

.admin-order-note-form .btn {
  align-self: flex-end;
}

.admin-order-timeline {
  position: relative;
  padding-left: 24px;
}

.admin-order-timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--color-border-subtle);
}

.admin-order-tl {
  position: relative;
  padding-bottom: var(--space-4);
}

.admin-order-tl:last-child {
  padding-bottom: 0;
}

.admin-order-tl::before {
  content: "";
  position: absolute;
  left: -23px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.admin-order-tl-top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.admin-order-tl-kind {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-accent);
  background: rgba(99,102,241,.1);
  padding: 2px 8px;
  border-radius: 6px;
}

.admin-order-tl-kind.k-status_changed { color: #8b5cf6; background: rgba(139,92,246,.1); }
.admin-order-tl-kind.k-note_added { color: #059669; background: rgba(5,150,105,.1); }
.admin-order-tl-kind.k-payment_rejected,
.admin-order-tl-kind.k-refund_requested { color: #dc2626; background: rgba(220,38,38,.1); }
.admin-order-tl-kind.k-payment_approved,
.admin-order-tl-kind.k-refunded { color: #b45309; background: rgba(180,83,9,.1); }
.admin-order-tl-kind.k-created { color: var(--color-text-muted); background: var(--color-bg-subtle, var(--color-bg)); }

.admin-order-tl-status {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono, monospace);
  color: var(--color-text-muted);
}

.admin-order-tl-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-left: auto;
}

.admin-order-tl-body {
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

/* ── Order Receipt card ──
   Moved (2026-09-11) to /static/css/checkout/order-receipt.css and
   renamed .admin-order-receipt* → .order-receipt* — the card is now
   shared with the student Order Detail page and mirrors the Order
   PDF (checkout/order_pdf.py). */

/* ── Order Summary (billing-details card, top of main column) ── */
.admin-order-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.admin-order-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
}

.admin-order-summary-title {
  margin: 0;
}

.admin-order-summary-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}

.admin-order-summary-total .admin-order-total {
  font-size: 22px;
  letter-spacing: -0.01em;
}

.admin-order-summary-subtotal {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.admin-order-summary .info-grid {
  /* Fit on a single row when there's room; the status row below
     spans full width, then the rest flows into a 2-col grid. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.admin-order-summary .admin-order-summary-status {
  /* Status is the most-looked-at field — make it a full-width hero
     row that spans both columns of the grid below the totals strip. */
  grid-column: 1 / -1;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-2);
  border-bottom: 1px dashed var(--color-border-subtle);
}

.admin-order-summary .admin-order-summary-status .badge {
  font-size: 13px;
  padding: 4px 10px;
}

.admin-order-summary-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.code-text-inline {
  /* .code-text sets display:inline-block via the base rule below; this
     scoped guard exists for new code that wants inline behaviour on
     flex parents (the admin_order_detail summary). */
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Actions sidebar — single card with two action groups ── */
.admin-order-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border-color: color-mix(in srgb, var(--color-accent) 35%, var(--color-border-subtle));
}

.admin-order-actions-title {
  margin: 0 0 var(--space-1) 0;
}

.admin-order-action-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.admin-order-action-group:not(:last-child) {
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
}

.admin-order-action-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-order-action-group-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.admin-order-quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.admin-order-quick-actions-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-right: 2px;
}

.admin-order-quick-action-form {
  margin: 0;
}

.admin-order-quick-action {
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
}

/* The Update Status select row lives inside the actions sidebar now;
   the existing .admin-order-status-controls rules were written for the
   old sidebar layout — constrain them so they behave well in the
   narrower (≈300px) actions card. */
.admin-order-actions .admin-order-status-controls {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
}

.admin-order-actions .admin-order-status-controls > form:first-child,
.admin-order-actions .admin-order-status-controls .admin-order-status-form {
  display: grid;
  gap: var(--space-2);
}

.admin-order-actions .admin-order-status-controls .form-group {
  grid-column: auto;
}

/* ── Payment Review action group (sidebar) ── */
.admin-order-review-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  font-size: 13px;
}

.admin-order-review-context-label {
  font-weight: 600;
}

.admin-order-review-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.admin-order-review-form input[type="text"] {
  min-width: 0;
}

.admin-order-review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-order-review-actions .btn {
  justify-content: center;
}

/* ── Record Payment / Refund / Cancel action groups ── */
.admin-order-record-form,
.admin-order-refund-form,
.admin-order-cancel-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ── Record Payment modal (checkout-style, 2026-09-11) ── */
.admin-record-modal {
  width: min(92vw, 640px);
  max-height: 90vh;
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  color: var(--color-text);
  background: var(--color-surface);
}

.admin-record-modal::backdrop {
  background: rgba(15, 23, 42, 0.58);
}

.admin-record-modal__inner {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-height: 90vh;
  overflow-y: auto;
}

.admin-record-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.admin-record-modal__header h3 {
  margin: 0;
  font-size: 16px;
}

.admin-record-modal__sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.admin-record-modal__header form button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.admin-record-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.admin-record-grid label.muted {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.admin-record-grid input,
.admin-record-grid select {
  box-sizing: border-box;
}

.admin-record-recap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-2);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  margin: 0;
}

.admin-record-recap__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.admin-record-recap__row dt,
.admin-record-recap__row dd {
  margin: 0;
}

.admin-record-recap__row dt {
  color: var(--color-text-muted);
}

.admin-record-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 560px) {
  .admin-record-grid {
    grid-template-columns: 1fr;
  }
}

.admin-order-cancel-form {
  margin: 0;
}

.admin-order-actions .admin-order-cancel-form .btn {
  width: 100%;
}

.required-star {
  color: var(--color-danger, #c53030);
}

/* ── Reconciliation block inside actions card ── */
.admin-order-actions .admin-order-reconciliation {
  margin-top: 0;
}

.admin-order-actions .admin-order-reconciliation-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.admin-order-actions .admin-order-reconciliation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.admin-order-actions .admin-order-reconciliation-actions .btn {
  flex: 1 1 auto;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .admin-order-note-form {
    flex-direction: column;
  }

  .admin-order-note-form .btn {
    align-self: flex-start;
  }

  .admin-order-tl-meta {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 900px) {
  .admin-order-page {
    grid-template-columns: 1fr;
  }

  .admin-order-page > .admin-order-items,
  .admin-order-page > .admin-order-payments,
  .admin-order-page > .admin-order-summary,
  .admin-order-page > .admin-order-status {
    grid-column: 1;
  }

  .admin-order-page > .admin-order-items {
    border-bottom-right-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
  }

  .admin-order-page > .admin-order-payments {
    margin-top: 0;
    border-top-right-radius: var(--radius-md);
    border-top-left-radius: var(--radius-md);
  }

  .admin-order-content {
    grid-template-columns: 1fr;
    grid-template-areas:
      "sidebar"
      "main";
  }

  .admin-order-payment-card {
    grid-template-columns: 1fr;
  }

  .admin-order-payment-card__details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-order-status-controls {
    grid-template-columns: 1fr 1fr;
  }

  .admin-order-status-controls .form-group {
    grid-column: 1 / -1;
  }

  .admin-order-main .admin-order-items {
    border-bottom-right-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
  }

  .admin-order-main .admin-order-payments {
    border-top-right-radius: var(--radius-md);
    border-top-left-radius: var(--radius-md);
  }

  /* New billing-details layout: stack the summary head, single-column
     the info-grid, and let the actions card span full width on
     narrow viewports. */
  .admin-order-summary-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-order-summary-total {
    align-items: flex-start;
    text-align: left;
  }

  .admin-order-summary .info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .filter-actions {
    flex-direction: column;
  }
  .filter-actions .button {
    width: 100%;
  }
}

/* ============================================
   MODULES TABLE
   ============================================ */
.modules-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.modules-table-scroll table {
  min-width: 720px;
}

/* ============================================
   ARTICLES TABLE
   ============================================ */
.articles-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.articles-table-scroll table {
  min-width: 800px;
}

.article-bulk-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  margin-top: var(--space-4);
}

@media (max-width: 768px) {
  .modules-bulk-actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }
  .modules-bulk-actions .button {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .modules-pagination {
    padding: var(--space-3) !important;
  }
  .modules-pagination-row {
    flex-direction: column;
    align-items: stretch !important;
  }
  .modules-pagination-controls {
    min-width: 0 !important;
    justify-content: flex-start !important;
  }
}

/* ============================================
   QUESTION ITEMS LIST
   ============================================ */
html:not([data-theme="dark"]) #admin-question-items-list table tbody tr:hover,
html:not([data-theme="dark"])
  #admin-question-items-list
  table
  tbody
  tr:hover
  td {
  background: var(--color-bg-secondary, #f1f5f9) !important;
  color: var(--color-text, #000000) !important;
}

html[data-theme="dark"] #admin-question-items-list table tbody tr:hover,
html[data-theme="dark"] #admin-question-items-list table tbody tr:hover td {
  background: #374151 !important;
  color: #f9fafb !important;
}

/* ============================================
   QUESTION DETAIL FORM
   ============================================ */
.question-detail-form .form-group {
  margin-bottom: 24px;
}
.question-detail-form .form-label {
  margin-bottom: 8px;
  display: block;
  font-weight: 600;
  color: var(--color-text);
}
.question-detail-form .form-help {
  margin-top: 8px;
  display: block;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.question-detail-form input[type="file"] {
  padding: 12px;
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  width: 100%;
  cursor: pointer;
  transition: all 0.2s;
  height: auto;
}

.question-detail-form input[type="file"]:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-text-muted);
}

.question-detail-form input[type="file"]::file-selector-button {
  margin-right: 16px;
  padding: 8px 16px;
  border: none;
  background: var(--color-accent);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.question-detail-form input[type="file"]::file-selector-button:hover {
  background: var(--color-accent-strong);
}

.image-preview {
  margin-top: 12px;
  padding: 8px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  display: inline-block;
}

.current-file {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--color-text);
  word-break: break-all;
}

.current-audio {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-success-bg, #f0fdf4);
  border: 1px solid var(--color-success, #bbf7d0);
  border-radius: var(--radius-md);
  margin-top: 12px;
}

.current-audio-icon {
  font-size: 20px;
  color: var(--color-success);
}
.current-audio-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.current-audio-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-success);
  font-weight: 600;
}
.current-audio-filename {
  font-size: 14px;
  color: var(--color-text);
}

/* ============================================
   DASHBOARD BOOKINGS COMPACT
   ============================================ */
.db-bookings-compact {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.db-bookings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border-subtle);
}

.db-bookings-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
}

.db-bookings-list {
  padding: var(--space-3);
}
.db-booking-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.db-booking-item:hover {
  background: var(--color-bg);
}

/* ============================================
   MODULE ARTICLES
   ============================================ */
.module-articles-table {
  overflow-x: auto;
}
.module-articles-table table {
  min-width: 600px;
}

@media (max-width: 768px) {
  .module-articles-actions {
    flex-direction: column;
  }
  .module-articles-actions .button {
    width: 100%;
  }
}

/* ============================================
   ARTICLES TABLE
   ============================================ */
.articles-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.articles-table-scroll table {
  min-width: 720px;
}

@media (max-width: 768px) {
  .articles-pagination {
    padding: var(--space-3) !important;
  }
  .articles-pagination-row {
    flex-direction: column;
    align-items: stretch !important;
  }
  .articles-pagination-controls {
    min-width: 0 !important;
    justify-content: flex-start !important;
  }
  .articles-pagination-actions {
    min-width: 0 !important;
    height: auto !important;
    padding: var(--space-3) !important;
    flex-direction: column;
    gap: var(--space-2);
  }
  .articles-pagination-actions > div {
    min-width: 0 !important;
  }
  .articles-pagination-actions .button {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .article-bulk-actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }
  .article-bulk-actions .button {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* ============================================
   ADMIN HOME DASHBOARD
   ============================================ */
.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.admin-page-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-1);
}

.admin-page-title h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
}

.admin-page-subtitle {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.admin-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
}

.shortcut-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  transition: all var(--duration-base) var(--easing-smooth);
}

.shortcut-card:hover {
  border-color: var(--color-accent);
  background: var(--color-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Dark mode shortcut card hover */
html[data-theme="dark"] .shortcut-card {
  background: #1f2937;
  border-color: #374151;
}

html[data-theme="dark"] .shortcut-card:hover {
  border-color: #6366f1;
  background: #374151;
}

html[data-theme="dark"] .shortcut-card .material-symbols-outlined,
html[data-theme="dark"] .shortcut-icon {
  color: #818cf8;
}

.shortcut-card .material-symbols-outlined {
  font-size: 20px;
  color: var(--color-accent);
}

.shortcut-icon {
  font-size: 24px;
  color: var(--color-accent);
}

.shortcut-label {
  font-size: 14px;
  font-weight: 500;
}

.dashboard-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  overflow: hidden;
}

.dashboard-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border-subtle);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.dashboard-card-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--color-text);
  font-size: 15px;
}

.dashboard-card-title .material-symbols-outlined {
  font-size: 24px;
  color: var(--color-accent);
}

.dashboard-card-link {
  font-size: 13px;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  transition: opacity var(--duration-fast) var(--easing-smooth);
}

.dashboard-card-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.dashboard-card-body {
  padding: var(--space-5);
}

.dashboard-card-body.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-8);
  text-align: center;
  color: var(--color-text-muted);
}

.empty-icon {
  font-size: 32px;
  opacity: 0.5;
}

.quick-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ============================================
   PRODUCT DETAIL PAGE
   ============================================ */
.page-subtitle {
  margin: var(--space-1) 0 0 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.card h2 {
  margin: 0 0 var(--space-4) 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}


.card-elevated {
  box-shadow: var(--shadow-md);
  width: 100%;
  box-sizing: border-box;
}

/* Ensure cards in stats grid stay aligned */
.stats-grid .card-elevated {
  min-width: 0; 
}

.section-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.section-card h2 {
  margin: 0 0 var(--space-4) 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
}

.section-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-title span {
  display: inline-flex;
  align-items: center;
}

h2.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.section-divider {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-subtle);
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.section-badges {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-1);
}

.badge-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-status.missing {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.badge-status.over {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.badge-status.under {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

.search-form {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: flex-end;
}

.search-results {
  margin-top: var(--space-3);
  max-height: 400px;
  overflow-y: auto;
}

.search-message {
  text-align: center;
  padding: var(--space-4);
  color: var(--color-text-muted);
  font-size: 14px;
}

.save-indicator {
  display: inline-block;
  margin-left: var(--space-2);
  padding: 2px 8px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-group {
  margin-bottom: var(--space-3);
}

.form-group-inline {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.form-group-inline > div {
  flex: 1;
  min-width: 200px;
}

.search-field {
  flex: 1;
  min-width: 240px;
}

.search-field-id {
  min-width: 120px;
}

.search-field-type {
  min-width: 260px;
}

.search-label {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  display: block;
}

.search-container {
  margin-top: var(--space-2);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-bg);
}

.section-content {
  margin-top: var(--space-2);
}

.section-actions {
  margin-top: var(--space-3);
  margin-left: auto;
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.search-summary {
  list-style: none;
  cursor: pointer;
  color: var(--color-accent);
  font-size: 14px;
  font-weight: 500;
}

.target-text {
  font-size: 13px;
  color: var(--color-text-muted);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 900px;
}

.table thead {
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-border-subtle);
}

.table th {
  padding: var(--space-3);
  text-align: left;
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 12px;
}

.table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text);
}

.table tbody tr:hover {
  background: var(--color-bg);
}

.action-icons {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  color: var(--color-text);
  background: var(--color-bg);
}

.icon-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.muted {
  color: var(--color-text-muted);
  font-size: 13px;
}

.button.secondary {
  background: var(--color-bg-secondary);
  color: var(--color-text);
  border: 1px solid var(--color-border-subtle);
}

.button.secondary:hover {
  background: var(--color-border-subtle);
}

.offline-allocate-form {
  display: inline-grid;
  grid-template-columns: 220px 120px auto;
  gap: 6px;
  align-items: center;
}

.offline-allocate-form select,
.offline-allocate-form input {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 4px;
  background: var(--color-bg);
  color: var(--color-text);
}

.empty-state {
  background: transparent;
  border: none;
  text-align: center;
  padding: var(--space-6);
  color: var(--color-text-muted);
}

.empty-state-icon {
  font-size: 32px;
  margin-bottom: var(--space-2);
}

.empty-state-text {
  margin: 0;
  font-size: 14px;
}

@media (max-width: 768px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-header .btn {
    width: 100%;
  }

  .table {
    font-size: 12px;
  }

  .table th,
  .table td {
    padding: var(--space-2);
  }
}

/* ============================================
   PRODUCT NEW/EDIT PAGE
   ============================================ */
.form-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-4) 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-error {
  color: var(--color-danger);
  font-size: 12px;
  margin-top: 2px;
}

.form-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}

.checkbox-label {
  font-size: 14px;
  color: var(--color-text);
  cursor: pointer;
}

.form-group label input[type="checkbox"] {
  width: auto;
  margin-right: var(--space-2);
  cursor: pointer;
}

.page-title-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.page-title-wrapper h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

.full-width {
  grid-column: 1 / -1;
}

.quick-actions .btn {
  flex: 0 1 auto;
}

@media (max-width: 768px) {
  .admin-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-actions {
    order: -1;
    margin-bottom: var(--space-3);
  }

  .dashboard-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-card-link {
    align-self: flex-start;
  }

  .dashboard-card-body {
    padding: var(--space-4);
  }

  .quick-actions {
    flex-direction: column;
  }

  .quick-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   ADMIN ORDER DETAIL
   ============================================ */
.page-title-group {
  flex: 1;
}

.page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

h1.page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

.page-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.section-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-3) 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.info-label {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.info-value {
  font-size: 14px;
  color: var(--color-text);
  font-weight: 500;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 700px;
}

.table thead {
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-border-subtle);
}

.table th {
  padding: var(--space-2);
  text-align: left;
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 12px;
}

.table td {
  padding: var(--space-2);
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text);
}

.table tbody tr:hover {
  background: var(--color-bg);
}

.code-text {
  background: var(--color-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
}

.back-link {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  transition: opacity 0.2s ease;
}

.back-link:hover {
  opacity: 0.8;
}

@media (max-width: 768px) {
  .page-title-group {
    flex: none;
  }

  .page-actions {
    width: 100%;
    flex-direction: column;
  }

  .section-card {
    padding: var(--space-3);
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .table {
    font-size: 12px;
  }

  .table th,
  .table td {
    padding: var(--space-1);
  }
}

/* ============================================
   ADMIN ENROLL FORM
   ============================================ */
.admin-enroll-form {
  max-width: 600px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-group label {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.form-group input,
.form-group select {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-accent);
}

@media (max-width: 768px) {
  .admin-enroll-form {
    max-width: 100%;
  }
}
/* Currency searchable select */
.currency-select-group .currency-search-input {
  background: var(--color-bg);
  font-size: 13px;
}

.currency-select-group select {
  max-height: 42px;
  overflow-y: auto;
}
/* ============================================
   ADMIN INQUIRY DETAIL
   ============================================ */
.status-bar {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Moved to components/tables.css
.status-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: var(--color-bg);
  color: var(--color-text);
}
*/

.status-bar-buttons {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.status-btn {
  padding: 6px 12px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.status-btn:hover {
  border-color: var(--color-accent);
}

.status-btn.active {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-4);
}

.note-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.note-form textarea {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
  min-height: 80px;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.note-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.note-form button {
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent);
  color: white;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.2s ease;
  align-self: flex-start;
}

.note-form button:hover {
  opacity: 0.9;
}

.notes-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.notes-item {
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
}

.notes-item-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
  font-size: 12px;
}

.activity-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--color-surface);
  border-radius: 4px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.notes-item-meta {
  color: var(--color-text-muted);
  font-size: 12px;
}

.notes-item-body {
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
}

.notes-empty {
  text-align: center;
  padding: var(--space-4);
  color: var(--color-text-muted);
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.info-item:last-child {
  border-bottom: none;
}

.info-icon {
  font-size: 18px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  margin-top: 2px;
}

.info-content {
  flex: 1;
  min-width: 0;
}

.lookup-results {
  margin-top: var(--space-2);
}

.lookup-item {
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-1);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
}

.lookup-item:hover {
  border-color: var(--color-accent);
  background: var(--color-surface);
}

.lookup-item strong {
  color: var(--color-text);
}

.lookup-item .lookup-meta {
  color: var(--color-text-muted);
  font-size: 12px;
  margin-top: 4px;
}

.selected-user-summary {
  background: var(--color-bg);
  border-left: 3px solid var(--color-accent);
  padding: var(--space-2) var(--space-3);
  border-radius: 4px;
  font-size: 13px;
  color: var(--color-text);
  margin-top: var(--space-2);
}

@media (max-width: 768px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .status-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-bar-buttons {
    width: 100%;
  }
}

/* ============================================
   ADMIN TOGGLE/CONFIRM PAGES
   ============================================ */
.page-wrapper {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--space-4);
}

.confirm-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.confirm-card.danger-border {
  border: 2px solid var(--color-danger);
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 var(--space-3) 0;
}

.card-title.danger {
  color: var(--color-danger);
}

.card-message {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0;
}

.details-box {
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin: var(--space-3) 0;
  font-size: 13px;
  color: var(--color-text);
}

.confirmation-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: var(--space-3) 0;
  text-align: left;
}

.confirmation-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.confirmation-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text);
  font: inherit;
}

.confirmation-field input:focus {
  outline: 2px solid var(--color-danger);
  outline-offset: 2px;
}

.field-error {
  margin: 0;
  color: var(--color-danger);
  font-size: 13px;
  font-weight: 600;
}

.warning-text {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: var(--space-2) 0 0 0;
  line-height: 1.5;
}

.info-code {
  background: var(--color-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
}

.btn-danger {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
}

.btn-danger:hover {
  opacity: 0.9;
}

.error-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.error-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 var(--space-3) 0;
}

@media (max-width: 768px) {
  .page-wrapper {
    padding: var(--space-2);
  }

  .confirm-card,
  .error-card {
    padding: var(--space-3);
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .no-print {
    display: none !important;
  }

  .page-header-wrapper {
    break-after: avoid;
  }

  .section-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  body {
    background: white !important;
  }

  .btn,
  .page-actions {
    display: none !important;
  }
}

/* ============================================
   TEACHER FORM STYLES
   ============================================ */
.teacher-create-container {
  max-width: 1000px;
  margin: 0 auto;
}

.teacher-create-header {
  border-bottom: 1px solid var(--color-border-subtle);
  padding-bottom: var(--space-6);
  margin-bottom: var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.teacher-create-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
}

.teacher-create-header p {
  margin: var(--space-1) 0 0 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.teacher-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.teacher-form-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.teacher-card__section {
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
}

.teacher-card__section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.teacher-card__section-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.teacher-card__section-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  font-size: 20px;
  color: var(--color-accent);
}

.teacher-card__section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.teacher-card__section-helper {
  display: block;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.teacher-form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.teacher-form-row--profile {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.teacher-profile-left,
.teacher-profile-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.teacher-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.teacher-form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.teacher-form-input,
.teacher-form-select,
.teacher-form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.teacher-form-input:focus,
.teacher-form-select:focus,
.teacher-form-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.teacher-form-textarea {
  min-height: 100px;
  resize: vertical;
}

.input-wrapper {
  position: relative;
  display: flex;
}

.input-icon-right {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--color-text-muted);
  font-size: 18px;
}

.input-wrapper .teacher-form-select {
  padding-right: 36px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 20px;
}

.teacher-card__footer {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.teacher-status-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.toggle-label {
  font-size: 14px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.switch input {
  display: none;
}

.slider {
  display: inline-block;
  width: 44px;
  height: 24px;
  background: var(--color-border-subtle);
  border-radius: var(--radius-lg);
  position: relative;
  transition: background-color 0.2s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
}

input:checked + .slider {
  background: var(--color-accent);
}

input:checked + .slider::before {
  transform: translateX(20px);
}

.btn-cancel,
.btn-create {
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  transition: all var(--duration-fast);
}

.btn-cancel {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border-subtle);
  text-decoration: none;
}

.btn-cancel:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-create {
  background: var(--color-accent);
  color: white;
}

.btn-create:hover {
  background: var(--color-accent-strong, #6366f1);
  transform: translateY(-1px);
}

.card.error {
  background: #fee2e2;
  border: 1px solid #fecaca;
}

.teacher-form-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .teacher-create-header {
    flex-direction: column;
    align-items: stretch;
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-4);
  }

  .teacher-form-row {
    grid-template-columns: 1fr;
  }

  .teacher-form-row--profile {
    grid-template-columns: 1fr;
  }

  .teacher-card__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .teacher-status-toggle {
    justify-content: flex-start;
  }

  .btn-cancel,
  .btn-create {
    width: 100%;
    justify-content: center;
  }

  .teacher-card {
    padding: var(--space-3);
  }

  .teacher-form-input,
  .teacher-form-select,
  .teacher-form-textarea {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .teacher-create-header h1 {
    font-size: 22px;
  }

  .teacher-form-label {
    font-size: 12px;
  }

  .teacher-form-input,
  .teacher-form-select,
  .teacher-form-textarea {
    font-size: 16px;
  }
}

/* ============================================
   TEACHER DETAIL PAGE
   ============================================ */

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.section-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
}

.section-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.detail-label {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.detail-value {
  font-size: 14px;
  color: var(--color-text);
}

.detail-link {
  color: var(--color-accent);
  text-decoration: none;
  transition: all 0.2s ease;
}

.detail-link:hover {
  text-decoration: underline;
}

/* Moved to components/tables.css
.status-badge.active {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
}

.status-badge.inactive {
  background: rgba(107, 114, 128, 0.15);
  color: var(--color-text-muted);
}

.status-badge.approved {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
*/
}

.detail-section-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-subtle);
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
}

.footer-link:hover {
  text-decoration: underline;
}

.bookings-table-wrapper {
  overflow-x: auto;
}

.bookings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.bookings-table thead {
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-border-subtle);
}

.bookings-table th {
  padding: var(--space-3);
  text-align: left;
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 12px;
}

.bookings-table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text);
}

.bookings-table tbody tr:hover {
  background: var(--color-bg);
}

.bookings-table .view-link {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.bookings-table .view-link:hover {
  text-decoration: underline;
}

/* ============================================
   STAT ICONS (LEGACY VARIANTS)
   ----------------------------------------------------
   The base .stat-icon dimensions live in
   /static/css/components/stat_card.css. This block keeps backward-
   compatible background-color variants for legacy templates that
   used `class="stat-icon questions"` (etc.) instead of the new
   `class="stat-card stat-card--{variant}"` convention.
   ============================================ */

.stat-icon.total {
  background: rgba(99, 102, 241, 0.15);
}

.stat-icon.active {
  background: rgba(34, 197, 94, 0.15);
}

.stat-icon.full {
  background: rgba(34, 197, 94, 0.15);
}

.stat-icon.sectional {
  background: rgba(249, 115, 22, 0.15);
}

.stat-icon.pending {
  background: rgba(249, 115, 22, 0.15);
}

.stat-icon.suspended {
  background: rgba(239, 68, 68, 0.15);
}

.stat-icon.events {
  background: rgba(99, 102, 241, 0.15);
}

.stat-icon.users {
  background: rgba(34, 197, 94, 0.15);
}

.stat-icon.products {
  background: rgba(249, 115, 22, 0.15);
}

.stat-icon.types {
  background: rgba(168, 85, 247, 0.15);
}

.stat-icon.orgs {
  background: rgba(168, 85, 247, 0.15);
}

.stat-icon.upcoming {
  background: rgba(99, 102, 241, 0.15);
}

.stat-icon.confirmed {
  background: rgba(34, 197, 94, 0.15);
}

.stat-icon.week {
  background: rgba(168, 85, 247, 0.15);
}

.stat-icon.revenue {
  background: rgba(20, 184, 166, 0.15);
}

.stat-icon.teachers {
  background: rgba(249, 115, 22, 0.15);
}

/* Legacy value-color variants â€” kept for templates that used
   class="stat-value active/pending/revenue/etc." prior to the
   centralized standard. New code should use .stat-card--{variant}
   on the card and rely on the global rules in stat_card.css. */
.stat-value.active {
  color: var(--color-success);
}

.stat-value.pending {
  color: var(--color-accent);
}

.stat-value.suspended {
  color: var(--color-danger);
}

.stat-value.orgs {
  color: #a855f7;
}

.stat-value.upcoming {
  color: #6366f1;
}

.stat-value.confirmed {
  color: #22c55e;
}

.stat-value.week {
  color: #a855f7;
}

.stat-value.revenue {
  color: #14b8a6;
}

.stat-value.teachers {
  color: #f97316;
}

.events-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
}

.event-type-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.event-type-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.event-type-count {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-accent);
}

/* ============================================
   ATTEMPTS LIST PARTIAL
   ============================================ */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.attempts-table-wrapper {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.attempts-table-scroll {
  overflow-x: auto;
}

.attempts-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

@media (max-width: 768px) {
  .attempts-table-scroll {
    display: none;
  }

  .attempts-mobile-cards {
    display: block !important;
    padding: 12px;
  }

  .attempt-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
  }

  .attempt-card:last-child {
    margin-bottom: 0;
  }
}

@media (max-width: 480px) {
  .attempt-card {
    padding: 12px;
  }

  .attempt-card-details {
    gap: 8px;
  }
}

/* ============================================
   PRODUCTS LIST PAGE
   ============================================ */
.section-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

.tabs-nav {
  display: flex;
  gap: var(--space-1);
  background: transparent;
  padding: 0;
  margin-bottom: var(--space-4);
  border-bottom: 2px solid var(--color-border-subtle);
}

.tab-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.tab-button:hover {
  color: var(--color-text);
}

.tab-button.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.tab-count {
  background: var(--color-bg);
  padding: 2px 8px;
  border-radius: var(--radius-lg);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.tab-button.active .tab-count {
  background: var(--color-accent);
  color: white;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-2);
  align-items: end;
  margin-bottom: var(--space-3);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-group label {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.form-group input,
.form-group select {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 13px;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 900px;
}

.table thead {
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-border-subtle);
}

.table th {
  padding: var(--space-3);
  text-align: left;
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 12px;
}

.table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text);
}

.table tbody tr:hover {
  background: var(--color-bg);
}

/* Moved to components/tables.css
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success, #22c55e);
}

.status-badge.inactive {
  background: rgba(107, 114, 128, 0.15);
  color: var(--color-text-muted);
}
*/

.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
  margin-top: var(--space-4);
}

.pagination-info {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-right: auto;
}

.pagination-btn {
  padding: 6px 10px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 4px;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  font-size: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.pagination-btn:hover {
  border-color: var(--color-accent);
  background: var(--color-bg);
}

.pagination-btn.active {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.empty-state {
  text-align: center;
  padding: var(--space-6);
  color: var(--color-text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-2);
  opacity: 0.3;
}

.clear-filters {
  margin-top: var(--space-3);
}

@media (max-width: 768px) {
  .page-header-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .table {
    font-size: 12px;
  }

  .table th,
  .table td {
    padding: var(--space-2);
  }

  .pagination {
    flex-direction: column;
    gap: var(--space-2);
  }

  .pagination-info {
    margin-right: 0;
    width: 100%;
    text-align: center;
  }

  .pagination-btn {
    flex: 1;
    text-align: center;
  }
}

/* ============================================
   PARTNER DASHBOARD STYLES
   ============================================ */
.partner-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.partner-header .material-icons-outlined {
  font-size: 40px;
  color: var(--color-accent);
  background: linear-gradient(
    135deg,
    var(--color-accent-contrast),
    transparent
  );
  padding: 12px;
  border-radius: var(--radius-lg);
}

.partner-header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
}

.partner-header p {
  margin: var(--space-1) 0 0 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.partner-nav-links {
  margin-left: auto;
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.partner-nav-links a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  transition: all 0.2s ease;
}

.partner-nav-links a:hover {
  background: var(--color-bg);
  border-color: var(--color-accent);
}

.partner-stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  box-sizing: border-box;
}

.partner-stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.partner-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
}

.partner-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  background: linear-gradient(
    135deg,
    var(--color-accent) 0%,
    var(--color-accent-strong) 100%
  );
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.partner-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.partner-action-btn.secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border-subtle);
}

.partner-action-btn.secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.partner-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-top: var(--space-4);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.partner-section > * {
  max-width: 100%;
  box-sizing: border-box;
}

.partner-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.partner-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size:17px;
  font-weight: 700;
  color: var(--color-text);
}

.partner-section-title .material-icons-outlined {
  color: var(--color-accent);
  font-size: 24px;
}

.badge-up {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.badge-down {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.badge-neutral {
  background: var(--color-bg-secondary);
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .partner-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .partner-nav-links {
    margin-left: 0;
    width: 100%;
  }

  .partner-nav-links a {
    flex: 1;
    justify-content: center;
  }
}

/* ============================================
   PARTNER LEDGER PAGE - LARGE SCREEN OPTIMIZATION
   ============================================ */

.admin-partner-ledger-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.admin-partner-ledger-muted {
  color: var(--color-text-muted);
}

.admin-partner-ledger-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3);
}

.admin-partner-ledger-toolbar {
  flex: 1;
}

.admin-partner-ledger-actions {
  display: flex;
  gap: var(--space-2);
}

@media (min-width: 1440px) {
  .admin-partner-ledger-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
  }

  .admin-partner-ledger-header {
    gap: var(--space-3);
  }

  .admin-partner-ledger-actions {
    gap: var(--space-3);
  }
}

@media (min-width: 1920px) {
  .admin-partner-ledger-stats {
    gap: var(--space-5);
  }

  .admin-partner-ledger-header {
    gap: var(--space-4);
  }

  .admin-partner-ledger-actions {
    gap: var(--space-4);
  }

  .section-card {
    padding: var(--space-6);
  }

  .stats-grid {
    gap: var(--space-5);
  }

  .section-header {
    gap: var(--space-4);
  }
}

/* ============================================
   PROVIDERS PAGE - LARGE SCREEN OPTIMIZATION
   ============================================ */

.admin-providers-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.admin-providers-title-section {
  flex: 1;
  min-width: 0;
}

.admin-providers-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

.admin-providers-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.admin-providers-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.admin-providers-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3);
  align-items: end;
}

@media (min-width: 1440px) {
  .admin-providers-filter-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
  }

  .admin-providers-page-header {
    gap: var(--space-4);
  }

  .admin-providers-actions {
    gap: var(--space-3);
  }

  .stats-grid {
    gap: var(--space-5);
  }
}

@media (min-width: 1920px) {
  .admin-providers-filter-grid {
    gap: var(--space-5);
  }

  .admin-providers-page-header {
    gap: var(--space-5);
  }

  .admin-providers-actions {
    gap: var(--space-4);
  }

  .stats-grid {
    gap: var(--space-6);
  }

  .section-card {
    padding: var(--space-6);
  }
}

/* ============================================
   ADMIN BOOKINGS PAGE STYLES
   ============================================ */

/* Toast Messages */
.toasts {
  margin-bottom: var(--space-4);
}

.toast {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid;
}

.toast.success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
  border-color: var(--color-success);
}

.toast.error {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
  border-color: var(--color-danger);
}

.toast.warning {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  border-color: var(--color-warning);
}

.toast.info {
  background: var(--color-info-bg);
  color: var(--color-info-text);
  border-color: var(--color-info);
}

.list-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

/* ============================================
   TEACHERS PAGE - LARGE SCREEN OPTIMIZATION
   ============================================ */

.admin-teachers-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.admin-teachers-title-section {
  flex: 1;
  min-width: 0;
}

.admin-teachers-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

.admin-teachers-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.admin-teachers-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.admin-teachers-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3);
  align-items: end;
}

@media (min-width: 1440px) {
  .admin-teachers-filter-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-4);
  }

  .admin-teachers-page-header {
    gap: var(--space-4);
  }

  .admin-teachers-actions {
    gap: var(--space-3);
  }

  .stats-grid {
    gap: var(--space-5);
  }
}

@media (min-width: 1920px) {
  .admin-teachers-filter-grid {
    gap: var(--space-5);
  }

  .admin-teachers-page-header {
    gap: var(--space-5);
  }

  .admin-teachers-actions {
    gap: var(--space-4);
  }

  .stats-grid {
    gap: var(--space-6);
  }

  .section-card {
    padding: var(--space-6);
  }
}

.analytics-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  margin-top: var(--space-6);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  clear: both;
}

.analytics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border-subtle);
  flex-wrap: wrap;
}

.analytics-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.analytics-title .material-symbols-outlined {
  font-size: 24px;
  color: var(--color-accent);
}

.analytics-tabs {
  display: flex;
  gap: var(--space-2);
}

.analytics-tab {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--easing-smooth);
}

.analytics-tab:hover {
  background: var(--color-bg);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.analytics-tab.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.analytics-tab.ielts.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
}

.analytics-tab.pte.active {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border-color: #f5576c;
}

.analytics-body {
  padding: var(--space-5);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  width: 100%;
}

@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

.chart-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  width: 100%;
  box-sizing: border-box;
  min-width: 0; /* Prevent grid blowout */
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-4) 0;
  text-align: center;
}

.chart-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}

.chart-container svg {
  display: block;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .analytics-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .analytics-tabs {
    width: 100%;
    flex-wrap: wrap;
  }

  .analytics-tab {
    flex: 1;
    text-align: center;
    min-width: 80px;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.stats-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

@media (max-width: 992px) {
  .stats-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .stats-grid-4 {
    grid-template-columns: 1fr;
  }
}

.stat-icon.providers {
  background: rgba(99, 102, 241, 0.15);
}

.stat-icon.reports {
  background: rgba(34, 197, 94, 0.15);
}

.stat-icon.remittances {
  background: rgba(249, 115, 22, 0.15);
}

.stat-icon.warning {
  background: rgba(239, 68, 68, 0.15);
}

/* ============================================
   COURSE ARTICLE / MODULE PAGE RESPONSIVE
   ============================================ */

/* Module list container â€” sensible padding and max-width so long titles
   don't overflow the viewport on small screens. */
.module-container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .module-container {
    padding: 16px 14px;
  }
}

/* On narrow viewports, stack the article sidebar below the main content
   so it doesn't overlap or squeeze the article body. */
@media (max-width: 900px) {
  .article-layout {
    flex-direction: column !important;
  }

  .article-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    position: static !important;
    top: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }
}

/* Tighten the article title and module title on small screens */
@media (max-width: 640px) {
  #article-content h1 {
    font-size: 1.5rem !important;
    word-break: break-word;
  }

  .module-container h1 {
    font-size: 1.5rem !important;
    line-height: 1.25 !important;
    word-break: break-word;
  }
}

/* Bottom navigation buttons wrap on narrow screens */
@media (max-width: 640px) {
  #article-content > nav {
    flex-wrap: wrap !important;
  }
  #article-content > nav > a {
    flex: 1 1 100% !important;
    justify-content: center !important;
    text-align: center !important;
  }
}

/* PDF attachment toolbar wraps cleanly on narrow screens */
@media (max-width: 640px) {
  [data-article-pdf] > div:first-child {
    flex-wrap: wrap !important;
  }
  [data-article-pdf] > div:first-child > a {
    flex: 1 1 calc(50% - 6px) !important;
    justify-content: center !important;
  }
}

/* Generic file attachment row (non-PDF) wraps on narrow screens */
@media (max-width: 640px) {
  #article-content
    div[style*="display: flex"][style*="align-items: center"][style*="gap: 12px"][style*="padding: 16px 20px"] {
    flex-wrap: wrap !important;
  }
}

.stat-icon.earned {
  background: rgba(34, 197, 94, 0.15);
}

.stat-icon.paid {
  background: rgba(99, 102, 241, 0.15);
}

.section-body {
  padding: 0;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.nav-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  transition: all var(--duration-base) var(--easing-smooth);
}

.nav-card:hover {
  border-color: var(--color-accent);
  background: var(--color-surface);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.nav-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.nav-icon.offerings {
  background: rgba(99, 102, 241, 0.15);
}

.nav-icon.ledger {
  background: rgba(34, 197, 94, 0.15);
}

.nav-icon.payouts {
  background: rgba(249, 115, 22, 0.15);
}

.nav-icon.offline {
  background: rgba(168, 85, 247, 0.15);
}

.nav-content {
  flex: 1;
}

.nav-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.nav-desc {
  font-size: 13px;
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .nav-grid {
    grid-template-columns: 1fr;
  }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.page-header .page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

.page-header .page-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header .page-actions {
    justify-content: flex-start;
  }
}

/* ============================================
   MOCK TESTS PAGE
   ============================================ */
.mocktests-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.mocktests-title h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.mocktests-title p {
  margin: var(--space-1) 0 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.mocktests-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
}

.list-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.table-container {
  overflow-x: auto;
  margin: 0 calc(-1 * var(--space-4));
  padding: 0 var(--space-4);
}

.test-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 900px;
}

.test-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  font-weight: 600;
  font-size: 12px;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border-subtle);
  white-space: nowrap;
}

.test-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
  vertical-align: middle;
}

.test-table tbody tr:hover {
  background: var(--color-bg);
}

.test-table tbody tr:last-child td {
  border-bottom: none;
}

.test-title {
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
}

.test-title:hover {
  text-decoration: underline;
}

.test-description {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.badge-family {
  background: rgba(99, 102, 241, 0.15);
  color: var(--color-accent);
}

.badge-type-full {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
}

.badge-type-sectional {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.status-active {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-success);
  font-weight: 500;
  font-size: 13px;
}

.status-inactive {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 13px;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.empty-state {
  text-align: center;
  padding: var(--space-8);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}

.empty-state p {
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .mocktests-header {
    flex-direction: column;
    align-items: stretch;
  }

  .mocktests-actions {
    justify-content: flex-start;
  }
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border-subtle);
}

.btn-secondary:hover {
  background: var(--color-bg);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

button.btn-reject {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #dc2626 !important;
}

button.btn-reject:hover {
  background: #fecaca;
  border-color: #b91c1c;
  color: #b91c1c;
}

button.btn-approve {
  background: #dcfce7;
  color: #16a34a;
  border: 1px solid #16a34a !important;
}

button.btn-approve:hover {
  background: #bbf7d0;
  border-color: #15803d;
  color: #15803d;
}

.status-draft {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--warning);
  font-weight: 500;
  font-size: 13px;
}

/* .status-draft::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
} */

.status-published {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-success);
  font-weight: 500;
  font-size: 13px;
}

/* .status-published::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
} */

/* ============================================
   CATALOG MANAGER PAGE
   ============================================ */
.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.catalog-title h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.catalog-title p {
  margin: var(--space-1) 0 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.catalog-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.list-title-with-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
}

.list-title-with-actions .list-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.list-title-with-actions #bulk-delete-btn {
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.list-title-with-actions #bulk-delete-btn:not(:disabled) {
  opacity: 1;
}

.quick-actions-section {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
}

.quick-actions-section .btn {
  flex-shrink: 0;
}

.inline-form {
  display: inline;
}

.loading-state {
  text-align: center;
  padding: var(--space-8);
  color: var(--color-text-muted);
}

.loading-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.stat-icon.questions {
  background: rgba(99, 102, 241, 0.15);
}

.stat-icon.skills {
  background: rgba(249, 115, 22, 0.15);
}

.stat-icon.sections {
  background: rgba(34, 197, 94, 0.15);
}

.stat-icon.predictions {
  background: rgba(239, 68, 68, 0.15);
}

/* ----- Clickable stat card (link variant) -----
   Used as a wrapper <a class="stat-card-link"> around a .stat-card to
   make the whole card clickable. The visual styling (padding, border,
   background) is inherited from the inner .stat-card; this class only
   adds the link affordance and a chevron.
   The whole-link MUST NOT add its own padding/background â€” that would
   double the card's surface. */
.stat-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition:
    transform var(--duration-fast) var(--easing-smooth),
    box-shadow var(--duration-fast) var(--easing-smooth);
}
.stat-card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.stat-card-link .stat-card {
  border-color: var(--color-border-subtle);
}
.stat-card-link:hover .stat-card {
  border-color: var(--color-accent);
}
.stat-card-link .stat-card-chevron {
  margin-left: auto;
  color: var(--color-text-muted);
  opacity: 0.6;
  flex-shrink: 0;
  transition:
    transform var(--duration-fast) var(--easing-smooth),
    opacity var(--duration-fast) var(--easing-smooth);
}
.stat-card-link:hover .stat-card-chevron {
  transform: translateX(2px);
  opacity: 1;
  color: var(--color-accent);
}
.stat-card-sub {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 6px;
  vertical-align: middle;
}
.stat-card-meta {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.info-card {
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
}

.info-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.info-card h3 {
  margin: 0 0 var(--space-2) 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.info-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.info-card-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .catalog-header {
    flex-direction: column;
    align-items: stretch;
  }

  .catalog-actions {
    justify-content: flex-start;
  }

  .quick-actions-section {
    flex-direction: column;
  }

  .quick-actions-section .btn {
    width: 100%;
    justify-content: center;
  }

  .info-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .info-card-actions {
    width: 100%;
  }

  .info-card-actions .btn {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .page-header-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .page-actions {
    order: -1;
    margin-bottom: var(--space-3);
  }

  .page-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .bookings-table {
    font-size: 12px;
  }

  .bookings-table th,
  .bookings-table td {
    padding: var(--space-2);
  }
}

/* ============================================
   TEACHERS LIST PAGE
   ============================================ */
.dashboard-booking-table-wrapper {
  overflow-x: auto;
}

.dashboard-booking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.dashboard-booking-table__header {
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-border-subtle);
}

.dashboard-booking-table__header-cell {
  padding: var(--space-3);
  text-align: left;
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 12px;
}

.dashboard-booking-table__header-cell--actions {
  text-align: right;
  min-width: 300px;
}

.dashboard-booking-table__body {
  background: var(--color-surface);
}

.dashboard-booking-table__row {
  border-bottom: 1px solid var(--color-border-subtle);
}

.dashboard-booking-table__row:hover {
  background: var(--color-bg);
}

.dashboard-booking-table__cell {
  padding: var(--space-3);
  color: var(--color-text);
}

.dashboard-booking-table__cell--actions {
  text-align: right;
}

.dashboard-booking-actions {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-booking-actions__form {
  display: inline;
}

.dashboard-booking-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg);
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.dashboard-booking-btn:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.dashboard-booking-btn--cancel {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.dashboard-booking-btn--cancel:hover {
  background: var(--color-danger);
  color: white;
}

.booking-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  background: var(--color-bg);
  border-top: 1px solid var(--color-border-subtle);
}

.booking-pagination-info {
  font-size: 13px;
  color: var(--color-text-muted);
}

.booking-pagination-highlight {
  font-weight: 600;
  color: var(--color-text);
}

.booking-pagination-controls {
  display: flex;
  gap: var(--space-1);
}

.booking-pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.booking-pagination-btn:hover:not(:disabled) {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.booking-pagination-btn.active {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.booking-pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.booking-pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* Moved to components/tables.css
.status-badge.status-confirmed {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
}

.status-badge.status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.status-badge.status-canceled {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
*/

@media (max-width: 768px) {
  .dashboard-booking-table__header-cell--actions {
    min-width: auto;
  }

  .dashboard-booking-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-booking-btn {
    width: 100%;
    justify-content: center;
  }

  .booking-pagination {
    flex-direction: column;
    gap: var(--space-3);
  }

  .booking-pagination-controls {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   PROVIDER DETAIL PAGE
   ============================================ */
.page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

.page-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.page-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.page-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg);
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.page-actions .btn:hover {
  border-color: var(--color-ac);
  background: var(--color-bg);
}

.page-actions .btn-secondary {
  background: transparent;
}

.page-actions .btn-danger {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.page-actions .btn-danger:hover {
  background: var(--color-danger);
  color: white;
}

.info-link {
  color: var(--color-accent);
  text-decoration: none;
  transition: all 0.2s ease;
}

.info-link:hover {
  text-decoration: underline;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.detail-card {
  background: var(--color-bg);
  padding: var(--space-4);
  border-radius: var(--radius-md);
}

.detail-card h3 {
  margin: 0 0 var(--space-3) 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.detail-card p {
  margin: 0 0 var(--space-2) 0;
  font-size: 13px;
  color: var(--color-text);
  line-height: 1.6;
}

.detail-card p strong {
  color: var(--color-text-muted);
  font-weight: 600;
}

.detail-card p:last-child {
  margin-bottom: 0;
}

.table .badge-link {
  color: var(--color-accent);
  text-decoration: none;
  transition: all 0.2s ease;
}

.table .badge-link:hover {
  text-decoration: underline;
}

.assign-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  align-items: end;
}

@media (max-width: 768px) {
  .page-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .page-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .assign-grid {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .assign-grid .btn {
    width: 100%;
  }
}

/* ============================================
   STUDENT DETAIL PAGE STYLES
   ============================================ */

.student-detail-grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: var(--space-6);
  align-items: start;
}

.student-profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.student-info-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.student-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border-subtle);
}

.student-avatar-circle {
  width: 100px;
  height: 100px;
  background: linear-gradient(
    135deg,
    var(--color-accent) 0%,
    var(--color-accent-strong) 100%
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: white;
  margin-bottom: var(--space-3);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
  overflow: hidden;
}

.student-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.student-avatar-circle .profile-avatar-initials {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.student-name-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
}

.student-id-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.info-item {
  margin-bottom: var(--space-4);
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.info-value {
  display: block;
  font-size: 15px;
  color: var(--color-text);
  font-weight: 500;
  word-break: break-all;
}

.student-main-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Section Cards Enhancement */
.section-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-card h2 {
  margin: 0 0 var(--space-4) 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Data List Items */
.data-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.data-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.data-item:hover {
  border-color: var(--color-accent);
  transform: translateX(4px);
}

.data-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.data-item-title {
  font-weight: 600;
  color: var(--color-text);
  font-size: 14px;
}

.data-item-meta {
  font-size: 12px;
  color: var(--color-text-muted);
}

.data-item-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.status-completed {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}
.status-pending {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}
.status-enrolled {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

/* Score Badges */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 45px;
  height: 28px;
  background: var(--color-accent);
  color: white;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
}

/* Limiter Items Enhancement */
.limiter-item {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.limiter-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.limiter-badge {
  padding: 2px 8px;
  background: #fee2e2;
  color: #ef4444;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
}

@media (max-width: 1024px) {
  .student-detail-grid {
    grid-template-columns: 1fr;
  }
}

.attempts-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    var(--accent-strong) 100%
  );
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.attempts-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.attempts-user-avatar .profile-avatar-initials {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.students-list-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    var(--accent-strong) 100%
  );
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.students-list-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.students-list-avatar .profile-avatar-initials {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

/* ============================================
   CRM STUDENT PROFILE â€” Header
   ============================================ */

.crm-header {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-4);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  flex-wrap: wrap;
}

.crm-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex: 1;
  min-width: 260px;
}

.crm-avatar {
  width: 64px;
  height: 64px;
  background: linear-gradient(
    135deg,
    var(--color-accent) 0%,
    var(--color-accent-strong) 100%
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.crm-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.crm-header-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.crm-header-name-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.crm-header-name-row h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.crm-id-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.crm-header-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.crm-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.crm-meta-chip svg {
  opacity: 0.6;
}

/* Header Stats */
.crm-header-stats {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-4);
}

.crm-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.crm-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.crm-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.crm-stat-divider {
  width: 1px;
  height: 36px;
  background: var(--color-border-subtle);
}

/* Header Actions */
.crm-header-actions {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}

/* ============================================
   CRM TABS
   ============================================ */

.crm-tabs {
  display: flex;
  gap: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 0 var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.crm-tabs::-webkit-scrollbar {
  display: none;
}

.crm-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  position: relative;
}

.crm-tab:hover {
  color: var(--color-text);
  background: var(--color-bg);
}

.crm-tab--active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  font-weight: 600;
}

.crm-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--color-bg);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.crm-tab--active .crm-tab-count {
  background: var(--color-accent);
  color: white;
}

/* Tab Content Area */
.crm-tab-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: var(--space-6);
  min-height: 400px;
}

/* ============================================
   CRM OVERVIEW TAB
   ============================================ */

.crm-overview-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* KPI Cards Row */
.crm-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.crm-kpi-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: border-color 0.2s ease;
}

.crm-kpi-card:hover {
  border-color: var(--color-accent);
}

.crm-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.crm-kpi-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.crm-kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.crm-kpi-label {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Overview Two-Column Layout */
.crm-overview-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

/* Contact Details List */
.crm-contact-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.crm-contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.crm-contact-row:last-child {
  border-bottom: none;
}

.crm-contact-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.crm-contact-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

/* Purchase Form Compact */
.crm-purchase-form {
  margin-top: var(--space-2);
}

.crm-purchase-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 80px 1fr auto;
  gap: var(--space-3);
  align-items: end;
}

/* See All Link */
.crm-see-all {
  margin-left: auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

.crm-see-all:hover {
  opacity: 0.8;
}

/* ============================================
   CRM FILTER BAR
   ============================================ */

.crm-filter-bar {
  display: flex;
  gap: var(--space-3);
  align-items: end;
  flex-wrap: wrap;
}

/* ============================================
   CRM ENROLLMENTS GRID
   ============================================ */

.crm-enrollments-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

/* ============================================
   CRM NOTES TAB
   ============================================ */

.crm-notes-layout {
  max-width: 800px;
}

.crm-notes-main .note-form {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border-subtle);
}

.note-form-actions {
  display: flex;
  justify-content: flex-end;
}

.note-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.note-delete-btn svg,
.note-pin-btn svg {
  flex-shrink: 0;
}

.note-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.note-pin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.note-pin-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-accent);
}

.note-pin-btn--active {
  color: var(--color-accent);
  background: rgba(99, 102, 241, 0.08);
}

.note-pin-btn--active:hover {
  background: rgba(99, 102, 241, 0.15);
}

.note-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.note-edit-btn svg {
  flex-shrink: 0;
}

.note-edit-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-accent);
}

.note-edit-area {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border-subtle);
}

.note-edit-textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 72px;
  transition: border-color 0.2s ease;
}

.note-edit-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.note-edit-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-2);
}

.note-edit-cancel {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.note-edit-cancel:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.note-edit-save {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.note-edit-save:hover {
  opacity: 0.9;
}

.notes-item--pinned {
  border-left: 3px solid var(--color-accent);
}

/* ============================================
   CRM RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .crm-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .crm-header-stats {
    width: 100%;
    justify-content: space-around;
    padding: var(--space-3) 0;
    border-top: 1px solid var(--color-border-subtle);
  }

  .crm-header-actions {
    margin-left: 0;
    width: 100%;
  }

  .crm-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .crm-overview-cols {
    grid-template-columns: 1fr;
  }

  .crm-enrollments-grid {
    grid-template-columns: 1fr;
  }

  .crm-purchase-fields {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .crm-header-stats {
    gap: var(--space-2);
  }

  .crm-stat-divider {
    display: none;
  }

  .crm-kpi-row {
    grid-template-columns: 1fr;
  }

  .crm-tabs {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .crm-tab {
    padding: var(--space-2) var(--space-3);
    font-size: 13px;
  }

  .crm-purchase-fields {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   ALERT BANNER (used on product list page for missing default prices)
   ============================================================================ */

.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid transparent;
}

.alert-banner--warning {
  background: #fff8e1;
  border-color: #ffe082;
  color: #7c6200;
}

.alert-banner--warning svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: #f9a825;
}

.alert-banner__content strong {
  font-weight: 700;
}

/* ============================================================================
   NO-DEFAULT-PRICE BADGE (product table row)
   ============================================================================ */

.badge--no-default-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full, 9999px);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
  white-space: nowrap;
}

.badge--no-default-price svg {
  flex-shrink: 0;
}

@import url("./booking_detail.css");

@import url("./booking_edit.css");

@import url("../core/student-pages.css");
