/* ==========================================================================
   EduCraft Platform — Core Design System Stylesheet
   Naming Convention: All component classes strictly use 'ec-' namespace prefix.
   Zero Inline CSS Architecture. Pure CSS Variables & Semantic Utilities.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

/* --- 1. Global CSS Design Tokens --- */
:root {
  /* Color Palette - Dark Surfaces */
  --ec-bg-base: #090D16;
  --ec-bg-surface: #0F172A;
  --ec-bg-elevated: #1E293B;
  --ec-bg-card: rgba(30, 41, 59, 0.7);
  --ec-bg-glass: rgba(15, 23, 42, 0.85);

  /* Borders & Dividers */
  --ec-border-subtle: rgba(255, 255, 255, 0.08);
  --ec-border-light: rgba(255, 255, 255, 0.14);
  --ec-border-primary-glow: rgba(99, 102, 241, 0.35);
  --ec-border-emerald-glow: rgba(16, 185, 129, 0.3);

  /* Primary Brand Accent (Neon Indigo / Violet) */
  --ec-color-primary: #6366F1;
  --ec-color-primary-hover: #4F46E5;
  --ec-color-primary-light: rgba(99, 102, 241, 0.12);
  --ec-color-primary-glow: 0 0 25px rgba(99, 102, 241, 0.35);

  /* Emerald Settlement Accent */
  --ec-color-emerald: #10B981;
  --ec-color-emerald-hover: #059669;
  --ec-color-emerald-light: rgba(16, 185, 129, 0.12);
  --ec-color-emerald-glow: 0 0 25px rgba(16, 185, 129, 0.3);

  /* Secondary Status Accents */
  --ec-color-amber: #F59E0B;
  --ec-color-amber-light: rgba(245, 158, 11, 0.12);
  --ec-color-rose: #EF4444;
  --ec-color-rose-light: rgba(239, 68, 68, 0.12);
  --ec-color-cyan: #06B6D4;

  /* Typography */
  --ec-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ec-font-heading: 'Outfit', 'Inter', -apple-system, sans-serif;

  /* Text Colors */
  --ec-text-primary: #F8FAFC;
  --ec-text-secondary: #94A3B8;
  --ec-text-muted: #64748B;
  --ec-text-inverse: #090D16;

  /* Layout & Radii */
  --ec-radius-sm: 8px;
  --ec-radius-md: 12px;
  --ec-radius-lg: 16px;
  --ec-radius-xl: 24px;
  --ec-radius-full: 9999px;

  /* Motion */
  --ec-transition-fast: 0.15s ease;
  --ec-transition-normal: 0.25s ease;
  --ec-transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- 2. CSS Reset & Base Defaults --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--ec-font-sans);
  background-color: var(--ec-bg-base);
  color: var(--ec-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ec-font-heading);
  color: var(--ec-text-primary);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: normal;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--ec-transition-fast);
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  max-width: 100%;
}

/* --- 3. Layout Utilities --- */
.ec-container {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.ec-container-sm {
  max-width: 720px;
}

.ec-container-mobile {
  max-width: 460px;
}

.ec-grid {
  display: grid;
  gap: 1.25rem;
  width: 100%;
}

.ec-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.ec-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.ec-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .ec-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .ec-grid-2, .ec-grid-3, .ec-grid-4 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.ec-flex {
  display: flex;
}

.ec-flex-wrap {
  flex-wrap: wrap;
}

.ec-flex-col {
  flex-direction: column;
}

.ec-items-center {
  align-items: center;
}

.ec-justify-between {
  justify-content: space-between;
}

.ec-justify-center {
  justify-content: center;
}

.ec-gap-1 { gap: 0.5rem; }
.ec-gap-2 { gap: 1rem; }
.ec-gap-3 { gap: 1.5rem; }
.ec-gap-4 { gap: 2rem; }

/* --- 4. Navigation Bar --- */
.ec-navbar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ec-border-subtle);
  padding: 0.85rem 0;
  pointer-events: none; /* Lets touch pass directly to document for native 120fps browser bar collapse */
}

.ec-navbar button,
.ec-navbar a,
.ec-navbar input,
.ec-navbar [role="button"] {
  pointer-events: auto; /* Keep all buttons, icons, and links fully clickable */
}

.ec-nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ec-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--ec-font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ec-text-primary);
}

.ec-brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--ec-color-primary), #A855F7);
  border-radius: var(--ec-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: var(--ec-color-primary-glow);
}

.ec-nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.ec-nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ec-text-secondary);
  transition: color var(--ec-transition-fast);
}

.ec-nav-link:hover {
  color: var(--ec-text-primary);
}

.ec-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

@media (max-width: 868px) {
  .ec-nav-links {
    display: none;
  }
}

@media (max-width: 640px) {
  .ec-nav-brand {
    font-size: 1.15rem;
    gap: 0.5rem;
  }
  .ec-brand-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  .ec-nav-hide-mobile {
    display: none !important;
  }
  .ec-nav-actions .ec-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
  }
}

/* --- 4.B Hamburger Menu & Mobile Drawer --- */
.ec-hamburger-btn {
  display: none;
  background: var(--ec-bg-elevated);
  border: 1px solid var(--ec-border-subtle);
  color: var(--ec-text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--ec-radius-md);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  transition: background var(--ec-transition-fast);
}

.ec-hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 868px) {
  .ec-hamburger-btn {
    display: inline-flex;
  }
}

.ec-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  opacity: 0;
  transition: opacity var(--ec-transition-normal);
}

.ec-drawer-overlay.ec-active {
  display: block;
  opacity: 1;
}

.ec-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 85%;
  max-width: 340px;
  background: var(--ec-bg-surface);
  border-left: 1px solid var(--ec-border-light);
  z-index: 210;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--ec-transition-smooth);
  overflow-y: auto;
}

.ec-drawer-overlay.ec-active .ec-drawer {
  transform: translateX(0);
}

.ec-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--ec-border-subtle);
  margin-bottom: 1.5rem;
}

.ec-drawer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.ec-drawer-link {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ec-text-secondary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  transition: color var(--ec-transition-fast);
}

.ec-drawer-link:hover {
  color: var(--ec-text-primary);
}

.ec-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: auto;
  border-top: 1px solid var(--ec-border-subtle);
  padding-top: 1.5rem;
}

/* --- Section Dividers & Rhythm --- */
.ec-section {
  padding: 4.5rem 0;
  position: relative;
}

.ec-section-divider {
  border-top: 1px solid var(--ec-border-subtle);
}

@media (max-width: 768px) {
  .ec-section {
    padding: 2.75rem 0;
  }
}

/* --- Rich Footer Styles (Inspired by Main Site) --- */
.ec-footer {
  background: rgba(10, 15, 26, 0.95);
  border-top: 1px solid var(--ec-border-subtle);
  padding: 4rem 0 2rem;
}

.ec-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.ec-footer-col h4 {
  font-size: 1rem;
  margin-bottom: 1.25rem;
  color: var(--ec-text-primary);
}

.ec-footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ec-footer-link {
  font-size: 0.9rem;
  color: var(--ec-text-secondary);
  transition: color var(--ec-transition-fast);
}

.ec-footer-link:hover {
  color: var(--ec-color-primary);
}

.ec-footer-bottom {
  border-top: 1px solid var(--ec-border-subtle);
  padding-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 868px) {
  .ec-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 540px) {
  .ec-footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* --- 5. Buttons & Badges --- */
.ec-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.35rem;
  border-radius: var(--ec-radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--ec-transition-fast);
  white-space: nowrap;
}

.ec-btn-primary {
  background: linear-gradient(135deg, var(--ec-color-primary), #4F46E5);
  color: #FFFFFF;
  box-shadow: var(--ec-color-primary-glow);
}

.ec-btn-primary:hover {
  background: linear-gradient(135deg, #4F46E5, #4338CA);
  transform: translateY(-1px);
}

.ec-btn-emerald {
  background: linear-gradient(135deg, var(--ec-color-emerald), #059669);
  color: #FFFFFF;
  box-shadow: var(--ec-color-emerald-glow);
}

.ec-btn-emerald:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
}

.ec-btn-outline {
  background: transparent;
  border-color: var(--ec-border-light);
  color: var(--ec-text-primary);
}

.ec-btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--ec-text-primary);
}

.ec-btn-secondary {
  background: var(--ec-bg-elevated);
  color: var(--ec-text-primary);
  border-color: var(--ec-border-subtle);
}

.ec-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.ec-btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

.ec-btn-lg {
  padding: 1rem 2rem;
  font-size: 1.05rem;
}

.ec-btn-block {
  width: 100%;
}

.ec-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: var(--ec-radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

.ec-badge-primary {
  background: var(--ec-color-primary-light);
  color: var(--ec-color-primary);
  border: 1px solid var(--ec-border-primary-glow);
}

.ec-badge-emerald {
  background: var(--ec-color-emerald-light);
  color: var(--ec-color-emerald);
  border: 1px solid var(--ec-border-emerald-glow);
}

.ec-badge-amber {
  background: var(--ec-color-amber-light);
  color: var(--ec-color-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Carousel Pagination Dots Indicator */
.ec-carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ec-border-subtle);
  cursor: pointer;
  display: inline-block;
  transition: all var(--ec-transition-fast);
}

.ec-carousel-dot:hover {
  background: var(--ec-border-light);
}

.ec-carousel-dot.ec-active {
  width: 18px;
  border-radius: 4px;
  background: var(--ec-color-primary);
}

/* --- 6. Glassmorphic Cards & Stat Widgets --- */
.ec-card {
  background: var(--ec-bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--ec-border-subtle);
  border-radius: var(--ec-radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--ec-transition-fast), border-color var(--ec-transition-fast);
}

.ec-card:hover {
  border-color: var(--ec-border-light);
}

.ec-card-glow {
  border-color: var(--ec-border-primary-glow);
  box-shadow: inset 0 0 40px rgba(99, 102, 241, 0.05);
}

.ec-card-balance {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid var(--ec-border-emerald-glow);
  padding: 1.25rem;
}

.ec-card-balance-amber {
  border-color: rgba(245, 158, 11, 0.3);
}

.ec-stat-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ec-text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ec-stat-value {
  font-family: var(--ec-font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--ec-text-primary);
  margin-top: 0.35rem;
}

.ec-stat-value-emerald {
  color: var(--ec-color-emerald);
}

.ec-stat-subtext {
  font-size: 0.78rem;
  color: var(--ec-text-muted);
  margin-top: 0.25rem;
}

/* --- 7. Hero Section & Typography --- */
.ec-hero {
  padding: 3.5rem 0 2rem;
  text-align: center;
  position: relative;
  width: 100%;
}

.ec-hero-badge-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.ec-hero-title {
  font-size: clamp(1.85rem, 5vw, 3.25rem);
  letter-spacing: -0.02em;
  max-width: 900px;
  margin: 0 auto 1.25rem;
  line-height: 1.2;
}

.ec-text-gradient {
  background: linear-gradient(135deg, #FFFFFF 30%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ec-text-gradient-accent {
  background: linear-gradient(135deg, #818CF8, #34D399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ec-hero-desc {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--ec-text-secondary);
  max-width: 660px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .ec-hero {
    padding: 2.5rem 0 1.5rem;
  }
}

/* --- 8. Interactive Earnings Calculator Widget --- */
.ec-calculator-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--ec-border-primary-glow);
  border-radius: var(--ec-radius-xl);
  padding: 1.5rem;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  margin-top: 1.5rem;
  width: 100%;
}

@media (min-width: 768px) {
  .ec-calculator-card {
    padding: 2.25rem;
  }
}

.ec-slider-group {
  margin-bottom: 2rem;
}

.ec-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.ec-slider-label {
  font-weight: 600;
  font-size: 1rem;
  color: var(--ec-text-primary);
}

.ec-slider-val {
  font-family: var(--ec-font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ec-color-primary);
}

.ec-slider-input {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--ec-bg-elevated);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.ec-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ec-color-primary);
  border: 3px solid #FFFFFF;
  box-shadow: var(--ec-color-primary-glow);
  cursor: pointer;
  transition: transform var(--ec-transition-fast);
}

.ec-slider-input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.ec-calc-result-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--ec-border-emerald-glow);
  border-radius: var(--ec-radius-lg);
  padding: 1.75rem;
  text-align: center;
}

/* --- 9. Modal Bottom Sheet & Dialog --- */
.ec-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity var(--ec-transition-normal);
}

.ec-modal-overlay.ec-active {
  display: flex;
  opacity: 1;
}

html.ec-modal-lock,
body.ec-modal-lock {
  overflow: hidden !important;
}

body.ec-modal-lock .ec-main-viewport {
  overflow: hidden !important;
}

.ec-modal-dialog {
  background: var(--ec-bg-surface);
  border: 1px solid var(--ec-border-light);
  border-radius: var(--ec-radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  transform: scale(0.95);
  transition: transform var(--ec-transition-normal);
}

.ec-modal-overlay.ec-active .ec-modal-dialog {
  transform: scale(1);
}

.ec-modal-header {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--ec-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ec-modal-title {
  font-size: 1.25rem;
}

.ec-modal-close {
  background: transparent;
  border: none;
  color: var(--ec-text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.ec-modal-close:hover {
  color: var(--ec-text-primary);
}

.ec-modal-body {
  padding: 1.75rem;
}

/* Mobile Slide-Up Bottom Sheet override */
@media (max-width: 640px) {
  .ec-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .ec-modal-sheet {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-height: 90vh;
    width: 100%;
    max-width: 100%;
  }
  .ec-modal-header {
    padding: 1rem 1.15rem;
  }
  .ec-modal-body {
    padding: 1.15rem;
  }
}

/* Truncation & Anti-Squish Utilities */
.ec-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* --- 9.B Step-by-Step Progress Bar --- */
.ec-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
}

.ec-step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  z-index: 2;
  background: var(--ec-bg-surface);
  padding: 0 0.5rem;
}

.ec-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ec-bg-elevated);
  border: 2px solid var(--ec-border-subtle);
  color: var(--ec-text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ec-transition-fast);
}

.ec-step-node.ec-active .ec-step-circle {
  background: var(--ec-color-primary);
  border-color: var(--ec-color-primary);
  color: #FFFFFF;
  box-shadow: var(--ec-color-primary-glow);
}

.ec-step-node.ec-completed .ec-step-circle {
  background: var(--ec-color-emerald);
  border-color: var(--ec-color-emerald);
  color: #FFFFFF;
}

.ec-step-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ec-text-muted);
}

.ec-step-node.ec-active .ec-step-label {
  color: var(--ec-text-primary);
}

.ec-step-node.ec-completed .ec-step-label {
  color: var(--ec-color-emerald);
}

.ec-stepper-line {
  position: absolute;
  top: 18px;
  left: 30px;
  right: 30px;
  height: 2px;
  background: var(--ec-border-subtle);
  z-index: 1;
}

/* --- 10. Forms & Form Controls --- */
.ec-form-group {
  margin-bottom: 1.25rem;
}

.ec-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ec-text-secondary);
  margin-bottom: 0.5rem;
}

.ec-input {
  width: 100%;
  background: var(--ec-bg-elevated);
  border: 1px solid var(--ec-border-subtle);
  border-radius: var(--ec-radius-md);
  padding: 0.8rem 1rem;
  color: var(--ec-text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--ec-transition-fast);
}

.ec-input:focus {
  border-color: var(--ec-color-primary);
  box-shadow: 0 0 0 3px var(--ec-color-primary-light);
}

/* --- 11. Responsive Navigation: Mobile Bottom Bar & Desktop Sidebar (Telegram/WhatsApp Style) --- */
.ec-app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

.ec-main-viewport {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Mobile Default (< 992px) */
.ec-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ec-bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--ec-border-subtle);
  display: flex;
  justify-content: space-around;
  padding: 0.45rem 0.2rem;
  z-index: 90;
}

.ec-sidebar-header,
.ec-sidebar-footer {
  display: none;
}

.ec-sidebar-nav {
  display: contents;
}

.ec-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  background: transparent;
  border: none;
  color: var(--ec-text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ec-transition-fast);
  padding: 0.25rem 0.15rem;
  flex: 1;
  text-align: center;
  border-radius: var(--ec-radius-sm);
}

.ec-tab-btn.ec-active {
  color: var(--ec-color-primary);
  font-weight: 700;
}

.ec-tab-btn:hover {
  color: var(--ec-text-primary);
}

.ec-tab-btn svg {
  width: 20px;
  height: 20px;
}

.ec-container-cockpit {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}

/* =========================================================================
   11.B Responsive Navigation Architecture:
   - Mobile Phone (< 640px): Native PWA Bottom Bar + Sticky Top Header (Fluid 100% width)
   - Tablet / Intermediate Screen (640px - 1023px): Collapsed Mini Icon Rail (72px)
   - Large Desktop (>= 1024px): Wide Expanded Drawer Sidebar (270px)
   ========================================================================= */

/* Desktop & Tablet Base Shell (>= 640px) */
@media (min-width: 640px) {
  body {
    padding-bottom: 0 !important;
    overflow: hidden;
  }

  .ec-app-layout {
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
  }

  /* Main Viewport */
  .ec-main-viewport {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    background: var(--ec-bg-base);
  }

  /* Desktop Top Navbar: Hidden on root dashboard view to eliminate duplicate branding */
  #ec-top-navbar:not(.ec-nav-has-nested) {
    display: none !important;
  }

  #ec-top-navbar.ec-nav-has-nested {
    display: block !important;
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid var(--ec-border-subtle);
    padding: 0.75rem 0;
  }

  /* Desktop Multi-column Grid Utilities */
  .ec-desktop-grid-2 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
  }

  .ec-desktop-grid-3 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.25rem !important;
  }
}

/* Intermediate Screen (640px to 1023px): Collapsed Icon-Only Navigation Rail */
@media (min-width: 640px) and (max-width: 1023px) {
  .ec-bottom-nav {
    position: static;
    width: 72px;
    min-width: 72px;
    height: 100vh;
    background: var(--ec-bg-elevated);
    border-top: none;
    border-right: 1px solid var(--ec-border-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1.25rem 0.5rem;
    gap: 0.5rem;
    z-index: 100;
    flex-shrink: 0;
  }

  .ec-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0 0 1rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--ec-border-subtle);
  }

  .ec-sidebar-brand-content {
    display: none !important;
  }

  .ec-sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    flex: 1;
    overflow-y: auto;
  }

  .ec-tab-btn {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    min-width: 48px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--ec-radius-md);
    color: var(--ec-text-secondary);
    transition: all var(--ec-transition-fast);
  }

  .ec-tab-btn span {
    display: none !important;
  }

  .ec-tab-btn .ec-icon {
    width: 21px;
    height: 21px;
    stroke-width: 2.1;
  }

  .ec-tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--ec-text-primary);
    transform: scale(1.06);
  }

  .ec-tab-btn.ec-active {
    background: var(--ec-color-primary-light);
    color: var(--ec-color-primary);
    box-shadow: 0 0 14px var(--ec-color-primary-glow);
  }

  .ec-sidebar-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-top: 0.75rem;
    border-top: 1px solid var(--ec-border-subtle);
  }

  .ec-sidebar-footer-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    padding: 0;
    border-radius: var(--ec-radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--ec-border-subtle);
    color: var(--ec-text-secondary);
    cursor: pointer;
    transition: all var(--ec-transition-fast);
  }

  .ec-sidebar-footer-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--ec-text-primary);
  }

  .ec-sidebar-footer-text {
    display: none !important;
  }

  .ec-sidebar-footer-btn .ec-icon-badge {
    position: absolute;
    top: -2px;
    right: -2px;
  }

  .ec-container-cockpit {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 3rem 1.5rem;
  }
}

/* Large Desktop (>= 1024px): Wide Expanded Drawer Sidebar (270px) */
@media (min-width: 1024px) {
  .ec-bottom-nav {
    position: static;
    width: 270px;
    min-width: 270px;
    height: 100vh;
    background: var(--ec-bg-elevated);
    border-top: none;
    border-right: 1px solid var(--ec-border-subtle);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 1.5rem 1rem;
    gap: 0.5rem;
    z-index: 100;
    flex-shrink: 0;
  }

  .ec-sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.25rem 1.25rem 0.25rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--ec-border-subtle);
  }

  .ec-sidebar-brand-content {
    display: block !important;
  }

  .ec-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    overflow-y: auto;
  }

  .ec-tab-btn {
    flex: 0 0 auto;
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: var(--ec-radius-md);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ec-text-secondary);
    text-align: left;
    transition: all var(--ec-transition-fast);
  }

  .ec-tab-btn span {
    display: inline !important;
  }

  .ec-tab-btn .ec-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
  }

  .ec-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--ec-text-primary);
    transform: translateX(3px);
  }

  .ec-tab-btn.ec-active {
    background: var(--ec-color-primary-light);
    color: var(--ec-color-primary);
    box-shadow: inset 3px 0 0 var(--ec-color-primary);
  }

  .ec-sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ec-border-subtle);
  }

  .ec-sidebar-footer-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--ec-border-subtle);
    border-radius: var(--ec-radius-md);
    color: var(--ec-text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ec-transition-fast);
  }

  .ec-sidebar-footer-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--ec-text-primary);
  }

  .ec-sidebar-footer-text {
    display: inline !important;
  }

  .ec-sidebar-footer-btn .ec-icon-badge {
    position: static;
    transform: none;
  }

  .ec-container-cockpit {
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem 2rem;
  }
}


/* --- Crisp Vector SVG Icon System --- */
.ec-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.ec-icon-sm {
  width: 14px;
  height: 14px;
}

.ec-icon-md {
  width: 18px;
  height: 18px;
}

.ec-icon-lg {
  width: 22px;
  height: 22px;
}

.ec-tab-btn .ec-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.1;
}

.ec-nav-tab-btn .ec-icon {
  width: 17px;
  height: 17px;
  stroke-width: 2.1;
}

.ec-btn .ec-icon {
  width: 15px;
  height: 15px;
  margin-right: 0.35rem;
}

/* --- Modern Circular Icon Button with Corner Badge --- */
.ec-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--ec-radius-full);
  background: var(--ec-bg-elevated);
  border: 1px solid var(--ec-border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ec-text-secondary);
  cursor: pointer;
  transition: all var(--ec-transition-fast);
  padding: 0;
}

.ec-icon-btn:hover {
  color: var(--ec-text-primary);
  border-color: var(--ec-border-primary-glow);
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-1px);
}

.ec-icon-btn svg {
  width: 19px;
  height: 19px;
}

.ec-icon-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #EF4444;
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--ec-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ec-bg-base);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  line-height: 1;
}

/* --- Modern Horizontal Tab Navigation Bar --- */
.ec-nav-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--ec-border-subtle);
  margin-bottom: 1.75rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ec-nav-tabs::-webkit-scrollbar,
.ec-filter-bar::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.ec-nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--ec-text-secondary);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--ec-radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: all var(--ec-transition-fast);
}

.ec-nav-tab-btn:hover {
  color: var(--ec-text-primary);
  background: var(--ec-bg-elevated);
}

.ec-nav-tab-btn.ec-active {
  color: var(--ec-color-primary);
  background: rgba(99, 102, 241, 0.12);
  border-bottom: 2px solid var(--ec-color-primary);
}

@media (max-width: 767px) {
  .ec-nav-tabs {
    display: none;
  }
}

@media (min-width: 768px) {
  .ec-bottom-nav.ec-admin-bottom-nav {
    display: none;
  }
}

/* --- 11.B Floating Action Button (FAB) --- */
.ec-fab {
  position: fixed;
  bottom: 5.2rem;
  right: 1.25rem;
  background: linear-gradient(135deg, var(--ec-color-primary), #4F46E5);
  color: #FFFFFF;
  border: none;
  border-radius: var(--ec-radius-full);
  padding: 0.8rem 1.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  cursor: pointer;
  z-index: 85;
  transition: transform var(--ec-transition-fast), box-shadow var(--ec-transition-fast);
}

.ec-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.55);
}

/* --- 11.C Segmented Control & Filter Tabs --- */
.ec-segmented-control {
  display: flex;
  background: var(--ec-bg-elevated);
  border: 1px solid var(--ec-border-subtle);
  border-radius: var(--ec-radius-md);
  padding: 0.25rem;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
}

.ec-segment-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.65rem 0.75rem;
  color: var(--ec-text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--ec-radius-sm);
  cursor: pointer;
  transition: all var(--ec-transition-fast);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.ec-segment-btn.ec-active {
  background: var(--ec-bg-card);
  color: var(--ec-text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--ec-border-light);
}

.ec-filter-bar {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  scrollbar-width: none; /* Hide scrollbar for clean look */
}
.ec-filter-bar::-webkit-scrollbar {
  display: none;
}

.ec-filter-pill {
  background: var(--ec-bg-elevated);
  border: 1px solid var(--ec-border-subtle);
  color: var(--ec-text-secondary);
  padding: 0.22rem 0.6rem;
  border-radius: var(--ec-radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--ec-transition-fast);
}

.ec-filter-pill:hover {
  color: var(--ec-text-primary);
  border-color: var(--ec-border-light);
}

.ec-filter-pill.ec-active {
  background: var(--ec-color-primary-light);
  color: var(--ec-color-primary);
  border-color: var(--ec-border-primary-glow);
}

/* --- 12. Accordion Component (FAQ) --- */
.ec-accordion-item {
  border-bottom: 1px solid var(--ec-border-subtle);
}

.ec-accordion-header {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 1.25rem 0;
  color: var(--ec-text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.ec-accordion-body {
  display: none;
  padding-bottom: 1.25rem;
  color: var(--ec-text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.ec-accordion-item.ec-open .ec-accordion-body {
  display: block;
}

.ec-accordion-icon {
  transition: transform var(--ec-transition-fast);
}

.ec-accordion-item.ec-open .ec-accordion-icon {
  transform: rotate(180deg);
}

/* --- 13. Comparison Table Component --- */
.ec-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--ec-border-subtle);
  border-radius: var(--ec-radius-lg);
  background: var(--ec-bg-card);
}

.ec-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.ec-table th, .ec-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--ec-border-subtle);
}

.ec-table th {
  background: var(--ec-bg-elevated);
  font-family: var(--ec-font-heading);
  font-size: 0.9rem;
  color: var(--ec-text-secondary);
  font-weight: 600;
}

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

/* --- 14. Multi-Question Test Series Studio --- */
.ec-q-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
  -webkit-overflow-scrolling: touch;
}

.ec-q-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--ec-radius-md);
  background: var(--ec-bg-elevated);
  border: 1px solid var(--ec-border-subtle);
  color: var(--ec-text-secondary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ec-transition-fast);
}

.ec-q-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ec-text-primary);
}

.ec-q-btn.ec-q-active {
  background: var(--ec-color-primary);
  color: #FFFFFF;
  border-color: var(--ec-color-primary);
  box-shadow: var(--ec-color-primary-glow);
}

.ec-q-btn.ec-q-answered {
  border-color: var(--ec-color-emerald);
  color: var(--ec-color-emerald);
}

.ec-q-add-btn {
  padding: 0 1rem;
  height: 40px;
  min-width: fit-content;
  border-radius: var(--ec-radius-md);
  background: transparent;
  border: 1px dashed var(--ec-border-light);
  color: var(--ec-color-primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ec-q-add-btn:hover {
  background: var(--ec-color-primary-light);
}

.ec-brand-text {
  font-family: var(--ec-font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.ec-brand-highlight {
  color: var(--ec-text-primary);
}

.ec-brand-accent {
  background: linear-gradient(135deg, var(--ec-color-primary), #A855F7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- 14. Multi-Question Test Series Studio --- */
.ec-test-studio {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ec-test-header-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1rem;
}

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

.ec-q-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--ec-border-subtle);
  padding-top: 0.25rem;
}

.ec-q-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: var(--ec-radius-md);
  background: var(--ec-bg-elevated);
  border: 1px solid var(--ec-border-subtle);
  color: var(--ec-text-secondary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all var(--ec-transition-fast);
}

.ec-q-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ec-text-primary);
}

.ec-q-btn.ec-q-active {
  background: var(--ec-color-primary);
  color: #FFFFFF;
  border-color: var(--ec-color-primary);
  box-shadow: var(--ec-color-primary-glow);
}

.ec-q-btn.ec-q-answered::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ec-color-emerald);
  box-shadow: 0 0 6px var(--ec-color-emerald);
}

.ec-q-add-btn {
  padding: 0 1rem;
  height: 42px;
  min-width: fit-content;
  border-radius: var(--ec-radius-md);
  background: rgba(99, 102, 241, 0.1);
  border: 1px dashed var(--ec-border-primary-glow);
  color: var(--ec-color-primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--ec-transition-fast);
}

.ec-q-add-btn:hover {
  background: var(--ec-color-primary);
  color: #FFFFFF;
}

.ec-option-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--ec-bg-elevated);
  border: 1px solid var(--ec-border-subtle);
  border-radius: var(--ec-radius-md);
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.65rem;
  transition: all var(--ec-transition-fast);
  cursor: pointer;
}

.ec-option-card:hover {
  border-color: var(--ec-border-light);
}

.ec-option-card.ec-option-correct {
  border-color: var(--ec-color-emerald);
  background: rgba(16, 185, 129, 0.08);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.3);
}

.ec-option-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ec-text-secondary);
}

.ec-option-correct .ec-option-badge {
  background: var(--ec-color-emerald);
  color: #FFFFFF;
}

.ec-option-radio {
  cursor: pointer;
  accent-color: var(--ec-color-emerald);
  width: 18px;
  height: 18px;
}

.ec-option-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ec-text-primary);
  font-size: 0.95rem;
}

.ec-test-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--ec-bg-elevated);
  border-radius: var(--ec-radius-md);
  border: 1px solid var(--ec-border-subtle);
  font-size: 0.88rem;
  color: var(--ec-text-secondary);
}

.ec-test-card {
  background: var(--ec-bg-card);
  border: 1px solid var(--ec-border-subtle);
  border-radius: var(--ec-radius-lg);
  padding: 1.15rem;
  margin-bottom: 0.75rem;
  transition: transform var(--ec-transition-fast), border-color var(--ec-transition-fast), box-shadow var(--ec-transition-fast);
  cursor: pointer;
}

.ec-test-card:hover {
  border-color: var(--ec-border-primary-glow);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Question Breakdown Cards inside Test Workspace */
.ec-question-card {
  background: var(--ec-bg-card);
  border: 1px solid var(--ec-border-subtle);
  border-radius: var(--ec-radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  transition: border-color var(--ec-transition-fast);
}

.ec-question-card:hover {
  border-color: var(--ec-border-light);
}

.ec-q-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  margin: 0.65rem 0;
}

@media (min-width: 640px) {
  .ec-q-options-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.ec-q-opt-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--ec-radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ec-border-subtle);
  font-size: 0.82rem;
  color: var(--ec-text-secondary);
}

.ec-q-opt-pill.ec-q-correct {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--ec-color-emerald);
  font-weight: 600;
}

.ec-q-badge-letter {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ec-text-primary);
  flex-shrink: 0;
}

.ec-q-opt-pill.ec-q-correct .ec-q-badge-letter {
  background: var(--ec-color-emerald);
  color: #FFFFFF;
}

.ec-q-explanation-box {
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--ec-color-primary);
  border-radius: 0 var(--ec-radius-sm) var(--ec-radius-sm) 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--ec-text-muted);
  line-height: 1.4;
  margin-top: 0.5rem;
}

/* --- 14. Batch Workspace & Student Breakdown Styles --- */
.ec-batch-card-clickable {
  cursor: pointer;
  transition: transform var(--ec-transition-fast), border-color var(--ec-transition-fast), box-shadow var(--ec-transition-fast);
  position: relative;
}

.ec-batch-card-clickable:hover {
  border-color: var(--ec-border-primary-glow);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Horizontal Stats Strip inside Batch Cards */
.ec-batch-card-stats-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ec-border-subtle);
  border-radius: var(--ec-radius-md);
  padding: 0.5rem 0.75rem;
}

.ec-batch-card-stat-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  min-width: 0;
}

.ec-batch-card-stat-item:nth-child(2) {
  justify-content: flex-end;
  text-align: right;
}

.ec-batch-card-stat-item .ec-stat-subtext {
  font-size: 0.65rem;
  color: var(--ec-text-muted);
  margin-bottom: 0.1rem;
}

.ec-batch-card-stat-item .ec-batch-stat-val {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ec-text-primary);
  white-space: nowrap;
}

.ec-batch-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.ec-batch-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

/* Compact 2x2 KPI Grid to eliminate huge vertical scrolling on mobile */
.ec-batch-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

@media (min-width: 768px) {
  .ec-batch-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
  }
}

.ec-batch-kpi-card {
  padding: 0.55rem 0.7rem !important;
  border-radius: var(--ec-radius-md);
  background: var(--ec-bg-card);
  border: 1px solid var(--ec-border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ec-batch-kpi-card .ec-stat-label {
  font-size: 0.7rem;
  color: var(--ec-text-muted);
  font-weight: 500;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ec-batch-kpi-card .ec-stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ec-text-primary);
}

.ec-batch-kpi-card .ec-stat-subtext {
  font-size: 0.65rem;
  color: var(--ec-text-secondary);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ec-batch-action-bar {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  margin-bottom: 0.65rem;
  scrollbar-width: none;
}

.ec-batch-action-bar::-webkit-scrollbar {
  display: none;
}

.ec-batch-action-bar .ec-btn {
  padding: 0.3rem 0.6rem !important;
  font-size: 0.75rem !important;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Compact Individual Student Breakdown Cards */
.ec-student-breakdown-card {
  position: relative;
  background: var(--ec-bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--ec-border-subtle);
  border-radius: var(--ec-radius-md);
  padding: 0.55rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: transform var(--ec-transition-fast), border-color var(--ec-transition-fast), background var(--ec-transition-fast);
}

.ec-student-breakdown-card:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--ec-border-light);
  transform: translateY(-1px);
}

.ec-student-breakdown-card:has(.ec-show),
.ec-student-breakdown-card.ec-menu-open {
  z-index: 150 !important;
}

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

.ec-student-row-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.15rem;
}

.ec-student-name {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ec-text-primary);
}

/* Minimal Subtle Status Dot (Replaces large bulky pills) */
.ec-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.ec-dot-emerald {
  background: #10B981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.ec-dot-amber {
  background: #F59E0B;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.ec-student-sub {
  font-size: 0.72rem;
  color: var(--ec-text-muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 3-Dot (⋮) Kebab Action Menu */
.ec-student-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ec-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.ec-btn-kebab {
  width: 32px;
  height: 32px;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ec-text-secondary);
  cursor: pointer;
  transition: background var(--ec-transition-fast), color var(--ec-transition-fast), border-color var(--ec-transition-fast);
}

.ec-btn-kebab:hover, .ec-btn-kebab.ec-active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ec-text-primary);
  border-color: var(--ec-border-subtle);
}

.ec-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 195px;
  background: var(--ec-bg-card, #131B2E);
  border: 1px solid var(--ec-border-light, rgba(255, 255, 255, 0.12));
  border-radius: var(--ec-radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  padding: 0.35rem 0;
  z-index: 100;
  display: none;
}

.ec-dropdown-menu.ec-show {
  display: block;
  animation: ecFadeIn 0.15s ease-out;
}

.ec-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: var(--ec-text-primary);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background var(--ec-transition-fast);
}

.ec-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ec-dropdown-item.ec-active {
  background: var(--ec-color-primary-light);
  color: var(--ec-color-primary);
  font-weight: 700;
}

#ec-modal-batch-filter .ec-arrange-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ec-text-primary);
}

#ec-modal-batch-filter .ec-dropdown-item {
  font-size: 0.88rem;
  padding: 0.62rem 0.8rem;
}

.ec-dropdown-item .ec-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
}

.ec-dropdown-item.ec-text-danger {
  color: #EF4444;
}

.ec-dropdown-item.ec-text-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.ec-dropdown-divider {
  height: 1px;
  background: var(--ec-border-subtle);
  margin: 0.25rem 0;
}

/* =========================================================================
   Test Series Workspace — Questions List & Option Pills
   ========================================================================= */
.ec-question-card {
  background: var(--ec-bg-surface);
  border: 1px solid var(--ec-border-subtle);
  border-radius: var(--ec-radius-md);
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  transition: all var(--ec-transition-fast);
}

.ec-question-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ec-question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.ec-q-num-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: var(--ec-radius-sm);
  background: rgba(99, 102, 241, 0.15);
  color: var(--ec-color-primary);
}

.ec-q-statement-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ec-text-primary);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.ec-q-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

@media (min-width: 640px) {
  .ec-q-options-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.ec-q-opt-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--ec-radius-sm);
  background: var(--ec-bg-input);
  border: 1px solid var(--ec-border-subtle);
  font-size: 0.82rem;
  color: var(--ec-text-secondary);
}

.ec-q-opt-pill.ec-q-correct {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--ec-border-emerald-glow);
  color: var(--ec-color-emerald);
  font-weight: 600;
}

.ec-q-badge-letter {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ec-text-secondary);
  flex-shrink: 0;
}

.ec-q-correct .ec-q-badge-letter {
  background: var(--ec-color-emerald);
  color: #FFFFFF;
}

.ec-q-explanation-box {
  background: rgba(99, 102, 241, 0.05);
  border-left: 3px solid var(--ec-color-primary);
  padding: 0.45rem 0.65rem;
  border-radius: 0 var(--ec-radius-sm) var(--ec-radius-sm) 0;
  font-size: 0.78rem;
  color: var(--ec-text-secondary);
  line-height: 1.35;
  margin-bottom: 0.6rem;
}

.ec-q-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px solid var(--ec-border-subtle);
  font-size: 0.72rem;
  color: var(--ec-text-secondary);
}

/* --- Master Student Directory Components (Individual Cards) --- */
.ec-student-master-card {
  position: relative;
  background: var(--ec-bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--ec-border-subtle);
  border-radius: var(--ec-radius-md);
  padding: 0.55rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: transform var(--ec-transition-fast), border-color var(--ec-transition-fast), background var(--ec-transition-fast);
}

.ec-student-master-card:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--ec-border-light);
  transform: translateY(-1px);
}

/* Ensure open kebab menu sits above all subsequent cards and sticky bottom bar */
.ec-student-master-card:has(.ec-show),
.ec-student-master-card.ec-menu-open {
  z-index: 150 !important;
}

.ec-student-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--ec-color-primary);
  font-weight: 700;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ec-student-batch-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  padding: 0.12rem 0.45rem;
  border-radius: var(--ec-radius-full);
  background: var(--ec-surface-card);
  border: 1px solid var(--ec-border-subtle);
  color: var(--ec-text-secondary);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all var(--ec-transition-fast);
}

.ec-student-batch-tag:hover {
  border-color: var(--ec-color-primary);
  color: var(--ec-color-primary);
  background: rgba(99, 102, 241, 0.08);
}

/* --- Kebab 3-Dot Dropdown Actions --- */
.ec-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.ec-btn-kebab {
  width: 24px;
  height: 24px;
  border-radius: var(--ec-radius-sm);
  background: transparent;
  border: none;
  color: var(--ec-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all var(--ec-transition-fast);
}

.ec-btn-kebab:hover,
.ec-btn-kebab.ec-active {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--ec-border-subtle);
  color: var(--ec-text-primary);
}

.ec-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 190px;
  background: #131A2A;
  border: 1px solid var(--ec-border-subtle);
  border-radius: var(--ec-radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.75);
  padding: 0.35rem 0;
  z-index: 200 !important;
  display: none;
  flex-direction: column;
}

.ec-dropdown-menu.ec-show {
  display: flex;
  animation: ec-fade-in 0.15s ease-out;
}

/* Upward opening when menu is near bottom of the screen */
.ec-dropdown-menu.ec-open-up {
  top: auto !important;
  bottom: calc(100% + 4px) !important;
}

.ec-dropdown-item {
  width: 100%;
  padding: 0.55rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: none;
  color: var(--ec-text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background var(--ec-transition-fast);
}

.ec-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ec-color-primary);
}

.ec-dropdown-divider {
  height: 1px;
  background: var(--ec-border-subtle);
  margin: 0.3rem 0;
}

/* --- 15. Passbook & Settlement Slip Styles --- */
.ec-pb-settle-card {
  transition: transform var(--ec-transition-fast), border-color var(--ec-transition-fast), background var(--ec-transition-fast);
}

.ec-pb-settle-card:hover {
  border-color: rgba(16, 185, 129, 0.5) !important;
  background: rgba(16, 185, 129, 0.06) !important;
  transform: translateY(-1px);
}

.ec-pb-settle-card:active {
  transform: translateY(0);
}


