/* ==========================================================================
   VIRTUAL LAB PENERJEMAH V2 - FHISIP UNIVERSITAS TERBUKA
   Design System & Styling
   ========================================================================== */

/* ── Google Fonts Import ── */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

/* ── Design Tokens & Variables ── */
:root {
  /* Color Palette - Brand UT Inspired */
  --primary: #0052cc;
  --primary-dark: #003b99;
  --primary-light: #ebf3ff;
  --primary-glow: rgba(0, 82, 204, 0.25);
  
  --accent-gold: #f59e0b;
  --accent-gold-light: #fef3c7;
  --accent-gold-glow: rgba(245, 158, 11, 0.3);

  --accent-purple: #8b5cf6;
  --accent-purple-light: #f3e8ff;
  
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #0ea5e9;
  --info-light: #e0f2fe;

  /* Neutral Shades (Light Theme) */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-glass: rgba(255, 255, 255, 0.85);
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-inverse: #ffffff;

  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  /* Elevation & Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 25px rgba(0, 82, 204, 0.18);

  /* Layout Measurements */
  --header-height: 72px;
  --sidebar-width: 320px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Fonts */
  --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', monospace;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Dark Theme Overrides ── */
[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-dark: #1d4ed8;
  --primary-light: rgba(59, 130, 246, 0.15);
  --primary-glow: rgba(59, 130, 246, 0.35);

  --accent-gold: #fbbf24;
  --accent-gold-light: rgba(251, 191, 36, 0.15);

  --bg-main: #0b0f19;
  --bg-card: #131b2e;
  --bg-card-glass: rgba(19, 27, 46, 0.85);
  --bg-subtle: #1e293b;
  --bg-hover: #2d3748;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --text-inverse: #0f172a;

  --border-color: #1e293b;
  --border-focus: #60a5fa;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.25);
}

/* ── Global Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  line-height: 1.25;
  font-weight: 700;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  text-decoration: underline;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

/* ── Custom Scrollbar (Cross-Browser) ── */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-subtle);
  border-radius: 4px;
  opacity: 0.4;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── App Shell Container (Allows natural scrolling & mode flexibility) ── */
#app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  background: var(--bg-main);
  position: relative;
}

/* ── Top Navigation Header ── */
.app-header {
  height: var(--header-height);
  background: var(--bg-card-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 50;
  position: relative;
  transition: background var(--transition-normal), border-color var(--transition-normal);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}
.menu-btn:hover {
  background: var(--bg-hover);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  box-shadow: 0 4px 12px rgba(0, 75, 156, 0.12);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}
.brand-wrapper:hover .brand-icon,
.portal-brand:hover .brand-icon {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 6px 16px var(--primary-glow);
}
[data-theme="dark"] .brand-icon {
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.ut-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--accent-gold);
  color: #000;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* User Stats Pills in Header */
.user-stat-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-main);
  transition: all var(--transition-fast);
}
.user-stat-pill-btn {
  cursor: pointer;
  border: 1px solid var(--border-color);
}
.user-stat-pill-btn:hover {
  background: var(--accent-gold-light);
  border-color: var(--accent-gold);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-gold-glow);
}
.stat-star-icon {
  font-size: 1rem;
  display: inline-block;
  animation: starPulse 2.5s ease-in-out infinite;
}
@keyframes starPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.stat-divider {
  opacity: 0.35;
  font-weight: 400;
}
.user-stat-pill svg {
  color: var(--accent-gold);
}

.theme-toggle-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.theme-toggle-btn:hover {
  background: var(--bg-hover);
  transform: translateY(-1px);
}

/* ── Main App Layout Body (Workspace Mode) ── */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  min-height: 0;
  position: relative;
}

/* ── Modern Sidebar Navigation ── */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  transition: transform var(--transition-normal), background var(--transition-normal);
  z-index: 40;
}

.sidebar-header {
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-title-tag {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.sidebar-headline {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Overall Progress Indicator in Sidebar */
.sidebar-progress-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.sidebar-progress-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
}
.progress-track {
  height: 6px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent-purple) 100%);
  border-radius: var(--radius-full);
  transition: width var(--transition-normal);
}

/* Sidebar Star Rating Display */
.sidebar-stars-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.sidebar-stars-section:hover {
  border-color: var(--accent-gold);
  background: var(--accent-gold-light);
  transform: translateY(-1px);
}
.sidebar-stars-row {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 1.1rem;
}
.star-icon {
  display: inline-block;
  transition: all var(--transition-fast);
}
.star-icon.active {
  color: #f59e0b;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.45);
}
.star-icon.dimmed {
  color: #94a3b8;
  opacity: 0.35;
}
.sidebar-star-title {
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Sidebar Reset Progress Button */
.sidebar-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.sidebar-reset-btn:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger);
}

/* Navigation Modules List */
.nav-section {
  padding: 0.75rem 0.5rem;
}
.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.5rem 0.75rem;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  color: var(--text-main);
  position: relative;
}

.nav-item-btn:hover {
  background: var(--bg-subtle);
}

.nav-item-btn.active {
  background: var(--primary-light);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: var(--shadow-sm);
}
.nav-item-btn.active .nav-num {
  background: var(--primary);
  color: #ffffff;
}
.nav-item-btn.active .nav-title {
  color: var(--primary);
  font-weight: 700;
}

.nav-num {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all var(--transition-fast);
}

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

.nav-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
}
.badge-materi {
  background: var(--primary-light);
  color: var(--primary);
}
.badge-exercise {
  background: var(--accent-purple-light);
  color: var(--accent-purple);
}
.badge-cat {
  background: var(--accent-gold-light);
  color: #b45309;
}
.badge-cert {
  background: var(--success-light);
  color: var(--success);
}

.nav-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
  white-space: normal;
}

.nav-subtitle {
  font-size: 0.725rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.nav-check-icon {
  margin-left: auto;
  color: var(--success);
  display: none;
  font-size: 0.9rem;
}
.nav-item-btn.completed .nav-check-icon {
  display: block;
}

/* Sidebar Backdrop (Mobile) */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 35;
}

/* ── Content View Area (Workspace Scroll Container) ── */
.app-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scroll-behavior: smooth;
  background: var(--bg-main);
  padding: 2rem 2.5rem 6rem;
  position: relative;
  min-height: 0;
}

/* Container Wrapper */
.content-wrapper {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn 0.3s ease-out;
}

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

/* ── Breadcrumb ── */
.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.breadcrumb-nav span {
  color: var(--text-subtle);
}
.breadcrumb-nav .active-crumb {
  color: var(--primary);
  font-weight: 600;
}

/* ── View Header ── */
.view-header {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.view-header-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.view-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.725rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.view-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.view-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 800px;
}

/* ── Cards & Panels ── */
.card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}
.card-panel:hover {
  box-shadow: var(--shadow-md);
}

.card-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.card-title-icon {
  color: var(--primary);
}

/* ── Hero Presentation (Landing / Home) ── */
.hero-banner {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #4338ca 100%);
  border-radius: var(--radius-xl);
  padding: 3.5rem 3rem;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: #ffffff;
}
.hero-title span {
  color: var(--accent-gold);
}

.hero-text {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 680px;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-hero-primary {
  background: var(--accent-gold);
  color: #1e1b4b;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
  background: #fbbf24;
}

.btn-hero-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all var(--transition-fast);
}
.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

/* Feature Grid Cards */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all var(--transition-fast);
  cursor: pointer;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.feature-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.feature-title {
  font-size: 1.1rem;
  font-weight: 700;
}
.feature-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Interactive Theory Pipeline (Newmark 4 Levels) ── */
.pipeline-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.pipeline-step-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
}
.pipeline-step-card.active-step {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light), var(--shadow-md);
}

.pipeline-step-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  background: var(--bg-subtle);
  transition: background var(--transition-fast);
}
.pipeline-step-header:hover {
  background: var(--bg-hover);
}

.pipeline-step-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.step-titles {
  display: flex;
  flex-direction: column;
}
.step-main-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}
.step-sub-title {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.step-focus-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
}

.pipeline-step-body {
  padding: 1.5rem;
  display: none;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}
.pipeline-step-card.active-step .pipeline-step-body {
  display: flex;
}

.example-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--primary);
}
.example-box-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.35rem;
}
.example-tsu {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}
.example-tsa {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
}
.example-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ── Reading Source Text Box (TSu Reader) ── */
.reading-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 1.75rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.reading-header {
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reading-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reading-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-main);
  font-family: Georgia, serif;
}
.reading-body p {
  text-align: justify;
}
.reading-source {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.5rem;
}

/* ── Smart Interactive Text Highlighter ── */
.highlighter-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.highlighter-instruction {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.highlighter-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-check-hl {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.55rem 1.35rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-check-hl:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-reset-hl {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-reset-hl:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Highlighted text passage */
.highlightable-text {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  font-size: 1rem;
  line-height: 2.2;
  font-family: Georgia, serif;
  user-select: text;
  cursor: text;
  margin-bottom: 1rem;
}

.highlightable-text mark {
  background: rgba(251, 191, 36, 0.45);
  border-bottom: 2px solid var(--accent-gold);
  border-radius: 3px;
  padding: 1px 3px;
  cursor: pointer;
  color: inherit;
  transition: background var(--transition-fast);
}
.highlightable-text mark:hover {
  background: rgba(245, 158, 11, 0.7);
}

.highlightable-text mark.valid {
  background: rgba(16, 185, 129, 0.3) !important;
  border-bottom-color: var(--success) !important;
}
.highlightable-text mark.extra {
  background: rgba(239, 68, 68, 0.25) !important;
  border-bottom-color: var(--danger) !important;
}

/* Results panel */
.hl-results-panel {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1.25rem;
}
.hl-results-panel.visible {
  display: block;
}

.hl-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-light);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.category-badge-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cat-item-box {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.cat-item-header {
  background: var(--bg-subtle);
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
}
.cat-item-body {
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chip-term {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}
.chip-term.found {
  background: var(--success-light);
  color: #065f46;
}
.chip-term.missed {
  background: var(--danger-light);
  color: #991b1b;
}

/* ── Interactive Quiz Component ── */
.quiz-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.q-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color var(--transition-fast);
}

.q-label-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
}

.q-number-badge {
  background: var(--primary);
  color: #ffffff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.q-hint-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-left: 2rem;
}

/* Text Input Question */
.q-text-input {
  width: 100%;
  max-width: 420px;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background: var(--bg-card);
  color: var(--text-main);
  transition: all var(--transition-fast);
  margin-left: 2rem;
}
.q-text-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.q-text-input.is-correct {
  border-color: var(--success);
  background: var(--success-light);
}
.q-text-input.is-wrong {
  border-color: var(--danger);
  background: var(--danger-light);
}

/* Radio & Checkbox Option Labels */
.q-options-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-left: 2rem;
}

.option-btn-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.option-btn-label:hover {
  background: var(--bg-subtle);
  border-color: var(--text-subtle);
}

.option-btn-label input[type="radio"],
.option-btn-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.option-btn-label.correct-choice {
  background: var(--success-light);
  border-color: var(--success);
  color: #065f46;
  font-weight: 600;
}
.option-btn-label.wrong-choice {
  background: var(--danger-light);
  border-color: var(--danger);
  color: #991b1b;
}

/* Explanation Accordion / Drawer */
.q-explanation-box {
  display: none;
  background: var(--bg-subtle);
  border-left: 4px solid var(--accent-purple);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 0.85rem 1.25rem;
  margin-left: 2rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-main);
}
.q-explanation-box.visible {
  display: block;
}
.q-explanation-box strong {
  color: var(--accent-purple);
}

/* Score Bar & Quiz Action Buttons */
.quiz-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 0;
}

.quiz-score-indicator {
  display: none;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}
.quiz-score-indicator.visible {
  display: flex;
}
.score-badge {
  background: var(--primary);
  color: #fff;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
}
.score-badge.perfect {
  background: var(--success);
}

.btn-primary-action {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.75rem 2.25rem;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--primary-glow);
  transition: all var(--transition-fast);
}
.btn-primary-action:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary-action {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-secondary-action:hover {
  background: var(--bg-hover);
}

/* ── Find-Mark-Classify-Decide Stepper (Modul 6) ── */
.stepper-progress-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.step-method-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-right: 0.4rem;
}
.tag-find { background: #3b82f6; }
.tag-mark { background: #8b5cf6; }
.tag-classify { background: #f59e0b; }
.tag-decide { background: #10b981; }

/* ── Interactive CAT Workbench Studio (Modul 7) ── */
.cat-workbench-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cat-toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.cat-segment-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
}
.cat-segment-row:focus-within {
  border-color: var(--primary);
}

.cat-tsu-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.cat-box-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cat-tsa-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cat-textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.95rem;
  resize: vertical;
  line-height: 1.6;
  transition: border-color var(--transition-fast);
}
.cat-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.cat-qa-panel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.qa-warning {
  color: var(--danger);
  font-weight: 600;
}

/* ── Glossary Search Engine ── */
.glossary-search-box {
  position: relative;
  margin-bottom: 1.5rem;
}
.glossary-search-input {
  width: 100%;
  padding: 0.85rem 1.25rem 0.85rem 3rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 1rem;
  background: var(--bg-card);
  color: var(--text-main);
}
.glossary-search-icon {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.glossary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}
.glossary-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.glossary-term-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
}
.glossary-expert-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-purple);
}
.glossary-term-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Certificate Generator View ── */
.certificate-preview-box {
  background: #ffffff;
  color: #1e293b;
  border: 8px double #1e3a8a;
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  max-width: 800px;
  margin: 0 auto 2rem;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-xl);
}

.cert-ut-header {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1e3a8a;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.cert-ut-sub {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 2rem;
}
.cert-main-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 0.5rem;
}
.cert-recipient-name {
  font-size: 1.8rem;
  font-weight: 800;
  color: #1e40af;
  border-bottom: 2px solid #cbd5e1;
  display: inline-block;
  padding: 0 2rem 0.25rem;
  margin: 1rem 0;
}
.cert-body-text {
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto 2rem;
}
.cert-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

/* ── Modal Popups ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal-overlay.open {
  display: flex;
}

.modal-content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--success-light);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

/* ── Achievement Star Modal Styles ── */
.achievement-modal-card {
  max-width: 580px;
  width: 100%;
  text-align: left;
  padding: 2.25rem 2rem;
  max-height: 90vh;
  overflow-y: auto;
}
.achievement-modal-header {
  text-align: center;
  margin-bottom: 1.25rem;
}
.achievement-big-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-gold-light);
  color: #b45309;
  border: 1px solid var(--accent-gold);
  padding: 0.4rem 1.15rem;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 12px var(--accent-gold-glow);
}
[data-theme="dark"] .achievement-big-badge {
  color: #fef3c7;
}
.achievement-modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}
.achievement-modal-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.achievement-summary-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  margin: 1.25rem 0;
  text-align: center;
}
.summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.summary-lbl {
  font-size: 0.725rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.summary-val {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
}

.achievement-milestones-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 290px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  padding-right: 0.25rem;
}
.milestone-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  transition: all var(--transition-fast);
}
.milestone-item.unlocked {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.05);
}
.milestone-star {
  font-size: 1.35rem;
  line-height: 1;
}
.milestone-star.gold {
  color: #f59e0b;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}
.milestone-star.gray {
  color: #94a3b8;
  opacity: 0.4;
}
.milestone-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.milestone-name {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--text-main);
}
.milestone-req {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.milestone-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}
.badge-unlocked {
  background: var(--success-light);
  color: var(--success);
}
.badge-locked {
  background: var(--bg-subtle);
  color: var(--text-subtle);
}

.achievement-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}
.btn-modal-reset-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-modal-reset-action:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger);
}

/* ── Reset Confirmation Modal Styles ── */
.reset-modal-card {
  max-width: 480px;
  width: 100%;
  text-align: center;
  padding: 2.25rem 2rem;
}
.reset-icon-circle {
  background: var(--danger-light);
  color: var(--danger);
}
.reset-impact-list {
  list-style: none;
  text-align: left;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 1.5rem;
}
.reset-impact-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  line-height: 1.4;
}
.reset-modal-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.btn-danger-confirm {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  background: #ef4444;
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}
.btn-danger-confirm:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.4);
}

/* ── Responsive Mobile Media Queries ── */
@media (max-width: 900px) {
  .menu-btn {
    display: inline-flex;
  }

  .app-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height));
    width: 85vw;
    max-width: 320px;
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }
  .app-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-backdrop.open {
    display: block;
  }

  .app-content-area {
    padding: 1.25rem 1rem 5rem;
  }

  .hero-banner {
    padding: 2.5rem 1.5rem;
  }
  .hero-title {
    font-size: 1.85rem;
  }

  .cat-segment-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   STANDALONE PORTAL LANDING PAGE & WORKSPACE SHELL STYLES
   ========================================================================== */

/* ── Container Modes ── */
.portal-landing-container {
  display: block;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-main);
  overflow-y: visible;
  position: relative;
}
.lab-workspace-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-main);
}

/* ── Workspace Header & Sidebar "Back to Portal" Buttons ── */
.btn-portal-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-portal-back:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.sidebar-portal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 0.85rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-glow);
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.sidebar-portal-btn:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* ── 1. Portal Page Wrapper & Sticky Navbar ── */
.portal-page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  background: var(--bg-main);
  color: var(--text-main);
  position: relative;
  overflow-x: hidden;
}

.portal-navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: all var(--transition-fast);
}
[data-theme="dark"] .portal-navbar {
  background: rgba(15, 23, 42, 0.88);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.portal-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.portal-brand-text {
  display: flex;
  flex-direction: column;
}
.portal-brand-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.portal-brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.portal-nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.portal-nav-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
  padding: 0.35rem 0.2rem;
  position: relative;
}
.portal-nav-link:hover {
  color: var(--primary);
}
.portal-nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform var(--transition-fast);
}
.portal-nav-link:hover::after {
  transform: scaleX(1);
}

.portal-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.portal-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.portal-btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--primary);
}
.portal-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.portal-theme-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  transform: rotate(15deg);
}
.portal-btn-enter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 14px var(--primary-glow);
}
.portal-btn-enter:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

/* ── 2. Portal Hero Section ── */
.portal-hero-section {
  position: relative;
  overflow: hidden;
  padding: 5.5rem 1.5rem 4.5rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(0, 82, 204, 0.08) 0%, rgba(139, 92, 246, 0.06) 50%, transparent 100%);
}
.portal-glow-aura {
  position: absolute;
  width: 500px;
  height: 500px;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(0, 82, 204, 0.22) 0%, rgba(139, 92, 246, 0.15) 50%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  animation: pulseAura 6s ease-in-out infinite alternate;
}
.portal-glow-aura-2 {
  position: absolute;
  width: 350px;
  height: 350px;
  bottom: 0;
  right: -50px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
}
@keyframes pulseAura {
  0% { transform: translateX(-50%) scale(1); opacity: 0.8; }
  100% { transform: translateX(-50%) scale(1.2); opacity: 1; }
}

.portal-hero-title {
  font-size: 3.4rem;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--text-main);
  max-width: 950px;
  margin: 1.5rem auto 1.25rem;
}
.portal-hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 860px;
  margin: 0 auto 2.5rem;
}
.portal-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 4rem;
}
.portal-btn-primary-large {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.25rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #0052cc 0%, #003b99 100%);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 8px 24px var(--primary-glow);
}
.portal-btn-primary-large:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px var(--primary-glow);
}
.portal-btn-secondary-large {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.portal-btn-secondary-large:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* ── Portal Stats Strip ── */
.portal-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
  text-align: left;
}
.portal-stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.portal-stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.portal-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.portal-stat-info {
  display: flex;
  flex-direction: column;
}
.portal-stat-val {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}
.portal-stat-lbl {
  font-size: 0.775rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── 3. Portal General Sections ── */
.portal-section {
  padding: 5rem 1.5rem;
  position: relative;
}
.portal-section.portal-bg-subtle {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}
.portal-container {
  max-width: 1200px;
  margin: 0 auto;
}
.portal-section-header {
  margin-bottom: 2.75rem;
}
.portal-section-header.text-center {
  text-align: center;
}
.portal-section-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.025em;
  line-height: 1.25;
}
.portal-section-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 800px;
  margin-top: 0.6rem;
}
.portal-section-header.text-center .portal-section-desc {
  margin-left: auto;
  margin-right: auto;
}

/* ── 4. CAT Spotlight Card ── */
.portal-cat-spotlight-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  box-shadow: var(--shadow-md);
}
.cat-spotlight-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.cat-features-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0.5rem 0;
}
.cat-feat-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-main);
}
.cat-feat-bullet {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--success-light);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.cat-spotlight-preview {
  position: relative;
}
.cat-preview-box {
  background: #0f172a;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}
.cat-preview-header {
  background: #1e293b;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.cat-preview-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.cat-preview-header .dot.red { background: #ef4444; }
.cat-preview-header .dot.yellow { background: #f59e0b; }
.cat-preview-header .dot.green { background: #10b981; }
.preview-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #94a3b8;
  margin-left: 0.5rem;
}
.cat-preview-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.preview-seg {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.preview-seg.active {
  border-color: var(--primary);
  background: rgba(0, 82, 204, 0.15);
}
.seg-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
}
.seg-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.seg-tsu {
  font-size: 0.825rem;
  color: #94a3b8;
  font-style: italic;
}
.seg-tsa {
  font-size: 0.875rem;
  color: #f8fafc;
  font-weight: 600;
}
.seg-status-ok {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

/* ── 5. FAQ Grid ── */
.portal-faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.faq-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}
.faq-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.faq-q {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.4;
}
.faq-a {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ── 6. Portal Footer ── */
.portal-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 4.5rem 1.5rem 2rem;
  margin-top: 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}
.footer-col-brand {
  display: flex;
  flex-direction: column;
}
.footer-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.footer-heading {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.footer-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
}
.footer-links a:hover {
  color: var(--primary);
  transform: translateX(3px);
  display: inline-block;
}
.footer-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.825rem;
  color: var(--text-muted);
}
.footer-bottom-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

/* ── Responsive Portal Layout ── */
@media (max-width: 1024px) {
  .portal-nav-menu {
    display: none;
  }
  .portal-hero-title {
    font-size: 2.75rem;
  }
  .portal-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .portal-cat-spotlight-card {
    grid-template-columns: 1fr;
  }
  .portal-faq-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .portal-hero-section {
    padding: 3.5rem 1.25rem 3rem;
  }
  .portal-hero-title {
    font-size: 2.15rem;
  }
  .portal-hero-desc {
    font-size: 1rem;
  }
  .portal-hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .portal-btn-primary-large, .portal-btn-secondary-large {
    width: 100%;
    justify-content: center;
  }
  .portal-stats-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom-bar {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}

/* ==========================================================================
   LANDING PAGE (HOME) MODERN & THEMATIC STYLES
   ========================================================================== */


/* ── 1. Hero Modern Section ── */
.hero-modern {
  position: relative;
  background: linear-gradient(135deg, rgba(0, 82, 204, 0.08) 0%, rgba(139, 92, 246, 0.12) 45%, rgba(245, 158, 11, 0.06) 100%), var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 3.5rem 3rem 2.5rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.hero-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple), var(--accent-gold), var(--success));
}
.hero-glow-aura {
  position: absolute;
  width: 380px;
  height: 380px;
  top: -100px;
  right: -80px;
  background: radial-gradient(circle, rgba(0, 82, 204, 0.18) 0%, rgba(139, 92, 246, 0.12) 45%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  animation: floatAura 8s ease-in-out infinite alternate;
}
@keyframes floatAura {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-30px, 40px) scale(1.15); }
}

.hero-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.hero-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-glow);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.hero-badge-divider {
  opacity: 0.4;
}
.hero-badge-version {
  background: var(--primary);
  color: #ffffff;
  padding: 0.1rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.725rem;
  font-weight: 800;
}
.hero-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--success-light);
  color: var(--success);
  font-size: 0.8rem;
  font-weight: 700;
}
.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulseDot 2s infinite;
}

.hero-headline {
  font-size: 2.65rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text-main);
  max-width: 900px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 50%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}
[data-theme="dark"] .gradient-text {
  background: linear-gradient(135deg, #60a5fa 0%, #c084fc 50%, #fcd34d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtext {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 820px;
  line-height: 1.7;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding-top: 0.5rem;
}
.btn-hero-tertiary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-hero-tertiary:hover {
  background: var(--bg-subtle);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ── Hero Stats Strip ── */
.hero-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-color);
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.stat-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-details {
  display: flex;
  flex-direction: column;
}
.stat-number {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── 2. Section Base & Header ── */
.home-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2.5rem;
  box-shadow: var(--shadow-md);
}
.section-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}
.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  margin-bottom: 0.35rem;
}
.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.section-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 0.35rem;
  max-width: 820px;
}

/* ── 3. Stepper Interactive Container ── */
.stepper-interactive-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}
.stepper-nav-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.stepper-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}
.stepper-tab-btn:hover {
  background: var(--bg-hover);
  transform: translateY(-2px);
}
.stepper-tab-btn.active {
  background: var(--bg-card);
  border-color: var(--primary);
  box-shadow: 0 4px 14px var(--primary-glow);
}
.stepper-btn-num {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.stepper-btn-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.stepper-btn-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stepper-btn-focus {
  font-size: 0.725rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stepper-display-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.stepper-display-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.display-level-badge {
  font-size: 0.95rem;
  font-weight: 800;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
}
.display-status-chip {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.sentence-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.sentence-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.sentence-box.tsu-box {
  border-left: 4px solid var(--primary);
}
.sentence-box.tsa-box {
  border-left: 4px solid var(--accent-gold);
}
.box-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.775rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}
.btn-mini-audio {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-mini-audio:hover {
  background: var(--primary);
  color: #ffffff;
}
.sentence-text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-main);
  font-style: italic;
  transition: opacity 0.2s ease;
}

.stepper-analysis-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
}
.analysis-item {
  display: flex;
  gap: 0.5rem;
}
.analysis-label {
  font-weight: 700;
  color: var(--text-main);
  flex-shrink: 0;
}

/* ── 4. Curriculum Phase Styles ── */
.curriculum-phase-block {
  margin-top: 1.75rem;
}
.phase-header-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border-color);
}
.phase-pill {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
}
.pill-phase-1 {
  background: var(--primary-light);
  color: var(--primary);
}
.pill-phase-2 {
  background: var(--accent-purple-light);
  color: var(--accent-purple);
}
.pill-phase-3 {
  background: var(--accent-gold-light);
  color: var(--accent-gold);
}
.phase-main-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}
.phase-sub-title {
  font-size: 0.825rem;
  color: var(--text-muted);
}

.feature-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.feature-xp-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--accent-gold-light);
  color: var(--accent-gold);
}
.feature-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}
.feature-link-text {
  color: var(--primary);
  font-weight: 700;
}

/* ── 5. Home Mini Test-Drive Card ── */
.home-testdrive-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(0, 82, 204, 0.06) 100%), var(--bg-card);
  border: 1px solid var(--accent-gold-glow);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.testdrive-badge-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.testdrive-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.testdrive-xp-pill {
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--accent-gold);
  color: #ffffff;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
}
.testdrive-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
}
.testdrive-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.testdrive-question {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}
.testdrive-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-top: 0.5rem;
}
.testdrive-opt-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}
.testdrive-opt-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.opt-key {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.opt-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}
.testdrive-opt-btn.opt-correct {
  background: var(--success-light) !important;
  border-color: var(--success) !important;
}
.testdrive-opt-btn.opt-correct .opt-key {
  background: var(--success) !important;
  color: #ffffff !important;
}
.testdrive-opt-btn.opt-wrong {
  background: var(--danger-light) !important;
  border-color: var(--danger) !important;
}
.testdrive-opt-btn.opt-wrong .opt-key {
  background: var(--danger) !important;
  color: #ffffff !important;
}

.testdrive-feedback {
  display: none;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 0.5rem;
  animation: fadeIn 0.25s ease;
}
.testdrive-feedback.visible {
  display: flex;
}
.feedback-success {
  background: var(--success-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #065f46;
}
[data-theme="dark"] .feedback-success {
  color: #a7f3d0;
}
.feedback-error {
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #991b1b;
}
[data-theme="dark"] .feedback-error {
  color: #fecaca;
}
.feedback-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* ── 6. Pedagogical Pillars Grid ── */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.pillar-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  transition: all var(--transition-fast);
}
.pillar-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.pillar-num {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--primary);
  opacity: 0.35;
  line-height: 1;
}
.pillar-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
}
.pillar-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}
.pillar-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  width: fit-content;
  margin-top: 0.5rem;
}

/* ── 7. Journey Steps Grid ── */
.journey-steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}
.journey-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}
.journey-card:hover {
  background: var(--bg-card);
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.journey-badge-num {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
}
.journey-card-title {
  font-size: 0.975rem;
  font-weight: 800;
  color: var(--text-main);
}
.journey-card-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── 8. CTA Modern Banner ── */
.cta-banner-modern {
  background: linear-gradient(135deg, #003b99 0%, #0052cc 50%, #4f46e5 100%);
  border-radius: var(--radius-xl);
  padding: 3.5rem 3rem;
  color: #ffffff;
  box-shadow: 0 15px 35px rgba(0, 82, 204, 0.35);
  position: relative;
  overflow: hidden;
  text-align: center;
}
.cta-banner-modern::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.cta-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  max-width: 750px;
  margin: 0 auto;
}
.cta-badge {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
}
.cta-title {
  font-size: 2rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.cta-desc {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}
.cta-btn-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}
.cta-banner-modern .btn-hero-primary {
  background: #ffffff;
  color: #003b99;
}
.cta-banner-modern .btn-hero-primary:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.cta-banner-modern .btn-hero-secondary {
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}
.cta-banner-modern .btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #ffffff;
}

/* ── Responsive Landing Page ── */
@media (max-width: 1024px) {
  .hero-stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .stepper-nav-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
  .sentence-compare-grid {
    grid-template-columns: 1fr;
  }
  .testdrive-options-grid {
    grid-template-columns: 1fr;
  }
  .pillars-grid {
    grid-template-columns: 1fr;
  }
  .journey-steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero-modern {
    padding: 2.25rem 1.5rem;
  }
  .hero-headline {
    font-size: 1.95rem;
  }
  .hero-stats-strip {
    grid-template-columns: 1fr;
  }
  .stepper-nav-tabs {
    grid-template-columns: 1fr;
  }
  .journey-steps-grid {
    grid-template-columns: 1fr;
  }
  .home-section-card {
    padding: 1.75rem 1.25rem;
  }
  .cta-banner-modern {
    padding: 2.5rem 1.5rem;
  }
  .cta-title {
    font-size: 1.5rem;
  }
}

/* ==========================================================================
   ADMIN PANEL & CMS STYLES
   ========================================================================== */


/* ── Header Quick Link & Sidebar Badge ── */
.admin-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-glow);
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.admin-quick-btn:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.badge-admin {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.nav-admin-btn {
  border-left: 3px solid #ef4444 !important;
}

/* ── Admin Dashboard Container ── */
.admin-dashboard {
  padding-bottom: 5rem;
}

/* ── Admin Header Banner Card ── */
.admin-header-card {
  background: linear-gradient(135deg, rgba(0, 82, 204, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%), var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}
.admin-header-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0052cc, #8b5cf6, #f59e0b, #10b981);
}
.admin-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(0, 82, 204, 0.12);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.admin-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}
.admin-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 850px;
  line-height: 1.6;
}

.admin-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-color);
}
.btn-admin-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
}
.btn-admin-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.btn-admin-save {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}
.btn-admin-save:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-admin-export:hover {
  background: var(--info-light);
  color: var(--info);
  border-color: var(--info);
}
.btn-admin-import:hover {
  background: var(--accent-purple-light);
  color: var(--accent-purple);
  border-color: var(--accent-purple);
}
.btn-admin-reset {
  color: var(--danger);
}
.btn-admin-reset:hover {
  background: var(--danger-light);
  border-color: var(--danger);
}

/* ── Admin Tabs Navigation Bar ── */
.admin-tabs-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.4rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
.admin-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.admin-tab-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}
.admin-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.admin-tab-icon {
  font-size: 1rem;
}

/* ── Tab Panes ── */
.admin-tab-pane {
  display: none;
  animation: fadeIn 0.25s ease forwards;
}
.admin-tab-pane.active {
  display: block;
}

/* ── Form Controls & Grid ── */
.admin-section-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.admin-subheading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 1.75rem 0 1rem 0;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-color);
}
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.admin-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.admin-form-group.full-width {
  grid-column: span 2;
}
.admin-label {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.admin-input, .admin-select, .admin-textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.925rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.admin-input:focus, .admin-select:focus, .admin-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.admin-textarea {
  resize: vertical;
  line-height: 1.6;
}

/* ── Subcards (Newmark Levels, Nord Factors, etc) ── */
.admin-levels-list, .admin-questions-list, .admin-sets-list, .admin-segments-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.admin-subcard, .admin-question-editor-card, .admin-set-editor-card, .admin-segment-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: border-color var(--transition-fast);
}
.admin-subcard:hover, .admin-question-editor-card:hover {
  border-color: var(--primary);
}
.admin-subcard-header, .admin-qcard-header, .admin-set-header, .admin-segment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border-color);
}
.admin-subcard-title, .admin-qcard-title, .admin-set-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
}
.admin-pill-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
}
.admin-tag-id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}
.btn-admin-del-q {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger-light);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-admin-del-q:hover {
  background: var(--danger);
  color: #ffffff;
}

/* ── Nord Factors List ── */
.admin-factors-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}
.admin-factor-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
}
.factor-code-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.factor-inputs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* ── Question Subtabs (M2, M4, M5, M6) ── */
.admin-qsubtabs-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}
.admin-qsubtab-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.admin-qsubtab-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.admin-qsubtab-btn.active {
  background: var(--text-main);
  color: var(--bg-card);
  border-color: var(--text-main);
}
.admin-qsubpane {
  display: none;
  animation: fadeIn 0.2s ease forwards;
}
.admin-qsubpane.active {
  display: block;
}

/* ── Highlighter Categories ── */
.admin-cat-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.admin-highlighter-cat-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Modul 6 Steps ── */
.admin-set-steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.admin-step-qcard {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.admin-step-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-purple);
  background: var(--accent-purple-light);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

/* ── Glossary Admin ── */
.admin-filter-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.admin-count-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}
.admin-glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.admin-glossary-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: border-color var(--transition-fast);
}
.admin-glossary-card:hover {
  border-color: var(--primary);
}
.admin-glossary-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

/* ── JSON Raw Editor & Backup ── */
.admin-json-editor-container {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.admin-json-textarea {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 1rem;
  background: #0b0f19;
  color: #38bdf8;
  border: none;
  outline: none;
  line-height: 1.6;
  resize: vertical;
}

.admin-backup-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.admin-backup-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.admin-backup-card h4 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}
.admin-backup-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.admin-backup-card.danger-card {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.03);
}

/* ── Floating Save Bar ── */
.admin-floating-save-bar {
  position: fixed;
  bottom: 24px;
  left: calc(var(--sidebar-width) + 32px);
  right: 32px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.35);
  z-index: 900;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (max-width: 1024px) {
  .admin-floating-save-bar {
    left: 20px;
    right: 20px;
    bottom: 20px;
  }
}
.admin-save-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #e2e8f0;
  font-size: 0.875rem;
  font-weight: 500;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}
.btn-save-floating {
  padding: 0.65rem 1.5rem;
  font-size: 0.9rem;
  box-shadow: 0 4px 14px rgba(0, 82, 204, 0.5);
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Responsive Admin Styles ── */
@media (max-width: 900px) {
  .admin-form-grid, .admin-factors-list, .admin-cat-list, .admin-glossary-grid, .admin-backup-actions-grid {
    grid-template-columns: 1fr;
  }
  .admin-form-group.full-width {
    grid-column: span 1;
  }
  .admin-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-actions-bar .btn-admin-action {
    justify-content: center;
  }
  .admin-floating-save-bar {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
    text-align: center;
  }
}

@media print {
  .app-header, .app-sidebar, .breadcrumb-nav, .view-header, .quiz-footer-bar, .highlighter-control-bar, .admin-floating-save-bar {
    display: none !important;
  }
  .app-content-area {
    padding: 0 !important;
  }
  .certificate-preview-box {
    box-shadow: none !important;
    border-width: 4px !important;
    margin: 0 !important;
    max-width: 100% !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   ADMIN AUTHENTICATION & LOGIN GATE STYLES
   ══════════════════════════════════════════════════════════════════════════ */
.admin-login-wrapper {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.admin-login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
}

.admin-login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2.25rem;
  box-shadow: var(--shadow-xl);
  width: 100%;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  animation: slideUp 0.35s ease-out;
}

.admin-login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple), var(--accent-gold));
}

.admin-login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.admin-login-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.admin-login-badge {
  display: inline-block;
  padding: 0.25rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--accent-purple-light);
  color: var(--accent-purple);
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
}

.admin-login-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.admin-login-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 480px;
  margin: 0 auto;
}

.admin-login-error {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}

.admin-login-error.shake {
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.admin-input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.admin-input-icon-wrapper .input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.admin-input.has-icon {
  padding-left: 2.75rem !important;
  padding-right: 2.75rem !important;
}

.btn-toggle-password {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.btn-toggle-password:hover {
  color: var(--primary);
}

.btn-admin-login-submit {
  width: 100%;
  justify-content: center;
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
  margin-top: 1.25rem;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.admin-credential-hint-card {
  margin-top: 1.75rem;
  background: var(--bg-subtle);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: left;
}

.hint-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.hint-details {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  background: var(--bg-card);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.hint-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.hint-label {
  color: var(--text-muted);
  font-weight: 500;
}

.hint-code {
  background: var(--primary-light);
  color: var(--primary);
  font-family: 'Fira Code', monospace;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.btn-quick-fill-creds {
  background: var(--bg-card);
  border: 1px solid var(--primary);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: center;
}

.btn-quick-fill-creds:hover {
  background: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 2px 8px var(--primary-glow);
}

.admin-login-footer {
  margin-top: 1.5rem;
  text-align: center;
}

.admin-session-indicator {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 0.4rem;
}

.btn-admin-logout {
  background: var(--danger-light) !important;
  color: var(--danger) !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
}

.btn-admin-logout:hover {
  background: var(--danger) !important;
  color: #ffffff !important;
  border-color: var(--danger) !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35) !important;
}

