/* eLearning Platform Styles */

/* === DESIGN TOKENS — ISHAAR Institute of Technology === */
:root {
  /* ISHAAR official brand colors */
  --color-cherry-red: #D71920;
  --color-dark-maroon: #8B0E0E;
  --color-white: #FFFFFF;
  --color-gray: #F5F5F5;
  --color-black: #1A1A1A;

  /* Supporting interface colors */
  --color-muted-gray: #B8B8B8;
  --color-metadata-gray: #737780;
  --color-metadata-alt: #7A7A7A;
  --color-divider: #E5E7EB;
  --color-soft-red-tint: #FCEBEC;
  --color-neutral-badge: #EEF0F3;
  --color-social-surface: #333333;
  --color-footer-divider: #3A3A3A;
  --color-desc-gray: #64748B;
  --red-hover: #B9141A;
  --field-bg: #F5F5F5;
  --text-secondary: #64748B;

  /* Mapped to legacy token names (used across the whole app) */
  --primary: #D71920;
  --primary-deep: #8B0E0E;
  --primary-glow: rgba(215,25,32,0.35);
  --accent: #737780;
  --accent-warm: #D71920;
  --accent-warm-deep: #8B0E0E;
  --green: #D71920;
  --green-deep: #8B0E0E;
  --danger: #ef4444;
  --success: #16A34A;

  --bg: #F5F5F5;
  --surface: #FFFFFF;
  --surface-2: #F5F5F5;
  --surface-3: #FCEBEC;
  --card-bg: #FFFFFF;
  --ink: #1A1A1A;
  --ink-soft: #333333;
  --text: #1A1A1A;
  --text-primary: #1A1A1A;
  --muted: #737780;
  --border: #E5E7EB;
  --border-light: #F0F2F5;

  --header-bg: #FFFFFF;
  --footer-bg: #1A1A1A;
  --footer-text: #B8B8B8;
  --footer-heading: #FFFFFF;

  /* Global consistency (every page, incl. future ones):
     hero background = footer color, shared hero type scale,
     identical space between the last section and the footer. */
  --hero-bg: var(--footer-bg);
  --hero-title-size: clamp(2rem, 4.6vw, 3.2rem);
  --hero-sub-size: clamp(15px, 1.4vw, 17px);
  --hero-height: 235px;
  --page-bottom-space: clamp(56px, 7vw, 88px);

  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(26,26,26,0.06);
  --shadow: 0 8px 24px rgba(26,26,26,0.08);
  --shadow-lg: 0 18px 40px rgba(26,26,26,0.12);
  --shadow-card: 0 4px 16px rgba(26,26,26,0.08);
  --shadow-green: 0 8px 18px -6px var(--primary-glow);
  /* Universal page-canvas card shadow (gray page + white content cards). */
  --shadow-page-card: 0 12px 34px rgba(16, 35, 49, 0.06);

  --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --transition: 0.18s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 0.3s cubic-bezier(0.4,0,0.2,1);
}

html[data-theme="dark"] {
  --color-gray: #1F1F1F;
  --color-divider: #2E2E2E;
  --color-neutral-badge: #262626;
  --color-soft-red-tint: #2A1416;
  --color-desc-gray: #94A3B8;
  --field-bg: #1F1F1F;
  --text-secondary: #94A3B8;

  --bg: #141414;
  --surface: #141414;
  --surface-2: #1F1F1F;
  --surface-3: #2A1416;
  --card-bg: #1F1F1F;
  --ink: #F5F5F5;
  --ink-soft: #C7CCDC;
  --text: #F5F5F5;
  --text-primary: #F5F5F5;
  --muted: #94A3B8;
  --border: #2E2E2E;
  --border-light: #2E2E2E;
  --header-bg: #141414;
  --footer-bg: #1A1A1A;
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.35s cubic-bezier(0.4,0,0.2,1), color 0.35s cubic-bezier(0.4,0,0.2,1);
}
body.loading .site-header,
body.loading .site-footer { visibility: hidden; }
.app-loader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  transition: opacity 0.3s ease;
}
body:not(.loading) .app-loader { opacity: 0; pointer-events: none; }
.app-loader-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-deep); }
img { max-width: 100%; display: block; }
.mono { font-family: var(--font-mono); }
.container { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

/* === HEADER (ISHAAR clone: flat white, relative, no shadow) === */
.site-header {
  position: relative;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid #F0F2F5;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px -2px var(--primary-glow);
  transition: transform var(--transition);
  flex-shrink: 0;
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }
.brand-mark svg { width: 18px; height: 18px; fill: none; stroke: white; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* === NAVIGATION === */
.nav { display: flex; align-items: center; gap: 8px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  position: relative;
  transition: color var(--transition), background var(--transition);
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform var(--transition);
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.active { color: var(--primary-deep); font-weight: 600; }
.nav-links a.active::after { transform: scaleX(1); }

/* CTA button in nav */
.nav-cta {
  background: var(--primary) !important;
  color: #fff !important;
  padding: 8px 20px !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  transition: background-color 0.15s ease, color 0.15s ease !important;
}
.nav-cta::after { display: none !important; }
.nav-cta:hover {
  background: var(--primary-deep) !important;
}

/* Theme toggle (macruuftech) */
/* Theme toggle — base visuals come from .icon-button (ISHAAR clone);
   keep only the hover spin + icon swap overrides. */
.theme-toggle:hover { transform: rotate(14deg); }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Logout button */
.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  transition: color var(--transition), background var(--transition);
  font-family: inherit;
}
.btn-link:hover { color: var(--danger); background: rgba(239,68,68,0.08); text-decoration: none; }

/* === HERO SECTION (arday252 + somalitech) === */
.hero {
  background: radial-gradient(circle at 50% 0%, var(--surface-2) 0%, var(--bg) 50%);
  padding: 56px 0 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
html[data-theme="dark"] .hero {
  background: radial-gradient(circle at 50% 0%, var(--surface-2) 0%, var(--bg) 50%);
}
.hero-inner { position: relative; z-index: 2; }

/* Eyebrow pill (arday252) */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--primary-deep);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(215,25,32,0.08);
  border: 1px solid rgba(215,25,32,0.2);
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  color: var(--ink);
  line-height: 1.1;
  max-width: 20ch;
  margin: 0 auto;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero h1 .accent {
  font-style: italic;
  font-weight: 500;
  color: var(--primary);
  display: block;
  margin-top: 0.04em;
}
.hero p.lead {
  margin-top: 20px;
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
  color: var(--muted);
}
.hero-ctas {
  display: flex;
  gap: 14px;
  margin-top: 32px;
  justify-content: center;
  flex-wrap: wrap;
}

/* === STAT STRIP (arday252) === */
.stat-strip {
  background: var(--ink);
  padding: 28px 0;
  margin-top: 48px;
  border-radius: 0 0 40px 40px;
  position: relative;
  z-index: 2;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.stat { text-align: center; }
.stat .num {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--bg);
}
.stat .num span { color: var(--primary); }
.stat .label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

/* === SECTIONS === */
.section { padding: 72px 0; }
.section-alt { background: var(--surface-2); }
.section-head { margin-bottom: 40px; }
.section-head .kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}
.section-head h2 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); }
.section-head p { margin-top: 10px; color: var(--muted); font-size: 1rem; }

/* Catalog toolbar (search + Level/Category filters) */
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin: -8px 0 24px;
}
.catalog-toolbar__search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 300px;
  max-width: 560px;
}
.catalog-toolbar__search .svg-ic {
  position: absolute;
  left: 15px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.catalog-toolbar__input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.catalog-toolbar__input::placeholder { color: var(--muted); }
.catalog-toolbar__input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.12);
}
.catalog-toolbar__filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.catalog-toolbar__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
  white-space: nowrap;
}
.catalog-toolbar .select {
  width: auto;
  padding: 7px 12px;
  font-size: 0.9rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  /* Native rendering. The base .select uses appearance:none plus a custom
     background, which makes Chrome on Windows paint the hovered row of the
     open list as white-on-white (invisible text). Restoring native
     appearance lets the browser draw its own hover highlight. */
  appearance: auto;
  -webkit-appearance: auto;
  background-image: none;
  padding-right: 12px;
}
.catalog-toolbar .select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(215, 25, 32, 0.12);
}

/* === CARDS (somalitech 3D + arday252 hover) === */
.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-page-card);
  transition: border-color var(--transition);
}
.card:hover {
  border-color: var(--border);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Course card specific */
.course-card { position: relative; overflow: hidden; }
.course-card h3 { margin: 0 0 0.4rem; font-size: 1.1rem; font-family: var(--font-body); font-weight: 600; }
.course-card h3 a { color: var(--ink); }
.course-card h3 a:hover { color: var(--primary-deep); }
.course-card .desc { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.75rem; line-height: 1.5; }
.course-card .badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.course-card .meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

/* === COURSE CARD V2 (Udemy-inspired) === */
.course-card-v2 {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.course-card-v2:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  text-decoration: none;
  color: inherit;
}

/* Image */
.course-card-v2__image {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--surface-2);
}
.course-card-v2__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.course-card-v2:hover .course-card-v2__image img {
  transform: scale(1.05);
}
.course-card-v2__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
}
.course-card-v2__placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.3;
}

/* "New" badge — top-left of the thumbnail, only while the course is ≤15 days old */
.course-card-v2__new {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px 5px 10px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(18, 32, 67, 0.18);
}
.course-card-v2__new .svg-ic {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Pricing row (price + discount badge, above the Details button).
   margin-top:auto pins the price/button block to the bottom of equal-height
   cards, so any spare height shows as a gap under the title. */
.course-card-v2__pricing {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-top: 0.75rem;
  margin-bottom: 0.75rem;
}
.course-card-v2__price-group {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.course-card-v2__price {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.course-card-v2__price-original {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
  text-decoration: line-through;
}

/* Discount badge ("X% OFF") */
.course-card-v2__sale {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(239,68,68,0.12);
  color: #b91c1c;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Body */
.course-card-v2__body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Badges */
.course-card-v2__badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  row-gap: 0.3rem;
  margin-bottom: 0.5rem;
}
.course-card-v2__category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: rgba(215,25,32,0.1);
  color: var(--primary-deep);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
}
.course-card-v2__level {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0;
  background: rgba(62,146,204,0.1);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
}

/* Total duration badge (clock icon + watch time, far right) */
.course-card-v2__duration {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.course-card-v2__duration .svg-ic {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Lesson count badge (book icon + lessons, spaced from the duration) */
.course-card-v2__lessons {
  margin-left: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.course-card-v2__lessons .svg-ic {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Title — fixed 3-line capacity.
   min-height reserves exactly 3 lines (3 × 1.35 line-height = 4.05em) so a
   1-, 2-, or 3-line title all take the same space and cards stay equal
   height; anything longer is clipped by the line clamp with an ellipsis. */
.course-card-v2__title {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  min-height: 4.05em;
}

/* Instructor label (light, above the instructor name) */
.course-card-v2__instructor-label {
  margin: 26px 0 6px;
  font-size: 0.63rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--muted);
  line-height: 1.3;
}

/* Instructor name (bold, below the label) */
.course-card-v2__instructor {
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Meta row (rating + students) */
.course-card-v2__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}
.course-card-v2__rating {
  display: flex;
  align-items: center;
  gap: 4px;
}
.course-card-v2__stars {
  color: #f4c150;
  font-size: 0.9rem;
  letter-spacing: 1px;
}
.course-card-v2__rating-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-warm-deep);
}
.course-card-v2__students {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* Actions */
.course-card-v2__actions {
  margin-top: 0;
}
.course-card-v2__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
}
.course-card-view {
  background: var(--primary);
  color: #fff;
}
.course-card-view:hover {
  background: var(--primary-deep);
}
.course-card-details {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--ink);
}
.course-card-details:hover {
  border-color: var(--ink);
  background: var(--surface-2);
}

/* Badges */
.badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--surface-3);
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
}
.badge-primary { background: rgba(215,25,32,0.1); color: var(--primary-deep); }
.badge-accent { background: rgba(62,146,204,0.1); color: var(--accent); }
.badge-warm { background: rgba(242,169,59,0.12); color: var(--accent-warm-deep); }

/* === BUTTONS (somalitech pill + arday252 glow) === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  border: none;
  border-radius: 12px;
  padding: 11px 24px;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  background: var(--primary-deep);
  color: #fff;
  text-decoration: none;
}
.btn-block { width: 100%; text-align: center; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
  box-shadow: none;
}
.btn-outline:hover {
  border-color: var(--ink);
  background: var(--surface-2);
  box-shadow: none;
  color: var(--ink);
}
.btn-ghost {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--ink);
  background: var(--surface-2);
  color: var(--ink);
}
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 16px; font-size: 0.82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }

/* === RICH EDITOR (Word/Canva style) === */
.rich-editor {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.rich-editor:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(215,25,32,0.1);
}
.rich-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.rich-editor-toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
}
.rich-editor-toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 6px;
}
.rich-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 4px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  transition: all 0.15s;
  font-family: inherit;
}
.rich-btn:hover {
  background: var(--surface-3);
  border-color: var(--border);
}
.rich-btn:active {
  background: var(--primary);
  color: #fff;
}
.rich-editor-content {
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  padding: 16px 20px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  outline: none;
}
.rich-editor-content:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}
.rich-editor-content h2 { font-size: 1.4rem; margin: 0.5rem 0; }
.rich-editor-content h3 { font-size: 1.2rem; margin: 0.5rem 0; }
.rich-editor-content p { margin: 0.5rem 0; }
.rich-editor-content ul, .rich-editor-content ol { margin: 0.5rem 0; padding-left: 1.5rem; }
.rich-editor-content a { color: var(--primary-deep); text-decoration: underline; }
.rich-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface-2);
  border-top: 1px solid var(--border-light);
}
.rich-editor-char-count {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* === FORMS === */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}
.input, .select, .textarea {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(215,25,32,0.15);
}
.textarea { min-height: 120px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%235B6270' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* === ALERTS === */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.alert-error {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  color: #dc2626;
}
.field-error {
  color: #dc2626;
  font-size: 0.83rem;
  font-weight: 500;
  margin-top: 0.35rem;
}
.alert-success {
  background: rgba(215,25,32,0.08);
  border: 1px solid rgba(215,25,32,0.25);
  color: var(--primary-deep);
}

/* === AUTH CARD === */
.auth-card {
  max-width: 420px;
  margin: 3rem auto;
  text-align: center;
}
.auth-card h2 { margin-bottom: 1.5rem; }
.auth-card .divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1.2rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.auth-card .divider::before, .auth-card .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* === REGISTER: PHONE + PASSWORD STRENGTH + TERMS === */
.phone-row { display: flex; gap: 8px; }
.phone-row .phone-cc {
  width: 56%;
  max-width: 250px;
  flex-shrink: 0;
  padding-right: 30px;
  text-overflow: ellipsis;
}
.phone-row .phone-num { flex: 1; min-width: 0; }

.pw-input-wrap { position: relative; }
.pw-input-wrap .input { padding-right: 42px; }
.pw-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 6px;
  opacity: 0.65;
}
.pw-eye:hover { opacity: 1; }

.pw-bars {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.pw-bars span {
  height: 6px;
  flex: 1;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.pw-bars span.on-red {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.55);
}
.pw-bars span.on-yellow {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.55);
}
.pw-bars span.on-green {
  background: var(--primary);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.55);
}

.pw-reqs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.pw-reqs span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: all 0.3s ease;
}
.pw-reqs span.valid {
  color: var(--primary);
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.12);
}
.pw-reqs span.valid::before { content: '✓'; font-weight: 700; }

.pw-match { font-size: 0.78rem; margin-top: 6px; min-height: 1em; }
.pw-match.ok { color: var(--primary); }
.pw-match.bad { color: #ef4444; }

.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0.2rem 0 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.terms-check input[type="checkbox"] {
  margin: 3px 0 0;
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  cursor: pointer;
}
.terms-check label { margin: 0; cursor: pointer; }
.terms-check a { color: var(--primary); font-weight: 600; }

.student-taught-row {
  display: grid;
  grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}
@media (max-width: 560px) {
  .student-taught-row { grid-template-columns: 1fr; }
}

/* === SOCIAL LINKS (admin create/edit user form) === */
.social-links-field { display: flex; gap: 0.6rem; align-items: flex-start; }
.social-links-rows { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.social-links-row { display: flex; align-items: center; gap: 0.5rem; }
.social-links-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: var(--color-soft-red-tint); color: var(--color-cherry-red);
}
.social-links-icon svg { width: 16px; height: 16px; }
.social-links-input { flex: 1; min-width: 0; }
.social-links-remove {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-size: 14px; line-height: 1; cursor: pointer; transition: color var(--transition), border-color var(--transition);
}
.social-links-remove:hover { color: var(--danger); border-color: var(--danger); }

/* === PROGRESS BAR === */
.progress-bar {
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  height: 8px;
  overflow: hidden;
  margin: 0.5rem 0;
}
.progress-fill {
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}

/* === COURSE CURRICULUM (Udemy-style sections → lectures) === */
.curriculum-section {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
  overflow: hidden;
  background: var(--surface);
}
.curriculum-section.open .curriculum-section__head { background: var(--surface-2); }
.curriculum-section__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 14px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  text-align: left;
  user-select: none;
}
.curriculum-section__chevron { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.curriculum-section__chevron svg { width: 14px; height: 14px; stroke: var(--muted); fill: none; stroke-width: 2; }
.curriculum-section.open .curriculum-section__chevron svg { transform: rotate(180deg); }
.curriculum-section__title { flex: 1; min-width: 0; font-weight: 600; font-size: 0.95rem; line-height: 1.35; overflow-wrap: anywhere; }
.curriculum-section__meta { flex-shrink: 0; font-size: 0.78rem; color: var(--muted); font-family: var(--font-mono); white-space: nowrap; }
.curriculum-section__body { display: none; }
.curriculum-section.open .curriculum-section__body { display: block; }

.curriculum-lectures { list-style: none; padding: 0; margin: 0; }
.curriculum-lecture {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 10px 16px;
  border-top: 1px solid var(--border-light);
}
.curriculum-lecture:hover { background: var(--surface-2); }
.cl-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--primary-deep); }
.cl-icon svg { width: 15px; height: 15px; stroke: var(--primary-deep); fill: none; stroke-width: 2; }
.cl-title { flex: 1; min-width: 0; color: var(--text); font-weight: 500; font-size: 0.92rem; overflow-wrap: anywhere; }
.cl-title:hover { color: var(--primary-deep); }
.cl-preview {
  flex-shrink: 0;
  color: var(--accent-warm-deep);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cl-duration { flex-shrink: 0; font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

/* Module accordion toggle icon (shared with student player) */
.module-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.module-toggle svg { width: 14px; height: 14px; stroke: var(--muted); fill: none; stroke-width: 2; }

/* === VIDEO FRAME === */
.video-frame {
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1.25rem;
  position: relative;
}



.video-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ink) 0%, #1a2744 100%);
  cursor: pointer;
}
.video-placeholder .play-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--primary-glow);
  transition: transform var(--transition);
}
.video-placeholder:hover .play-icon { transform: scale(1.1); }
.video-placeholder .play-icon svg { width: 24px; height: 24px; fill: white; margin-left: 3px; }

/* === CERTIFICATE CARD === */
.cert-card {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 2.5rem;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 2px solid var(--primary);
  position: relative;
  overflow: hidden;
}
.cert-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--accent-warm));
}
.cert-card .cert-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(215,25,32,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.cert-card .cert-icon svg { width: 32px; height: 32px; stroke: var(--primary); fill: none; stroke-width: 2; }
.cert-code {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  background: var(--surface-3);
  padding: 8px 20px;
  border-radius: var(--radius-xs);
  display: inline-block;
  margin: 0.75rem 0;
  letter-spacing: 0.05em;
  color: var(--ink);
}

/* === DASHBOARD === */
.dash-welcome {
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  margin-bottom: 0.5rem;
}
.dash-subtitle { color: var(--muted); margin-bottom: 2rem; }

/* === MAIN CONTENT === */
#app { padding: 0 0 2rem; min-height: 60vh; }

/* ============================================================
   UNIVERSAL PAGE CANVAS  (global — applies to EVERY page, and to
   any page added in the future, automatically).
   Rule: the whole site sits on the brand gray canvas (var(--bg));
   every content panel / container renders as a WHITE card with a
   small shadow (var(--shadow-page-card)), matching the Contact and
   Legal pages. Build any new page with .card (or .pg-card) and it
   inherits this treatment — do not paint full-width white bands.
   ============================================================ */
#app { background: var(--bg); }
.section.course-landing { background: transparent; }

/* ============================================================
   FOOTER (somalitech dark gradient)
   ============================================================ */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  margin-top: 4rem;
  border-radius: 40px 40px 0 0;
}
.footer-main {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding: 56px 0 40px;
}
.footer-brand p { font-size: 0.88rem; line-height: 1.6; margin-top: 12px; max-width: 280px; }
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--footer-heading);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a {
  color: var(--footer-text);
  font-size: 0.88rem;
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}
.footer-social { display: flex; gap: 12px; }
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--footer-text);
  transition: background var(--transition), color var(--transition);
}
.footer-social a:hover { background: var(--primary); color: #fff; }
.footer-social svg { width: 16px; height: 16px; }

/* === SCROLL REVEAL (arday252) — animations removed === */
.reveal {
  opacity: 1;
  transform: none;
}

/* === UTILITIES === */
.muted { color: var(--muted); font-size: 0.9rem; }
.spacer { height: 1rem; }
.flex { display: flex; gap: 0.75rem; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* === COURSE DETAIL HEADER === */
.course-hero {
  padding: 2rem 0;
}
.course-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}
.course-hero .course-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.course-hero .course-desc {
  font-size: 1rem;
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.7;
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}
.empty-state .empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}
.empty-state .empty-icon svg { width: 32px; height: 32px; stroke: var(--muted); fill: none; stroke-width: 1.5; }
.empty-state h3 { margin-bottom: 0.5rem; }
.empty-state p { color: var(--muted); margin-bottom: 1.5rem; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .header-inner { height: 56px; }
  .nav-links a { padding: 6px 10px; font-size: 0.85rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .stat .num { font-size: 1.4rem; }
  .grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .hero-ctas { flex-direction: column; align-items: center; }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 28px; padding: 36px 0 28px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .section { padding: 48px 0; }
  .course-hero .course-meta { gap: 6px; }
  .stat-strip { border-radius: 0 0 24px 24px; }
  .site-footer { border-radius: 24px 24px 0 0; }
}

@media (max-width: 480px) {
  .nav-links a.hide-mobile { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .footer-main { grid-template-columns: 1fr; }
  .auth-card { margin: 2rem 1rem; }
  .course-card-v2__body { padding: 1rem; }
}

/* ============================================================
   ADMIN PANEL
   ============================================================ */

/* === ADMIN LAYOUT === */
/* The Admin Panel is its own application context: a full-height section below
   the site header. The frontend footer is structurally excluded from Admin
   routes (see body.admin-page rules), so nothing participates below this
   section — the sidebar can be permanently anchored to the viewport. */
.admin-layout {
  min-height: calc(100vh - 64px);
  min-height: calc(100dvh - 64px);
}

/* === ADMIN HEADER === */
.admin-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  background: var(--header-bg, var(--surface));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.admin-logo {
  height: 36px;
  width: auto;
  display: block;
}
.admin-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-header-logout {
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  transition: background var(--transition), color var(--transition);
}
.admin-header-logout:hover {
  background: var(--surface-2);
  color: var(--danger, #ef4444);
}
.admin-theme-toggle {
  width: 36px;
  height: 36px;
}
.admin-body {
  display: flex;
  min-height: calc(100vh - 64px);
  min-height: calc(100dvh - 64px);
}

/* === SIDEBAR COLLAPSE/EXPAND ARROWS === */
.sidebar-collapse-btn,
.sidebar-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover,
.sidebar-expand-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.sidebar-collapse-btn svg,
.sidebar-expand-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.sidebar-collapse-btn {
  margin-left: auto;
}
.sidebar-expand-btn {
  float: left;
  margin-right: 12px;
  margin-top: 4px;
}
.admin-main::after {
  content: '';
  display: table;
  clear: both;
}

/* === SIDEBAR COLLAPSE STATE === */
.admin-layout.sidebar-collapsed .admin-sidebar {
  margin-left: -240px;
}
.admin-layout.sidebar-collapsed .admin-main {
  margin-left: 0;
}
.admin-layout.sidebar-collapsed .sidebar-collapse-btn {
  display: none;
}
.admin-layout:not(.sidebar-collapsed) .sidebar-expand-btn {
  display: none !important;
}

/* === DESKTOP BOTTOM NAV — Shows when sidebar collapsed === */
.admin-layout:not(.sidebar-collapsed) .admin-bottom-nav {
  display: none;
}
.admin-layout.sidebar-collapsed .admin-bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface);
  border-top: 1px solid var(--border-light);
  padding: 4px 8px;
  justify-content: space-evenly;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.admin-layout.sidebar-collapsed .admin-bottom-nav::-webkit-scrollbar {
  display: none;
}
.admin-layout.sidebar-collapsed .admin-bottom-nav .admin-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 6px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  flex: 1;
  min-width: 0;
  max-width: 90px;
  white-space: nowrap;
  border-radius: var(--radius-xs);
  transition: color var(--transition), background var(--transition);
}
.admin-layout.sidebar-collapsed .admin-bottom-nav .admin-bottom-nav-item:hover {
  background: var(--surface-2);
}
.admin-layout.sidebar-collapsed .admin-bottom-nav .admin-bottom-nav-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}
.admin-layout.sidebar-collapsed .admin-bottom-nav .admin-bottom-nav-item.active {
  color: var(--primary-deep);
}
.admin-layout.sidebar-collapsed .admin-bottom-nav .admin-bottom-nav-item.active svg {
  stroke: var(--primary-deep);
}
.admin-layout.sidebar-collapsed .admin-main.has-bottom-nav {
  padding-bottom: 70px;
}

/* === ADMIN SIDEBAR === */
/* Permanently visible navigation region for the Admin interface: viewport
   anchored just below the sticky site header (top:64px), full remaining
   height, own vertical scroll. It never depends on the height of the current
   table/card and never scrolls away with the Admin content. */
.admin-sidebar {
  position: fixed;
  top: 64px;
  left: 0;
  width: 240px;
  height: calc(100vh - 64px);
  height: calc(100dvh - 64px);
  background: var(--surface);
  border-right: 1px solid var(--border-light);
  padding: 24px 0;
  overflow-y: auto;
  z-index: 90;
  transition: margin-left 0.3s ease;
}
.admin-sidebar .sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 8px;
}
.admin-sidebar .sidebar-brand h3 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0;
}
.admin-nav { list-style: none; padding: 0; margin: 0; }
.admin-nav li { margin: 2px 8px; }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}
.admin-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.admin-nav a.active {
  color: var(--primary-deep);
  background: rgba(215,25,32,0.08);
  font-weight: 600;
}
.admin-nav a svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; flex-shrink: 0; }
.admin-nav .nav-divider { height: 1px; background: var(--border-light); margin: 8px 14px; }
.admin-nav .back-link { color: var(--accent); }

/* === ADMIN MAIN === */
/* Reserves the fixed sidebar's width (margin-left) and is constrained to the
   remaining viewport width (min-width:0), so a wide table can never widen the
   Admin column — the table scrolls inside its own wrapper instead. */
.admin-main {
  flex: 1;
  margin-left: 240px;
  min-width: 0;
  padding: 28px 32px;
  background: var(--bg);
  min-height: calc(100vh - 64px);
  min-height: calc(100dvh - 64px);
  transition: margin-left 0.3s ease;
  position: relative;
}
.admin-page-header {
  margin-bottom: 28px;
}
.admin-page-header h1 {
  font-size: 1.6rem;
  margin-bottom: 4px;
}
.admin-page-header p { color: var(--muted); font-size: 0.9rem; }

/* === ADMIN STAT CARDS === */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.admin-stat-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.admin-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-stat-icon svg { width: 22px; height: 22px; stroke: white; fill: none; stroke-width: 2; }
.admin-stat-icon.green { background: linear-gradient(135deg, #D71920, #8B0E0E); }
.admin-stat-icon.blue { background: linear-gradient(135deg, #3E92CC, #2563EB); }
.admin-stat-icon.amber { background: linear-gradient(135deg, #F2A93B, #D98A1F); }
.admin-stat-icon.purple { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.admin-stat-info .num {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}
.admin-stat-info .label { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }

/* === ADMIN TABLE === */
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}
.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
  flex-wrap: wrap;
}
.admin-card-header h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}
.admin-table-wrap { overflow-x: auto; min-width: 0; max-width: 100%; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.admin-table th {
  text-align: left;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.admin-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface-2); }
.admin-table .mono { font-family: var(--font-mono); font-size: 0.82rem; }
.admin-status-select {
  font-size: 0.78rem;
  padding: 4px 8px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--surface-1);
  color: var(--text);
  cursor: pointer;
  max-width: 140px;
}
.admin-status-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Fixed-layout tables (explicit <colgroup> widths): short columns stay
   compact and the flexible columns receive the available width instead of
   the browser inflating every column to fill the container. The min-width
   guarantees the Actions column always has room for the Edit/Delete/Manage
   buttons on a single row; below it the wrapper scrolls (never the page). */
.admin-table--fixed { table-layout: fixed; min-width: 1000px; }

/* === USER MANAGEMENT TABLE (scoped variant) ===
   Auto layout let the columns inflate from their content and pushed the table
   beyond the content area. Fixed layout uses exactly the <colgroup> widths
   below: compact columns stay compact, EMAIL is the flexible column that
   absorbs the remaining space, and cell padding is trimmed (16px -> 10px) to
   reclaim wasted horizontal space while staying readable. The min-width is the
   smallest width at which all nine columns stay readable; below it the table
   wrapper scrolls only because the viewport genuinely cannot fit them. */
.admin-table--users { table-layout: fixed; min-width: 1050px; }
.admin-table--users th,
.admin-table--users td { padding: 10px 10px; }
/* Long unbreakable emails must not spill over the cell into the Sex/Phone
   columns: when an address is longer than the Email column, break it onto a
   second line inside the cell instead. Short addresses stay on one line. */
.admin-table--users .email-cell { word-break: break-all; }

/* Shared action-icon sizing for every admin-table button (14px course
   baseline). Icon color comes from `stroke="currentColor"` on the SVG, so it
   inherits the button's text color in both themes. */
.admin-table .btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.user-avatar.placeholder {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-count {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
  margin-left: 4px;
}

/* Table badges */
.role-badge, .status-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  display: inline-block;
}
.role-badge.admin { background: rgba(139,92,246,0.1); color: #7C3AED; }
.role-badge.instructor { background: rgba(62,146,204,0.1); color: var(--accent); }
.role-badge.student { background: rgba(215,25,32,0.1); color: var(--primary-deep); }
.role-badge.super_admin { background: rgba(239,68,68,0.1); color: #DC2626; }
.status-badge.active { background: rgba(215,25,32,0.1); color: var(--primary-deep); }
.status-badge.suspended { background: rgba(239,68,68,0.1); color: #DC2626; }
.status-badge.published { background: rgba(215,25,32,0.1); color: var(--primary-deep); }
.status-badge.draft { background: rgba(242,169,59,0.12); color: var(--accent-warm-deep); }
.status-badge.archived { background: rgba(148,163,184,0.15); color: var(--muted); }

/* === ADMIN FILTERS === */
.admin-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-search {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 0.85rem;
  color: var(--text);
  font-family: inherit;
  min-width: 200px;
  transition: border-color var(--transition);
}
.admin-search:focus { outline: none; border-color: var(--primary); }
/* All search inputs share the brand button radius (12px). */
.manage-search, .media-search-input, .admin-media-search {
  border-radius: var(--radius-sm) !important;
}
input[placeholder="Search media"] {
  border-radius: var(--radius-sm) !important;
}
.admin-filter-select {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 7px 28px 7px 10px;
  font-size: 0.85rem;
  color: var(--text);
  font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%235B6270' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
}

/* Self-deleted (historical) account marker + filter toggle. */
.badge-soft {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  background: rgba(148, 163, 184, 0.16);
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.28);
  vertical-align: middle;
}
.admin-deleted-toggle.is-active {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--color-cherry-red, #D71920);
  background: #fff;
  color: var(--color-cherry-red, #D71920);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.admin-deleted-toggle.is-active:hover {
  background: rgba(215, 25, 32, 0.06);
  border-color: var(--color-cherry-red, #D71920);
  color: var(--color-cherry-red, #D71920);
}
.admin-deleted-toggle.is-active svg {
  flex: 0 0 auto;
}
.admin-deleted-toggle:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Admin user detail: collapsible deletion-status panel. */
.del-status summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.del-status summary::-webkit-details-marker { display: none; }
.del-status summary::after {
  content: "+";
  font-size: 1.1rem;
  line-height: 1;
  color: var(--muted);
}
.del-status[open] summary::after { content: "−"; }
.del-status-body {
  padding: 0 18px 16px;
  display: grid;
  gap: 10px;
}
.del-status-body > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.88rem;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.del-status-body > div > span { color: var(--muted); }
.del-status-body > div > strong { text-align: right; font-weight: 600; }

/* === ADMIN PAGINATION === */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  font-size: 0.82rem;
  color: var(--muted);
}
.admin-pagination .page-btns { display: flex; gap: 4px; }
.admin-pagination button {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 5px 12px;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition);
}
.admin-pagination button:hover { background: var(--border); }
.admin-pagination button:disabled { opacity: 0.4; cursor: default; }
.admin-pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* === ADMIN MODAL === */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.admin-modal-overlay.show { opacity: 1; visibility: visible; }
.admin-modal {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.2s;
}
.admin-modal-overlay.show .admin-modal { transform: translateY(0) scale(1); }
.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.admin-modal-header h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}
.admin-modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: background var(--transition);
}
.admin-modal-close:hover { background: var(--border); }
.admin-modal-body { padding: 20px; }
.admin-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
}

/* ─── Delete Course Confirm Modal ─── */
.delete-course-confirm {
  padding: 1rem 0;
}
.delete-course-confirm__enrolled {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.delete-course-confirm__enrolled-icon {
  font-size: 1.3rem;
  color: var(--primary);
}
.delete-course-confirm__instruction {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.delete-course-confirm__input {
  width: 100%;
  max-width: 400px;
  padding: 12px 14px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.delete-course-confirm__input:focus {
  border-color: var(--danger);
}
.delete-course-confirm__input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

/* === ADMIN RESPONSIVE === */
@media (max-width: 900px) {
  .admin-sidebar {
    position: fixed;
    left: -260px;
    top: 64px;
    width: 240px;
    z-index: 150;
    transition: left 0.3s;
    box-shadow: var(--shadow-lg);
  }
  .admin-sidebar.open { left: 0; }
  .admin-main { margin-left: 0; padding: 20px 16px; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-card-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .admin-stats { grid-template-columns: 1fr; }
  .admin-filters { flex-direction: column; }
  .admin-search { min-width: 100%; }
}

/* Admin Progress Dashboard responsive */
@media (max-width: 900px) {
  .admin-progress-layout { grid-template-columns: 1fr !important; }
}
.admin-progress-tree-item:hover { background: var(--surface-2) !important; }
.admin-progress-tree-item.active { background: var(--primary-light) !important; }

/* ============================================================
   COURSE BUILDER — Multi-Step Wizard
   ============================================================ */

.builder-layout {
  min-height: calc(100vh - 64px);
  background: var(--bg);
}

.builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  gap: 16px;
  flex-wrap: wrap;
}

.builder-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.builder-course-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  outline: none;
  min-width: 200px;
  transition: border-color var(--transition);
}
.builder-course-title:hover,
.builder-course-title:focus {
  border-color: var(--primary);
  background: var(--surface-2);
}

.builder-header-right {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Step indicator */
.builder-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 20px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
}

.builder-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition);
}
.builder-step:hover {
  color: var(--text);
}
.builder-step:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  border-radius: var(--radius-xs);
}
.builder-step.active {
  color: var(--primary-deep);
  font-weight: 600;
}
.builder-step.completed {
  color: var(--green);
}
.builder-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  border: 2px solid var(--border);
}
.builder-step.active .builder-step-num {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.builder-step.completed .builder-step-num {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.builder-step::after {
  content: '';
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 2px;
  background: var(--border);
}
.builder-step:last-child::after {
  display: none;
}
.builder-step.completed::after {
  background: var(--green);
}

/* Builder content */
.builder-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 28px;
  min-width: 0;
}

.builder-footer {
  display: flex;
  justify-content: space-between;
  padding: 16px 28px;
  border-top: 1px solid var(--border-light);
  background: var(--surface);
}

/* Builder grid layout (Step 1 & 3) */
.builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1.05fr);
  gap: 24px;
  align-items: start;
}

.builder-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.builder-sidebar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.builder-sidebar > .builder-card {
  min-height: 96px;
}

/* Summary step (Step 3) — horizontally centered */
.builder-summary {
  width: 100%;
  padding: 8px 0;
}
.builder-summary .builder-summary-card {
  max-width: 760px;
  margin-inline: auto;
}

.builder-media-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 4px;
}

.builder-media-grid .builder-card h3 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

@media (max-width: 768px) {
  .builder-grid {
    grid-template-columns: 1fr;
  }
  .builder-media-grid {
    grid-template-columns: 1fr;
  }
  .builder-sidebar {
    grid-template-columns: 1fr;
  }
}

.builder-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  padding: 20px;
}
.builder-card h3 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--ink);
}

/* Builder form elements */
.builder-card .form-group {
  margin-bottom: 14px;
}
.builder-card .form-group:last-child {
  margin-bottom: 0;
}
.builder-card label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 5px;
}

.builder-card .input,
.builder-card .select,
.builder-card textarea {
  width: 100%;
}

/* "What You'll Learn" learning-objective repeater */
.wyyl-items {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.6rem;
}
.wyyl-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.wyyl-item .input { flex: 1; }
.wyyl-item .btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.input-group {
  display: flex;
  align-items: center;
}
.input-prefix {
  padding: 8px 12px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-xs) 0 0 var(--radius-xs);
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}
.input-group .input {
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.form-row {
  display: flex;
  gap: 12px;
}

/* Visibility select with icon */
.visibility-select {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  background: var(--surface);
}
.visibility-select svg { color: var(--muted); flex-shrink: 0; }
.visibility-select .select {
  border: none;
  background: transparent;
  padding: 0;
  font-weight: 500;
}

/* Toggle switch (Tutor LMS style) */
.toggle-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.toggle-row span:first-child {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}
.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  transition: background 0.2s;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-row input[type="checkbox"] { display: none; }
.toggle-row input[type="checkbox"]:checked + .toggle-slider {
  background: var(--primary);
}
.toggle-row input[type="checkbox"]:checked + .toggle-slider::after {
  transform: translateX(20px);
}

/* Pricing radio buttons */
.pricing-radio {
  display: flex;
  gap: 16px;
}
.radio-label {
  display: flex !important;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.88rem;
}
.radio-label input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* Register: sex radio row */
.sex-row {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  padding: 0.2rem 0.3rem;
}
.sex-row strong {
  font-weight: 700;
}

/* Upload areas (Tutor LMS style) */
.upload-thumb, .upload-video {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface-2);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-thumb:hover, .upload-video:hover {
  border-color: var(--primary);
  background: rgba(215,25,32,0.03);
}
.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.upload-placeholder svg { opacity: 0.7; width: 28px; height: 28px; }
.upload-placeholder small {
  color: var(--muted);
  font-size: 0.72rem;
}
.btn-accent {
  background: var(--accent);
  color: #fff;
  padding: 8px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.85rem;
}
.btn-accent:hover {
  background: var(--primary-deep);
  color: #fff;
}
.add-from-url-link {
  color: var(--primary-deep);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}
.add-from-url-link:hover { color: var(--primary); }

/* Schedule calendar */
.schedule-calendar {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}
.schedule-calendar .input {
  width: 100%;
  margin-top: 4px;
}

/* Dynamic tag manager */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 4px;
  margin-bottom: 10px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(62, 146, 204, 0.12);
  color: var(--accent);
  border: 1px solid rgba(62, 146, 204, 0.25);
  border-radius: var(--radius-sm);
  padding: 4px 6px 4px 10px;
  font-size: 0.78rem;
  font-weight: 500;
}
.tag-chip-remove {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 2px;
}
.tag-chip-remove:hover {
  color: var(--danger);
}
.tag-add-row {
  display: flex;
  gap: 8px;
}
.tag-add-row .input {
  flex: 1;
  min-width: 0;
}
.tag-add-row .btn {
  flex-shrink: 0;
}

/* Video preview */
.video-preview {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: #000;
}
.video-preview iframe {
  width: 100%;
  height: 100%;
}

/* Media Library Modal */
.media-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.media-modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.media-modal {
  background: var(--surface);
  border-radius: 12px;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.media-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.media-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}
.media-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
}
.media-modal-close:hover { color: var(--ink); }

/* Video player modal (reusable Play/Preview for READY videos) */
.video-player-modal {
  max-width: 880px;
  width: 92%;
}
.video-player-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #000;
  overflow: hidden;
}
.video-player-stage video,
.video-player-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.media-modal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-light);
  padding: 0 20px;
}
.media-tab {
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.media-tab.active {
  color: var(--primary-deep);
  border-bottom-color: var(--primary-deep);
}
.media-tab:hover { color: var(--text); }
.media-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.media-grid-area {
  flex: 1;
  min-width: 0;
  padding: 16px 20px;
  overflow-y: auto;
  overflow-x: hidden;
}
.media-modal.video-mode {
  max-width: 980px;
}
.media-modal.video-mode .media-sidebar {
  width: 230px;
}
.media-sidebar {
  width: 260px;
  border-left: 1px solid var(--border-light);
  padding: 16px;
  overflow-y: auto;
}
.media-sidebar h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 12px;
}
.media-sidebar .form-group { margin-bottom: 12px; }
.media-sidebar label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
}
.media-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  gap: 8px;
}
.media-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.media-filter-row label {
  font-size: 0.82rem;
  color: var(--muted);
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.media-grid-item {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
  position: relative;
}
.media-grid-item:hover { border-color: var(--primary); }
.media-grid-item.selected { border-color: var(--primary-deep); }
.media-grid-item img { width: 100%; height: 100%; object-fit: cover; }
.media-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(220,38,38,0.9);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.media-grid-item:hover .media-delete-btn { opacity: 1; }
.media-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.media-upload-zone:hover {
  border-color: var(--primary);
  background: rgba(215,25,32,0.03);
}
.media-upload-zone p {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Upload area */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
  overflow: hidden;
}
.upload-area:hover {
  border-color: var(--primary);
  background: var(--surface-2);
}
.upload-placeholder span {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}
.upload-placeholder p {
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 4px;
}
.upload-placeholder small {
  color: var(--muted);
  font-size: 0.78rem;
}
.upload-preview {
  width: 100%;
  max-height: 250px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  display: block;
}
.upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: var(--radius-sm);
}
.upload-area:hover .upload-overlay {
  opacity: 1;
}
.upload-overlay span {
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--primary-deep);
  padding: 8px 16px;
  border-radius: 8px;
}
.upload-area.drag-over {
  border-color: var(--primary);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}
.video-progress-bar {
  width: 100%;
  max-width: 320px;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.video-upload-status {
  margin-top: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.video-upload-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}
.video-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.2s ease;
}
.video-status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.video-status-ready {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}
.video-status-failed {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}
.video-status-pending {
  background: rgba(234, 179, 8, 0.15);
  color: #ca8a04;
}
.video-status-error {
  display: block;
  margin-top: 4px;
  color: #dc2626;
  font-size: 0.75rem;
}
.video-quality-pills {
  display: inline-flex;
  gap: 4px;
  margin-left: 8px;
  vertical-align: middle;
}
.video-quality-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(234, 179, 8, 0.15);
  color: #ca8a04;
  white-space: nowrap;
}
.video-quality-pill.is-done {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}
.video-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 4px 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.video-meta span:first-child {
  color: var(--text);
  font-weight: 600;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-library-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  min-width: 0;
  width: 100%;
}
.video-library-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) 84px 56px 72px minmax(0, 1.4fr) auto;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  font-size: 0.82rem;
}
.video-library-row > span {
  min-width: 0;
}
.video-library-row > span:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
  align-items: center;
}
.video-library-row .btn {
  white-space: nowrap;
  padding: 3px 8px;
  font-size: 0.72rem;
}
.video-library-row.video-library-head {
  border: none;
  background: transparent;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.72rem;
}
.video-library-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Status cell is one coherent inline block: the status badge and the
   quality pills sit on the same horizontal row with a shared vertical
   centerline (Ready | 360p | 480p | ...). On narrow widths they wrap as a
   group instead of overflowing the cell. */
.video-library-status-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.video-library-status-cell .video-quality-pills { margin-left: 0; }
.video-library-status-cell .video-status-error { flex-basis: 100%; margin-top: 0; }
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Summary list */
.summary-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}
.summary-item:last-child { border-bottom: none; }
.summary-item span { color: var(--muted); }
.summary-item strong { color: var(--ink); font-weight: 500; }

/* ============================================================
   CURRICULUM BUILDER (Step 2)
   ============================================================ */

.builder-curriculum {
  max-width: 800px;
  margin: 0 auto;
}

.curriculum-header {
  margin-bottom: 24px;
}
.curriculum-header h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.curriculum-topics {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Topic card */
.curriculum-topic {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.topic-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-light);
}
.topic-drag {
  cursor: grab;
  color: var(--muted);
  font-size: 1.1rem;
  user-select: none;
}
.topic-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  flex-shrink: 0;
}
.topic-title-input {
  flex: 1;
  border: 1px solid transparent !important;
  background: transparent !important;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 4px 8px !important;
}
.topic-title-input:hover,
.topic-title-input:focus {
  border-color: var(--border) !important;
  background: var(--surface) !important;
}

.topic-lessons {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Curriculum items (lessons, quizzes) */
.curriculum-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  transition: background var(--transition);
}
.curriculum-item:hover {
  background: var(--surface-3);
}

.curriculum-item-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.curriculum-item-info {
  flex: 1;
  min-width: 0;
}
.curriculum-item-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.curriculum-item-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--muted);
}

.curriculum-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.btn-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition);
}
.btn-icon:hover {
  background: var(--surface-3);
  border-color: var(--border);
}
.btn-icon.btn-danger:hover {
  background: #FEE2E2;
  border-color: #FECACA;
  color: #DC2626;
}

.badge-sm {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.topic-add {
  padding-top: 6px;
}

.btn-add-topic {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border-style: dashed;
  font-size: 0.9rem;
}

/* ============================================================
   QUIZ BUILDER — SPLIT-VIEW MODAL
   ============================================================ */
.quiz-builder-modal { width: 100vw; height: 100vh; max-width: none; max-height: none; border-radius: 0; border: none; box-shadow: none; margin: 0; padding: 0; transform: none; display: flex; flex-direction: column; }
/* Override overlay for quiz fullscreen */
#quiz-modal { padding: 0 !important; background: var(--surface) !important; backdrop-filter: none !important; align-items: stretch !important; justify-content: stretch !important; }
.quiz-builder-body { display: flex; gap: 0; flex: 1; min-height: 0; padding: 0 !important; overflow: hidden; height: 100%; }
/* Fullscreen header */
#quiz-modal .admin-modal-header { border-radius: 0; }
/* Fullscreen body fills remaining space */
#quiz-modal .admin-modal-body { flex: 1; min-height: 0; padding: 0 !important; overflow: hidden; height: calc(100vh - 56px); }
.quiz-builder-left {
  flex: 1 1 55%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-light);
  overflow-y: auto;
}
.quiz-builder-right {
  flex: 1 1 45%;
  min-width: 0;
  overflow-y: auto;
  padding: 20px;
}
.quiz-builder-section { padding: 16px 20px; }
.quiz-builder-section + .quiz-builder-section { border-top: 1px solid var(--border-light); }
.quiz-builder-section-title { font-size: 0.85rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.quiz-builder-right .form-group { margin-bottom: 14px; }
.quiz-builder-right .form-row { display: flex; gap: 12px; }
.quiz-builder-right .form-row .form-group { flex: 1; }
.quiz-preview-box {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  min-height: 120px;
}
.quiz-preview-box .preview-question-text { font-size: 0.95rem; font-weight: 500; margin-bottom: 10px; line-height: 1.5; }
.quiz-preview-box .preview-option { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 0.88rem; }
.quiz-preview-box .preview-option.correct { color: var(--primary); font-weight: 600; }
.quiz-preview-box .preview-badge { display: inline-block; font-size: 0.75rem; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--primary); color: #fff; margin-bottom: 8px; }
.quiz-builder-right .quiz-builder-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-light); }
.quiz-builder-placeholder { text-align: center; color: var(--muted); font-size: 0.88rem; padding: 24px 0; }
.quiz-builder-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 0.85rem; margin-bottom: 12px; }

/* ============================================================
   STUDENT QUIZ INTERFACE
   ============================================================ */
#student-quiz-container {
  background: var(--surface-2);
  min-height: 100%;
  overflow-y: auto;
  padding: 32px 28px;
}
.student-quiz { max-width: 720px; margin: 0 auto; }
.quiz-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 300px; }
.student-quiz__header { margin-bottom: 28px; }
.student-quiz__title { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; color: var(--text-primary); }
.student-quiz__meta { display: flex; gap: 16px; font-size: 0.85rem; color: var(--muted); flex-wrap: wrap; }
.student-quiz__body { display: flex; flex-direction: column; gap: 20px; margin-bottom: 28px; }
.quiz-question { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 22px 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.quiz-question__text { font-size: 1rem; font-weight: 600; line-height: 1.6; margin-bottom: 14px; color: var(--text-primary); }
.quiz-question__num { color: var(--primary); margin-right: 6px; }
.quiz-question__answers { display: flex; flex-direction: column; gap: 8px; }
.quiz-answer { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--border-light); border-radius: var(--radius-xs); cursor: pointer; transition: all 0.15s; font-size: 0.92rem; background: var(--surface); }
.quiz-answer:hover { border-color: var(--primary); background: var(--surface-2); }
.quiz-answer input[type="radio"] { accent-color: var(--primary); width: 18px; height: 18px; }
.quiz-answer__text { flex: 1; color: var(--text-primary); }
.quiz-answer--checkbox { border-color: var(--border-light); }
.quiz-answer--checkbox input[type="checkbox"] { accent-color: var(--primary); width: 18px; height: 18px; }
.quiz-checkbox-group { display: flex; flex-direction: column; gap: 8px; }
.quiz-textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-xs); font-size: 0.95rem; resize: vertical; font-family: inherit; line-height: 1.5; transition: border-color 0.2s; }
.quiz-textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 59,130,246), 0.15); }
.student-quiz__footer { display: flex; gap: 12px; padding-top: 4px; }

/* ============================================================
   FLOATING QUIZ RESULT MODAL
   ============================================================ */
.quiz-result-modal {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.quiz-result-modal.show { opacity: 1; pointer-events: auto; }
.quiz-result-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.quiz-result-modal__content {
  position: relative; z-index: 1;
  background: var(--surface);
  border-radius: 16px;
  padding: 40px 36px;
  max-width: 400px; width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}
.quiz-result-modal.show .quiz-result-modal__content { transform: scale(1); }
.quiz-result-modal__icon { font-size: 3rem; margin-bottom: 8px; }
.quiz-result-modal__title { font-size: 1.25rem; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.quiz-result-modal__score { font-size: 3rem; font-weight: 800; margin: 8px 0; }
.quiz-result-modal__score.passed { color: #22c55e; }
.quiz-result-modal__score.failed { color: #ef4444; }
.quiz-result-modal__detail { font-size: 0.9rem; color: var(--muted); margin-bottom: 4px; }
.quiz-result-modal__threshold { font-size: 0.82rem; color: var(--muted); margin-bottom: 20px; }
.quiz-result-modal__close { min-width: 120px; }

/* ============================================================
   QUIZ EDITOR (builder)
   ============================================================ */

.quiz-question-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  margin-bottom: 8px;
}
.quiz-question-order {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}
.quiz-question-main {
  flex: 1;
  min-width: 0;
}
.quiz-question-text {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quiz-question-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 3px;
  font-size: 0.75rem;
  color: var(--muted);
}
.quiz-question-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.quiz-options-group {
  margin-bottom: 14px;
}
.quiz-options-group > label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 5px;
}
.quiz-option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.quiz-option-row .quiz-option-correct {
  flex-shrink: 0;
}
.quiz-option-row .quiz-option-text {
  flex: 1;
  min-width: 0;
}
.quiz-option-label {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 500;
}

/* ============================================================
   TOAST
   ============================================================ */

.app-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: min(90vw, 480px);
  text-align: center;
}
.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.app-toast.error {
  background: #DC2626;
}

/* ============================================================
   RICH TEXT EDITOR
   ============================================================ */

.rich-editor-toolbar {
  display: flex;
  gap: 2px;
  padding: 6px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  flex-wrap: wrap;
}
.rich-editor-toolbar button {
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text);
  transition: all var(--transition);
}
.rich-editor-toolbar button:hover {
  background: var(--surface);
  border-color: var(--border);
}

.rich-editor {
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-xs) var(--radius-xs);
  background: var(--surface);
  font-size: 0.9rem;
  line-height: 1.7;
  outline: none;
  color: var(--text);
}
.rich-editor:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

/* Builder responsive */
@media (max-width: 900px) {
  .builder-grid {
    grid-template-columns: 1fr;
  }
  .builder-sidebar {
    position: static;
  }
  .builder-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .builder-steps {
    padding: 12px 16px;
    gap: 0;
    overflow-x: auto;
  }
  .builder-step {
    padding: 6px 12px;
    font-size: 0.82rem;
  }
  .builder-step::after {
    width: 20px;
    right: -10px;
  }
  .builder-content {
    padding: 16px;
  }
  .builder-footer {
    padding: 12px 16px;
  }
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.status-badge.active, .status-badge.published {
  background: rgba(215,25,32,0.12);
  color: var(--green-deep);
}
.status-badge.draft {
  background: rgba(242,169,59,0.12);
  color: var(--accent-warm-deep);
}
.status-badge.review {
  background: rgba(62,146,204,0.12);
  color: var(--accent);
}
.status-badge.suspended, .status-badge.revoked {
  background: rgba(239,68,68,0.12);
  color: #DC2626;
}
.status-badge.completed {
  background: rgba(215,25,32,0.12);
  color: var(--green-deep);
}
.status-badge.expired {
  background: rgba(242,169,59,0.12);
  color: var(--accent-warm-deep);
}
.status-badge.cancelled {
  background: rgba(107,114,128,0.12);
  color: #6B7280;
}

/* Role badges */
.role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.role-badge.student {
  background: rgba(62,146,204,0.12);
  color: var(--accent);
}
.role-badge.instructor {
  background: rgba(215,25,32,0.12);
  color: var(--green-deep);
}
.role-badge.admin, .role-badge.super_admin {
  background: rgba(139,92,246,0.12);
  color: #7C3AED;
}
.role-badge.leader {
  background: rgba(242,169,59,0.12);
  color: var(--accent-warm-deep);
}


/* === Course table compact action group === */
.course-actions { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }
.course-actions .btn { padding: 6px 10px; font-size: 0.78rem; border-radius: 8px; gap: 6px; min-height: 32px; white-space: nowrap; }
.course-actions .btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.course-actions .btn span { line-height: 1; }
.course-actions .course-action-danger { color: var(--danger); }
.course-actions .course-action-danger:hover { border-color: var(--danger); color: var(--danger); }

/* === Manage workspace (full-screen) === */
.manage-workspace .manage-back { margin-bottom: 4px; }
.manage-workspace { min-width: 0; max-width: 100%; }
.manage-notice { padding: 10px 14px; border-radius: 8px; margin: 12px 0; font-size: 0.85rem; font-weight: 500; display: none; }
.manage-notice.success { background: rgba(215,25,32,.12); color: var(--success); border: 1px solid rgba(215,25,32,.3); }
.manage-notice.error { background: rgba(239,68,68,.12); color: var(--danger); border: 1px solid rgba(239,68,68,.3); }
.manage-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 4px 0 0; }
.manage-tab { border: none; background: transparent; padding: 10px 18px; font-family: inherit; font-size: 0.88rem; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; transition: color .15s; }
.manage-tab:hover { color: var(--ink); }
.manage-tab.active { color: var(--ink); border-bottom-color: var(--primary); }
.manage-tab-count { font-size: 0.75rem; color: var(--muted); margin-left: 2px; }
.manage-toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border-light); flex-wrap: wrap; }
.manage-search { flex: 1; min-width: 200px; max-width: 360px; }
.manage-sort { width: auto; }
.manage-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.manage-actions .btn { border-radius: 8px; }
.manage-actions .btn svg { width: 14px; height: 14px; }
.row-muted td { opacity: .55; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state p { margin: 4px 0; }
.manage-check { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.manage-check:disabled { cursor: not-allowed; }
.course-actions .btn:disabled, .manage-actions .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

/* === Universal bulk selection (admin tables) === */
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 20px 4px; }
.bulk-bar--flush { padding: 4px 0 12px; }
.bulk-bar .bulk-count { font-size: 0.82rem; color: var(--muted); min-width: 68px; }
.bulk-bar .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.bulk-check-cell { width: 34px; text-align: center; }
.bulk-check-cell .manage-check { vertical-align: middle; }
@media (max-width: 767.98px) {
  .admin-table td.bulk-check-cell {
    justify-content: flex-start;
    min-height: auto;
    padding: 6px 0 0;
    border-bottom: none;
  }
  .admin-table td.bulk-check-cell::before { content: none; }
  .bulk-bar { padding: 10px 14px 4px; }
  .bulk-bar--flush { padding: 4px 0 12px; }
}

/* === COURSE LANDING PAGE (hybrid: hero + stats + sidebar + curriculum) === */
.svg-ic { width: 20px; height: 20px; flex-shrink: 0; }

.course-breadcrumb {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--muted); margin-bottom: 1rem;
}
.course-breadcrumb a { color: var(--accent); text-decoration: none; font-weight: 500; }
.course-breadcrumb a:hover { text-decoration: underline; }
.course-breadcrumb .cb-sep { color: var(--border); }
.course-breadcrumb .cb-current { color: var(--muted); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.course-landing .course-hero { padding: 0.25rem 0 1rem; }
.course-landing .course-hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}
.course-landing .course-desc {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 72ch;
  line-height: 1.75;
  margin-bottom: 1rem;
}

/* Stats strip */
.course-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 1.25rem 0 2rem;
}
.course-stat {
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
}
.course-stat__icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); color: var(--primary-deep);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.course-stat__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.course-stat .cs-num { font-family: var(--font-mono); font-weight: 600; font-size: 1.02rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-stat .cs-label { font-size: 0.76rem; color: var(--muted); }

/* Two-column layout */
.course-page { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2rem; align-items: start; margin-bottom: 1.5rem; }
.course-main { min-width: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.course-sidebar { display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: 90px; }

/* Sidebar card — compact, tight vertical rhythm (Udemy-style) */
.sidebar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 30px rgba(18,32,67,0.06); }
.sidebar-card__body { padding: 0.8rem 1.25rem 0.85rem; }
.sidebar-card__foot { padding: 0.7rem 1.25rem 0.9rem; background: var(--surface-3); border-top: 1px solid var(--border-light); }
.price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 0.5rem; }
.price-current { font-family: var(--font-mono); font-size: 1.9rem; font-weight: 700; color: var(--ink); }
.price-old { text-decoration: line-through; color: var(--muted); font-family: var(--font-mono); font-size: 0.95rem; }
.price-save {
  background: rgba(242,169,59,0.14); color: var(--accent-warm-deep); font-size: 0.75rem; font-weight: 700;
  padding: 3px 8px; border-radius: var(--radius-sm); font-family: var(--font-mono);
}
.price-note { color: var(--muted); font-size: 0.85rem; }

.btn-block { width: 100%; display: flex; justify-content: center; align-items: center; box-sizing: border-box; }

.course-includes { list-style: none; padding: 0; margin: 0.35rem 0 0; }
.course-includes li {
  display: flex; align-items: center; gap: 10px; padding: 4px 0; border-top: 1px solid var(--border-light);
  font-size: 0.9rem; color: var(--text); line-height: 1.4;
}
.course-includes li:first-child { border-top: none; }
.course-includes li .svg-ic { color: var(--primary-deep); }

/* Sidebar "This course details" sub-panel */
.course-details-panel {
  margin-top: 0.9rem;
  padding: 0.8rem 1rem 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 12px;
}
.course-details-panel .kicker { display: block; margin-bottom: 0.3rem; font-weight: 700; }
.course-details-panel .course-includes li { border-top: none; padding: 3px 0; font-size: 0.86rem; font-weight: 400; }
.course-details-panel .cd-details__label { font-weight: 700; color: var(--color-dark-maroon); }
.course-details-panel .cd-details__value { font-weight: 400; color: var(--text); }
.course-details-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-light);
}
.course-details-action {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.course-details-action:hover { color: var(--primary-deep); }
.course-details-action .svg-ic {
  width: 36px;
  height: 36px;
  padding: 9px;
  box-sizing: border-box;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
}
.course-details-action.is-saved { color: var(--primary-deep); }
.course-details-action.is-saved .svg-ic { background: var(--primary-deep); }

/* Share sheet modal (course details "Share" button) */
.share-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 3500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(18, 32, 67, 0.5);
}
.share-sheet {
  width: min(430px, 100%);
  max-height: min(86vh, 700px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 18px;
  padding: 16px 18px 20px;
  box-shadow: 0 24px 64px rgba(18, 32, 67, 0.35);
}
.share-sheet__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.share-sheet__head > .svg-ic { width: 20px; height: 20px; color: var(--ink); flex-shrink: 0; }
.share-sheet__title { flex: 1; font-weight: 700; font-size: 1.02rem; color: var(--ink); }
.share-sheet__close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.share-sheet__close:hover { background: var(--surface-2); color: var(--ink); }
.share-sheet__close .svg-ic { width: 16px; height: 16px; }
.share-sheet__link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 10px;
}
.share-sheet__link-ic,
.share-sheet__copy {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-sheet__link-ic .svg-ic { width: 18px; height: 18px; }
.share-sheet__copy { cursor: pointer; color: var(--ink); }
.share-sheet__copy:hover { border-color: var(--primary); color: var(--primary-deep); }
.share-sheet__copy .svg-ic { width: 18px; height: 18px; }
.share-sheet__link-text { flex: 1; min-width: 0; display: block; }
.share-sheet__link-text strong {
  display: block;
  font-size: 0.88rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.share-sheet__link-text > span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.share-sheet__label { margin: 16px 0 10px; font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.share-sheet__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; }
.share-sheet__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
}
.share-sheet__item svg { width: 40px; height: 40px; }
.share-sheet__item span {
  font-size: 0.72rem;
  line-height: 1.25;
  color: var(--text);
  text-align: center;
}
.share-sheet__item:hover span { color: var(--primary-deep); }

/* Share via email form */
.share-email { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.25rem; }
.share-email__label { display: block; font-weight: 600; font-size: 0.85rem; color: var(--ink); margin-bottom: 0.4rem; }
.share-email__input {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
}
.share-email__input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15); }
.share-email__hint { margin: 0.35rem 0 0; font-size: 0.75rem; color: var(--muted); }
.share-email__errors { margin: 0.35rem 0 0; padding: 0; list-style: none; }
.share-email__errors li { font-size: 0.78rem; color: #dc2626; line-height: 1.45; }
.share-email__success { margin: 0; font-size: 0.88rem; font-style: italic; font-weight: 600; color: var(--primary-deep); }
.share-email__foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.share-email__note { font-size: 0.72rem; color: var(--muted); max-width: 220px; line-height: 1.4; }
.share-email__actions { display: flex; align-items: center; gap: 0.5rem; }
.share-email__cancel {
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 1.1rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.share-email__cancel:hover { border-color: var(--ink); }
.share-email__send {
  background: var(--primary);
  border: none;
  border-radius: 10px;
  padding: 0.55rem 1.4rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}
.share-email__send:hover { background: var(--primary-deep); }
.share-email__send:disabled { opacity: 0.6; cursor: default; }

@media (max-width: 480px) {
  .share-sheet__grid { grid-template-columns: repeat(3, 1fr); }
}

/* Sidebar "Course Includes" card */
.sidebar-includes-card .includes-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.3rem;
}
.sidebar-includes-card .includes-head .svg-ic { width: 18px; height: 18px; color: var(--primary-deep); }
.sidebar-includes-card .includes-head h3 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.sidebar-includes-card .course-includes { margin-top: 0.4rem; }
.sidebar-includes-card .course-includes li { border-top: none; padding: 6px 0; }

/* Course content / curriculum */
.course-content { padding: 1.5rem; }
.course-content-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; margin-bottom: 0.5rem; }
.cc-counts { display: block; font-size: 0.82rem; color: var(--muted); font-family: var(--font-mono); margin-top: 6px; }

/* About / What you'll learn */
.course-about { padding: 1.5rem; }
.course-about__text { color: var(--muted); line-height: 1.75; white-space: pre-line; }

/* Udemy-style "What you'll learn" checklist — balanced two-column grid */
.course-learn { padding: 1.5rem; }
.course-learn-grid {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.5rem;
  row-gap: 0.85rem;
}
.course-learn-grid__item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
  min-width: 0;
}
.course-learn-grid__check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--color-cherry-red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.course-learn-grid__check .svg-ic { width: 12px; height: 12px; }
.course-learn-grid__text { min-width: 0; }

@media (max-width: 768px) {
  .course-learn-grid { grid-template-columns: 1fr; }
}

/* What you'll learn: collapse after three rows (no fade overlay) */
.course-learn-wrap { position: relative; }
.course-learn-wrap.is-collapsed {
  max-height: var(--learn-cap, 220px);
  overflow: hidden;
}
.course-learn-toggle[hidden] { display: none; }

/* Curriculum section tabs */
.course-tabs {
  display: flex;
  gap: 1.75rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1.1rem;
}
.course-tab {
  position: relative;
  padding: 0.35rem 0 0.65rem;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.course-tab:hover { color: var(--ink); }
.course-tab.is-active { color: var(--ink); }
.course-tab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--primary);
}
.course-tab-panel { display: none; }
.course-tab-panel.is-active { display: block; }

/* Curriculum: default max 10 sections, reveal the rest via See More button */
.curriculum-section.is-more-hidden { display: none; }
.curriculum-more { width: 100%; font-size: 1rem; padding: 14px 24px; margin-top: 0.75rem; }
.curriculum-more[hidden] { display: none; }

/* Subtle panel treatment (Learning outcomes + Course Content) */
.course-landing .card.course-about,
.course-landing .card.course-content {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: none;
  padding: 1.35rem 1.5rem;
}
.course-landing .card.course-about:hover,
.course-landing .card.course-content:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border-light);
}
@media (max-width: 768px) {
  .course-landing .card.course-about,
  .course-landing .card.course-content { padding: 1rem 1.1rem; }
}

/* Instructor */
.instructor-card { display: flex; gap: 1rem; align-items: center; padding: 1.25rem 1.5rem; }
.instructor-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.2rem;
}

/* Instructor profile (below Related Courses) */
.course-instructor-profile { padding: 0.35rem 0 0.1rem; }
.course-instructor-profile .kicker { display: block; }
.course-instructor-profile__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.55rem;
  color: var(--ink);
  margin: 0.2rem 0 0.9rem;
}
.course-instructor-profile__row { display: flex; align-items: center; gap: 1.1rem; }
.course-instructor-profile .instructor-avatar { width: 84px; height: 84px; font-size: 1.7rem; }
.course-instructor-profile__meta { margin: 0; font-size: 0.95rem; }

/* Certificate banner */
.cert-banner {
  display: flex; gap: 1rem; align-items: center; padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--surface-2), var(--surface)); border: 1.5px dashed var(--primary);
  border-radius: var(--radius);
}
.cert-banner__icon {
  width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.cert-banner__icon svg { width: 24px; height: 24px; }

/* Related courses */
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
/* Related-course cards on the course page are static (no hover animations). */
.related-grid .course-card-v2,
.related-grid .course-card-v2:hover { transform: none; transition: none; }
.related-grid .course-card-v2:hover .course-card-v2__image img { transform: none; }

/* Mobile sticky CTA */
.mobile-cta { display: none; }
.mobile-cta-spacer { display: none; }

@media (max-width: 1024px) {
  .course-page { grid-template-columns: 1fr; gap: 1.25rem; }
  .course-sidebar { position: static; order: 2; }
  .course-main { order: 1; }
}
@media (max-width: 768px) {
  .course-stats { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: 1fr; }
  .course-content { padding: 1.25rem; }
  .course-content-head { align-items: flex-start; }
  .mobile-cta {
    display: flex; align-items: center; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 10px 16px; box-shadow: 0 -6px 20px rgba(0,0,0,0.08);
  }
  .mobile-cta__price { font-family: var(--font-mono); font-size: 1.05rem; color: var(--ink); white-space: nowrap; }
  .mobile-cta__price strong { color: var(--primary-deep); }
  .mobile-cta__price .price-old { font-size: 0.8rem; }
  .mobile-cta .btn { margin: 0; flex: 1; }
  .mobile-cta-spacer { display: block; height: 78px; }
}

/* ============================================================
   COURSE DETAIL — REDESIGN (matches Ishaaar Institute mockup)
   ============================================================ */
.cd-h2 { font-size: 1.32rem; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; margin: 0 0 1rem; }
.cd-h3 { font-size: 1.02rem; font-weight: 600; color: var(--ink); margin: 0 0 0.75rem; }

/* ── Hero (full-bleed dark banner, same shape as contact/about heroes) ── */
.cd-hero {
  position: relative;
  background: var(--hero-bg);
  color: #fff;
  overflow: hidden;
  min-height: var(--hero-height);
  padding: clamp(30px, 3.8vw, 48px) 0 clamp(34px, 4.2vw, 52px);
  margin-bottom: 0;
}
.cd-hero__container { position: relative; z-index: 2; }
.cd-back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: rgba(255,255,255,0.82); font-size: 0.88rem; font-weight: 600;
  text-decoration: none; margin-bottom: 1.05rem;
}
.cd-back:hover { color: #fff; }
.cd-hero__badges { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.9rem; position: relative; z-index: 1; }
.cd-badge {
  display: inline-flex; align-items: center;
  padding: 0.32rem 0.8rem; border-radius: var(--radius-sm);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.01em;
}
.cd-badge--cat { background: var(--color-cherry-red); color: #fff; }
.cd-badge--level { background: #293D5D; color: #fff; }
.cd-hero__title {
  line-height: 1.12; letter-spacing: -0.02em; font-weight: 800;
  margin: 0; position: relative; z-index: 1; color: #fff;
  white-space: nowrap; max-width: 100%;
}

/* ── Card 1: Overview / Requirements / Outcomes tabs ── */
.cd-tabs-card {
  background: var(--surface);
  border: 1px solid var(--color-divider);
  box-shadow: var(--shadow-page-card);
  padding: 1.5rem 1.75rem 1.75rem;
}
.cd-includes-card,
.cd-curriculum-card,
.cd-instructor-card {
  margin-bottom: 1.5rem;
}
.course-landing .cd-tabs-card.course-content { background: var(--surface); box-shadow: var(--shadow-page-card); padding: 1.5rem 1.75rem 1.75rem; }
.cd-tabs-card .course-tabs { border-bottom-color: var(--color-divider); }
.cd-tabs-card .course-tab.is-active { color: var(--color-cherry-red); }
.cd-tabs-card .course-tab.is-active::after { background: var(--color-cherry-red); }
.cd-about.is-clamped .cd-about__text {
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.cd-about__text { color: var(--muted); line-height: 1.75; }
.cd-about__text p { margin: 0 0 0.75rem; }
.cd-about__text p:last-child { margin-bottom: 0; }
.cd-showmore {
  display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap;
  background: none; border: none; padding: 0.4rem 0 0;
  font-family: inherit; font-size: 0.9rem; font-weight: 700;
  color: var(--color-cherry-red); cursor: pointer;
}
.cd-showmore .svg-ic { width: 14px; height: 14px; transition: transform var(--transition); }
.cd-showmore[hidden] { display: none; }
.cd-showmore[aria-expanded="true"] .svg-ic { transform: rotate(180deg); }
.cd-showmore:hover { color: var(--red-hover); }
.cd-divider { height: 1px; background: var(--color-divider); border: 0; margin: 1.5rem 0; }
.cd-learn { margin-top: 0; }

/* ── Card 2: Course Includes (3×2 grid with dividers) ── */
.cd-includes-card {
  background: var(--surface);
  border: 1px solid var(--color-divider);
  box-shadow: var(--shadow-page-card);
  padding: 1.5rem 1.75rem 1.75rem;
}
.cd-includes-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--color-divider); border-radius: 12px; overflow: hidden;
}
.cd-includes-grid__item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 1rem 1.15rem; font-size: 0.9rem; color: var(--text); line-height: 1.4;
  border-right: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}
.cd-includes-grid__item:nth-child(3n) { border-right: none; }
.cd-includes-grid__item:nth-last-child(-n+3) { border-bottom: none; }
.cd-includes-grid__item .svg-ic { width: 18px; height: 18px; color: var(--color-cherry-red); flex-shrink: 0; }

/* ── Card 3: Curriculum ── */
.cd-curriculum-card {
  background: var(--surface);
  border: 1px solid var(--color-divider);
  box-shadow: var(--shadow-page-card);
  padding: 1.5rem 1.75rem 1.75rem;
}
.cd-curriculum-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; margin-bottom: 0.35rem; }
.cd-curriculum-head .cc-counts { margin-top: 0; display: flex; align-items: center; flex-wrap: wrap; }
.cc-sep { font-style: normal; margin: 0 0.65rem; color: var(--muted); }
.cd-expand-all {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: none; border: none; padding: 0.25rem 0;
  font-family: inherit; font-size: 0.9rem; font-weight: 700;
  color: var(--color-cherry-red); cursor: pointer; white-space: nowrap;
}
.cd-expand-all:hover { color: var(--red-hover); }
.cd-expand-all .svg-ic { width: 14px; height: 14px; transition: transform var(--transition); }
.cd-expand-all.is-open .svg-ic { transform: rotate(180deg); }

.cd-curriculum-card .curriculum-section { margin-top: 0.6rem; border-color: var(--color-divider); border-radius: 12px; }
.cd-curriculum-card .curriculum-section.open .curriculum-section__head { background: var(--surface-2); }
.cd-curriculum-card .curriculum-section__head { padding: 0.8rem 1rem; gap: 0.85rem; }
.cd-curriculum-card .curriculum-section__num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 0.35rem; border-radius: 10px;
  background: var(--color-soft-red-tint); color: var(--color-cherry-red);
  font-size: 0.82rem; font-weight: 700; flex-shrink: 0;
  font-family: var(--font-mono);
}
.cd-curriculum-card .curriculum-section__chevron { margin-left: 0.15rem; }
.cd-curriculum-card .curriculum-lecture { padding: 0.65rem 1rem 0.65rem 3.9rem; }
.cd-curriculum-card .curriculum-section__body .muted { padding-left: 3.9rem !important; }

/* ── Card 4: Meet Your Instructor ── */
.cd-instructor-card {
  background: var(--surface);
  border: 1px solid var(--color-divider);
  box-shadow: var(--shadow-page-card);
  padding: 1.5rem 1.75rem 1.75rem;
}
.cd-instructor__divider {
  height: 1px;
  background: var(--color-divider);
  margin: 0 0 1.5rem;
}
.cd-instructor__body {
  border: 1px solid var(--color-divider);
  border-radius: 12px;
  padding: 1.5rem;
}
.cd-instructor__row { display: grid; grid-template-columns: minmax(0, 2fr) auto minmax(0, 1fr); gap: 1.75rem; align-items: start; }
.cd-instructor__profile { display: flex; gap: 1.25rem; align-items: flex-start; min-width: 0; }
.cd-instructor__avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 66px; height: 66px; border-radius: 50%;
  background: var(--color-soft-red-tint); color: var(--color-cherry-red);
  font-size: 1.25rem; font-weight: 700;
  overflow: hidden;
}
.cd-instructor__avatar img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
}
.cd-instructor__name { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin: 0 0 0.15rem; }
.cd-instructor__role { font-size: 0.88rem; font-weight: 600; color: var(--color-cherry-red); margin: 0 0 0.5rem; }
.cd-instructor__bio {
  font-size: 0.88rem; line-height: 1.6; color: var(--muted); margin: 0.5rem 0 0; max-width: 52ch;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.cd-instructor-card--full .cd-instructor__bio { display: block; -webkit-line-clamp: none; overflow: visible; }
.cd-instructor__more {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 0.6rem; font-size: 0.85rem; font-weight: 700;
  color: var(--color-cherry-red); text-decoration: none;
}
.cd-instructor__more:hover { color: var(--red-hover); text-decoration: underline; }
.cd-instructor__more[hidden] { display: none; }
.cd-instructor__more-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--ink); color: #fff; flex-shrink: 0;
}
.cd-instructor__more-icon svg { width: 12px; height: 12px; display: block; }
.cd-instructor__stats {
  list-style: none; padding: 0 0 0 1.75rem; margin: 0;
  border-left: 1px solid var(--color-divider);
  display: flex; flex-direction: column; gap: 0.9rem;
}
.cd-instructor__stats li {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.88rem; font-weight: 600; color: var(--text); white-space: nowrap;
}
.cd-instructor__stat-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--color-soft-red-tint); color: var(--color-cherry-red);
  flex-shrink: 0;
}
.cd-instructor__stat-icon .svg-ic { width: 16px; height: 16px; }

/* Instructor social links — 3-per-row grid of outlined icon chips.
   Each chip: light border + white background + bigger cherry-red glyph.
   A vertical light line divides this block from the stats block, and the
   icons are kept away from the card's right edge. */
.cd-instructor__social {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  gap: 10px;
  align-content: center;
  justify-content: start;
  align-self: stretch;
  border-left: 1px solid var(--color-divider);
  padding-left: 1.75rem;
}
.cd-instructor__social-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--surface);
  border: 1.5px solid rgba(215, 25, 32, 0.3);
  color: var(--color-cherry-red);
  transition: background-color var(--transition), border-color var(--transition), transform var(--transition);
}
.cd-instructor__social-icon:hover {
  border-color: var(--color-cherry-red);
  background: var(--color-soft-red-tint);
  transform: translateY(-1px);
}
.cd-instructor__social-icon svg { width: 24px; height: 24px; }

/* ── Related Course (sits directly on the page background, no card) ── */
.cd-related { margin-top: 1.75rem; }
.cd-related .related-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }

/* ── Sidebar purchase card ── */
.cd-side { border-color: var(--color-divider); border-radius: var(--radius); }
.cd-side .sidebar-card__body { padding: 1rem 1.25rem 1.25rem; }
.cd-preview-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--color-cherry-red); color: #fff;
  font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.26rem 0.6rem; border-radius: var(--radius-sm);
}
.cd-side .price-current { color: var(--color-cherry-red); }
.cd-side .price-current { font-size: 1.75rem; }
.cd-side .course-details-panel {
  margin-top: 1rem; padding: 0; background: none; border: none; border-radius: 0;
}
.cd-side .course-details-panel .kicker { display: block; margin-bottom: 0.45rem; font-weight: 700; font-size: 0.8rem; color: var(--ink); }
.cd-side .course-details-panel .course-includes li { border-top: none; padding: 0.3rem 0; font-size: 0.86rem; font-weight: 400; color: var(--text); }
.cd-side .course-details-panel .course-includes li .svg-ic { color: var(--ink); }
.cd-side .course-details-actions {
  display: flex; justify-content: center; align-items: center; gap: 2.75rem;
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--color-divider);
}
.cd-side .course-details-action { font-size: 0.86rem; }
.cd-side .course-details-action .svg-ic {
  width: 17px; height: 17px; padding: 0; background: none; color: var(--ink);
}
.cd-side .course-details-action:hover .svg-ic,
.cd-side .course-details-action:hover { color: var(--color-cherry-red); }
.cd-side .course-details-action + .course-details-action::before {
  content: ''; position: absolute; left: -1.375rem; top: 1px; bottom: 1px;
  width: 1px; background: var(--color-divider);
}
.cd-side .course-details-action { position: relative; }

/* ── Course detail responsive ── */
@media (max-width: 1180px) {
  .cd-related .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .cd-hero { padding: 1.35rem 0 1.5rem; }
  .cd-hero__title { white-space: normal; }
  .cd-tabs-card, .cd-includes-card, .cd-curriculum-card, .cd-instructor-card { padding: 1.25rem; }
  .course-landing .cd-tabs-card.course-content { padding: 1.25rem; }
  .cd-includes-grid { grid-template-columns: 1fr; }
  .cd-includes-grid__item { border-right: none; }
  .cd-includes-grid__item:nth-last-child(-n+3) { border-bottom: 1px solid var(--color-divider); }
  .cd-includes-grid__item:last-child { border-bottom: none; }
  .cd-instructor__row { grid-template-columns: 1fr; gap: 1.25rem; }
  .cd-instructor__stats { border-left: none; border-top: 1px solid var(--color-divider); padding: 1rem 0 0; }
  .cd-instructor__stats li { white-space: normal; }
  .cd-instructor__social { justify-content: start; }
  .cd-curriculum-card .curriculum-lecture { padding-left: 1rem; }
  .cd-curriculum-card .curriculum-section__body .muted { padding-left: 1rem !important; }
  .cd-related .related-grid { grid-template-columns: 1fr; }
  .course-page { grid-template-columns: 1fr; }
}

/* ============================================================
   STUDENT PORTAL — shared shell, dashboard, learning, player
   ============================================================ */

/* --- Skeleton loading --- */
.skel {
  height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.3s infinite;
}
.skel-title { height: 26px; width: 220px; }
.skel-card { border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border-light); overflow: hidden; position: relative; }
@keyframes skel-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- Shell --- */
.student-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
  max-width: 1440px;
  margin: 0 auto;
}
.student-sidebar {
  border-right: 1px solid var(--border-light);
  background: var(--surface);
  padding: 1.25rem 0.9rem;
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}
.student-nav { display: flex; flex-direction: column; gap: 4px; }
.student-nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.93rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.student-nav__item .svg-ic { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.student-nav__item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.student-nav__item.active {
  background: rgba(215,25,32,0.12);
  color: var(--primary-deep);
  font-weight: 600;
}
.student-nav__item.active .svg-ic { color: var(--primary-deep); }
.student-sidebar__foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border-light); }
.student-main { padding: 1.75rem 2rem 3rem; min-width: 0; }

/* --- Page header + welcome --- */
.student-page { max-width: 1120px; margin: 0 auto; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-bottom: 1.5rem; flex-wrap: wrap;
}
.page-head h1 { font-size: 1.7rem; }
.dash-welcome-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 1.5rem; flex-wrap: wrap;
}
.dash-welcome { font-size: 1.85rem; margin: 0; }
.dash-subtitle { color: var(--muted); margin-top: 4px; }
.dash-welcome-actions { display: flex; align-items: center; gap: 10px; }
.overall-grade { color: var(--muted); font-size: 0.9rem; }
.overall-grade strong { color: var(--primary-deep); font-family: var(--font-mono); }

/* --- Continue Learning hero --- */
.continue-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(215,25,32,0.10), var(--surface));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  margin-bottom: 1.5rem;
}
.continue-card__media { position: relative; min-height: 180px; background: var(--surface-3); }
.continue-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.continue-card__ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--primary);
}
.continue-card__ph svg { width: 48px; height: 48px; }
.continue-card__body { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start; }
.continue-card__body h2 { margin: 0; }
.continue-card__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.continue-card__progress { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 420px; }
.continue-card__progress .progress-bar { flex: 1; }

/* --- KPI cards --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 1.5rem;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex; align-items: center; gap: 12px;
}
.kpi-card__icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(215,25,32,0.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary-deep); flex-shrink: 0;
}
.kpi-card__icon .svg-ic { width: 20px; height: 20px; }
.kpi-card__value { display: block; font-size: 1.25rem; font-weight: 700; font-family: var(--font-mono); color: var(--ink); line-height: 1.1; }
.kpi-card__label { display: block; font-size: 0.78rem; color: var(--muted); }

/* --- Two-column dashboard grid --- */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.panel { padding: 1.25rem; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 0.9rem;
}
.panel-head h3 { margin: 0; font-size: 1.1rem; }
.panel-head .kicker { margin: 0; }
.panel-empty { padding: 1rem 0; }

/* --- Tasks --- */
.task-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.task-item {
  display: flex; align-items: center; gap: 12px;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--border-light);
}
.task-item:last-child { border-bottom: none; }
.task-item__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.task-item__dot.task-session { background: var(--accent); }
.task-item__dot.task-quiz { background: var(--accent-warm); }
.task-item__dot.task-expiry { background: var(--primary); }
.task-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.task-item__badge { flex-shrink: 0; }

/* --- Events / calendar --- */
.event-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.event-item {
  display: flex; align-items: center; gap: 12px;
  padding: 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--surface-2);
}
.event-item__date {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-mono);
}
.event-item__date strong { font-size: 1.05rem; color: var(--primary-deep); line-height: 1; }
.event-item__date span { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; }
.event-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.calendar-day { margin-bottom: 1.5rem; }
.calendar-day h3 { font-size: 1.05rem; margin-bottom: 0.6rem; }

/* --- My Learning list (dashboard preview) --- */
.learning-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.learning-item {
  display: flex; gap: 12px; align-items: center;
  padding: 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}
.learning-item__thumb {
  width: 68px; height: 46px; border-radius: 8px; overflow: hidden; flex-shrink: 0;
  background: var(--surface-3); display: flex; align-items: center; justify-content: center; color: var(--primary);
}
.learning-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.learning-item__thumb svg { width: 22px; height: 22px; }
.learning-item__body { flex: 1; min-width: 0; }

/* --- Activity --- */
.activity-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.activity-item {
  display: flex; align-items: center; gap: 12px;
  padding: 0.6rem 0.3rem;
  border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }
.activity-item__icon {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: rgba(215,25,32,0.12); color: var(--primary-deep);
  display: flex; align-items: center; justify-content: center;
}
.activity-item__icon .svg-ic { width: 16px; height: 16px; }
.activity-item__icon.award { background: rgba(242,169,59,0.15); color: var(--accent-warm-deep); }

/* --- Notifications --- */
.notif-wrap { position: relative; }
.notif-bell { position: relative; }
.notif-bell__count {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--primary); color: #fff;
  font-size: 0.68rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}
.notif-drop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
  width: 300px; max-height: 360px; overflow: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  padding: 0.5rem;
}
.notif-item { padding: 0.7rem; border-bottom: 1px solid var(--border-light); }
.notif-item:last-child { border-bottom: none; }
.notif-item p { margin: 2px 0 8px; }
.notif-item .btn { margin: 0; }

/* --- Filters --- */
.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1.25rem; }
.filter-tab {
  padding: 8px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 0.85rem; font-weight: 500; cursor: pointer;
  transition: all var(--transition);
}
.filter-tab:hover { border-color: var(--primary); }
.filter-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* --- My Learning grid cards --- */
.learning-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.course-card-l { overflow: hidden; display: flex; flex-direction: column; }
.course-card-l__media { position: relative; aspect-ratio: 16 / 9; background: var(--surface-3); }
.course-card-l__media img { width: 100%; height: 100%; object-fit: cover; }
.course-card-l__ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--primary); }
.course-card-l__ph svg { width: 36px; height: 36px; }
.course-card-l__status { position: absolute; top: 10px; left: 10px; }
.course-card-l__body { padding: 1rem; display: flex; flex-direction: column; flex: 1; }
.course-card-l__body h3 { font-size: 1.05rem; margin: 0 0 2px; }
.course-card-l__foot { margin-top: auto; padding-top: 0.8rem; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* Offline payment awaiting admin approval (course page + My Learning card). */
.pay-pending-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 12px;
  background: #F5A623;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: default;
  user-select: none;
}
.course-card-l--pending { cursor: default; }
.pending-card__title { color: var(--primary); font-size: 1.05rem; margin: 0 0 2px; }
.pending-card__price {
  margin-top: 14px;
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}
.course-card-l--pending .pay-pending-bar { margin-top: 14px; }

/* --- Certificates --- */
.cert-list { display: flex; flex-direction: column; gap: 12px; }
.cert-row { display: flex; align-items: center; gap: 16px; padding: 1.1rem 1.25rem; }
.cert-row__icon {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: rgba(242,169,59,0.15); color: var(--accent-warm-deep);
  display: flex; align-items: center; justify-content: center;
}
.cert-row__icon svg { width: 26px; height: 26px; }
.cert-row__body { flex: 1; min-width: 0; }
.cert-row__body h3 { font-size: 1.1rem; margin: 0; }

/* --- Grades --- */
.grade-list { list-style: none; display: flex; flex-direction: column; }
.grade-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0.9rem 0.3rem;
  border-bottom: 1px solid var(--border-light);
}
.grade-item:last-child { border-bottom: none; }
.grade-item__main { flex: 1; min-width: 0; }
.grade-item__score {
  font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem;
  text-align: right; display: flex; flex-direction: column;
}
.grade-item__score small { font-size: 0.7rem; font-family: var(--font-body); font-weight: 500; }
.grade-item__score.pass { color: var(--primary-deep); }
.grade-item__score.fail { color: var(--accent-warm-deep); }

/* --- Player: shell --- */
body.player-mode .site-header,
body.player-mode .site-footer { display: none; }
/* --- Admin Panel: separate layout context --- */
/* The frontend footer is structurally excluded from the Admin Panel. render()
   toggles body.admin-page on Admin routes, so the footer (and its spacing)
   exist only on public/frontend pages and are completely absent here. */
body.admin-page .site-footer { display: none; }
body.admin-page .site-header { display: none; }
body.admin-page #app { padding-bottom: 0; }
.player { min-height: 100vh; background: var(--bg); --lesson-nav-h: 70px; }
.player-header {
  position: sticky; top: 0; z-index: 90;
  display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.player-header__menu { font-size: 1.2rem; display: none; }
.player-header__brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.player-header__course { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.player-header__course strong { font-size: 0.9rem; color: var(--ink); }
.player-header__course span { font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-header__actions { display: flex; align-items: center; gap: 8px; }
.player-header__back { margin-left: 4px; }

/* --- Player body grid --- */
.player-body {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  height: calc(100vh - 60px);
  overflow: hidden;
}
.player-body ~ *, #app:has(.player-body) { padding-bottom: 0; }
.curriculum {
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex; flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.curriculum__head { padding: 1rem 1.1rem; border-bottom: 1px solid var(--border-light); display: flex; flex-direction: column; gap: 2px; }
.curriculum__head strong { font-size: 0.98rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.curriculum__scroll { flex: 1; overflow-y: auto; padding: 0.75rem 0.6rem; }

.curriculum-progress { padding: 0.75rem; border-bottom: 1px solid var(--border-light); margin-bottom: 0.5rem; }
.curriculum-expiry {
  margin: 0 0.75rem 0.75rem; padding: 0.6rem 0.75rem;
  border-radius: var(--radius-xs);
  background: rgba(242,169,59,0.12); color: var(--accent-warm-deep);
  font-size: 0.8rem;
}
.curriculum-expiry.expired { background: rgba(239,68,68,0.12); color: #dc2626; }

.curriculum-module { margin-bottom: 0.35rem; }
.curriculum-module__head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0.65rem 0.7rem; border: none; background: transparent; cursor: pointer;
  color: var(--text); font-family: var(--font-body); text-align: left; border-radius: var(--radius-xs);
}
.curriculum-module__head:hover { background: var(--surface-2); }
.curriculum-module__head .module-toggle { transition: transform var(--transition); display: flex; }
.curriculum-module.open .module-toggle { transform: rotate(180deg); }
.curriculum-module__lessons { display: none; list-style: none; }
.curriculum-module.open .curriculum-module__lessons { display: block; }
.curriculum-module__lessons li { margin: 2px 0; }

.curriculum-lesson {
  display: flex; align-items: center; gap: 8px;
  padding: 0.55rem 0.7rem; border-radius: var(--radius-xs);
  color: var(--text); font-size: 0.87rem; line-height: 1.35;
}
.curriculum-lesson:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.curriculum-lesson__state { width: 16px; flex-shrink: 0; font-size: 0.8rem; text-align: center; color: var(--muted); }
.curriculum-lesson__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.curriculum-lesson.completed .curriculum-lesson__state { color: var(--primary-deep); }
.curriculum-lesson.completed { color: var(--muted); }
.curriculum-lesson.active {
  background: rgba(215,25,32,0.12);
  color: var(--ink); font-weight: 600;
}
.curriculum-lesson.active .curriculum-lesson__state { color: var(--primary-deep); }
.curriculum-lesson.in_progress .curriculum-lesson__state { color: var(--accent-warm-deep); }
.curriculum-lesson.locked { color: var(--muted); opacity: 0.7; cursor: not-allowed; }

/* --- Player main ---
   Layout contract: the video is as large as the viewport allows, the
   lesson nav sticks to the bottom of this column (always visible, above
   the OS taskbar), and the notes/tabs block below scrolls out of view. */
.player-main {
  min-width: 0; padding: 0; height: 100%;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
}
/* Letterbox row: transparent so only the video box reads as black -
   no black container showing on the left/right of the player. */
.player-stage {
  flex: 0 0 auto;
  width: 100%;
  background: transparent;
  display: flex;
  justify-content: center;
}
.media-wrap {
  background: #000;
  flex: 0 0 auto;
  /* 16:9, sized to fill the column width whenever the viewport height
     allows; only shrinks (centred) on short screens so nav stays visible */
  width: min(100%, calc((100vh - 60px - var(--lesson-nav-h, 70px)) * 1.7778));
  margin-inline: auto;
  aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.media-wrap video,
.media-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.media-loading { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); padding: 2rem; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.player-error { color: var(--text); text-align: center; padding: 2rem; display: flex; flex-direction: column; gap: 10px; align-items: center; }

.player-under {
  flex: 0 0 auto;
  padding: 1.4rem 1.75rem 2.5rem;
}
.lesson-context { margin-bottom: 1.25rem; }
.breadcrumb { color: var(--muted); font-size: 0.85rem; margin-bottom: 4px; }
.lesson-context h2 { font-size: 1.5rem; margin: 0 0 4px; }

/* --- Supporting tabs --- */
.supporting { margin-bottom: 1.25rem; }
.tab-bar { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 1rem; flex-wrap: wrap; }
.tab-btn {
  padding: 0.6rem 1rem; border: none; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 0.9rem; font-weight: 500; font-family: var(--font-body);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--primary-deep); border-bottom-color: var(--primary); font-weight: 600; }

/* --- Notes --- */
.notes-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 1rem; }
.notes-form textarea {
  width: 100%; resize: vertical; min-height: 60px;
  padding: 0.7rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-family: var(--font-body);
}
.notes-form textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
.notes-form .btn { align-self: flex-start; }
.note-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.note-item {
  padding: 0.8rem; border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.note-item__meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.note-item__meta .btn-icon { margin-left: auto; }

/* --- Materials --- */
.material-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.material-item {
  display: flex; align-items: center; gap: 12px;
  padding: 0.8rem; border: 1px solid var(--border-light); border-radius: var(--radius-sm);
}
.material-item__icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: rgba(62,146,204,0.12); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.material-item__icon .svg-ic { width: 18px; height: 18px; }
.material-item > div { flex: 1; min-width: 0; }
.material-item .btn { flex-shrink: 0; }

/* --- Lesson nav (pinned to the bottom of the player column, always
   visible above the taskbar; course/lesson name below it scrolls away) --- */
.lesson-nav {
  position: sticky; bottom: 0; z-index: 5;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0; padding: 12px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.lesson-nav .btn { margin: 0; max-width: 50%; white-space: normal; }

/* Quiz view replaces media/tabs; let it own the scroll area */
.player-main > #student-quiz-container { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

/* --- Lesson text (non-video) --- */
.lesson-text { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 960px; margin: 0 auto; align-self: center; }

/* --- Access denied / empty --- */
.access-denied { margin: 3rem auto; max-width: 480px; }

/* --- Badge variants used in portal --- */
.badge-success { background: rgba(215,25,32,0.14); color: var(--primary-deep); }
.badge-danger { background: rgba(239,68,68,0.14); color: #dc2626; }
.badge-accent { background: rgba(62,146,204,0.14); color: var(--accent); }

/* --- Responsive --- */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .learning-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .student-shell { grid-template-columns: 200px minmax(0, 1fr); }
  .player-body { grid-template-columns: 1fr; }
  .curriculum {
    position: fixed; left: 0; top: 60px; bottom: 0; width: 320px;
    transform: translateX(-100%); transition: transform var(--transition-slow);
    z-index: 80; box-shadow: var(--shadow-lg);
  }
  .player-body.curriculum-open .curriculum { transform: translateX(0); }
  .player-header__menu { display: inline-flex; }
}
@media (max-width: 768px) {
  .student-shell { grid-template-columns: 1fr; }
  .student-sidebar {
    position: static; top: auto; height: auto;
    flex-direction: row; overflow-x: auto; padding: 0.5rem;
    border-right: none; border-bottom: 1px solid var(--border-light);
  }
  .student-nav { flex-direction: row; gap: 6px; }
  .student-nav__item { padding: 8px 12px; white-space: nowrap; }
  .student-nav__item .svg-ic { display: none; }
  .student-sidebar__foot { display: none; }
  .student-main { padding: 1.25rem 1rem 2.5rem; }
  .dash-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .continue-card { grid-template-columns: 1fr; }
  .continue-card__media { min-height: 140px; }
  .learning-grid { grid-template-columns: 1fr; }
  .player-under { padding: 1.1rem 1rem 2rem; }
  .lesson-nav .btn { max-width: 100%; width: 100%; }

  /* === Mobile Video Player Overhaul === */

  /* Hide Plyr's bottom-left play button on mobile */
  .elp-viewport .plyr__controls .plyr__controls__item:first-child {
    display: none !important;
  }

  /* Hide duplicate Rewind/Forward buttons in bottom bar (center cluster has them) */
  .elp-viewport .plyr__controls [data-plyr="rewind"],
  .elp-viewport .plyr__controls [data-plyr="fast-forward"] {
    display: none !important;
  }

  /* Hide volume slider on mobile — keep only mute toggle icon */
  .elp-viewport .plyr__controls .plyr__volume input[type=range] {
    display: none !important;
  }
  .elp-viewport .plyr__controls .plyr__volume {
    min-width: auto !important;
  }

  /* Make the center overlaid play button bigger and more prominent on mobile */
  .elp-viewport .plyr__control--overlaid {
    padding: 20px !important;
    opacity: 0.95 !important;
    background: rgba(0,0,0,0.3) !important;
    border: 3px solid rgba(255,255,255,0.8) !important;
  }
  .elp-viewport .plyr__control--overlaid svg {
    width: 28px !important;
    height: 28px !important;
    fill: #fff !important;
  }

  /* Hide center play when video is playing */
  .elp-viewport .plyr--playing .plyr__control--overlaid {
    opacity: 0 !important;
    visibility: hidden !important;
  }

  /* Center cluster: rewind | play | forward overlay */
  .elp-mobile-cluster {
    display: flex !important;
    align-items: center;
    gap: 20px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    pointer-events: none;
  }
  .elp-mobile-cluster button {
    pointer-events: auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.8);
    background: rgba(0,0,0,0.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  .elp-mobile-cluster button:active {
    transform: scale(0.9);
    background: rgba(255,255,255,0.2);
  }
  .elp-mobile-cluster button svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
  }
  .elp-mobile-cluster .elp-cluster-play {
    width: 64px;
    height: 64px;
    border: 3px solid rgba(255,255,255,0.8);
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  .elp-mobile-cluster .elp-cluster-play svg {
    width: 30px;
    height: 30px;
    margin-left: 3px;
  }

  /* Hide center cluster when playing (video is active) */
  .elp-viewport.plyr--playing .elp-mobile-cluster {
    opacity: 0;
    transition: opacity 0.4s ease;
  }
  .elp-viewport:not(.plyr--playing) .elp-mobile-cluster {
    opacity: 1;
    transition: opacity 0.3s ease;
  }

  /* Make the ELP custom controls more touch-friendly on mobile */
  .elp-controls {
    padding: 8px 12px !important;
    border-radius: 0 !important;
  }
  .elp-seek {
    height: 10px !important;
    border-radius: 5px !important;
  }
  .elp-seek::-webkit-slider-thumb {
    width: 18px !important;
    height: 18px !important;
  }
  .elp-time {
    font-size: 14px !important;
    font-weight: 500;
  }
  .elp-controls button {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px !important;
    font-size: 14px;
  }

  /* Volume slider: vertical, slides from left on mobile */
  .elp-volume-slider {
    display: flex !important;
    position: absolute;
    left: 0;
    bottom: 60px;
    width: 44px;
    height: 160px;
    background: rgba(10,14,20,0.95);
    border-radius: 0 8px 8px 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
  }
  .elp-volume-slider.elp-volume-visible {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }
  .elp-volume-slider input[type=range] {
    writing-mode: vertical-lr;
    direction: rtl;
    width: 6px;
    height: 100px;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    outline: none;
  }
  .elp-volume-slider input[type=range]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0f766e;
    cursor: pointer;
  }
  .elp-volume-slider .elp-vol-icon {
    color: #e5e7eb;
    font-size: 18px;
    cursor: pointer;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skel, .spinner { animation: none; }
  .curriculum { transition: none; }
}

/* ===== Admin Media Library page ===== */
.admin-media-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid var(--border, #e5e7eb);
  margin-bottom: 0;
  flex-wrap: wrap;
}
.admin-media-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted, #6b7280);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  margin-bottom: -2px;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.admin-media-tab:hover { color: var(--text, #111827); background: rgba(0,0,0,.03); }
.admin-media-tab.active {
  color: var(--primary, #2563eb);
  border-color: var(--border, #e5e7eb);
  border-bottom-color: transparent;
  background: var(--card-bg, #fff);
}
.media-admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 0 12px;
}
.media-admin-upload-label { cursor: pointer; display: inline-flex; align-items: center; }
.admin-media-library { min-width: 0; width: 100%; }
/* Upload progress/status lives directly under the Media toolbar as a
   full-width status strip (no stray right-hand whitespace). */
.admin-media-video-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
}
.admin-media-video-status:empty { display: none; padding: 0; margin: 0; }
.admin-media-video-status .video-progress-bar { max-width: none; width: 100%; }
.admin-media-video-status p { margin: 0; font-size: 0.85rem; font-weight: 600; }
.admin-media-video-status small { color: var(--muted); }
.admin-media-video-status .video-status-badge { align-self: flex-start; }
.admin-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 8px; }
.admin-media-grid .media-grid-item { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--border, #e5e7eb); }
.admin-media-grid .media-grid-item img { display: block; width: 100%; height: 110px; object-fit: cover; }
.admin-media-grid .media-grid-name {
  font-size: .74rem;
  color: var(--muted, #6b7280);
  padding: 6px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--card-bg, #fff);
}
.admin-media-queue { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.admin-media-queue-item {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 1.4fr auto auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--card-bg, #fff);
}
.admin-media-queue-name { font-size: .82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-media-queue-state { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.admin-media-queue-state.queued { color: var(--muted, #6b7280); }
.admin-media-queue-state.uploading { color: var(--primary, #2563eb); }
.admin-media-queue-state.paused { color: #d97706; }
.admin-media-queue-state.done { color: #16a34a; }
.admin-media-queue-state.error { color: #dc2626; }
.software-url-row { display: flex; gap: 6px; align-items: center; }
@media (max-width: 640px) {
  .admin-media-queue-item { grid-template-columns: 1fr; gap: 6px; }
  .admin-media-tab { font-size: .85rem; padding: 8px 12px; }
}

/* === Udemy-style Course Preview banner (top of Course Details sidebar) === */
.course-preview-banner {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: pointer;
  background: var(--primary-deep);
}
.course-preview-banner--static { cursor: default; }
.course-preview-banner__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.course-preview-banner:hover .course-preview-banner__img { transform: scale(1.05); }
.course-preview-banner__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(18,32,67,0.08) 0%, rgba(18,32,67,0.55) 100%);
  color: #fff;
}
.course-preview-banner__play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  transition: transform 0.2s ease;
}
.course-preview-banner__play .svg-ic { width: 26px; height: 26px; stroke: var(--primary-deep); fill: none; }
.course-preview-banner:hover .course-preview-banner__play { transform: scale(1.08); }
.course-preview-banner__label {
  font-weight: 600;
  font-size: 0.9rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.45);
}
.course-preview-banner:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Udemy-style stacked purchase buttons (Add to Cart / Buy Now) */
.course-cta-stack { display: flex; flex-direction: row; gap: 0.5rem; margin-bottom: 0.15rem; }
.course-cta-stack .btn { flex: 1; min-width: 0; margin: 0; }

/* Buy Now (scoped to the sidebar stack) — metric parity with "Add to Cart":
   identical radius, weight, vertical padding, height and hover transition,
   and the SAME brand-green background (var(--primary), hover primary-deep).
   The global .btn-accent (admin/media buttons) is intentionally untouched. */
.course-cta-stack .btn-accent {
  background: var(--primary);
  color: #fff;
  padding: 14px 32px;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 600;
  box-shadow: none;
}
.course-cta-stack .btn-accent:hover {
  background: var(--primary-deep);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-green);
}

/* ============================================================
   DEDICATED CoursePreviewModal — fully isolated component.
   Independent of the shared #video-player-modal (Admin Media
   Library / generic media viewer). Compact ~720px dialog with a
   16:9 player on top and a "Free Sample Videos" playlist stacked
   directly below (Udemy-style). All selectors are namespaced
   under .course-preview-* so nothing bleeds into the shared modal.
   ============================================================ */
.course-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 15, 24, 0.65);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.course-preview-overlay.show { opacity: 1; pointer-events: auto; }

.course-preview-dialog {
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #101828;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.course-preview-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.course-preview-dialog__header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}
.course-preview-dialog__subtitle {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: #94a3b8;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 560px;
}
.course-preview-dialog__header .media-modal-close { color: #94a3b8; }
.course-preview-dialog__header .media-modal-close:hover { color: #fff; }

.course-preview-dialog__stage {
  position: relative;
  width: 100%;
  /* The stage matches the source video's NATIVE ratio (set from JS as
     --preview-stage-ratio once videoWidth/videoHeight are known; 16/9 default).
     object-fit: contain below therefore renders the full frame flush —
     no top/bottom bars, no side pillarboxes, no cropping. */
  aspect-ratio: var(--preview-stage-ratio, 16 / 9);
  background: #000;
  flex-shrink: 0;
  overflow: hidden;
}
.course-preview-dialog__stage video,
.course-preview-dialog__stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.course-preview-dialog__stage video { object-fit: contain !important; }

.course-preview-playlist {
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b1526;
}
.course-preview-playlist .kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.course-preview-list { list-style: none; margin: 8px 0 0; padding: 0; }
.course-preview-list__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  color: #dce1ec;
}
.course-preview-list__item:hover { background: rgba(255, 255, 255, 0.06); }
.course-preview-list__item.active { background: rgba(62, 146, 204, 0.22); color: #7db4dd; }
.course-preview-list__icon .svg-ic { width: 16px; height: 16px; }
.course-preview-list__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-preview-list__duration { font-family: var(--font-mono); font-size: 0.78rem; color: #94a3b8; }
.course-preview-list__status { font-size: 0.72rem; font-weight: 700; color: var(--accent); min-width: 46px; text-align: right; }

/* Short viewports: the stage would otherwise push the playlist out of view,
   so scale the whole stage down proportionally (height-driven, width auto →
   both dimensions shrink together, still the video's native ratio). contain
   guarantees the full frame stays visible with zero cropping. */
@media (max-height: 640px) {
  .course-preview-dialog { max-height: 94vh; }
  .course-preview-dialog__stage {
    height: 46vh;
    width: auto;
    margin-inline: auto;
  }
  .course-preview-playlist { min-height: 90px; }
}
@media (max-width: 640px) {
  .course-preview-overlay { padding: 12px; }
  .course-preview-dialog__subtitle { max-width: 340px; }
}

/* Header cart link + count badge */
.nav-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  padding: 6px;
  border-radius: 8px;
  margin-right: 4px;
}
.nav-cart:hover { color: var(--primary-deep); }
.nav-cart svg { width: 22px; height: 22px; }
.nav-cart__badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}
.nav-cart__badge[hidden] { display: none; }

/* Cart page */
.cart-list { list-style: none; margin: 1.25rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cart-item__thumb { width: 84px; height: 48px; border-radius: 6px; overflow: hidden; flex-shrink: 0; background: var(--surface-3); display: flex; align-items: center; justify-content: center; }
.cart-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__thumb--ph .svg-ic { width: 22px; height: 22px; color: var(--muted); }
.cart-item__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cart-item__title { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-item__title:hover { color: var(--primary-deep); }
.cart-item__price { display: flex; align-items: baseline; gap: 8px; flex-shrink: 0; }
.cart-item__now { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; }
.cart-item__actions { display: flex; gap: 8px; flex-shrink: 0; }
.cart-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 8px; margin-top: 1rem; font-size: 1.1rem; }
.cart-total strong { font-family: var(--font-mono); font-size: 1.4rem; color: var(--primary-deep); }
@media (max-width: 640px) {
  .cart-item { flex-wrap: wrap; }
  .cart-item__actions { width: 100%; justify-content: flex-end; }
}

/* Checkout page responsive */
@media (max-width: 768px) {
  #checkout-form > div { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
  #checkout-form > div > div:last-child { position: static !important; }
}

/* ============================================================
   ENTERPRISE RESPONSIVE DESIGN SYSTEM
   Bootstrap 5 breakpoints as REFERENCE — custom CSS only
   Focus: xs (<576px), sm (≥576px), md (≥768px)
   Desktop (≥992px) is NOT modified
   ============================================================ */

/* ─────────────────────────────────────────────
   GLOBAL MOBILE FOUNDATIONS (max-width: 767.98px)
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  /* Touch-friendly base: all inputs/buttons ≥44px */
  .input, .select, textarea, button.btn, a.btn {
    min-height: 44px;
    font-size: 16px; /* Prevent iOS zoom on focus */
  }
  /* Reduce body padding */
  .container { padding: 0 12px; }
  /* Page headings smaller */
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.2rem; }
  h3 { font-size: 1.05rem; }
}

/* ─────────────────────────────────────────────
   HEADER — Hamburger menu for mobile
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .site-header { position: sticky; top: 0; z-index: 200; }
  .header-inner { height: 56px; padding: 0 12px; }
  .brand { font-size: 1.05rem; gap: 8px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-mark svg { width: 16px; height: 16px; }
  /* Hide nav links on mobile */
  .nav-links { display: none; }
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 12px;
    gap: 4px;
    z-index: 199;
  }
  .nav-links.mobile-open a,
  .nav-links.mobile-open button {
    width: 100%;
    padding: 12px 16px;
    min-height: 48px;
    font-size: 1rem;
    text-align: left;
    border-radius: var(--radius-xs);
  }
  .nav-links.mobile-open .nav-cta {
    text-align: center;
    margin-top: 8px;
  }
  /* Hamburger button */
  .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink);
    border-radius: var(--radius-xs);
    flex-shrink: 0;
  }
  .hamburger-btn:active { background: var(--surface-2); }
  .hamburger-btn svg { width: 24px; height: 24px; }
  /* Nav items touch-friendly */
  .nav-links a, .nav-links button {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 10px 14px;
  }
  .nav-cart { margin-right: 0; }
  .nav-cart svg { width: 24px; height: 24px; }
  .theme-toggle { width: 44px; height: 44px; }
  /* Hide secondary links */
  .hide-mobile { display: none !important; }
}
@media (min-width: 768px) {
  .hamburger-btn { display: none; }
}

/* ─────────────────────────────────────────────
   ADMIN SIDEBAR — Off-canvas mobile + overlay
   ───────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .admin-sidebar {
    position: fixed;
    left: -280px;
    top: 64px;
    width: 260px;
    height: calc(100vh - 64px);
    z-index: 200;
    box-shadow: var(--shadow-lg);
    transition: left 0.3s cubic-bezier(0.4,0,0.2,1);
    border-right: 1px solid var(--border);
  }
  .admin-sidebar.open { left: 0; }
  /* Overlay backdrop */
  .admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: 64px;
    background: rgba(0,0,0,0.4);
    z-index: 199;
    backdrop-filter: blur(2px);
  }
  .admin-sidebar-overlay.show { display: block; }
  .admin-main { margin-left: 0; padding: 20px 14px; }
  /* Hamburger toggle button in admin header */
  .admin-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    color: var(--ink);
    flex-shrink: 0;
    margin-right: 8px;
  }
  .admin-menu-btn svg { width: 22px; height: 22px; }
  .admin-menu-btn:active { background: var(--surface-2); }
  /* Hide desktop collapse/expand buttons on mobile */
  .sidebar-collapse-btn { display: none !important; }
  .sidebar-expand-btn { display: none !important; }
}
@media (min-width: 992px) {
  .admin-menu-btn { display: none; }
  .admin-sidebar-overlay { display: none !important; }
}

/* ─────────────────────────────────────────────
   ADMIN STATS CARDS — Stack on mobile
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .admin-stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .admin-stat-card {
    padding: 14px;
    gap: 10px;
  }
  .admin-stat-icon {
    width: 40px;
    height: 40px;
  }
  .admin-stat-info .num { font-size: 1.3rem; }
  .admin-stat-info .label { font-size: 0.78rem; }
}
@media (max-width: 479.98px) {
  .admin-stats {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────────
   ADMIN DASHBOARD GRID — 2-column → 1-column on mobile
   ───────────────────────────────────────────── */
.admin-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 767.98px) {
  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────────
   ADMIN TABLES — Card-based mobile layout
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .admin-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px 14px;
  }
  .admin-filters {
    flex-direction: column;
    gap: 8px;
  }
  .admin-search {
    min-width: 100%;
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;
  }
  .admin-filter-select {
    width: 100%;
    padding: 10px 28px 10px 12px;
    font-size: 16px;
  }
  /* Table: hide headers, convert rows to cards */
  .admin-table-wrap { overflow-x: visible; }
  .admin-table thead { display: none; }
  .admin-table,
  .admin-table--fixed,
  .admin-table--users {
    table-layout: auto;
    min-width: 0;
  }
  .admin-table tbody tr {
    display: block;
    padding: 14px;
    margin-bottom: 12px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
  }
  .admin-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    text-align: right;
    min-height: 40px;
    gap: 12px;
  }
  .admin-table td:last-child { border-bottom: none; }
  /* Show column labels via data-label attribute */
  .admin-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    text-align: left;
    flex-shrink: 0;
    font-size: 0.82rem;
  }
  /* Action buttons full-width */
  .course-actions {
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }
  .course-actions .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }
  /* Status select full width */
  .admin-status-select {
    max-width: 100%;
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
  }
  /* Pagination touch-friendly */
  .admin-pagination {
    flex-direction: column;
    gap: 10px;
    padding: 14px;
  }
  .admin-pagination button {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 14px;
  }
  .admin-pagination .page-btns {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ─────────────────────────────────────────────
   ADMIN MODALS — Full-screen on mobile
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .admin-modal-overlay { padding: 0; }
  .admin-modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    min-height: 100vh;
  }
  .admin-modal-header,
  .admin-modal-body,
  .admin-modal-footer { padding: 16px; }
  /* Touch-friendly form inputs */
  .admin-modal-body input[type="text"],
  .admin-modal-body input[type="email"],
  .admin-modal-body input[type="password"],
  .admin-modal-body input[type="tel"],
  .admin-modal-body input[type="file"],
  .admin-modal-body select,
  .admin-modal-body textarea {
    min-height: 48px;
    font-size: 16px;
    padding: 10px 12px;
    width: 100%;
    box-sizing: border-box;
  }
  .admin-modal-body .form-group {
    margin-bottom: 14px;
  }
  .admin-modal-body label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
  }
  .admin-modal-footer {
    display: flex;
    gap: 10px;
    padding: 12px 16px env(safe-area-inset-bottom, 12px);
  }
  .admin-modal-footer .btn {
    flex: 1;
    min-height: 44px;
  }
  .admin-modal-footer .btn-cancel {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
  }
  .admin-modal-footer .btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
  }
}

/* ─────────────────────────────────────────────
   ADMIN PAGE HEADER — Flex wrap on mobile
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .admin-page-header { margin-bottom: 16px; }
  .admin-page-header h1 { font-size: 1.3rem; }
  .admin-page-header p { font-size: 0.85rem; }
  .admin-page-header .flex-between,
  .admin-page-header .flex {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
}

/* ─────────────────────────────────────────────
   STUDENT SHELL — Sidebar collapse on mobile
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .student-shell {
    grid-template-columns: 1fr;
  }
  .student-sidebar {
    position: static;
    top: auto;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 12px;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .student-sidebar::-webkit-scrollbar { display: none; }
  .student-nav {
    flex-direction: row;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .student-nav__item {
    padding: 10px 14px;
    white-space: nowrap;
    font-size: 0.88rem;
    min-height: 44px;
  }
  .student-nav__item .svg-ic { display: none; }
  .student-sidebar__foot { display: none; }
  .student-main { padding: 16px 12px 80px; }
}

/* ─────────────────────────────────────────────
   STUDENT DASHBOARD — KPI, continue card, grids
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .dash-welcome-row {
    flex-direction: column;
    gap: 12px;
  }
  .dash-welcome { font-size: 1.4rem; }
  .dash-welcome-actions { width: 100%; }
  .dash-welcome-actions .btn { width: 100%; min-height: 48px; }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .kpi-card {
    padding: 12px;
    gap: 10px;
  }
  .kpi-card__icon {
    width: 38px;
    height: 38px;
  }
  .kpi-card__value { font-size: 1.1rem; }
  .kpi-card__label { font-size: 0.72rem; }
  .dash-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .continue-card {
    grid-template-columns: 1fr;
  }
  .continue-card__media {
    min-height: 140px;
    max-height: 180px;
  }
  .continue-card__body {
    padding: 1rem;
  }
  .continue-card__body h2 { font-size: 1.1rem; }
  .continue-card__progress { max-width: 100%; }
  .learning-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .page-head h1 { font-size: 1.3rem; }
  /* Filter tabs scroll horizontally */
  .filter-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-tab {
    flex-shrink: 0;
    min-height: 44px;
    padding: 10px 16px;
  }
  /* Panels */
  .panel { padding: 1rem; }
  .panel-head h3 { font-size: 1rem; }
  /* Learning items */
  .learning-item { padding: 10px; }
  .learning-item__thumb { width: 56px; height: 40px; }
  /* Certificate rows */
  .cert-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 1rem;
  }
  .cert-row__icon { width: 44px; height: 44px; }
  /* Grade items */
  .grade-item {
    padding: 10px 0;
    gap: 10px;
  }
  .grade-item__score { font-size: 1rem; }
}
@media (max-width: 479.98px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { flex-direction: column; text-align: center; gap: 8px; }
}

/* ─────────────────────────────────────────────
   COURSE BUILDER — Mobile responsive
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .builder-header {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
    gap: 10px;
  }
  .builder-header-left { min-width: 0; }
  .builder-course-title {
    min-width: 0;
    width: 100%;
    font-size: 1rem;
  }
  .builder-header-right {
    width: 100%;
  }
  .builder-header-right .btn {
    flex: 1;
    min-height: 44px;
  }
  .builder-steps {
    padding: 10px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
  }
  .builder-steps::-webkit-scrollbar { display: none; }
  .builder-step {
    padding: 8px 14px;
    font-size: 0.82rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .builder-step-num {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }
  .builder-step::after { display: none; }
  .builder-content {
    padding: 14px 12px;
  }
  .builder-footer {
    padding: 12px 14px;
    flex-direction: column;
    gap: 8px;
  }
  .builder-footer .btn {
    width: 100%;
    min-height: 48px;
  }
  .builder-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .builder-sidebar {
    grid-template-columns: 1fr;
  }
  .builder-media-grid {
    grid-template-columns: 1fr;
  }
  /* Form groups */
  .form-row {
    flex-direction: column;
    gap: 12px;
  }
  .builder-card label { font-size: 0.88rem; }
  .builder-card .input,
  .builder-card .select,
  .builder-card textarea {
    padding: 12px;
    font-size: 16px;
  }
  .upload-thumb, .upload-video {
    min-height: 100px;
    padding: 16px;
  }
  .toggle-row {
    min-height: 48px;
    padding: 8px 0;
  }
  .wyyl-item .btn {
    width: 44px;
    height: 44px;
  }
  .input-group { flex-direction: column; }
  .input-prefix {
    border-right: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius-xs) var(--radius-xs) 0 0;
    width: 100%;
    text-align: center;
  }
  .input-group .input {
    border-radius: 0 0 var(--radius-xs) var(--radius-xs);
    width: 100%;
  }
}

/* ─────────────────────────────────────────────
   COURSE DETAILS — Mobile responsive
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .course-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .related-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .course-content {
    padding: 1rem;
  }
  .course-content-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .course-hero .course-meta {
    gap: 6px;
    flex-wrap: wrap;
  }
  /* Mobile CTA bar */
  .mobile-cta {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 10px 16px;
    box-shadow: 0 -6px 20px rgba(0,0,0,0.08);
  }
  .mobile-cta__price {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    color: var(--ink);
    white-space: nowrap;
  }
  .mobile-cta__price strong { color: var(--primary-deep); }
  .mobile-cta__price .price-old { font-size: 0.8rem; }
  .mobile-cta .btn {
    margin: 0;
    flex: 1;
    min-height: 48px;
  }
  .mobile-cta-spacer { display: block; height: 78px; }
  /* Course page grid */
  .course-page {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .course-sidebar {
    position: static;
    order: 2;
  }
  .course-main { order: 1; }
}
@media (max-width: 479.98px) {
  .course-stats { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────
   VIDEO PLAYER — Mobile optimizations
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .player-body {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 56px);
  }
  .curriculum {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    z-index: 200;
    box-shadow: var(--shadow-lg);
  }
  .player-body.curriculum-open .curriculum { transform: translateX(0); }
  .player-body.curriculum-open::after {
    content: '';
    position: fixed;
    inset: 0;
    top: 60px;
    background: rgba(0,0,0,0.4);
    z-index: 199;
  }
  .player-header { height: 56px; padding: 0 12px; }
  .player-header__menu { display: inline-flex; }
  .player-header__course strong { font-size: 0.85rem; }
  .player-header__course span { font-size: 0.72rem; }
  .player-under { padding: 14px 12px 24px; }
  /* Mobile: page scrolls normally; nav buttons stack (taller bar) */
  .player { --lesson-nav-h: 132px; }
  .player-main { height: auto; overflow: visible; }
  .media-wrap { width: 100%; }
  .lesson-nav { position: static; padding: 10px 12px; }
  .lesson-nav .btn {
    max-width: 100%;
    width: 100%;
    min-height: 48px;
  }
  .lesson-text {
    padding: 1rem;
    font-size: 0.95rem;
  }
}

/* ─────────────────────────────────────────────
   AUTH PAGES — Mobile responsive
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .auth-card {
    margin: 1.5rem 12px;
    padding: 24px 20px;
  }
  .auth-card h2 { font-size: 1.3rem; }
  .auth-card .input {
    padding: 12px;
    font-size: 16px;
    min-height: 48px;
  }
  .auth-card .btn {
    min-height: 48px;
    font-size: 1rem;
    width: 100%;
  }
}

/* ─────────────────────────────────────────────
   FOOTER — Mobile responsive
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .site-footer { border-radius: 24px 24px 0 0; }
  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 36px 0 24px;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
  .footer-brand p { max-width: 100%; font-size: 0.85rem; }
  .footer-col h4 { font-size: 0.8rem; }
  .footer-col a { font-size: 0.85rem; }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 16px 0;
  }
  .footer-social { justify-content: center; }
}
@media (max-width: 479.98px) {
  .footer-main {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ─────────────────────────────────────────────
   GENERAL FORMS — Mobile stacking
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .form-row {
    flex-direction: column;
    gap: 12px;
  }
  .form-group label {
    font-size: 0.9rem;
    margin-bottom: 6px;
  }
  /* All inputs touch-friendly */
  .input, .select, textarea {
    padding: 12px;
    font-size: 16px;
    min-height: 48px;
  }
  /* All buttons touch-friendly */
  button.btn, a.btn {
    min-height: 48px;
    padding: 12px 20px;
    font-size: 0.95rem;
  }
  /* Full-width buttons */
  .btn-block { width: 100%; }
  /* Modals full-screen */
  .admin-modal-overlay { padding: 0; }
  .admin-modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* ─────────────────────────────────────────────
   CART — Mobile responsive
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .cart-item {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .cart-item__thumb { width: 100%; height: 120px; }
  .cart-item__actions { width: 100%; justify-content: flex-end; }
  .cart-total {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }
  #checkout-form > div {
    grid-template-columns: 1fr !important;
  }
}

/* ─────────────────────────────────────────────
   INSTRUCTOR PANEL — Mobile responsive
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .instructor-card {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 1rem;
  }
  .instructor-avatar {
    width: 48px;
    height: 48px;
    font-size: 1rem;
  }
}

/* ─────────────────────────────────────────────
   NOTIFICATION DROPDOWN — Mobile responsive
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .notif-drop {
    position: fixed;
    top: 56px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: 60vh;
  }
}

/* ─────────────────────────────────────────────
   ACCESSIBILITY — Focus visible for keyboard nav
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
  }
  /* Prevent text overflow */
  .admin-table td,
  .admin-table th,
  .course-card-l__body h3,
  .learning-item__body {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ─────────────────────────────────────────────
   SM BREAKPOINT (≥576px) — Large phones landscape
   ───────────────────────────────────────────── */
@media (min-width: 576px) and (max-width: 767.98px) {
  .admin-stats { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .learning-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─────────────────────────────────────────────
   MD BREAKPOINT (≥768px) — Tablet portrait
   ───────────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 991.98px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-main { padding: 24px 20px; }
  .student-main { padding: 1.5rem 1.25rem; }
  .builder-content { padding: 20px; }
}

/* ─────────────────────────────────────────────
   MOBILE ADMIN DASHBOARD — Compact cards, expand/collapse, header alignment
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  /* Hide Recent Certificates on mobile */
  .admin-card-certificates { display: none; }
  /* Expandable cards: hide table by default, show on .expanded */
  .admin-table-expandable {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }
  .admin-card.expanded .admin-table-expandable {
    max-height: 600px;
  }
  /* View All button text change when expanded */
  .admin-card.expanded .admin-card-header .btn[data-action="expand-card"] {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
  }
  /* Header alignment: hamburger + title side by side */
  .admin-main {
    display: flex;
    flex-direction: column;
  }
  .admin-page-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px 0;
  }
  .admin-page-header h1 { margin: 0; }
}

/* ─────────────────────────────────────────────
   BOTTOM NAVIGATION BAR — Mobile admin only
   ───────────────────────────────────────────── */
.admin-bottom-nav {
  display: none;
}
@media (max-width: 767.98px) {
  body.admin-page .admin-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--surface);
    border-top: 1px solid var(--border-light);
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    justify-content: flex-start;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  body.admin-page .admin-bottom-nav::-webkit-scrollbar {
    display: none;
  }
  .admin-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    min-width: 52px;
    flex-shrink: 0;
    white-space: nowrap;
    transition: color var(--transition);
  }
  .admin-bottom-nav-item svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
  }
  .admin-bottom-nav-item.active {
    color: var(--primary-deep);
  }
  .admin-bottom-nav-item.active svg {
    stroke: var(--primary-deep);
  }
  .admin-main.has-bottom-nav {
    padding-bottom: 80px;
  }

  /* Sidebar brand — flex layout for logout button alignment */
  .sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 8px;
  }
  .sidebar-brand h3 { margin: 0; }
  .admin-logout-btn {
    padding: 6px 14px;
    border: 1px solid var(--danger, #ef4444);
    background: transparent;
    color: var(--danger, #ef4444);
    border-radius: var(--radius-xs);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    min-height: 32px;
  }
  .admin-logout-btn:hover {
    background: var(--danger, #ef4444);
    color: #fff;
  }
}

/* Desktop defaults: show table, hide mobile cards */
.admin-users-table-desktop { display: block; }
.admin-users-cards-mobile { display: none; }

/* ─────────────────────────────────────────────
   USER MODULE — Mobile Card Layout
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  /* Hide desktop table, show mobile cards */
  .admin-users-table-desktop { display: none; }
  .admin-users-cards-mobile { display: block; }
  /* Action bar stacking */
  .admin-users-cards-mobile .admin-filters {
    flex-direction: column;
    gap: 8px;
  }
  .admin-users-cards-mobile .admin-search {
    width: 100%;
    min-width: 0;
  }
  .admin-users-cards-mobile .admin-filter-select {
    width: 100%;
  }
  .admin-users-cards-mobile .btn-create-user-mobile {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    min-height: 44px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
  }
  /* User card */
  .user-card-mobile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
  }
  .user-avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
  }
  .user-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .user-avatar-circle.large {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
  }
  .user-card-mobile-center {
    flex: 1;
    min-width: 0;
  }
  .user-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 2px;
  }
  .user-card-email {
    font-size: 0.8rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .user-card-badges {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
  }
  .user-card-meta {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 2px;
  }
  .user-card-mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
  }
  .user-card-mobile-actions button,
  .user-card-mobile-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xs);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
  }
  .user-card-mobile-actions button:hover,
  .user-card-mobile-actions a:hover {
    background: var(--surface-2);
    color: var(--text);
  }
  .user-card-mobile-actions .btn-delete {
    color: var(--danger, #ef4444);
    border-color: var(--danger, #ef4444);
  }
  .user-card-mobile-actions svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
  }
}

/* ─────────────────────────────────────────────
   USER PROFILE — Desktop Layout
   ───────────────────────────────────────────── */
.user-profile-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.user-profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.user-profile-header h2 {
  margin: 0;
  font-size: 1.2rem;
}
.user-profile-header p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.user-profile-fields {
  border-top: 1px solid var(--border-light);
}
.user-profile-fields .field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}
.user-profile-fields .field-row:last-child {
  border-bottom: none;
}
.user-profile-fields .field-label {
  color: var(--muted);
  font-weight: 500;
}

/* ─────────────────────────────────────────────
   USER PROFILE — Mobile Card Layout
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .user-profile-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
  }
  .user-profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
  }
  .user-profile-header h2 {
    margin: 0;
    font-size: 1.1rem;
  }
  .user-profile-header p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
  }
  .user-profile-fields {
    border-top: 1px solid var(--border-light);
  }
  .user-profile-fields .field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
  }
  .user-profile-fields .field-row:last-child {
    border-bottom: none;
  }
  .user-profile-fields .field-label {
    color: var(--muted);
    font-weight: 500;
  }
  .enrollment-card-mobile {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
  }
  .enrollment-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
  }
  .enrollment-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 10px;
  }
  .enrollment-card-mobile .btn-block {
    width: 100%;
    min-height: 40px;
  }
}

/* ─────────────────────────────────────────────
   USER PROGRESS — Desktop Layout
   ───────────────────────────────────────────── */
.stats-grid-mobile {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card-small {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-card-small .stat-num {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.stat-card-small .stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.student-info-header {
  margin-bottom: 20px;
}
.student-info-header h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}
.student-info-header p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.curriculum-mobile {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}
.curriculum-module-header {
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.85rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-light);
}
.lesson-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-light);
}
.lesson-row:last-child {
  border-bottom: none;
}
.lesson-check {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.lesson-check.completed { color: var(--success); }
.lesson-check.pending { color: var(--muted); }
.lesson-name { flex: 1; }
.lesson-duration { font-size: 0.8rem; color: var(--muted); flex-shrink: 0; }
.lesson-progress-mobile {
  display: flex;
  flex-direction: column;
}
.lesson-progress-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-light);
  align-items: center;
}
.lesson-progress-row:last-child {
  border-bottom: none;
}

/* ─────────────────────────────────────────────
   USER PROGRESS — Mobile Layout
   ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .stats-grid-mobile {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }
  .stat-card-small {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
  }
  .stat-card-small .stat-num {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
  }
  .stat-card-small .stat-label {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 2px;
  }
  .progress-bar-full {
    width: 100%;
    height: 10px;
    background: var(--border-light);
    border-radius: 5px;
    overflow: hidden;
    margin: 8px 0;
  }
  .progress-bar-full .progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 5px;
    transition: width 0.3s ease;
  }
  .curriculum-mobile {
    margin-top: 16px;
  }
  .curriculum-module-header {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
  }
  .lesson-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
  }
  .lesson-row:last-child {
    border-bottom: none;
  }
  .lesson-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
  }
  .lesson-check.completed {
    background: var(--primary);
    color: #fff;
  }
  .lesson-check.pending {
    background: var(--border-light);
    color: var(--muted);
  }
  .lesson-name {
    flex: 1;
    min-width: 0;
  }
  .lesson-duration {
    color: var(--muted);
    font-size: 0.8rem;
    flex-shrink: 0;
  }
  .lesson-progress-mobile {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-top: 12px;
  }
  .lesson-progress-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
  }
  .lesson-progress-row:last-child {
    border-bottom: none;
  }
  .student-info-header {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 12px;
  }
  .student-info-header h3 {
    margin: 0 0 4px 0;
    font-size: 1rem;
  }
  .student-info-header p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
  }
}

/* ─────────────────────────────────────────────
   REDUCED MOTION — Accessibility
   ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─────────────────────────────────────────────
   MODERN PAGES — Privacy / Terms / Contact
   (dark hero + sidebar + card layout)
   ───────────────────────────────────────────── */
.modern-hero {
  position: relative;
  background: var(--hero-bg);
  color: #fff;
  overflow: hidden;
  min-height: var(--hero-height);
  padding: clamp(34px, 4.4vw, 56px) 0 clamp(42px, 5vw, 62px);
}
.modern-hero__container { position: relative; z-index: 2; }
.modern-hero__bar { width: 44px; height: 5px; border-radius: 3px; background: var(--color-cherry-red); margin-bottom: 20px; }
.modern-hero__title { font-size: var(--hero-title-size); font-weight: 800; letter-spacing: -0.02em; line-height: 1.04; margin: 0 0 12px; color: #fff; }
.modern-hero__sub { color: #AEB6C0; font-size: var(--hero-sub-size); max-width: 640px; margin: 0; line-height: 1.6; }

.modern-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 26px; align-items: start; padding: clamp(28px, 3.4vw, 44px) 0 var(--page-bottom-space); }
.modern-layout--contact { grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr); }

/* ─────────────────────────────────────────────
   GUIDE PAGE — public Student Guide videos
   (gray canvas body + white video cards,
    2 columns × 3 rows, search + Prev/Next)
   ───────────────────────────────────────────── */
.guide-body { padding: clamp(28px, 3.4vw, 44px) 0 var(--page-bottom-space); }
.guide-toolbar { position: relative; max-width: 560px; margin-bottom: 26px; }
.guide-toolbar__icon {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted); pointer-events: none;
}
.guide-toolbar__input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  font: inherit; font-size: 0.95rem; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.guide-toolbar__input::placeholder { color: var(--muted); }
.guide-toolbar__input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.12);
}

.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.guide-card {
  background: var(--surface);
  border: 1px solid var(--color-divider);
  border-radius: 14px;
  box-shadow: var(--shadow-page-card);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.guide-card__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.guide-card__icon { display: inline-flex; color: var(--primary); flex-shrink: 0; }
.guide-card__icon svg { width: 20px; height: 20px; }
.guide-card__title {
  margin: 0; font-size: 17px; font-weight: 800; line-height: 1.35;
  color: var(--ink);
}
.guide-card__media { position: relative; aspect-ratio: 16 / 9; background: #0d0d0d; }
/* Poster slots (YouTube/Vimeo): an instant thumbnail + our own center play
   button. The heavy ELP lesson player is mounted ONLY in the popup on click,
   so the grid paints immediately and never runs several players at once. */
.guide-card__media[data-guide-embed] { cursor: pointer; }
.guide-card__thumb {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0; display: block;
  object-fit: cover;
  background-color: #0d0d0d;
  background-size: cover;
  background-position: center;
}
.guide-card__play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.3);
  pointer-events: none; /* the whole media slot is the click target */
}
.guide-card__play svg { width: 24px; height: 24px; fill: #fff; margin-left: 3px; }
.guide-card__media[data-guide-embed]:hover .guide-card__play {
  background: rgba(0, 0, 0, 0.45);
  border-color: #fff;
}
.guide-card__frame,
.guide-card__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0; display: block;
}
.guide-card__video { object-fit: contain; background: #000; }
.guide-card__placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: var(--color-gray); color: var(--color-metadata-gray); font-size: 0.9rem;
}

.guide-empty {
  background: var(--surface);
  border: 1px solid var(--color-divider);
  border-radius: 14px;
  box-shadow: var(--shadow-page-card);
  padding: 40px 20px;
}

.guide-pagination {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 28px;
}
.guide-pagination__info {
  font-size: 0.9rem; font-weight: 600; color: var(--color-metadata-gray);
}

/* ── GUIDE POPUP PLAYER (guide page only) ──────────────────────
   Large centered player over a blurred (still visible) backdrop.
   Closes ONLY via its X button — no outside-click, no Esc.
   Nothing outside #guide-popup-overlay / .guide-popup-* is affected. */
.guide-popup-overlay {
  position: fixed; inset: 0; z-index: 1500;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 3vw, 40px);
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.guide-popup-overlay[hidden] { display: none; }
.guide-popup {
  position: relative;
  width: min(1120px, 96vw);
  background: var(--color-white);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(16, 35, 49, 0.28);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.guide-popup__head { display: flex; align-items: center; gap: 10px; padding: 14px 58px 14px 16px; }
.guide-popup__title { margin: 0; font-size: 17px; font-weight: 800; color: var(--ink); }
.guide-popup__close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-white); color: var(--color-cherry-red);
  border: 2px solid var(--color-black);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.guide-popup__close:hover { background: var(--color-cherry-red); color: #fff; }
.guide-popup__stage { position: relative; width: 100%; background: #000; }
.guide-popup__stage .elp-shell { max-width: 100%; border-radius: 0; box-shadow: none; }
.guide-popup__stage .elp-viewport { border-radius: 0; }
body.guide-popup-open { overflow: hidden; }

/* Membership page — placeholder body */
.membership-body { padding: clamp(28px, 3.4vw, 44px) 0 var(--page-bottom-space); }

@media (max-width: 768px) {
  .guide-grid { grid-template-columns: 1fr; }
  .guide-toolbar { max-width: none; }
}

/* Admin "Student Guide" module helpers */
.guide-admin-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.guide-status-select { padding: 4px 8px; font-size: 0.8rem; height: auto; border-radius: 8px; min-width: 110px; }
.guide-url-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guide-url-cell a { color: var(--primary); text-decoration: none; }
.guide-url-cell a:hover { text-decoration: underline; }

.pg-card { background: var(--surface); border: 1px solid var(--color-divider); border-radius: 18px; box-shadow: var(--shadow-page-card); }
.pg-card__pad { padding: 26px 26px 28px; }
.pg-label { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: var(--color-black); margin: 0 0 20px; }
.pg-label::before { content: ""; width: 22px; height: 3px; border-radius: 2px; background: var(--color-cherry-red); flex: 0 0 auto; }
.pg-label--red { color: var(--color-cherry-red); }

.pg-nav { display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; }
.pg-nav__item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; color: var(--color-black); font-weight: 600; font-size: 15px; text-decoration: none; transition: background 0.15s ease, color 0.15s ease; }
.pg-nav__item svg { width: 20px; height: 20px; color: var(--color-metadata-gray); flex: 0 0 auto; }
.pg-nav__item:hover { background: var(--color-gray); }
.pg-nav__item.is-active { background: var(--color-soft-red-tint); color: var(--color-cherry-red); }
.pg-nav__item.is-active svg { color: var(--color-cherry-red); }
.pg-nav__chev { margin-left: auto; color: var(--color-cherry-red); display: inline-flex; }

.pg-help { background: var(--color-soft-red-tint); border-radius: 14px; padding: 20px; }
.pg-help__head { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--color-black); margin: 0 0 8px; font-size: 16px; }
.pg-help__head svg { width: 22px; height: 22px; color: var(--color-cherry-red); }
.pg-help p { color: var(--color-desc-gray); font-size: 14px; line-height: 1.6; margin: 0 0 16px; }
.pg-help__btn { display: inline-flex; align-items: center; gap: 8px; background: var(--color-cherry-red); color: #fff; border: none; padding: 11px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; transition: background 0.15s ease; }
.pg-help__btn:hover { background: var(--red-hover); }
.pg-help__btn svg { width: 16px; height: 16px; }

.pg-title { display: flex; align-items: center; gap: 12px; font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 800; color: var(--color-black); margin: 0 0 8px; }
.pg-title::before { content: ""; width: 26px; height: 4px; border-radius: 2px; background: var(--color-cherry-red); flex: 0 0 auto; }
.pg-updated { color: var(--color-metadata-gray); font-size: 14px; margin: 0 0 18px; }
.pg-intro { color: var(--color-desc-gray); font-size: 15.5px; line-height: 1.75; margin: 0 0 26px; }

.pg-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.pg-point { display: flex; gap: 16px; scroll-margin-top: 96px; }
.pg-point__num { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: var(--color-soft-red-tint); color: var(--color-cherry-red); font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.pg-point__body h3 { font-size: 16.5px; font-weight: 700; color: var(--color-black); margin: 3px 0 6px; }
.pg-point__body p { color: var(--color-desc-gray); font-size: 15px; line-height: 1.72; margin: 0; }

/* Contact page */
.contact-head { margin: 0 0 12px; }
.contact-title { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 800; color: var(--color-black); line-height: 1.12; margin: 0 0 16px; }
.contact-sub { color: var(--color-desc-gray); font-size: 16px; line-height: 1.7; margin: 0 0 30px; max-width: 460px; }
.contact-items { display: flex; flex-direction: column; gap: 24px; }
.contact-item { display: flex; gap: 16px; align-items: flex-start; }
.contact-item__icon { width: 52px; height: 52px; border-radius: 14px; background: var(--color-soft-red-tint); color: var(--color-cherry-red); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.contact-item__icon svg { width: 24px; height: 24px; }
.contact-item__body h3 { font-weight: 700; color: var(--color-black); margin: 0 0 4px; font-size: 16px; }
.contact-item__body p { color: var(--color-desc-gray); margin: 0; font-size: 15px; line-height: 1.6; }
.contact-item__body a { color: var(--color-cherry-red); text-decoration: none; font-weight: 600; }
.contact-item__body a:hover { text-decoration: underline; }

.form-title { font-size: clamp(1.5rem, 2.4vw, 1.95rem); font-weight: 800; color: var(--color-black); margin: 0 0 10px; }
.form-sub { color: var(--color-desc-gray); font-size: 15px; line-height: 1.65; margin: 0 0 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field--full { grid-column: 1 / -1; }
.form-field label { font-weight: 700; font-size: 14px; color: var(--color-black); }
.form-field input, .form-field select, .form-field textarea { border: 1px solid var(--color-divider); border-radius: 10px; padding: 12px 14px; font-size: 15px; color: var(--text); background: var(--surface); font-family: inherit; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--color-cherry-red); box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.12); }
.form-field textarea { min-height: 128px; resize: vertical; }
.form-field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737780' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.form-submit { display: inline-flex; align-items: center; gap: 10px; background: var(--color-cherry-red); color: #fff; border: none; padding: 13px 24px; border-radius: 12px; font-weight: 700; font-size: 15px; cursor: pointer; transition: background 0.15s ease; }
.form-submit:hover { background: var(--red-hover); }
.form-submit svg { width: 18px; height: 18px; }

@media (max-width: 1023px) {
  .modern-layout, .modern-layout--contact { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
  .pg-card__pad { padding: 22px 20px 24px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* === OTP SIGN-IN (Continue with Gmail) — DISABLED, pending Google plan.
   Everything below is commented out; remove the trailing */ to re-enable. .otp-open-btn { margin-top: 0.15rem; }
.otp-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.otp-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 22, 0.6);
}
.otp-modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.6rem 1.4rem 1.4rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.otp-modal-x {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.otp-modal-x:hover { color: var(--text); }
.otp-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  text-align: left;
}
.otp-sub {
  font-size: 0.85rem;
  margin-bottom: 1rem;
  text-align: left;
}
.otp-accounts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.otp-account {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  text-align: left;
  transition: border-color var(--transition), background var(--transition);
}
.otp-account:hover { border-color: var(--primary); }
.otp-account[hidden] { display: none; }
.otp-account-other { background: transparent; }
.otp-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.otp-account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otp-code-input {
  width: 100%;
  text-align: center;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.45em;
  padding-left: 0.45em;
  margin-bottom: 0.8rem;
}
.otp-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 0.9rem;
}
.otp-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
}
.otp-link:disabled { color: var(--muted); cursor: default; }
.otp-open-btn { text-align: center; }
/* end DISABLED OTP styles */

/* === ISHAAR INSTITUTE OF TECHNOLOGY — FULL SYSTEM (global, not homepage-only) === */
/* Source: n2/ishaar-homepage/css/styles.css — integrated 1:1, tokens above. */

/* ============================================================ TOKENS (clone aliases) === */
:root {
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px; --space-16: 64px;

  --container-max: 1440px;
  --container-pad: clamp(20px, 5vw, 56px);

  --t-fast: 180ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --surface: var(--color-white);
  --text-primary: var(--color-black);
  --text-secondary: var(--color-desc-gray);
  --field-bg: var(--color-gray);
}

[data-theme="dark"] {
  --surface: #141414;
  --text-primary: #F5F5F5;
  --text-secondary: #94A3B8;
  --field-bg: #1F1F1F;
  --color-gray: #1F1F1F;
  --color-divider: #2E2E2E;
  --color-neutral-badge: #262626;
  --color-soft-red-tint: #2A1416;
  --color-desc-gray: #94A3B8;
}

/* ============================================================
   GLOBAL FRONTEND LAYOUT SYSTEM (non-admin only)
   One shared, centered container with equal left/right outer
   space and identical responsive gutters. Every frontend section
   below inherits these horizontal boundaries — new sections and
   new pages get them for free by reusing the container classes.
   The Admin Panel is untouched: admin routes set body.admin-page
   (see §"Admin Panel" below) and never use these classes.
   ============================================================ */

/* Visually hidden but accessible (screen-reader text). */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* The [hidden] attribute must win over author `display` rules
   (e.g. `.btn { display: inline-flex }` otherwise reveals the
   guest/auth buttons that should be hidden). Scoped to the
   frontend shell so the Admin Panel is unaffected. */
.site-header [hidden],
.mobile-nav [hidden],
.site-footer [hidden],
.announcement [hidden] { display: none !important; }

/* The shared frontend container. */
.fe-container,
.announcement__container,
.header-container,
.hero__content,
.features__container,
.courses__head,
.courses__grid,
.footer-container {
  width: min(var(--container-max), 100% - 2 * var(--container-pad));
  margin-inline: auto;
}

/* Existing generic `.container` pages (catalog, course detail, auth,
   checkout, dashboard…) join the same system, but only on the
   non-admin frontend. */
body:not(.admin-page) .container {
  width: min(var(--container-max), 100% - 2 * var(--container-pad));
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 0;
}

/* ==================================================== §1 ANNOUNCEMENT === */
.announcement {
  width: 100%;
  background: linear-gradient(100deg, #8B0E0E 0%, #A10F16 55%, #8B0E0E 100%);
  color: var(--color-white);
}
.announcement[hidden] { display: none; }

.announcement__container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.4vw, 34px);
  min-height: 44px;
  padding: 6px 0;
}

.announcement__message { display: flex; align-items: center; gap: 9px; }
.announcement__icon { flex: 0 0 auto; color: var(--color-white); }
.announcement__text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.announcement__sep {
  width: 1px; height: 22px;
  background: rgba(255, 255, 255, 0.25);
  flex: 0 0 auto;
}

/* countdown */
.countdown { display: flex; align-items: center; gap: 7px; }
.countdown__icon { color: var(--color-white); margin-right: 3px; }
.countdown__unit {
  display: flex; flex-direction: column; align-items: center;
  min-width: 38px; padding: 3px 6px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 5px;
}
.countdown__num { font-size: 14px; font-weight: 700; line-height: 1.1; color: var(--color-white); font-variant-numeric: tabular-nums; }
.countdown__label { font-size: 8px; font-weight: 500; letter-spacing: 0.6px; color: rgba(255,255,255,0.85); }
.countdown__colon { font-weight: 700; color: rgba(255,255,255,0.7); }

/* buy now */
.announcement__cta {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 20px;
  background: var(--color-white);
  color: var(--color-dark-maroon);
  font-size: 12px; font-weight: 700;
  border-radius: 12px;
  white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.announcement__cta:hover { background: #FCEBEC; }

.announcement__close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  margin-left: 2px;
  background: rgba(255, 255, 255, 0.10);
  border: 0; border-radius: 50%;
  color: var(--color-white);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease);
}
.announcement__close:hover { background: rgba(255, 255, 255, 0.22); }

/* ==================================================== §2 HEADER NAV === */
.site-header {
  width: 100%;
  background: var(--color-white);
  border-bottom: 1px solid #F0F2F5;
  position: relative;
  z-index: 100;
}
html[data-theme="dark"] .site-header {
  background: #141414;
  border-bottom-color: #2E2E2E;
}

.header-container {
  display: flex;
  align-items: center;
  min-height: 86px;
  padding-inline: 0;
  gap: 0;
}

.brand { display: flex; align-items: center; flex: 0 0 auto; margin-right: 32px; text-decoration: none; }
.brand__logo { width: 190px; max-height: 56px; height: auto; object-fit: contain; filter: none; }

/* search */
.course-search {
  position: relative;
  display: flex; align-items: center;
  flex: 0 1 268px;
  min-width: 0; height: 44px;
  background: var(--field-bg);
  border: 1px solid #DDE2E7;
  border-radius: var(--radius-sm);
  margin-right: 28px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
html[data-theme="dark"] .course-search { border-color: #2E2E2E; }
.course-search__icon { flex: 0 0 auto; width: 18px; height: 18px; margin-left: 16px; margin-right: 10px; color: var(--color-desc-gray); pointer-events: none; }
.course-search__input {
  flex: 1 1 auto; min-width: 0; height: 100%;
  padding: 0 16px 0 0; border: 0; background: transparent;
  color: var(--text-primary); font-family: var(--font-primary); font-size: 14px; border-radius: inherit;
}
.course-search__input::placeholder { color: var(--text-secondary); opacity: 1; }
.course-search__input:focus { outline: none; }
.course-search:focus-within { border-color: var(--color-cherry-red); box-shadow: 0 0 0 3px rgba(215,25,32,0.15); }

/* Realtime search suggestion dropdown (header / mobile / catalog search) */
.search-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 1200;
  width: max(100%, 400px);
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
  max-height: 420px;
  overflow-y: auto;
  padding: 8px;
}
.search-suggest__group + .search-suggest__group { border-top: 1px solid var(--border-light); margin-top: 6px; padding-top: 6px; }
.search-suggest__title {
  display: block; padding: 8px 10px 4px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted);
}
.search-suggest__row,
.search-suggest__course {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 9px 10px; margin: 0;
  border: 0; background: transparent;
  border-radius: 8px; cursor: pointer;
  font: inherit; color: var(--ink);
}
.search-suggest__row:hover,
.search-suggest__course:hover { background: var(--surface-2); }
.search-suggest__row .svg-ic { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.search-suggest__row span { font-size: 0.9rem; }
.search-suggest__course img,
.search-suggest__ph {
  width: 56px; height: 36px; flex-shrink: 0;
  object-fit: cover; border-radius: 6px;
  background: var(--surface-3);
}
.search-suggest__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.search-suggest__ct {
  font-size: 0.88rem; font-weight: 600; line-height: 1.3; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.search-suggest__cs { font-size: 0.78rem; color: var(--muted); }
.search-suggest__empty { padding: 14px 10px; font-size: 0.9rem; color: var(--muted); }

/* nav */
.primary-nav { flex: 0 0 auto; }
.primary-nav__list { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.primary-nav__link {
  position: relative; display: block; padding: 6px 2px;
  color: var(--color-black); font-size: 14px; font-weight: 500; line-height: 1.4;
  transition: color var(--t-fast) var(--ease);
}
html[data-theme="dark"] .primary-nav__link { color: #F5F5F5; }
.primary-nav__link:hover { color: var(--color-cherry-red); }
/* Active page: bold label + Dark Maroon underline — both appear at the same
   time when a nav item's page is selected (brand: #8B0E0E). */
.primary-nav__link.is-active,
.primary-nav__link[aria-current="page"] { font-weight: 700; }
.primary-nav__link.is-active::after,
.primary-nav__link[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 3px; background: var(--color-dark-maroon); border-radius: 2px;
}

/* actions */
.header-actions { display: flex; align-items: center; margin-left: auto; gap: 20px; flex: 0 0 auto; }
.auth-actions { display: flex; align-items: center; gap: 11px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding-inline: 24px;
  border-radius: 12px;
  font-family: var(--font-primary); font-size: 14px; line-height: 1;
  white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn--primary { background: var(--color-cherry-red); color: var(--color-white); font-weight: 700; border: 1px solid transparent; }
.btn--primary:hover { background: var(--color-dark-maroon); }
.btn--outline { background: var(--color-white); color: var(--color-cherry-red); border: 1px solid var(--color-cherry-red); font-weight: 600; }
.btn--outline:hover { background: var(--color-soft-red-tint); color: var(--color-dark-maroon); border-color: var(--color-dark-maroon); }
html[data-theme="dark"] .btn--outline { background: transparent; color: var(--color-cherry-red); }
.btn--block { width: 100%; }

.utility-divider { width: 1px; height: 22px; background: var(--color-divider); flex: 0 0 auto; }
.utility-actions { display: flex; align-items: center; gap: 10px; }
.utility-item { position: relative; display: flex; }

.icon-button {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0;
  background: transparent; border: 0; border-radius: 50%;
  color: var(--color-black); cursor: pointer;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
html[data-theme="dark"] .icon-button { color: #F5F5F5; }
.icon-button:hover { color: var(--color-cherry-red); }
.icon-button svg { width: 20px; height: 20px; }

.cart-badge {
  position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--color-cherry-red); color: var(--color-white);
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 168px; padding: 6px;
  background: var(--surface); border: 1px solid var(--color-divider); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.10); z-index: 20;
}
.dropdown > li { padding: 9px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-primary); cursor: pointer; }
.dropdown > li:hover, .dropdown > li:focus-visible { background: var(--color-gray); }
.dropdown > li[aria-selected="true"] { color: var(--color-cherry-red); font-weight: 600; }

.menu-toggle { display: none; }
.icon-close { display: none; }
body.nav-open .icon-menu { display: none; }
body.nav-open .icon-close { display: block; }

/* mobile panel */
.mobile-nav { border-top: 1px solid #F0F2F5; background: var(--surface); }
html[data-theme="dark"] .mobile-nav { border-top-color: #2E2E2E; }
.mobile-nav[hidden] { display: none; }
.mobile-nav__inner { max-width: 1800px; margin-inline: auto; padding: 16px 18px 22px; }
.mobile-search {
  position: relative;
  display: flex; align-items: center; height: 44px; margin-bottom: 14px;
  background: var(--field-bg); border: 1px solid #DDE2E7; border-radius: var(--radius-sm);
}
html[data-theme="dark"] .mobile-search { border-color: #2E2E2E; }
.mobile-search:focus-within { border-color: var(--color-cherry-red); }
.mobile-nav__list { display: flex; flex-direction: column; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-divider); }
.mobile-nav__link { display: block; padding: 14px 2px; border-bottom: 1px solid var(--color-divider); font-size: 15px; font-weight: 500; color: var(--text-primary); text-decoration: none; }
.mobile-nav__link[aria-current="page"] { color: var(--color-cherry-red); font-weight: 600; }
.mobile-nav__auth { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.mobile-nav__utility { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--color-divider); }

/* ====================================================== §3 MAIN HERO === */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 600px;
  display: flex;
  align-items: center;
  text-align: left;
  padding: 0;
  background-color: #102331;
  background-image: url("/assets/hero-ict.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.hero__content {
  position: relative;
  z-index: 1;
  padding: 64px 0;
}

.hero__card {
  max-width: 560px;
  background: var(--color-white);
  border: 1px solid #ECEEF1;
  border-radius: 18px;
  padding: 40px 38px;
  box-shadow: 0 24px 60px rgba(16, 35, 49, 0.20);
}

.hero .hero__eyebrow {
  display: flex; align-items: center; gap: 10px;
  color: var(--color-cherry-red);
  font-size: 13px; font-weight: 700; letter-spacing: 1.6px;
  text-transform: uppercase; line-height: 1.4; margin-bottom: 14px;
}
.hero .hero__eyebrow::before {
  content: ""; flex: 0 0 auto; width: 26px; height: 2px; background: var(--color-cherry-red);
}
/* Scoped to .hero so it outranks the legacy `.hero h1` rule. */
.hero .hero__title {
  font-family: var(--font-primary);
  font-size: clamp(2rem, 3.1vw, 2.75rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 100%;
  color: var(--color-black);
}
.hero__title-primary { display: block; color: var(--color-black); }
.hero__title-accent { display: block; color: var(--color-cherry-red); }

.hero .hero__description {
  max-width: 460px;
  margin: 18px 0 26px;
  color: var(--color-desc-gray);
  font-size: 16px; font-weight: 400; line-height: 1.6;
}

.hero__cta-group { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero__cta-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px;
  border: 0; border-radius: 12px;
  background: var(--color-cherry-red); color: var(--color-white);
  font-size: 15px; font-weight: 700; text-decoration: none;
  transition: background-color 200ms var(--ease);
}
.hero__cta-primary:hover { background: var(--color-dark-maroon); }
.hero__cta-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px 0 14px;
  border: 1px solid #DDE2E7; border-radius: 12px;
  background: var(--color-white); color: var(--color-black);
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease);
}
.hero__cta-secondary:hover { background: #F5F5F5; border-color: #C9CFD6; }
.hero__play {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--color-cherry-red); color: var(--color-white); flex: 0 0 auto;
}

/* ================================================== §4 KEY FEATURES === */
.features {
  background: transparent;
  padding: clamp(40px, 5vw, 60px) 0;
}
.features__container { /* width from the shared container system */ }
.features__grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius);
  box-shadow: var(--shadow-page-card);
  padding: 1.35rem 0.5rem;
}

.feature { position: relative; padding: 8px 26px; text-align: center; }
.feature:not(:last-child)::after {
  content: ""; position: absolute; top: 2px; bottom: 2px; right: 0; width: 1px;
  background: var(--color-divider);
}
.feature__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--color-soft-red-tint); color: var(--color-cherry-red);
  margin-bottom: 18px;
}
.feature__icon svg { width: 30px; height: 30px; }
.feature__title { color: var(--color-black); font-size: 16px; font-weight: 700; line-height: 1.35; margin-bottom: 12px; }
.feature__text { color: var(--color-desc-gray); font-size: 14px; font-weight: 400; line-height: 1.6; }

/* ================================================= §5 LATEST COURSES === */
.courses {
  background: transparent;
  padding: clamp(48px, 7vw, 84px) 0 var(--page-bottom-space);
}
.courses__head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.courses__eyebrow {
  display: flex; align-items: center; gap: 12px;
  color: var(--color-cherry-red); font-size: 13px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 10px;
}
.courses__line { display: block; width: 30px; height: 3px; background: var(--color-cherry-red); border-radius: 2px; }
.courses__title { color: var(--text-primary); font-size: clamp(1.6rem, 2.6vw, 2rem); font-weight: 700; line-height: 1.2; }
.courses__subtitle { margin-top: 8px; color: var(--text-secondary); font-size: 15px; line-height: 1.5; }
.courses__viewall {
  display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
  color: var(--color-cherry-red); font-size: 15px; font-weight: 700; white-space: nowrap; text-decoration: none;
  transition: gap var(--t-fast) var(--ease);
}
.courses__viewall:hover { gap: 12px; }

.courses__grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

/* Catalog pagination — Previous / 1 2 3 / Next (hidden until >1 page) */
.catalog-pagination {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  flex-wrap: wrap;
  margin-top: clamp(28px, 4vw, 44px);
}
.catalog-pagination[hidden] { display: none; }
.catalog-pagination__btn {
  min-width: 42px; height: 42px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-divider); border-radius: 10px;
  background: var(--surface); color: var(--text-primary);
  font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.catalog-pagination__btn:hover:not(:disabled):not(.is-active) { background: var(--color-gray); }
.catalog-pagination__btn.is-active { background: var(--color-black); border-color: var(--color-black); color: #fff; }
.catalog-pagination__btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---- course card (clone) ---- */
.course-card {
  display: flex; flex-direction: column;
  background: var(--color-white);
  border: 1px solid var(--color-divider);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  text-decoration: none; color: inherit; cursor: pointer;
  transition: box-shadow var(--t-fast) var(--ease);
}
html[data-theme="dark"] .course-card { background: #1F1F1F; }
.course-card:hover { box-shadow: var(--shadow-card-hover, 0 10px 26px rgba(26,26,26,0.13)); }

.course-card__media { position: relative; aspect-ratio: 16 / 9; background: var(--color-gray); }
.course-card__media img { width: 100%; height: 100%; object-fit: cover; }
.course-card__placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-gray); color: var(--color-metadata-alt);
}
.course-card__placeholder svg { width: 48px; height: 48px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: var(--radius-sm); font-weight: 600; line-height: 1; white-space: nowrap;
}
.badge--new {
  position: absolute; top: 12px; left: 12px;
  padding: 8px 14px; font-size: 14px; font-weight: 600;
  background: var(--color-cherry-red); color: var(--color-white);
}
.badge--category { padding: 6px 10px; font-size: 13px; background: var(--color-soft-red-tint); color: var(--color-dark-maroon); }
.badge--level { padding: 6px 12px; font-size: 13px; font-weight: 700; background: var(--color-soft-red-tint); color: var(--color-dark-maroon); }
.badge--discount { padding: 8px 12px; font-size: 13px; font-weight: 600; background: var(--color-neutral-badge); color: var(--text-primary); margin-left: auto; }

.course-card__body { display: flex; flex-direction: column; padding: 24px; flex: 1 1 auto; }
.course-card__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.course-card__meta .badge--level { margin-left: auto; }
.course-meta {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--color-metadata-alt); font-size: 12px; font-weight: 500;
}
.course-meta svg { color: var(--color-metadata-alt); width: 14px; height: 14px; }

/* Scoped so it outranks the legacy `.course-card h3` rule. */
.course-card .course-card__title {
  margin: auto 0 0; color: var(--text-primary);
  font-size: 20px; font-weight: 700; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
/* Bottom-anchored title + footer (divider → pricing). The title absorbs the
   free space of equal-height cards, so the meta row stays pinned to the top
   and dividers/prices line up across a row. */
.course-card__footer { display: flex; flex-direction: column; }
.course-card__divider { height: 1px; background: var(--color-divider); margin-top: 18px; }
.course-card__pricing { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.price-current { color: var(--color-dark-maroon); font-size: 22px; font-weight: 700; line-height: 1; }
.price-current--free { font-size: 22px; }
.price-original { color: var(--color-metadata-alt); font-size: 14px; font-weight: 500; text-decoration: line-through; }

/* ======================================================= §6 FOOTER === */
.site-footer { width: 100%; background: var(--color-black); color: var(--color-white); margin-top: 0; border-radius: 0; }
.footer-container { padding: 56px 0 28px; }
.footer-main {
  display: grid;
  grid-template-columns: minmax(280px, 1.7fr) repeat(4, minmax(120px, 1fr));
  gap: 40px;
  padding: 0;
}

.footer-brand__logo-link { display: inline-block; }
.footer-brand__logo { width: 200px; max-height: 60px; height: auto; object-fit: contain; }
.footer-brand__desc {
  margin-top: 16px; max-width: 360px;
  color: var(--color-muted-gray); font-size: 14px; font-weight: 400; line-height: 1.6;
}
.social { display: flex; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; }
.social__link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--color-social-surface); color: var(--color-white);
  transition: background-color var(--t-fast) var(--ease);
}
.social__link:hover { background: var(--color-cherry-red); }
.social__link svg { width: 24px; height: 24px; }

.footer-col__title {
  position: relative; color: var(--color-white);
  font-size: 14px; font-weight: 700; line-height: 1.4;
  text-transform: uppercase; letter-spacing: 0.4px;
  padding-bottom: 12px; margin-bottom: 16px;
}
.footer-col__title::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 44px; height: 3px; background: var(--color-cherry-red);
}
.footer-col__list { list-style: none; margin: 0; padding: 0; }
.footer-col__list li + li { margin-top: 8px; }
.footer-col__list a {
  color: var(--color-muted-gray); font-size: 14px; font-weight: 400; line-height: 1.7; text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
.footer-col__list a:hover { color: var(--color-cherry-red); }

.footer-bottom { margin-top: 32px; display: block; border-top: 0; padding: 0; justify-content: initial; }
.footer-divider { border: 0; height: 1px; background: var(--color-footer-divider); margin: 0 0 16px; }
.footer-copyright { color: var(--color-muted-gray); font-size: 13px; font-weight: 400; text-align: center; }

/* ==================================================== HOME: 4-UP COURSES === */
.home-page .courses__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ========================================================= §7 ABOUT PAGE === */
.about-intro { background: transparent; padding: clamp(40px, 5vw, 64px) 0 clamp(20px, 3vw, 32px); }
.about-intro__grid {
  display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr); gap: 0; align-items: start;
}
.about-intro__card {
  position: relative; z-index: 2;
  background: var(--surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius);
  box-shadow: var(--shadow-page-card);
  padding: clamp(28px, 3.5vw, 44px);
}
.about-eyebrow { display: flex; align-items: center; gap: 10px; color: var(--color-cherry-red); font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin: 0 0 14px; }
.about-intro__text .about-eyebrow { color: var(--color-cherry-red); }
.about-eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--color-cherry-red); }
.about-intro__text h2 { font-size: clamp(1.6rem, 2.35vw, 2.2rem); font-weight: 800; line-height: 1.12; color: var(--color-black); margin: 0 0 20px; }
.about-intro__text p { color: var(--color-desc-gray); font-size: 16px; line-height: 1.75; margin: 0 0 16px; }
.about-intro__text p:last-of-type { margin-bottom: 26px; }
.about-intro__cta { gap: 8px; }
.about-intro__media { position: relative; z-index: 1; margin-left: -7%; }
.about-intro__figure { position: relative; }
.about-intro__media img { width: 100%; height: auto; border-radius: 16px; display: block; box-shadow: 0 20px 50px rgba(16, 35, 49, 0.14); }
.about-intro__row { display: flex; align-items: stretch; gap: 14px; margin-top: 18px; }
.about-intro__badge {
  flex: 1;
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border-radius: 16px;
  box-shadow: var(--shadow-page-card);
  padding: 18px 22px;
}
.about-intro__play {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
  background: var(--color-cherry-red); color: #fff;
}
.about-intro__play svg { margin-left: 2px; }
.about-intro__badge-text strong { display: block; font-size: 16px; font-weight: 800; color: var(--color-black); }
.about-intro__badge-text p { margin: 3px 0 0; font-size: 14px; color: var(--color-desc-gray); }
.about-intro__stats {
  flex: 1.08;
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--surface); border-radius: 16px;
  box-shadow: var(--shadow-page-card);
  padding: 22px 10px;
}
.about-intro__stat { text-align: center; padding: 4px 12px; }
.about-intro__stat + .about-intro__stat { border-left: 1px solid var(--color-divider); }
.about-intro__stat strong { display: block; font-size: 30px; font-weight: 800; color: var(--color-cherry-red); line-height: 1.1; }
.about-intro__stat span { display: block; margin-top: 6px; font-size: 15px; color: var(--color-desc-gray); font-weight: 600; }

.about-mvv { background: transparent; padding: clamp(20px, 3vw, 32px) 0 var(--page-bottom-space); }
.about-mvv__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.5vw, 28px); }
.mvv { text-align: center; background: var(--surface); border: 1px solid var(--color-divider); border-radius: 16px; padding: 34px 26px 32px; box-shadow: var(--shadow-page-card); }
.mvv__icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: var(--color-soft-red-tint); color: var(--color-cherry-red); margin-bottom: 18px; }
.mvv__icon svg { width: 30px; height: 30px; }
.mvv h3 { font-size: 20px; font-weight: 800; color: var(--color-black); margin: 0 0 12px; }
.mvv p { color: var(--color-desc-gray); font-size: 15px; line-height: 1.7; margin: 0; }

/* ==================================================== CLONE RESPONSIVE === */

@media (max-width: 1439px) {
  .brand { margin-right: 26px; }
  .brand__logo { width: 172px; }
  .course-search { flex-basis: 236px; margin-right: 22px; }
  .primary-nav__list { gap: 22px; }
  .header-actions { gap: 16px; }
}

@media (max-width: 1279px) {
  .courses__grid,
  .home-page .courses__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  .header-container { min-height: 76px; }
  .brand__logo { width: 156px; }
  .course-search { flex-basis: 210px; margin-right: 18px; }
  .primary-nav, .auth-actions, .utility-divider { display: none; }
  .header-actions { margin-left: auto; }
  .menu-toggle { display: inline-flex; }
  .utility-actions { gap: 4px; }

  .features__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 26px; }
  .feature { padding: 10px 22px; }
  .feature:nth-child(3n)::after { display: none; }

  .courses__grid,
  .home-page .courses__grid,
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-main { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }

  .about-intro__grid { grid-template-columns: 1fr; }
  .about-intro__media { margin-left: 0; }
}

@media (max-width: 767px) {
  .header-container { min-height: 68px; }
  .brand__logo { width: 142px; max-height: 42px; }
  .course-search { display: none; }
  .utility-item { display: none; }
  .utility-item#nav-cart { display: flex; }
  .menu-toggle { display: inline-flex; }

  .announcement__container { flex-wrap: wrap; justify-content: center; row-gap: 8px; padding: 8px 18px; }
  .announcement__sep { display: none; }
  .announcement__text { font-size: 12px; }

  .hero { min-height: 0; background-position: center; }
  .hero__content { padding: 36px 0; }
  .hero__card { padding: 26px 20px; max-width: 100%; }
  .hero .hero__title { font-size: clamp(1.7rem, 7.4vw, 2.2rem); }
  .hero .hero__description { font-size: 15px; }

  .features__grid { grid-template-columns: 1fr; row-gap: 22px; }
  .feature { padding: 0; }
  .feature::after { display: none !important; }
  .feature__icon svg { width: 28px; height: 28px; }

  .courses__head { flex-direction: column; align-items: flex-start; }
  .courses__grid,
  .home-page .courses__grid,
  .related-grid { grid-template-columns: 1fr; gap: 20px; }
  .course-card__body { padding: 18px; }
  .course-card__title { font-size: 18px; }
  .price-current { font-size: 24px; }

  .about-intro__row { flex-direction: column; gap: 12px; }
  .about-intro__badge { padding: 14px 16px; }
  .about-intro__badge-text strong { font-size: 14px; }
  .about-intro__badge-text p { font-size: 13px; }
  .about-intro__stats { grid-template-columns: 1fr; gap: 0; }
  .about-intro__stat + .about-intro__stat { border-left: 0; border-top: 1px solid var(--color-divider); padding-top: 14px; margin-top: 14px; }
  .about-mvv__grid { grid-template-columns: 1fr; }
  .mvv { padding: 28px 22px; }

  .footer-main { grid-template-columns: 1fr; gap: 28px; }
  .footer-brand { grid-column: auto; }
}

@media (max-width: 479px) {
  .countdown__unit { min-width: 32px; padding: 2px 4px; }
  .countdown__num { font-size: 13px; }
  .announcement__cta { height: 28px; padding: 0 14px; font-size: 11px; }
  .footer-col__list { display: grid; grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .announcement, .btn, .course-card, .course-card__cta, .hero__cta-primary, .hero__cta-secondary, .social__link, .icon-button, .primary-nav__link, .footer-col__list a, .courses__viewall {
    transition-duration: 0.01ms !important;
  }
}

/* Main header stays visible while scrolling. The announcement bar above it
   keeps its existing behaviour (it scrolls away). */
.site-header { position: sticky; top: 0; z-index: 200; }
html { scroll-padding-top: 96px; }
@media (max-width: 767.98px) { html { scroll-padding-top: 64px; } }

/* Route transitions must paint at the top: stop the browser from re-anchoring
   scroll when new page content is inserted. */
#app { overflow-anchor: none; }

/* === Student account modules (profile / security / notifications) === */

/* Sidebar groups + collapse */
.student-shell { transition: grid-template-columns 0.18s ease; }
.student-shell.is-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
.student-nav__group { display: flex; flex-direction: column; gap: 4px; }
.student-nav__group + .student-nav__group { margin-top: 12px; }
.student-nav__group-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-deep);
  padding: 4px 12px;
}
.student-nav__item { position: relative; }
.student-nav__collapse {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: -2px 0 8px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}
.student-nav__collapse:hover { background: var(--surface); color: var(--ink); }
.student-nav__collapse .svg-ic { width: 15px; height: 15px; }
.student-shell.is-collapsed .student-nav__collapse { align-self: center; transform: rotate(180deg); }
.student-shell.is-collapsed .student-nav__label,
.student-shell.is-collapsed .student-nav__group-label { display: none; }
.student-shell.is-collapsed .student-nav__item { justify-content: center; padding: 11px 0; }
.student-shell.is-collapsed .student-nav__group + .student-nav__group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-light); }

/* Breadcrumbs */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
.crumbs i { font-style: normal; opacity: 0.6; }
.crumbs strong { color: var(--ink); font-weight: 600; }

/* Profile */
.profile-stack { display: flex; flex-direction: column; gap: 1rem; }
.profile-stack .sec-card { margin-bottom: 0; }
.profile-card { padding: 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 1.15rem; }
.profile-card__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.profile-ident { display: flex; align-items: center; gap: 14px; min-width: 0; }
.profile-ident__text h2 { font-size: 1.2rem; margin: 0; }
.profile-ident__text .muted { font-size: 0.88rem; }
.profile-avatar {
  position: relative; width: 74px; height: 74px; flex-shrink: 0;
  border-radius: 14px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border-light);
  display: grid; place-items: center; cursor: pointer;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-avatar__initials { font-weight: 700; font-size: 1.45rem; text-transform: uppercase; color: var(--ink); }
.profile-avatar__overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  background: rgba(17, 24, 39, 0.68); color: #fff;
  font-size: 0.6rem; font-weight: 600; text-align: center; line-height: 1.1;
  opacity: 0; transition: opacity 0.18s ease; padding: 4px;
}
.profile-avatar__overlay .svg-ic { width: 18px; height: 18px; }
.profile-avatar:hover .profile-avatar__overlay,
.profile-avatar:focus-visible .profile-avatar__overlay { opacity: 1; }
.profile-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .form-group { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.form-grid label { font-size: 0.85rem; font-weight: 600; }
.req { color: #dc2626; margin-left: 3px; }
.form-hint { font-size: 0.74rem; color: var(--muted); }
.profile-card .input { background: var(--card-bg); }
.input.is-locked { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon .svg-ic { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.input-with-icon .input { padding-left: 34px; }
.profile-section { border-top: 1px solid var(--border-light); padding-top: 1rem; display: flex; flex-direction: column; gap: 0.8rem; }
.profile-section h3 { font-size: 1rem; margin: 0; }
.profile-privacy { flex-direction: row; align-items: center; justify-content: space-between; gap: 18px; }
.profile-privacy p { margin: 2px 0 0; font-size: 0.85rem; }
.switch { position: relative; display: inline-flex; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch__track { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: background 0.18s ease; pointer-events: none; }
.switch__track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.18s ease;
}
.switch input:checked + .switch__track { background: var(--primary); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:disabled + .switch__track { opacity: 0.5; }

/* Security */
.sec-card { padding: 1.35rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }
.sec-head { display: flex; gap: 12px; align-items: flex-start; }
.sec-head .svg-ic { width: 22px; height: 22px; color: var(--primary-deep); flex-shrink: 0; margin-top: 2px; }
.sec-head h3 { margin: 0; font-size: 1.02rem; }
.sec-head p { margin: 2px 0 0; font-size: 0.86rem; }
.sec-form { display: flex; flex-direction: column; gap: 14px; max-width: 540px; }
.sec-form .btn { align-self: flex-start; }

/* Close account */
.danger-card { padding: 1.4rem 1.5rem; border: 1px solid rgba(239, 68, 68, 0.4); }
.danger-card__head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 1rem; }
.danger-card__head .svg-ic { width: 22px; height: 22px; color: #dc2626; flex-shrink: 0; margin-top: 2px; }
.danger-card__head h3 { margin: 0; font-size: 1.05rem; }
.danger-card__head p { margin: 2px 0 0; font-size: 0.86rem; }
.danger-list { margin: 0 0 1.1rem 1.1rem; padding: 0; display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 0.88rem; }
.check-row { display: flex; align-items: center; gap: 10px; margin-bottom: 1rem; font-size: 0.9rem; cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: #dc2626; }
/* Account deletion workflow modal: email -> OTP -> reason -> final warning. */
.del-modal { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 16px; }
.del-modal[hidden] { display: none; }
.del-modal__backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, 0.6); }
.del-modal__card {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--surface, #fff);
  color: var(--ink, #1f2937);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 1.35rem 1.5rem 1.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}
.del-modal__head { display: flex; align-items: center; gap: 10px; margin-bottom: 0.85rem; }
.del-modal__head h3 { margin: 0; font-size: 1.18rem; font-weight: 700; color: var(--ink); flex: 1; }
.del-modal__icon { display: inline-flex; align-items: center; color: var(--color-cherry-red); flex-shrink: 0; }
.del-modal__icon svg, .del-modal__icon .svg-ic { width: 22px; height: 22px; }
.del-modal__x {
  border: 0; background: none; cursor: pointer;
  font-size: 1.6rem; line-height: 1; padding: 2px 6px;
  color: var(--muted); border-radius: 6px; flex-shrink: 0;
}
.del-modal__x:hover { background: var(--surface-2); color: var(--ink); }
.del-modal__text { margin: 0 0 1rem; color: var(--muted); font-size: 0.95rem; line-height: 1.55; }
.del-modal__label { display: block; font-weight: 700; font-size: 0.92rem; color: var(--ink); margin-bottom: 0.45rem; }
.del-modal__input { width: 100%; margin-bottom: 0.85rem; }
.del-modal__code { font-size: 1.35rem; letter-spacing: 0.5em; text-align: center; font-weight: 700; padding-top: 0.85rem; padding-bottom: 0.85rem; }
.del-modal__note { margin: 0 0 0.6rem; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.del-modal__error { margin: 0 0 0.85rem; color: var(--color-cherry-red); font-size: 0.9rem; font-weight: 600; }
.del-modal__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.del-modal__primary { background: var(--color-cherry-red); border-color: var(--color-cherry-red); color: #fff; }
.del-modal__primary:hover { filter: brightness(0.94); }
.del-warn { margin-bottom: 0.5rem; }
.del-warn ul { margin: 0 0 1rem 1.1rem; padding: 0; display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }

/* Notifications */
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-row {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.notif-row__icon {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(215, 25, 32, 0.1); color: var(--primary-deep);
}
.notif-row__icon .svg-ic { width: 18px; height: 18px; }
.notif-row__body { flex: 1; min-width: 0; }
.notif-row__body strong { font-size: 0.93rem; }
.notif-row__body p { font-size: 0.85rem; margin: 2px 0; }
.notif-row__time { font-size: 0.74rem; color: var(--muted); }

/* Platform updates */
.updates-card { padding: 0.4rem 1.5rem; }
.update-row { display: flex; gap: 16px; padding: 1rem 0; border-bottom: 1px solid var(--border-light); }
.update-row:last-child { border-bottom: none; }
.update-row__date { min-width: 96px; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.update-row__body strong { font-size: 0.95rem; }
.update-row__body p { margin: 3px 0 0; font-size: 0.87rem; }

/* Header: student-area variant (matches the dashboard mock) */
.header-user { display: flex; align-items: center; gap: 8px; }
.header-user__bell { display: inline-flex; }
.header-user__chip {
  width: 38px; height: 38px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  background: var(--primary); color: #fff;
  font-weight: 700; font-size: 0.84rem; text-decoration: none;
}
.header-user__chip:hover { text-decoration: none; opacity: 0.9; }
.header-user__avatar { width: 100%; height: 100%; object-fit: cover; }
body.student-area .course-search { display: none; }
body.student-area .primary-nav__link[data-route="/courses"],
body.student-area .primary-nav__link[data-route="/about"],
body.student-area #nav-dashboard { display: none; }

@media (max-width: 768px) {
  .student-shell.is-collapsed { grid-template-columns: 1fr; }
  .student-nav__collapse { display: none; }
  .student-nav { gap: 6px; }
  .student-nav__group { flex-direction: row; gap: 6px; }
  .student-nav__group + .student-nav__group { margin-top: 0; padding-top: 0; border-top: none; }
  .student-nav__group-label { display: none; }
  .student-shell.is-collapsed .student-nav__item { justify-content: flex-start; padding: 8px 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .profile-privacy { flex-direction: column; align-items: flex-start; }
  .update-row { flex-direction: column; gap: 4px; }
  .update-row__date { min-width: 0; }
}
/* ============================================================
   PORTAL SHELL (student / instructor workspaces)
   ============================================================ */
/* The marketing footer belongs to public pages only. */
body.no-footer .site-footer { display: none; }
body.no-footer #app { padding-bottom: 0; }

/* Pin the header while the workspace scrolls (mobile already does this). */
@media (min-width: 769px) {
  body.student-area .site-header { position: sticky; top: 0; z-index: 200; }
}

/* Centre the public nav between the brand and the account actions. */
body.student-area .primary-nav { flex: 1 1 auto; display: flex; justify-content: center; }
body.student-area .primary-nav__list { justify-content: center; }

/* Sidebar: sticky, own scroll, never hidden behind page content. */
@media (min-width: 769px) {
  .student-sidebar {
    position: sticky;
    top: 64px;
    align-self: start;
    height: calc(100vh - 64px);
    max-height: calc(100vh - 64px);
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .student-sidebar::-webkit-scrollbar { width: 6px; }
  .student-sidebar::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 999px; }
  .student-sidebar::-webkit-scrollbar-track { background: transparent; }
}

/* Header avatar dropdown */
.header-user__wrap { position: relative; display: flex; }
button.header-user__chip { border: 0; padding: 0; cursor: pointer; font-family: inherit; }
button.header-user__chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 272px;
  padding: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 300;
}
.user-menu[hidden] { display: none; }
.user-menu__head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 14px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 6px;
}
.user-menu__avatar {
  width: 44px; height: 44px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--primary); color: #fff;
  font-weight: 700; font-size: 0.9rem;
}
.user-menu__avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-menu__id { min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.user-menu__id strong { font-size: 0.95rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu__id span { font-size: 0.8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu__list { display: flex; flex-direction: column; gap: 2px; }
.user-menu__item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px;
  border: 0; border-radius: 10px;
  background: none; color: var(--text);
  font-family: inherit; font-size: 0.92rem; font-weight: 500;
  text-align: left; cursor: pointer;
}
.user-menu__item svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.user-menu__item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.user-menu__foot { border-top: 1px solid var(--border-light); margin-top: 6px; padding-top: 6px; }
.user-menu__item--danger { color: var(--primary); }
.user-menu__item--danger svg { color: var(--primary); }


/* ===== STUDENT SIGN-IN EMAIL CHANGE ===== */
.sec-email { margin: 0.35rem 0 0.65rem; }
.sec-email__label { display: block; font-weight: 600; font-size: 0.94rem; color: var(--ink); margin-bottom: 0.55rem; }
.sec-email__row { display: flex; align-items: stretch; gap: 0.6rem; }
.sec-email__box {
  flex: 1; min-width: 0;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.72rem 0.9rem;
  font-size: 0.95rem; color: var(--muted);
  background: var(--surface-2);
  overflow-wrap: anywhere;
}
.sec-email__box strong { color: var(--ink); font-weight: 700; }
.sec-email__edit {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: auto; padding: 0 1.05rem;
  border: 1px solid var(--color-cherry-red);
  border-radius: 8px;
  background: transparent;
  color: var(--color-cherry-red);
  font-size: 0.95rem; font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.sec-email__edit:hover { background: color-mix(in srgb, var(--color-cherry-red) 10%, transparent); }

.ec-modal { position: fixed; inset: 0; z-index: 1400; display: grid; place-items: center; padding: 16px; }
.ec-modal[hidden] { display: none; }
.ec-modal__backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, 0.55); }
.ec-modal__card {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--surface, #fff);
  color: var(--ink, #1f2937);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 1.35rem 1.5rem 1.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
.ec-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 0.85rem; }
.ec-modal__head h3 { margin: 0; font-size: 1.18rem; font-weight: 700; color: var(--ink); }
.ec-modal__x {
  border: 0; background: none; cursor: pointer;
  font-size: 1.6rem; line-height: 1; padding: 2px 6px;
  color: var(--muted); border-radius: 6px;
}
.ec-modal__x:hover { background: var(--surface-2); color: var(--ink); }
.ec-modal__text { margin: 0 0 1.1rem; color: var(--muted); font-size: 0.96rem; line-height: 1.55; }
.ec-modal__label { display: block; font-weight: 700; font-size: 0.94rem; color: var(--ink); margin-bottom: 0.5rem; }
.ec-modal__input { width: 100%; margin-bottom: 0.85rem; }
.ec-modal__code { font-size: 1.35rem; letter-spacing: 0.5em; text-align: center; font-weight: 700; padding-top: 0.85rem; padding-bottom: 0.85rem; }
.ec-modal__note { margin: 0 0 1rem; color: var(--muted); font-size: 0.93rem; line-height: 1.55; }
.ec-modal__error { margin: 0 0 0.85rem; color: var(--danger, #b91c1c); font-size: 0.9rem; font-weight: 600; }
.ec-modal__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.ec-modal__primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.ec-modal__primary:hover { filter: brightness(0.94); }

/* ==========================================================================
   Course builder: wider layout + 3-column sidebar + unified Course Pricing
   ========================================================================== */
.builder-content {
  max-width: 1680px;
  padding: 20px 24px;
}
.builder-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 24px;
}
.builder-sidebar {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.builder-sidebar .builder-card {
  padding: 16px;
  min-height: 0;
}
.builder-sidebar .builder-card h3 {
  font-size: 0.85rem;
  margin-bottom: 12px;
}
.builder-sidebar .builder-card label {
  font-size: 0.76rem;
}
.builder-sidebar .builder-card .input,
.builder-sidebar .builder-card .select {
  font-size: 0.82rem;
}

.builder-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.builder-card__head h3 {
  margin-bottom: 0;
}

/* Red square add button (q790 / gg8) */
.plan-add-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: background .15s ease, border-color .15s ease;
}
.plan-add-btn:hover:not(:disabled) {
  background: var(--red-hover, #b9141a);
  border-color: var(--red-hover, #b9141a);
}
.plan-add-btn:focus-visible {
  outline: 2px solid var(--primary-glow);
  outline-offset: 2px;
}
.plan-add-btn:disabled {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--muted);
  opacity: 0.7;
  cursor: not-allowed;
}

/* Free / Paid selector kept inside the unified section */
.plan-pricing-model {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.plan-pricing-model__opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.plan-pricing-model__opt input {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
}

/* Saved plans table: PRICE | VALIDITY | delete */
.plan-table__head,
.plan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 24px;
  gap: 6px;
  align-items: center;
}
.plan-table__head {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0 2px 7px;
  border-bottom: 1px solid var(--border-light);
}
.plan-row {
  padding: 9px 2px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  font-size: 0.78rem;
}
.plan-row:last-child {
  border-bottom: 0;
}
.plan-row:hover,
.plan-row:focus-visible {
  background: var(--surface-2);
  outline: none;
}
.plan-row__price {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.plan-row__price b {
  font-weight: 700;
  color: var(--ink);
}
.plan-row__price s {
  color: var(--muted);
  font-size: 0.68rem;
}
.plan-row__validity {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-row__delete {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.plan-row__delete:hover {
  color: var(--danger);
}
.plan-table__empty {
  margin: 0;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Add Plan popup */
.plan-modal {
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}
.plan-modal .admin-modal-body {
  overflow-y: auto;
}
.plan-discount-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.plan-discount-fields {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.plan-discount-fields[hidden] {
  display: none;
}
.plan-discount-input {
  width: 92px;
  flex: 0 0 auto;
}
.plan-discount-eq {
  font-weight: 700;
  color: var(--text);
}
.plan-effective {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-deep);
}
.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--primary-glow);
  outline-offset: 2px;
}
.plan-modal-error {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Course details: OTHER PLANS */
.other-plans {
  margin: 12px 0 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-light);
}
.other-plans__title {
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 8px;
  font-weight: 700;
}
.other-plan-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  margin-bottom: 6px;
  font-size: 0.84rem;
  text-align: left;
}
.other-plan-row:hover {
  border-color: var(--primary);
  background: var(--surface-3);
}
.other-plan-row__label {
  color: var(--text);
  font-weight: 500;
}
.other-plan-row__price {
  font-weight: 700;
  color: var(--primary-deep);
}

/* ==========================================================================
   Checkout (multi-plan, offline USSD instructions)
   ========================================================================== */
.checkout-page {
  background: var(--bg);
  padding: 1.5rem 0 3rem;
}
.checkout-container {
  max-width: 1180px;
}
.checkout-crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.checkout-crumbs a {
  color: var(--primary);
  text-decoration: none;
}
.checkout-crumbs .is-current {
  color: var(--text);
}
.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
}
.checkout-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 18px;
}
.checkout-main > .checkout-card:last-child {
  margin-bottom: 0;
}
.checkout-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 18px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
  line-height: 1.2;
}
.checkout-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.checkout-title-row .checkout-title {
  margin: 0;
}
.checkout-merchant {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}
.pm-subtitle {
  margin: 14px 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.checkout-steps {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 18px;
}
.checkout-step {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 14px;
  align-items: start;
}
.checkout-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(200, 30, 45, 0.10);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
}
.checkout-step__body {
  font-size: 0.92rem;
  line-height: 1.5;
}
.checkout-step__body label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}
.billing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
#checkout-form .form-group {
  margin-bottom: 16px;
}
#checkout-form .form-group:last-child {
  margin-bottom: 0;
}
#checkout-form .form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--text);
  margin-bottom: 6px;
}
#checkout-form .input {
  width: 100%;
}
.input.is-locked {
  background: var(--surface-2);
  color: var(--muted);
  cursor: default;
}
.pm-choices {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.pm-choice {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--surface);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
}
.pm-choice input {
  accent-color: var(--primary);
}
.pm-choice.is-active {
  border-color: var(--primary);
  background: var(--surface-3);
}
.pm-choice.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.pm-badge {
  font-size: 0.62rem;
  background: var(--color-neutral-badge, #eef0f3);
  color: var(--muted);
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pm-providers {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.pm-provider {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
}
.pm-provider input {
  accent-color: var(--primary);
}
.pm-provider.is-selected {
  border-color: var(--primary);
  background: var(--surface-3);
  color: var(--primary-deep);
}
.pay-instructions {
  background: var(--color-soft-red-tint, #fcebec);
  border: 1px solid #f6c9cb;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.pay-instructions__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pay-instructions__steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.pay-step {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.pay-instructions__body {
  min-width: 0;
}
.pay-instructions__label {
  display: block;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.45;
}
.ussd-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.ussd-line code {
  background: #fff;
  border: 1px dashed var(--primary);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--primary-deep);
}
.copy-btn {
  border: 0;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 6px;
  cursor: pointer;
}
.copy-btn:hover {
  background: var(--red-hover, #b9141a);
}
.watch-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  margin-left: 4px;
}
.checkout-upload {
  border-top: 1px dashed var(--border);
  padding-top: 14px;
}
.checkout-upload__hint {
  font-size: 0.8rem;
  color: var(--primary-deep);
  font-weight: 600;
  margin-bottom: 8px;
}
.checkout-shot {
  max-width: 100%;
  max-height: 140px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.checkout-shot-remove {
  color: var(--danger);
  font-size: 0.78rem;
  padding: 2px 8px;
}
.checkout-error {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.85rem;
  font-weight: 600;
}
.checkout-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--primary-deep);
}
.checkout-confirm {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 0.83rem;
  line-height: 1.45;
  color: var(--text);
  cursor: pointer;
}
.checkout-confirm input {
  margin-top: 3px;
  accent-color: var(--primary);
}
.checkout-side {
  position: sticky;
  top: 92px;
}
.checkout-summary {
  margin-bottom: 0;
}
.checkout-summary__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.checkout-course {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.checkout-course__thumb {
  width: 84px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 auto;
}
.checkout-course__thumb--ph {
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.checkout-course__meta {
  min-width: 0;
}
.checkout-course__title {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.35;
  margin-bottom: 4px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.checkout-course__instructor {
  font-size: 0.78rem;
  color: var(--muted);
}
.checkout-plan-picker {
  margin-bottom: 14px;
}
.checkout-plan-picker__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.checkout-plans {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.plan-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
}
.plan-pill input {
  accent-color: var(--primary);
}
.plan-pill.is-selected {
  border-color: var(--primary);
  background: var(--surface-3);
  color: var(--primary-deep);
}
.checkout-totals {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-bottom: 14px;
}
.checkout-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.checkout-total-row span:last-child {
  color: var(--text);
  font-weight: 600;
}
.checkout-total-row.is-total {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 1.02rem;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 0;
}
.checkout-total-row.is-total span:last-child {
  color: var(--primary-deep);
  font-size: 1.1rem;
}
.checkout-note {
  text-align: center;
  margin: 10px 0 0;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.45;
}
.checkout-summary #checkout-submit {
  margin-top: 14px;
}

@media (max-width: 1200px) {
  .builder-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1000px) {
  .checkout-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}
@media (max-width: 900px) {
  .builder-grid {
    grid-template-columns: 1fr;
  }
  .builder-sidebar {
    grid-template-columns: 1fr;
  }
  .checkout-grid {
    grid-template-columns: 1fr;
  }
  .checkout-side {
    position: static;
  }
  .billing-grid {
    grid-template-columns: 1fr;
  }
  .checkout-card {
    padding: 18px;
  }
}

/* ==========================================================================
   Admin → Discount Management (platform-level discounts)
   ========================================================================== */
.discounts-card { padding: 22px 24px 24px; }
.discounts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.discounts-head .manage-tabs { flex: 1; min-width: 240px; margin: 0; }
.discounts-notice { padding: 10px 14px; border-radius: 8px; margin: 12px 0; font-size: 0.85rem; font-weight: 500; display: none; }
.discounts-notice.success { background: rgba(22,163,74,.10); color: #15803d; border: 1px solid rgba(22,163,74,.28); }
.discounts-notice.error { background: rgba(239,68,68,.12); color: var(--danger); border: 1px solid rgba(239,68,68,.3); }
.discounts-notice.warn { background: rgba(242,169,59,.14); color: var(--accent-warm-deep); border: 1px solid rgba(242,169,59,.35); }
.discounts-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.discounts-selected { font-size: 0.8rem; color: var(--muted); min-width: 72px; }
.discounts-search { flex: 1; min-width: 200px; max-width: 420px; }
.discounts-sort { width: auto; min-width: 150px; }
.discounts-table { min-width: 0; }
/* Discounts list: fits the card width (no horizontal scrollbar), keeps long
   discount names on a single line and pins the action buttons to the right. */
.discounts-table--list { width: 100%; min-width: 0; table-layout: auto; }
.discounts-table--list th, .discounts-table--list td { padding: 12px 10px; }
.discounts-table--list th:first-child,
.discounts-table--list td:first-child { width: 34px; padding-left: 6px; }
.discounts-table--list th:nth-child(2), .discounts-table--list td:nth-child(2) { width: 48px; }
.discounts-table--list th:nth-child(3),
.discounts-table--list td:nth-child(3) { min-width: 190px; white-space: nowrap; }
.discounts-table--list th:nth-child(4), .discounts-table--list td:nth-child(4) { width: 96px; }
.discounts-table--list th:nth-child(5), .discounts-table--list td:nth-child(5) { width: 84px; }
.discounts-table--list th:nth-child(6), .discounts-table--list td:nth-child(6) { width: 104px; }
.discounts-table--list th:nth-child(7), .discounts-table--list td:nth-child(7) { width: 72px; }
.discounts-table--list th:nth-child(8), .discounts-table--list td:nth-child(8) { width: 56px; }
.discounts-table--list tbody tr:not(.discount-expand-row) th:last-child,
.discounts-table--list tbody tr:not(.discount-expand-row) td:last-child,
.discounts-table--list thead th:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  text-align: right;
  white-space: nowrap;
  background: var(--surface);
}
.discounts-table--list thead th:last-child { background: var(--surface-2); }
.discounts-table--list tbody tr:not(.discount-expand-row):hover td:last-child,
.discounts-table--list tbody tr.discount-row-expanded td:last-child { background: var(--surface-2); }
.discounts-table--list .discount-actions-cell { justify-content: flex-end; gap: 6px; }
.discounts-table--list .discount-actions-cell .btn,
.discounts-table--list .discount-add-btn { padding: 5px 12px; font-size: 0.78rem; line-height: 1.35; }
.discounts-table th, .discounts-table td { vertical-align: middle; }
.discounts-table .discounts-check { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.discounts-table .discounts-check:disabled { cursor: not-allowed; }
.discounts-table .row-muted { opacity: .55; }
.discount-course-title { font-weight: 600; color: var(--ink); }
.discount-price-list { display: flex; flex-direction: column; gap: 2px; font-size: 0.82rem; }
.discount-price-list b { color: var(--primary-deep); font-weight: 700; }
.discount-price-list span { color: var(--muted); font-size: 0.78rem; }
.discount-actions-cell { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }
.discount-delete-btn { color: var(--primary-deep); border-color: rgba(215,25,32,.35); }
.discount-delete-btn:hover { background: rgba(215,25,32,.08); }
.discount-add-btn {
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 6px 12px;
  white-space: nowrap;
}
.discount-add-btn:hover { background: var(--red-hover, #b9141a); border-color: var(--red-hover, #b9141a); }
.discount-add-one {
  border-radius: 8px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  white-space: nowrap;
}
.discount-add-one:hover:not(:disabled) { background: var(--red-hover, #b9141a); border-color: var(--red-hover, #b9141a); }
.discount-add-one:disabled {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--muted);
  opacity: .6;
  cursor: not-allowed;
}
.discount-toggle-view {
  width: 34px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.discount-toggle-view:hover { border-color: var(--primary); color: var(--primary-deep); }
.discount-row-expanded td { background: var(--surface-2); }
.discount-expand-row > td { background: var(--surface-2); padding: 0 !important; }
.discount-expand { padding: 18px 20px 22px; }
.discount-expand h4 { margin: 0 0 12px; font-size: 1.02rem; }
.discount-expand-note { margin: 0 0 10px; font-size: 0.8rem; color: var(--muted); }
/* Expanded per-course table (red headers + bare values) with a row-level hover
   that highlights the entire course group, matching the approved design. */
.discount-expand-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  background: var(--surface);
  min-width: 720px;
}
.discount-expand-table th {
  padding: 10px 14px 11px;
  text-align: left;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--primary);
  background: transparent;
  border-bottom: 1px solid var(--border-light);
}
.discount-expand-table td {
  padding: 12px 14px;
  font-size: 0.92rem;
  vertical-align: middle;
  color: var(--ink);
  border-bottom: 1px solid var(--border-light);
}
.discount-expand-table .discount-course-cell { font-weight: 500; color: var(--ink); }
.discount-expand-table tbody.discount-course-group + tbody.discount-course-group tr:first-child td {
  border-top: 1px solid var(--border-light);
}
.discount-expand-table tbody.discount-course-group:hover td { background: #FFF5F5; }
.discount-expand-table tbody.discount-course-group:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--primary);
}
.discount-expand-table tbody.discount-course-group:hover tr:first-child td {
  box-shadow: inset 0 1px 0 rgba(215, 25, 32, 0.45);
}
.discount-expand-table tbody.discount-course-group:hover tr:last-child td {
  box-shadow: inset 0 -1px 0 rgba(215, 25, 32, 0.45);
}
.discount-detail-label { color: var(--muted); font-size: 0.76rem; font-weight: 600; margin-right: 4px; }
.discount-remove-cell { text-align: right; width: 46px; }
.discount-remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.discount-remove-btn:hover { color: var(--danger); border-color: rgba(239,68,68,.5); background: rgba(239,68,68,.06); }
.discount-empty-inline { padding: 18px 20px; color: var(--muted); font-size: 0.85rem; }

/* Create / edit modal (ff1) */
.discount-modal { width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.discount-modal .admin-modal-body { overflow-y: auto; }
.discount-modal .form-group { margin-bottom: 16px; }
.discount-duration-label { font-size: 0.8rem; font-weight: 700; color: var(--muted); margin: 4px 0 10px; }
.discount-date-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.discount-date-row .form-group { min-width: 0; }
.discount-date-row .input { font-size: 0.8rem; padding: 10px 10px; }
.discount-status-select { width: 150px; }
.discount-confirm-modal { width: min(430px, calc(100vw - 32px)); }
.discount-confirm-text { margin: 0; font-size: 0.9rem; line-height: 1.5; color: var(--text); }

@media (max-width: 720px) {
  .discounts-card { padding: 16px; }
  .discounts-head { align-items: stretch; }
  .discounts-head .btn { width: 100%; }
  .discounts-toolbar { gap: 8px; }
  .discounts-search { max-width: none; flex: 1 1 100%; }
  .discounts-sort { flex: 1; }
  .discount-date-row { grid-template-columns: 1fr; }
}

/* === Discount type selector (admin modal) === */
.discount-modal [hidden] { display: none !important; }
.discount-field-label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.discount-field-hint { margin: 6px 0 0; font-size: 0.74rem; line-height: 1.4; color: var(--muted); }
.discount-type-options { display: flex; gap: 10px; flex-wrap: wrap; }
.discount-type-option {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border: 1px solid var(--border, #E3E6EB); border-radius: 10px;
  font-size: 0.85rem; font-weight: 600; cursor: pointer; user-select: none;
  background: var(--surface, #fff);
}
.discount-type-option:has(input:checked) {
  border-color: var(--color-dark-maroon, #8B0E0E);
  box-shadow: inset 0 0 0 1px var(--color-dark-maroon, #8B0E0E);
}
.discount-type-option input { accent-color: var(--color-dark-maroon, #8B0E0E); margin: 0; }

/* === Promo header (announcement bar) =====================================
   Ported from the supplied promo-header design. Every rule is scoped to
   .promo-header so the rest of the app is untouched. */
.promo-header {
  --promo-deep-red: #78070e;
  --promo-wine: #8d111b;
  --promo-bright-red: #f32231;
  --promo-pale-pink: #fde8e9;
  --promo-divider: #e9cdd0;
  width: 100%;
  min-height: 94px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: linear-gradient(105deg, #80080f 0%, #65060c 52%, #850911 100%);
  box-sizing: border-box;
}
.promo-header[hidden] { display: none !important; }
.promo-header * { box-sizing: border-box; }
.promo-header .promo-banner {
  width: fit-content;
  max-width: min(1090px, calc(100vw - 330px));
  min-height: 64px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 1.6vw, 26px);
  flex: 0 0 auto;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  color: var(--promo-wine);
}
.promo-header .offer-icon {
  width: 26px; height: 26px; flex: 0 0 26px;
  display: grid; place-items: center; color: var(--promo-bright-red);
}
.promo-header .offer-icon svg { width: 100%; height: 100%; }
.promo-header .price-block {
  display: flex; align-items: center; gap: 14px; white-space: nowrap;
  margin-right: clamp(4px, 1.2vw, 16px);
}
.promo-header .price {
  color: #94111b;
  font-size: clamp(25px, 2.1vw, 34px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -1.3px;
}
.promo-header .all-courses { font-size: 17px; font-weight: 800; letter-spacing: -.35px; }
.promo-header .separator {
  height: 22px; width: 1px; flex: 0 0 1px; background: var(--promo-divider);
}
.promo-header .time-left {
  display: flex; align-items: center; gap: 10px;
  color: #28333c; font-size: 12px; font-weight: 800; white-space: nowrap;
  margin-left: 6px;
}
.promo-header .clock-icon { width: 22px; height: 22px; color: var(--promo-bright-red); flex: 0 0 auto; }
.promo-header .countdown {
  display: flex; align-items: center; gap: 6px;
  flex: 0 0 auto; white-space: nowrap; margin-left: auto;
}
.promo-header .countdown-unit {
  width: 50px; height: 38px; flex: 0 0 50px; padding: 3px 2px;
  border-radius: 7px; background: var(--promo-pale-pink);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: #89151d; line-height: 1;
}
.promo-header .countdown-unit strong {
  display: block; width: 100%; font-size: 16px; line-height: 17px;
  text-align: center; font-weight: 800; font-variant-numeric: tabular-nums;
}
.promo-header .countdown-unit span {
  display: block; font-size: 9px; line-height: 10px; font-weight: 800; color: #4e3739;
}
.promo-header .colon {
  color: #e7192a; font-size: 15px; line-height: 1; font-weight: 800; flex: 0 0 auto;
}
.promo-header .buy-button {
  min-width: 152px; height: 48px; padding: 0 21px; border-radius: 2px;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--primary, #D71920); color: #fff; text-decoration: none;
  white-space: nowrap; font-size: 13px; font-weight: 800;
  transition: background .18s ease, transform .18s ease;
}
.promo-header .buy-button:hover { background: var(--primary-deep, #8B0E0E); transform: translateY(-1px); }
.promo-header .buy-button:focus-visible,
.promo-header .close-button:focus-visible { outline: 3px solid #ffabb2; outline-offset: 4px; }
.promo-header .buy-button span { font-size: 19px; line-height: 1; }
.promo-header .close-button {
  width: 34px; height: 34px; flex: 0 0 34px; padding: 0;
  position: relative; border: 0; background: transparent; cursor: pointer;
}
.promo-header .close-button span::before,
.promo-header .close-button span::after {
  content: ""; width: 29px; height: 4px; position: absolute; top: 15px; left: 2px;
  border-radius: 3px; background: #fff;
}
.promo-header .close-button span::before { transform: rotate(45deg); }
.promo-header .close-button span::after { transform: rotate(-45deg); }

@media (max-width: 1000px) {
  .promo-header { padding: 10px 12px; gap: 14px; }
  .promo-header .promo-banner { padding: 0 16px; gap: 12px; }
  .promo-header .all-courses { font-size: 14px; }
  .promo-header .time-left { font-size: 11px; gap: 7px; }
  .promo-header .countdown { gap: 4px; }
  .promo-header .countdown-unit { width: 49px; }
  .promo-header .buy-button { min-width: 120px; padding-inline: 14px; }
}

@media (max-width: 720px) {
  .promo-header {
    min-height: auto; align-items: flex-start; padding: 5px 8px; gap: 6px;
  }
  .promo-header .promo-banner {
    display: grid; grid-template-columns: 28px 1fr auto; gap: 10px 12px;
    padding: 10px 12px; border-radius: 0;
  }
  .promo-header .offer-icon { grid-column: 1; grid-row: 1; width: 26px; height: 26px; }
  .promo-header .price-block { grid-column: 2; grid-row: 1; align-self: center; align-items: center; gap: 10px; margin-right: 0; }
  .promo-header .price { font-size: 27px; }
  .promo-header .all-courses { font-size: 13px; }
  .promo-header .promo-banner > .separator { display: none; }
  .promo-header .time-left {
    grid-column: 1 / 3; grid-row: 2; padding-top: 7px;
    border-top: 1px solid var(--promo-divider); font-size: 11px;
  }
  .promo-header .countdown { grid-column: 1 / -1; grid-row: 3; justify-content: center; padding-top: 4px; }
  .promo-header .countdown-unit { width: 62px; height: 44px; }
  .promo-header .buy-button {
    min-width: 100px; height: 36px; padding-inline: 12px; font-size: 12px;
    gap: 6px; margin-left: auto;
  }
  .promo-header .close-button { width: 27px; height: 27px; flex-basis: 27px; }
  .promo-header .close-button span::before,
  .promo-header .close-button span::after { width: 24px; top: 12px; left: 1px; }
}

@media (max-width: 390px) {
  .promo-header { padding-inline: 8px; gap: 7px; }
  .promo-header .promo-banner { gap: 9px; padding: 12px 10px; }
  .promo-header .price { font-size: 24px; }
  .promo-header .all-courses { font-size: 11px; }
  .promo-header .buy-button { min-width: 88px; padding-inline: 8px; font-size: 11px; }
}

/* === Media Library — Videos redesign (w0) === */
.admin-video-toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 0 4px;
}
.admin-video-search { width: 360px; max-width: 100%; padding: 9px 14px; }
.admin-video-toolbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: wrap; }
.admin-video-playlist-label { font-size: 0.9rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.admin-video-playlist-filter { width: 350px; max-width: 100%; }
.admin-video-upload-btn { height: 44px; padding: 0 24px; white-space: nowrap; }
.admin-video-hint { padding: 2px 0 12px; font-size: 0.8rem; color: var(--muted); }
.admin-video-table .admin-video-actions-head { text-align: right; }
.admin-video-actions { text-align: right; white-space: nowrap; }
.admin-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; margin-left: 8px; padding: 0;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.admin-icon-btn:hover { background: var(--color-soft-red-tint); border-color: #e7b6ba; }
.admin-icon-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.admin-icon-btn-danger:hover { color: #b91c1c; border-color: #f3b4b4; background: #fef2f2; }
.admin-icon-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.admin-video-playlist-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--color-neutral-badge); color: var(--text-secondary);
  font-size: 0.78rem; font-weight: 600; white-space: nowrap;
}

/* Add Playlist dialog (p0) */
.playlist-modal { width: min(544px, calc(100vw - 32px)); }
.playlist-modal [hidden] { display: none !important; }
.playlist-modal .admin-modal-body { padding-top: 18px; }
.playlist-modal .form-group + .form-group { margin-top: 16px; }

/* Video timings dialog (cl1): read-only phase timeline. */
.video-timing-modal { width: min(560px, calc(100vw - 32px)); }
.video-timing-modal .admin-modal-body { padding-top: 18px; }
.video-timing-file {
  margin-bottom: 18px; font-weight: 600; word-break: break-all;
}
.video-timing-section { margin-bottom: 22px; }
.video-timing-section-title { margin-bottom: 10px; font-size: 0.95rem; font-weight: 600; }
.video-timing-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 16px;
}
.video-timing-head { font-size: 0.85rem; font-weight: 600; }
.video-timing-value {
  font-size: 0.85rem; color: var(--text-secondary);
  font-variant-numeric: tabular-nums; word-break: break-word;
}
.video-timing-encoder {
  padding-top: 14px; border-top: 1px solid var(--border-light); font-size: 0.9rem;
}


/* === Lesson video field (w43 / w2) === */
.lesson-video-dropzone { padding: 0; border: 0; background: transparent; }
.lesson-video-empty {
  min-height: 122px; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px dashed var(--border); border-radius: 10px;
  color: var(--text); cursor: pointer; background: var(--field-bg, #f7f8fa);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.lesson-video-empty:hover { border-color: var(--primary); background: var(--color-soft-red-tint); }
.lesson-video-upload-icon { display: inline-flex; color: var(--text-secondary); }
.lesson-video-upload-text { font-size: 0.95rem; font-weight: 700; }
.lesson-video-assigned {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 6px 0 10px;
}
.lesson-video-assigned-title {
  font-size: 1rem; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.lesson-video-assigned-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.lesson-video-replace {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 48px; padding: 0 20px; border-radius: 8px;
  border: 1.5px dashed #cfd5dd; background: transparent; color: var(--text-secondary);
  font-size: 0.9rem; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.lesson-video-replace:hover { border-color: var(--primary); color: var(--primary); background: var(--color-soft-red-tint); }
.lesson-video-replace-icon { display: inline-flex; }
.lesson-video-preview-btn { height: 48px; padding: 0 24px; border-radius: 8px; }

/* === Video Library picker (w1) === */
.video-library-overlay { z-index: 1100; }
.video-library-modal {
  width: min(1150px, calc(100vw - 48px));
  max-height: min(88vh, 840px);
  display: flex; flex-direction: column; overflow: hidden;
}
.video-library-tabs { padding: 14px 20px 0; background: #f5f6f8; }
.video-library-tab {
  display: inline-block; padding: 10px 20px;
  background: var(--surface); color: var(--primary); font-weight: 700; font-size: 0.9rem;
  border-radius: 7px 7px 0 0; border-bottom: 2px solid var(--primary);
}
.video-library-body { display: flex; flex-direction: column; gap: 14px; overflow: hidden; padding: 16px 20px; }
.video-library-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.video-library-toolbar #video-library-search { width: 290px; max-width: 100%; }
.video-library-filter { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.video-library-filter label { font-size: 0.9rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.video-library-filter .select { width: 340px; max-width: 100%; }
.video-library-table-wrap { overflow: auto; border: 1px solid var(--border-light); border-radius: 10px; }
.video-library-table { margin: 0; }
.video-library-table thead th { background: #f5f6f8; }
.video-library-row { cursor: pointer; }
.video-library-row:hover td { background: #fbfbfc; }
.video-library-row.selected td { background: var(--color-soft-red-tint); }
.video-library-sub { font-size: 0.75rem; color: var(--muted); }
.video-library-empty { text-align: center; color: var(--muted); padding: 28px 0 !important; }
.media-modal-footer { flex-shrink: 0; }

/* Shared R2 preview overlay */
.video-preview-overlay {
  position: fixed; inset: 0; z-index: 1400;
  background: rgba(0, 0, 0, 0.62);
  display: grid; place-items: center; padding: 24px;
}
.video-preview-overlay[hidden] { display: none !important; }
.video-preview-box {
  width: min(920px, 94vw); background: #0b0b0d; color: #fff;
  border-radius: 12px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.video-preview-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; font-size: 0.9rem;
}
.video-preview-head button {
  background: transparent; border: 0; color: #fff; font-size: 24px; line-height: 1;
  cursor: pointer; padding: 0 4px;
}
.video-preview-stage { position: relative; aspect-ratio: 16 / 9; width: 100%; background: #000; }

/* Persistent video thumbnails in the Media Library tables. */
.admin-video-file,
.video-library-file {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.admin-video-file__meta { min-width: 0; }
.admin-video-thumb,
.video-library-thumb {
  width: 64px;
  height: 36px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
  background: #0b0b0d;
  color: rgba(255, 255, 255, 0.42);
  object-fit: cover;
}
.video-library-thumb { width: 56px; height: 32px; }
.admin-video-thumb--empty {
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.08);
}

@media (max-width: 1000px) {
  .admin-video-search { width: 100%; }
  .admin-video-toolbar-right { width: 100%; margin-left: 0; }
  .admin-video-playlist-filter { flex: 1 1 auto; width: auto; }
  .video-library-toolbar #video-library-search { width: 100%; }
  .video-library-filter { width: 100%; margin-left: 0; justify-content: space-between; }
  .video-library-filter .select { flex: 1 1 auto; width: auto; }
}

@media (max-width: 720px) {
  .lesson-video-assigned { flex-direction: column; align-items: flex-start; }
  .lesson-video-assigned-actions { width: 100%; }
  .lesson-video-replace { flex: 1; }
  .video-library-modal { width: calc(100vw - 16px); max-height: 92vh; }
  .video-library-body { padding: 12px; }
  .video-library-tabs { padding: 12px 12px 0; }
  .video-library-filter { flex-direction: column; align-items: stretch; gap: 6px; }
  .video-library-filter .select { width: 100%; }
  .video-preview-overlay { padding: 10px; }
  .video-preview-box { width: 100%; }
}

/* === R2 window player quality selector (R2-only) === */
.r2-player-shell { position: absolute; inset: 0; }
.r2-player-shell video { width: 100%; height: 100%; background: #000; display: block; }
.r2-quality { position: absolute; top: 12px; right: 12px; z-index: 3; }
.r2-quality-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 10px 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 8px;
  background: rgba(10, 10, 12, 0.72); color: #fff;
  font: 600 12px/1 inherit; cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.r2-quality-btn:hover { background: rgba(20, 20, 24, 0.88); border-color: rgba(255, 255, 255, 0.34); }
.r2-quality-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.r2-quality-btn svg { opacity: 0.8; }
.r2-quality-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 112px; padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 10px;
  background: rgba(12, 12, 14, 0.96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  display: flex; flex-direction: column; gap: 2px;
}
.r2-quality-menu[hidden] { display: none !important; }
.r2-quality-item {
  appearance: none; border: 0; background: transparent;
  color: rgba(255, 255, 255, 0.78); text-align: left;
  font: 500 12px/1 inherit; padding: 9px 10px; border-radius: 6px; cursor: pointer;
}
.r2-quality-item:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.r2-quality-item.is-active { background: rgba(255, 255, 255, 0.16); color: #fff; font-weight: 700; }

@media (max-width: 720px) {
  .r2-quality { top: 8px; right: 8px; }
  .r2-quality-btn { height: 30px; padding: 0 8px 0 10px; }
}

/* === R2 custom player UI ===
   Scoped entirely to .r2p so the YouTube and Vimeo surfaces are untouched.
   The accent uses the site's existing brand colour (#D71920 / #8B0E0E),
   matching the old Vimeo/YouTube custom control surfaces. */
.r2p {
  --r2p-accent: var(--primary, #D71920);
  --r2p-accent-strong: var(--primary-deep, #8B0E0E);
  --r2p-glow: rgba(215, 25, 32, 0.22);
  --r2p-ink: #f8fafc;
  --r2p-muted: rgba(248, 250, 252, 0.72);
  --r2p-panel: rgba(12, 14, 18, 0.94);
  --r2p-border: rgba(255, 255, 255, 0.16);
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: var(--r2p-ink);
  font-family: var(--font-body);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.r2p:focus-visible { box-shadow: inset 0 0 0 2px var(--r2p-accent); }
.r2p.is-pip {
  border-radius: 0;
  box-shadow: none;
}
.r2p.is-pip .r2p-side { display: none; }
/* Compact control bar for the floating window, but keep every control
   (play/pause, skip, timeline, time, mute + volume, settings, PiP, fullscreen).
   These rules use extra specificity so the page's narrow-viewport media
   queries cannot strip controls from the Document PiP window. */
.r2p.is-pip .r2p-controls { padding: 0 8px 6px; }
.r2p.is-pip .r2p-row { gap: 4px; }
.r2p.is-pip .r2p-btn { width: 30px; height: 30px; border-radius: 8px; }
.r2p.is-pip .r2p-btn svg { width: 16px; height: 16px; }
.r2p.is-pip .r2p-play svg { width: 18px; height: 18px; }
.r2p.is-pip .r2p-time { font-size: 10px; }
.r2p.is-pip .r2p-volume { width: 48px; }
.r2p.is-pip .r2p-volume-wrap { display: flex; }
.r2p.is-pip .r2p-left,
.r2p.is-pip .r2p-right { gap: 2px; }
.r2p-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

/* Instant poster + subtle initial-load indicator (R2 only). The poster remains
   until the decoder paints the first frame; the spinner never blocks input. */
.r2p-poster {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Neutral surface while the image is still loading: never a black flash. */
  background: radial-gradient(120% 90% at 50% 30%, #1b1b21 0%, #0a0a0c 72%);
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.r2p-poster.is-empty {
  background: radial-gradient(120% 90% at 50% 30%, #1b1b21 0%, #0a0a0c 72%);
}
.r2p-poster.is-hidden { opacity: 0; visibility: hidden; }
.r2p-loading {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  display: flex;
  pointer-events: none;
}
.r2p-loading[hidden] { display: none !important; }
.r2p-loading .r2p-spinner { width: 22px; height: 22px; border-width: 2px; }

/* Pre-mount layer: covers the gap between clearing the stage and attaching the
   HLS player (module import + manifest fetch), so the modal never flashes black. */
.r2p-bootstrap {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 30%, #1b1b21 0%, #0a0a0c 72%);
  pointer-events: none;
}
.r2p-bootstrap__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}
.r2p-bootstrap.is-empty {
  background: radial-gradient(120% 90% at 50% 30%, #1b1b21 0%, #0a0a0c 72%);
}
.r2p-bootstrap__spinner { position: relative; z-index: 1; }
.r2p-gradient {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.16) 36%, rgba(0, 0, 0, 0.78) 100%);
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.r2p.is-idle .r2p-gradient { opacity: 0; }

.r2p-controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 5;
  padding: 0 16px 12px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.r2p.is-idle .r2p-controls {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}
.r2p-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.r2p-group { display: flex; align-items: center; gap: 4px; min-width: 0; }
.r2p-right { gap: 6px; }

.r2p-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--r2p-ink);
  width: 38px; height: 38px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.r2p-btn svg { width: 20px; height: 20px; display: block; }
.r2p-btn:hover { background: rgba(255, 255, 255, 0.12); }
.r2p-btn:active { transform: scale(0.94); }
.r2p-btn:focus-visible { outline: 2px solid var(--r2p-accent); outline-offset: 2px; }
.r2p-btn.is-active { color: var(--r2p-accent); }
.r2p-play svg { width: 22px; height: 22px; }

.r2p-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 68px; height: 68px;
  border: 0;
  border-radius: 50%;
  background: var(--r2p-accent);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35), 0 0 0 6px var(--r2p-glow);
  transition: transform 0.15s ease, background-color 0.15s ease, opacity 0.2s ease;
}
.r2p-center:hover { background: var(--r2p-accent-strong); transform: translate(-50%, -50%) scale(1.04); }
.r2p-center:active { transform: translate(-50%, -50%) scale(0.96); }
.r2p-center:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.r2p-center svg { width: 30px; height: 30px; margin-left: 3px; }
.r2p-center[hidden] { display: none !important; }
.r2p.is-playing .r2p-center { opacity: 0; pointer-events: none; }

.r2p-timeline {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 18px;
  margin: 0 0 2px;
  background: transparent;
  cursor: pointer;
  --r2p-progress: 0%;
}
.r2p-timeline:focus-visible { outline: 2px solid var(--r2p-accent); outline-offset: 2px; border-radius: 999px; }
.r2p-timeline::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--r2p-accent) 0 var(--r2p-progress), rgba(255, 255, 255, 0.3) var(--r2p-progress) 100%);
}
.r2p-timeline::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  margin-top: -4px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.r2p-timeline::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
}
.r2p-timeline::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--r2p-accent);
}
.r2p-timeline::-moz-range-thumb {
  width: 12px; height: 12px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.r2p-time {
  padding: 0 2px;
  font: 600 12px/1 var(--font-body);
  color: var(--r2p-ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
  flex: 0 0 auto;
}

.r2p-volume-wrap { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.r2p-volume {
  -webkit-appearance: none;
  appearance: none;
  width: 72px;
  height: 18px;
  background: transparent;
  cursor: pointer;
  --r2p-volume: 100%;
}
.r2p-volume:focus-visible { outline: 2px solid var(--r2p-accent); outline-offset: 2px; border-radius: 999px; }
.r2p-volume::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--r2p-accent) 0 var(--r2p-volume), rgba(255, 255, 255, 0.3) var(--r2p-volume) 100%);
}
.r2p-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  margin-top: -4px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.r2p-volume::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
}
.r2p-volume::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--r2p-accent);
}
.r2p-volume::-moz-range-thumb {
  width: 12px; height: 12px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.r2p-settings-wrap { position: relative; display: inline-flex; }
.r2p-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: 210px;
  max-height: 360px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.32) transparent;
  padding: 10px;
  border: 1px solid var(--r2p-border);
  border-radius: 12px;
  background: var(--r2p-panel);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  z-index: 6;
}
.r2p-menu[hidden] { display: none !important; }
.r2p-menu-section + .r2p-menu-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.r2p-menu-title {
  display: block;
  padding: 0 8px 6px;
  font: 700 10px/1.4 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--r2p-muted);
}
.r2p-menu-list { display: flex; flex-direction: column; gap: 2px; }
.r2p-menu-list--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 6px; }
.r2p-menu-item {
  appearance: none;
  border: 0;
  width: 100%;
  text-align: left;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 9px 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--r2p-ink);
  font: 500 13px/1.2 var(--font-body);
  cursor: pointer;
}
.r2p-menu-item:hover { background: rgba(255, 255, 255, 0.1); }
.r2p-menu-item.is-active { color: var(--r2p-accent); font-weight: 700; }
.r2p-menu-item:focus-visible { outline: 2px solid var(--r2p-accent); outline-offset: -2px; }
.r2p-check { display: inline-flex; width: 16px; height: 16px; }
.r2p-check svg { width: 16px; height: 16px; }

.r2p-pip-placeholder {
  --r2p-ink: #f8fafc;
  --r2p-muted: rgba(248, 250, 252, 0.72);
  --r2p-accent: var(--primary, #D71920);
  --r2p-accent-strong: var(--primary-deep, #8B0E0E);
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(215, 25, 32, 0.16) 0%, rgba(10, 12, 16, 0) 60%),
    #0b0d12;
  color: var(--r2p-ink);
  text-align: center;
}
.r2p-pip-placeholder[hidden] { display: none !important; }
.r2p-pip-label {
  font: 700 13px/1.4 var(--font-body);
  letter-spacing: 0.01em;
}
.r2p-pip-hint {
  font: 500 11px/1.4 var(--font-body);
  color: var(--r2p-muted);
}
.r2p-pip-return {
  appearance: none;
  margin-top: 6px;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--r2p-accent);
  color: #fff;
  font: 700 11px/1 var(--font-body);
  cursor: pointer;
}
.r2p-pip-return:hover { background: var(--r2p-accent-strong); }
.r2p-pip-return:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.r2p-side {
  position: absolute;
  right: 14px;
  bottom: 26%;
  z-index: 4;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 10px;
  background: rgba(124, 128, 135, 0.92);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
  opacity: 0;
  transform: translateY(4px) scale(0.94);
  pointer-events: none;
  transition: background-color 0.15s ease, opacity 0.18s ease, transform 0.18s ease;
}
.r2p.has-pointer .r2p-side,
.r2p-side:focus-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.r2p-side:hover { background: rgba(102, 106, 113, 0.96); }
.r2p-side.is-active { color: #fff; background: var(--r2p-accent); }
.r2p-side:active { transform: scale(0.95); }
.r2p-side:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.r2p-side svg { width: 22px; height: 22px; }
.r2p.is-idle .r2p-side { opacity: 0; transform: translateY(4px) scale(0.94); pointer-events: none; }

.r2p-status {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.32);
  color: var(--r2p-ink);
  font: 600 12px/1.4 var(--font-body);
  text-align: center;
  pointer-events: none;
}
.r2p-status[hidden] { display: none !important; }
.r2p-status .r2p-retry { pointer-events: auto; }
.r2p-spinner {
  width: 34px; height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.24);
  border-top-color: var(--r2p-accent);
  border-radius: 50%;
  animation: r2p-spin 0.8s linear infinite;
}
@keyframes r2p-spin { to { transform: rotate(360deg); } }
.r2p-retry {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  background: var(--r2p-accent);
  color: #fff;
  font: 700 12px/1 var(--font-body);
  cursor: pointer;
}
.r2p-retry:hover { background: var(--r2p-accent-strong); }

.r2p:fullscreen,
.r2p:-webkit-full-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  box-shadow: none;
  background: #000;
}
.r2p:fullscreen .r2p-video,
.r2p:-webkit-full-screen .r2p-video { width: 100%; height: 100%; object-fit: contain; }

@media (max-width: 720px) {
  .r2p-controls { padding: 0 10px 8px; }
  .r2p-btn { width: 34px; height: 34px; border-radius: 8px; }
  .r2p-btn svg { width: 18px; height: 18px; }
  .r2p-play svg { width: 20px; height: 20px; }
  .r2p-center { width: 58px; height: 58px; }
  .r2p-center svg { width: 26px; height: 26px; }
  .r2p-time { font-size: 11px; }
  .r2p-volume { width: 62px; }
  .r2p-side { right: 10px; width: 40px; height: 40px; border-radius: 10px; }
  .r2p-side svg { width: 18px; height: 18px; }
  .r2p-menu { width: 196px; }
}

@media (max-width: 520px) {
  .r2p-volume-wrap { display: none; }
  .r2p-time { font-size: 10px; }
  .r2p-group { gap: 0; }
  .r2p-right { gap: 2px; }
}

/* Library table: live progress for the one admitted upload. */
.admin-video-upload { margin-top: 6px; max-width: 210px; }
.admin-video-upload-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.admin-video-upload-fill {
  height: 100%;
  background: var(--primary, #c62828);
  transition: width 0.3s ease;
}
.admin-video-upload-meta { margin-top: 3px; font-size: 0.7rem; color: var(--muted); }
