/* =========================================
   FikerLesson — Design System (FikerLearn Aesthetic)
   ========================================= */

:root {
  /* FikerLearn Core Palette */
  --cream: #F5EDE3;
  --beige: #E8D5BF;
  --tan: #C9A882;
  --brown: #8B5E3C;
  --brown-mid: #6E4A2E;
  --brown-dark: #4A2E18;
  --espresso: #2C1A0E;
  --gold: #D4A843;
  --gold-light: #F0C96A;
  --gold-dark: #A67D22;
  --white: #FEFAF7;
  --surface: #FFFFFF;
  --surface-2: #F8F2EC;
  --surface-3: #F0E4D4;
  --border: #E8D5BF;
  --border-soft: #F0E4D4;
  --text-primary: #2C1A0E;
  --text-secondary: #7B4F2E;
  --text-tertiary: #A07850;

  /* Semantic Color Mapping */
  --color-primary: #8B5E3C;
  --color-primary-light: #F0C96A;
  --color-primary-dark: #6E4A2E;
  --color-primary-50: #F8F2EC;
  --color-primary-100: #F0E4D4;
  --color-primary-200: #E8D5BF;
  --color-primary-500: #8B5E3C;
  --color-primary-600: #6E4A2E;
  --color-primary-700: #4A2E18;
  --color-primary-800: #2C1A0E;
  --color-primary-900: #140D08;

  --color-accent: #D4A843;
  --color-accent-light: #F0C96A;
  --color-accent-dark: #A67D22;

  --color-surface: #FFFFFF;
  --color-surface-dim: #F5EDE3;
  --color-surface-container: #F8F2EC;
  --color-surface-container-high: #F0E4D4;

  --color-on-surface: #2C1A0E;
  --color-on-surface-variant: #7B4F2E;
  --color-outline: #E8D5BF;
  --color-outline-variant: #F0E4D4;

  --color-error: #C0392B;
  --color-error-light: #FDECEA;
  --color-success: #5B8A4A;
  --color-success-light: #E8F5E3;
  --color-info: #8B5E3C;
  --color-info-light: #F8F2EC;
  --color-warning: #E67E22;
  --color-warning-light: #FFF8EE;

  /* Card accents */
  --color-indigo: #8B5E3C;
  --color-indigo-light: #F8F2EC;
  --color-purple: #6E4A2E;
  --color-purple-light: #F0E4D4;
  --color-rose: #C0392B;
  --color-rose-light: #FDECEA;

  /* Dark Theme Support */
  --bg-dark: #140D08;
  --surface-dark: #20150D;
  --on-dark: #FEFAF7;
  --outline-dark: #3A2517;

  /* FikerLearn Signature Gradients */
  --grad-primary: linear-gradient(135deg, #8B5E3C 0%, #6E4A2E 100%);
  --grad-warm: linear-gradient(135deg, #C9A882 0%, #8B5E3C 100%);
  --grad-gold: linear-gradient(135deg, #F0C96A 0%, #D4A843 100%);
  --grad-dark: linear-gradient(135deg, #4A2E18 0%, #2C1A0E 100%);

  /* Warm Espresso Shadows */
  --shadow-xs: 0 1px 3px rgba(44, 26, 14, 0.05);
  --shadow-sm: 0 1px 4px rgba(44, 26, 14, 0.08);
  --shadow-md: 0 4px 16px rgba(44, 26, 14, 0.12);
  --shadow-lg: 0 8px 32px rgba(44, 26, 14, 0.16);
  --shadow-xl: 0 16px 40px rgba(44, 26, 14, 0.20);
  --shadow-gold: 0 4px 20px rgba(212, 168, 67, 0.35);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Font */
  --font-family: 'Plus Jakarta Sans', 'Noto Sans Ethiopic', system-ui, sans-serif;
  --font-main: 'Plus Jakarta Sans', 'Noto Sans Ethiopic', sans-serif;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   Reset & Base
   ========================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

body {
  font-family: var(--font-family);
  color: var(--color-on-surface);
  background: var(--color-surface-dim);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* =========================================
   Screens
   ========================================= */
.screen {
  display: none;
  min-height: 100vh;
  animation: fadeIn 0.3s ease;
  /* Perf: skip layout/paint for inactive screens */
  content-visibility: hidden;
  contain-intrinsic-size: 0 500px;
}

.screen.active {
  display: flex;
  flex-direction: column;
  content-visibility: visible;
  contain-intrinsic-size: auto;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 0.5;
  }

  100% {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  33% {
    transform: translateY(-10px) rotate(2deg);
  }

  66% {
    transform: translateY(5px) rotate(-1deg);
  }
}

/* =========================================
   Auth Screen
   ========================================= */
.auth-container {
  display: flex;
  min-height: 100vh;
}

.auth-hero {
  flex: 1;
  background: linear-gradient(135deg, var(--color-primary-900) 0%, var(--color-primary-700) 40%, var(--color-primary-500) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-hero-content {
  text-align: center;
  color: white;
  z-index: 2;
  padding: 40px;
}

.hero-icon-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  animation: float 6s ease-in-out infinite;
}

.hero-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease;
}

.hero-icon-ring:hover .hero-icon {
  transform: scale(1.05);
}

.hero-title {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 28px;
  font-weight: 300;
  opacity: 0.9;
  margin-top: -4px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-description {
  margin-top: 20px;
  font-size: 15px;
  opacity: 0.8;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.hero-bg-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  background: white;
}

.shape-1 {
  width: 400px;
  height: 400px;
  top: -100px;
  right: -100px;
  animation: float 8s ease-in-out infinite;
}

.shape-2 {
  width: 300px;
  height: 300px;
  bottom: -50px;
  left: -80px;
  animation: float 10s ease-in-out infinite reverse;
}

.shape-3 {
  width: 200px;
  height: 200px;
  top: 50%;
  right: 30%;
  animation: float 7s ease-in-out infinite 1s;
}

.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--color-surface);
}

.auth-form-content {
  width: 100%;
  max-width: 420px;
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-on-surface);
  margin-bottom: 4px;
}

.auth-subtitle {
  color: var(--color-on-surface-variant);
  margin-bottom: 32px;
  font-size: 15px;
}

.divider-text {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: var(--color-on-surface-variant);
  font-size: 13px;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-outline-variant);
}

.divider-text span {
  padding: 0 12px;
}

.auth-toggle {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--color-on-surface-variant);
}

.auth-toggle a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
}

.auth-toggle a:hover {
  text-decoration: underline;
}

/* =========================================
   Form Elements
   ========================================= */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-on-surface-variant);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 20px;
  color: var(--color-outline);
  transition: color var(--transition-fast);
  pointer-events: none;
}

.input-wrapper input,
.input-wrapper select {
  width: 100%;
  padding: 12px 14px 12px 46px;
  border: 2px solid var(--color-outline-variant);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 15px;
  color: var(--color-on-surface);
  background: var(--color-surface);
  outline: none;
  transition: all var(--transition-fast);
}

.input-wrapper input:focus,
.input-wrapper select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.input-wrapper input:focus~.input-icon,
.input-wrapper select:focus~.input-icon {
  color: var(--color-primary);
}

/* Fix select icon order */
.input-wrapper:has(select) .input-icon {
  z-index: 1;
}

textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--color-outline-variant);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 15px;
  color: var(--color-on-surface);
  background: var(--color-surface);
  outline: none;
  resize: vertical;
  transition: all var(--transition-fast);
}

textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.hidden {
  display: none !important;
}

/* =========================================
   Buttons
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  user-select: none;
}

.btn:active {
  transform: scale(0.96);
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  transform: scale(0);
  opacity: 0;
  transition: transform 0.5s, opacity 0.3s;
}

.btn:active::after {
  transform: scale(4);
  opacity: 1;
  transition: transform 0s, opacity 0s;
}

.btn-primary {
  background: var(--grad-primary);
  color: #FEFAF7;
  box-shadow: 0 4px 16px rgba(139, 94, 60, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #9C6B46 0%, #7D5434 100%);
  box-shadow: 0 6px 20px rgba(139, 94, 60, 0.38);
  transform: translateY(-1px);
}

.btn-gold {
  background: var(--grad-gold);
  color: #2C1A0E;
  font-weight: 700;
  box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
  box-shadow: 0 6px 24px rgba(212, 168, 67, 0.45);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary-50);
}

.btn-text {
  background: transparent;
  color: var(--color-primary);
  padding: 8px 12px;
  font-size: 14px;
}

.btn-text:hover {
  background: var(--color-primary-50);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-google {
  background: var(--color-surface);
  color: var(--color-on-surface);
  border: 2px solid var(--color-outline-variant);
}

.btn-google:hover {
  background: var(--color-surface-dim);
  border-color: var(--color-outline);
}

.google-icon {
  flex-shrink: 0;
}

.btn-icon {
  font-size: 18px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background var(--transition-fast);
  color: var(--color-on-surface-variant);
}

.icon-btn:hover {
  background: var(--color-surface-container);
}

.icon-btn .material-icons-round {
  font-size: 22px;
}

.badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-error);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================================
   App Header
   ========================================= */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-outline-variant);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo-icon {
  font-size: 28px;
  color: var(--color-primary);
}

.header-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-on-surface);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-indicator {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-50);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

/* =========================================
   Avatar & User Menu
   ========================================= */
.avatar-menu {
  position: relative;
  cursor: pointer;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  transition: transform var(--transition-fast);
}

.avatar:hover {
  transform: scale(1.08);
}

.avatar-lg {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-outline-variant);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transition: all var(--transition-normal);
  z-index: 200;
  overflow: hidden;
}

.user-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.user-menu-name {
  font-weight: 600;
  font-size: 15px;
}

.user-menu-email {
  font-size: 12px;
  color: var(--color-on-surface-variant);
}

.user-menu-divider {
  height: 1px;
  background: var(--color-outline-variant);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--color-on-surface);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.user-menu-item:hover {
  background: var(--color-surface-container);
}

.user-menu-item .material-icons-round {
  font-size: 20px;
  color: var(--color-on-surface-variant);
}

/* =========================================
   Dashboard
   ========================================= */
.dashboard-main {
  flex: 1;
  padding: 14px 20px;
}

.dashboard-container {
  max-width: 1280px;
  margin: 0 auto;
}



.welcome-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 90% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 10% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
}

.welcome-pattern::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  border: 2px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  top: -60px;
  right: -40px;
}

/* Quick Actions */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-on-surface);
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.action-card {
  padding: 24px 16px;
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  font-family: var(--font-family);
  animation: slideUp 0.5s ease backwards;
}

.action-card:nth-child(1) {
  animation-delay: 0.1s;
}

.action-card:nth-child(2) {
  animation-delay: 0.15s;
}

.action-card:nth-child(3) {
  animation-delay: 0.2s;
}

.action-card:nth-child(4) {
  animation-delay: 0.25s;
}

.action-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.action-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.action-card-icon .material-icons-round {
  font-size: 28px;
}

.action-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.action-card p {
  font-size: 12px;
  opacity: 0.7;
}

.action-new {
  background: var(--color-primary-50);
  border-color: var(--color-primary-100);
  color: var(--color-primary-800);
}

.action-new .action-card-icon {
  background: var(--color-primary-100);
}

.action-new .action-card-icon .material-icons-round {
  color: var(--color-primary);
}

.action-new:hover {
  border-color: var(--color-primary-200);
}

.action-curriculum {
  background: var(--color-indigo-light);
  border-color: #e0e7ff;
  color: #312e81;
}

.action-curriculum .action-card-icon {
  background: #e0e7ff;
}

.action-curriculum .action-card-icon .material-icons-round {
  color: var(--color-indigo);
}

.action-curriculum:hover {
  border-color: #c7d2fe;
}

.action-ai {
  background: var(--color-purple-light);
  border-color: #f3e8ff;
  color: #581c87;
}

.action-ai .action-card-icon {
  background: #f3e8ff;
}

.action-ai .action-card-icon .material-icons-round {
  color: var(--color-purple);
}

.action-ai:hover {
  border-color: #e9d5ff;
}

.action-export {
  background: var(--color-rose-light);
  border-color: #ffe4e6;
  color: #9f1239;
}

.action-export .action-card-icon {
  background: #ffe4e6;
}

.action-export .action-card-icon .material-icons-round {
  color: var(--color-rose);
}

.action-export:hover {
  border-color: #fecdd3;
}

/* Recent Plans */
.plan-card {
  background: var(--color-surface);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  animation: slideUp 0.4s ease backwards;
}

.plan-card:hover {
  border-color: var(--color-primary-200);
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.plan-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.plan-card-info {
  flex: 1;
}

.plan-card-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}

.plan-card-meta {
  font-size: 13px;
  color: var(--color-on-surface-variant);
}

.plan-card-actions {
  display: flex;
  gap: 4px;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.sync-status.synced {
  background: var(--color-success-light);
  color: #166534;
}

.sync-status.unsynced {
  background: var(--color-warning-light);
  color: #92400e;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--color-on-surface-variant);
}

.empty-state .material-icons-round {
  font-size: 64px;
  color: var(--color-outline);
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 15px;
}

/* =========================================
   FAB
   ========================================= */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  height: 56px;
  padding: 0 24px;
  border-radius: var(--radius-full);
  border: none;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
  transition: all var(--transition-normal);
  z-index: 50;
}

.fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(13, 148, 136, 0.5);
}

.fab .material-icons-round {
  font-size: 22px;
}

/* =========================================
   Wizard
   ========================================= */
.wizard-main {
  flex: 1;
  padding: 24px;
}

.wizard-container {
  max-width: 1200px;
  margin: 0 auto;
}

.wizard-progress {
  margin-bottom: 32px;
}

.progress-track {
  height: 4px;
  background: var(--color-surface-container-high);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  border-radius: 2px;
  transition: width var(--transition-slow);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.step-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-container-high);
  color: var(--color-on-surface-variant);
  transition: all var(--transition-normal);
}

.step-dot .material-icons-round {
  font-size: 18px;
}

.progress-step.active .step-dot {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.progress-step.completed .step-dot {
  background: var(--color-success);
  color: white;
}

.step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-on-surface-variant);
}

.progress-step.active .step-label {
  color: var(--color-primary);
}

.wizard-step {
  display: none;
  animation: fadeIn 0.3s ease;
}

.wizard-step.active {
  display: block;
}

.wizard-step-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.wizard-step-desc {
  color: var(--color-on-surface-variant);
  margin-bottom: 28px;
  font-size: 15px;
}

.subsection-title {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--color-on-surface);
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-outline-variant);
}

/* Daily Plan Accordion */
.daily-plan-item {
  background: var(--color-surface);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.daily-plan-item:hover {
  border-color: var(--color-primary-200);
}

.daily-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-on-surface);
  background: var(--color-surface-dim);
  transition: background var(--transition-fast);
  border: none;
  width: 100%;
  font-family: var(--font-family);
  text-align: left;
}

.daily-plan-header:hover {
  background: var(--color-surface-container);
}

.daily-plan-header .material-icons-round {
  font-size: 20px;
  transition: transform var(--transition-fast);
  color: var(--color-on-surface-variant);
}

.daily-plan-item.open .daily-plan-header .material-icons-round {
  transform: rotate(180deg);
}

.daily-plan-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.daily-plan-item.open .daily-plan-body {
  max-height: 600px;
}

.daily-plan-content {
  padding: 16px;
}

.daily-plan-content .form-group {
  margin-bottom: 14px;
}

.daily-plan-content label {
  font-size: 12px;
}

.daily-plan-content input,
.daily-plan-content textarea {
  padding: 10px 12px;
  font-size: 14px;
}

/* Stage Editor */
.stage-editor {
  background: var(--color-surface);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}

.stage-editor-header {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  background: var(--color-surface-dim);
  border-bottom: 1px solid var(--color-outline-variant);
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage-editor-header .material-icons-round {
  color: var(--color-primary);
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-outline-variant);
}

.stage-block {
  padding: 16px;
  background: var(--color-surface);
}

.stage-block-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary-700);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stage-block-title .label-tag {
  font-size: 11px;
  background: var(--color-primary-100);
  color: var(--color-primary-700);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.stage-block .form-group {
  margin-bottom: 10px;
}

.stage-block label {
  font-size: 11px;
}

.stage-block input,
.stage-block textarea {
  padding: 8px 10px;
  font-size: 13px;
}

/* =========================================
   Review
   ========================================= */
.review-card {
  background: var(--color-surface);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.review-card-header {
  padding: 16px 20px;
  background: var(--color-surface-dim);
  font-weight: 600;
  font-size: 15px;
  border-bottom: 1px solid var(--color-outline-variant);
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-card-header .material-icons-round {
  color: var(--color-primary);
  font-size: 20px;
}

.review-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-outline-variant);
}

.review-info-item {
  padding: 12px 16px;
  background: var(--color-surface);
}

.review-info-item label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.review-info-item span {
  font-size: 14px;
  font-weight: 500;
}

.review-day-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.review-day-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--color-surface-dim);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-on-surface-variant);
  border-bottom: 1px solid var(--color-outline-variant);
}

.review-day-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-outline-variant);
  vertical-align: top;
}

/* =========================================
   Curriculum Browser
   ========================================= */
.curriculum-main {
  flex: 1;
  padding: 24px;
}

.curriculum-container {
  max-width: 1200px;
  margin: 0 auto;
}

.curriculum-filters {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.curriculum-filters .form-group {
  flex: 1;
  margin-bottom: 0;
}

.curriculum-filters select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--color-outline-variant);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

.curriculum-filters select:focus {
  border-color: var(--color-primary);
}

.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--color-success-light);
  color: #166534;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 20px;
}

.offline-badge .material-icons-round {
  font-size: 16px;
}

.curriculum-item {
  background: var(--color-surface);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.curriculum-item:hover {
  border-color: var(--color-primary-200);
  box-shadow: var(--shadow-sm);
}

.curriculum-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.curriculum-item-unit {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.curriculum-item-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.curriculum-item-objectives {
  font-size: 13px;
  color: var(--color-on-surface-variant);
  line-height: 1.6;
}

.curriculum-item-objectives ul {
  padding-left: 18px;
  margin-top: 4px;
}

.curriculum-item-objectives li {
  margin-bottom: 2px;
}

/* =========================================
   PDF Preview — Landscape A4 Ethiopian Format
   ========================================= */
.pdf-main {
  flex: 1;
  padding: 24px;
  background: #d1d5db;
  overflow-y: auto;
}

.pdf-pages-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding-bottom: 40px;
}

.pdf-page {
  background: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-family: 'Inter', 'Times New Roman', serif;
  font-size: 10px;
  line-height: 1.35;
  color: #1a1a1a;
  animation: slideUp 0.4s ease;
  position: relative;
}

.pdf-page.landscape {
  width: 1120px;
  /* A4 landscape ratio */
  min-height: 790px;
  padding: 28px 32px;
}

.pdf-page::after {
  content: attr(data-page-num);
  position: absolute;
  bottom: 10px;
  right: 20px;
  font-size: 9px;
  color: #999;
}

/* PDF Header */
.pdf-header-block {
  text-align: center;
  margin-bottom: 10px;
}

.pdf-school-name {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.pdf-doc-title {
  font-size: 12px;
  font-weight: 700;
  border-top: 2px solid #333;
  border-bottom: 2px solid #333;
  padding: 4px 0;
  margin: 6px auto;
  display: inline-block;
  padding-left: 24px;
  padding-right: 24px;
}

/* PDF Metadata Grid */
.pdf-meta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  margin-bottom: 8px;
}

.pdf-meta-table td {
  padding: 3px 6px;
  border: 1px solid #bbb;
  vertical-align: middle;
}

.pdf-meta-table td.label-cell {
  font-weight: 700;
  background: #f3f4f6;
  width: 8% !important;
  white-space: nowrap !important;
}

.pdf-meta-table td.value-cell {
  width: 17% !important;
  white-space: normal !important;
  word-wrap: break-word;
}

.pdf-rationale-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal !important;
  word-wrap: break-word;
  line-height: 1.2;
  max-height: 2.4em;
}

/* Main Lesson Plan Table */
.pdf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
  line-height: 1.3;
  table-layout: fixed;
}

.pdf-table th {
  background: #e5e7eb;
  padding: 4px 3px;
  border: 1px solid #888;
  font-size: 8px;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  vertical-align: middle;
  word-wrap: break-word;
}

.pdf-table td {
  padding: 3px 4px;
  border: 1px solid #888;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.pdf-table td.day-cell {
  font-weight: 700;
  text-align: center;
  font-size: 9px;
}

.pdf-table td.stage-cell {
  font-size: 8px;
  font-weight: 600;
  text-align: center;
  background: #f9fafb;
}

.pdf-table .bullet-list {
  margin: 0;
  padding: 0 0 0 10px;
  font-size: 8px;
}

.pdf-table .bullet-list li {
  margin-bottom: 1px;
}

/* Footer Sections */
.pdf-footer-section {
  margin-top: 8px;
  font-size: 10px;
}

.pdf-footer-section .footer-label {
  font-weight: 700;
  display: inline;
}

.pdf-footer-section .footer-box {
  border: 1px solid #bbb;
  padding: 4px 8px;
  min-height: 28px;
  margin-top: 2px;
  margin-bottom: 6px;
  font-size: 9px;
}

.pdf-signatures {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
  font-size: 9px;
  border-top: 1px solid #ccc;
  padding-top: 10px;
}

.pdf-sig-block {
  text-align: center;
}

.pdf-sig-block .sig-role {
  font-weight: 700;
  font-size: 9px;
  margin-bottom: 20px;
}

.pdf-sig-line {
  border-bottom: 1px solid #333;
  height: 1px;
  margin: 4px 0;
}

.pdf-sig-block .sig-label {
  font-size: 8px;
  color: #666;
}

/* ========================================= */
/* Exact Template Styles (Government Match)   */
/* ========================================= */
.pdf-header-exact {
  text-align: center;
  margin-bottom: 8px;
  font-family: 'Times New Roman', serif, 'Inter';
  color: #000;
}

.pdf-school-name-exact {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.pdf-academic-year-exact {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}

.pdf-title-exact {
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  margin-bottom: 6px;
}

.pdf-meta-line-1 {
  font-size: 10px;
  line-height: 1.5;
  text-align: left;
  margin-bottom: 4px;
}

.pdf-meta-line-2 {
  font-size: 10px;
  line-height: 1.4;
  text-align: left;
  margin-bottom: 6px;
}

.pdf-underline {
  text-decoration: underline;
}

.pdf-table-exact {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.5px;
  line-height: 1.25;
  table-layout: fixed;
  font-family: 'Times New Roman', serif, 'Inter';
  color: #000;
}

.pdf-table-exact th,
.pdf-table-exact td {
  border: 1px solid #000;
  padding: 3px 4px;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.pdf-table-exact th {
  text-align: center;
  font-weight: 700;
  background: #fff;
  vertical-align: middle;
}

.pdf-table-exact td.day-cell-exact {
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
}

.pdf-table-exact td.content-cell-exact {
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
}

.pdf-table-exact td.stage-cell-exact {
  text-align: center;
  vertical-align: middle;
  font-size: 8px;
  line-height: 1.15;
}

.pdf-table-exact td.page-cell-exact {
  text-align: center;
  vertical-align: middle;
  font-weight: 700;
}

.pdf-footer-exact {
  margin-top: 8px;
  font-size: 9.5px;
  line-height: 1.35;
  font-family: 'Times New Roman', serif, 'Inter';
  color: #000;
}

.pdf-learner-support-exact {
  margin-bottom: 6px;
}

.pdf-self-eval-exact {
  margin-bottom: 10px;
}

.pdf-signatures-grid-exact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.sig-row-exact {
  display: flex;
  justify-content: space-between;
}

.sig-col-exact {
  flex: 1;
}

/* Print styles */
@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body * {
    visibility: hidden;
  }

  #pdf-screen,
  #pdf-screen *,
  .pdf-main,
  .pdf-main *,
  .pdf-pages-wrapper,
  .pdf-pages-wrapper *,
  #pdf-container,
  #pdf-container *,
  .pdf-page,
  .pdf-page * {
    visibility: visible;
  }

  #pdf-screen,
  .pdf-pages-wrapper,
  #pdf-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 297mm !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .pdf-page.landscape {
    width: 297mm !important;
    height: 210mm !important;
    max-height: 210mm !important;
    padding: 6mm 10mm 8mm 10mm !important;
    box-sizing: border-box !important;
    page-break-after: always;
    page-break-inside: avoid;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    position: relative !important;
  }

  .pdf-page.landscape:last-child {
    page-break-after: auto;
  }

  /* Page 1 Header */
  .pdf-header-exact {
    margin-bottom: 3px !important;
  }

  .pdf-school-name-exact {
    font-size: 15px !important;
    margin-bottom: 1px !important;
  }

  .pdf-academic-year-exact {
    font-size: 12.5px !important;
    margin-bottom: 1px !important;
  }

  .pdf-title-exact {
    font-size: 13.5px !important;
    margin-bottom: 3px !important;
  }

  .pdf-meta-line-1 {
    font-size: 10px !important;
    line-height: 1.35 !important;
    margin-bottom: 2px !important;
  }

  .pdf-meta-line-2 {
    font-size: 10px !important;
    line-height: 1.3 !important;
    margin-bottom: 3px !important;
  }

  /* Tables full utilization */
  .pdf-table-exact {
    font-size: 9.8px !important;
    line-height: 1.2 !important;
    width: 100% !important;
  }

  .pdf-table-exact th {
    padding: 3px 2px !important;
    font-size: 9.5px !important;
  }

  .pdf-table-exact td {
    padding: 3px 4px !important;
  }

  .pdf-table-exact td.stage-cell-exact {
    font-size: 9px !important;
    line-height: 1.15 !important;
  }

  /* Page 1 table height stretches to fill page cleanly */
  #pdf-page-1 .pdf-table-exact {
    height: 156mm !important;
  }

  /* Page 2 table and footer stretch to fill page cleanly */
  #pdf-page-2 .pdf-table-exact {
    height: 130mm !important;
    margin-top: 2px !important;
  }

  .pdf-footer-exact {
    margin-top: auto !important;
    padding-top: 3mm !important;
    font-size: 9.8px !important;
    line-height: 1.35 !important;
  }

  .pdf-learner-support-exact {
    margin-bottom: 4px !important;
  }

  .pdf-self-eval-exact {
    margin-bottom: 6px !important;
  }

  .pdf-signatures-grid-exact {
    margin-top: 6px !important;
    gap: 8px !important;
  }

  .app-header,
  .fab,
  .btn,
  .snackbar,
  .screen:not(.active),
  .pdf-main>header,
  .pdf-sidebar,
  .pdf-toolbar,
  .navbar,
  #snackbar,
  .ai-badge {
    display: none !important;
  }
}

/* =========================================
   Snackbar
   ========================================= */
.snackbar {
  position: fixed;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-on-surface);
  color: white;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  transition: bottom var(--transition-normal);
}

.snackbar.show {
  bottom: 24px;
}

.snackbar-icon {
  font-size: 20px;
}

/* =========================================
   Loading Overlay
   ========================================= */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.loading-overlay.show {
  display: flex;
}

.loading-spinner {
  background: var(--color-surface);
  padding: 40px 60px;
  border-radius: var(--radius-xl);
  text-align: center;
  box-shadow: var(--shadow-xl);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-surface-container-high);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

.loading-spinner p {
  font-weight: 600;
  color: var(--color-on-surface);
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 768px) {
  .auth-container {
    flex-direction: column;
  }

  .auth-hero {
    min-height: 280px;
    flex: unset;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 22px;
  }

  .auth-form-panel {
    padding: 24px;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .welcome-card-content {
    flex-direction: column;
    gap: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .stage-grid {
    grid-template-columns: 1fr;
  }

  .review-info-grid {
    grid-template-columns: 1fr 1fr;
  }

  .pdf-meta-grid {
    grid-template-columns: 1fr;
  }

  .profile-setup-card {
    margin: 16px;
    padding: 24px;
  }

  .checkbox-grid {
    grid-template-columns: 1fr 1fr;
  }

  .auth-loading-container .hero-title {
    font-size: 32px;
  }
}

/* =========================================
   Auth Loading Screen
   ========================================= */
.auth-loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--color-primary-900) 0%, var(--color-primary-700) 40%, var(--color-primary-500) 100%);
  color: white;
}

.auth-loading-brand {
  text-align: center;
  margin-bottom: 48px;
  animation: fadeIn 0.5s ease;
}

.auth-loading-brand .hero-icon-ring {
  animation: float 6s ease-in-out infinite;
}

.auth-loading-spinner {
  text-align: center;
  animation: fadeIn 0.8s ease 0.3s both;
}

.auth-loading-spinner .spinner {
  border-color: rgba(255, 255, 255, 0.2);
  border-top-color: white;
  width: 40px;
  height: 40px;
}

.auth-loading-spinner p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
  margin-top: 12px;
}

/* =========================================
   Auth Error Message
   ========================================= */
.auth-error-msg {
  background: var(--color-error-light);
  color: #b91c1c;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  border: 1px solid #fecaca;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.auth-error-msg.hidden {
  display: none;
}

/* =========================================
   Button Spinner (inline)
   ========================================= */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* =========================================
   Profile Setup Screen
   ========================================= */
.profile-setup-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(135deg, var(--color-surface-dim) 0%, var(--color-primary-50) 100%);
}

.profile-setup-card {
  width: 100%;
  max-width: 640px;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.5s ease;
}

.profile-setup-header {
  text-align: center;
  margin-bottom: 32px;
}

.profile-icon-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-100) 0%, var(--color-primary-50) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  border: 2px solid var(--color-primary-200);
}

.profile-icon-ring .material-icons-round {
  font-size: 32px;
  color: var(--color-primary);
}

.profile-setup-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-on-surface);
  margin-bottom: 4px;
}

.profile-setup-header p {
  font-size: 14px;
  color: var(--color-on-surface-variant);
}

/* =========================================
   Checkbox Grid (Subjects & Grades)
   ========================================= */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 2px solid var(--color-outline-variant);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-on-surface);
  user-select: none;
}

.checkbox-item:hover {
  border-color: var(--color-primary-200);
  background: var(--color-primary-50);
}

.checkbox-item:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-50);
  color: var(--color-primary-700);
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* =========================================
   My Lesson Plans Screen
   ========================================= */
.myplans-main {
  flex: 1;
  padding: 24px;
}

.myplans-container {
  max-width: 1400px;
  margin: 0 auto;
}

/* =========================================
   Landing Page — Hero UX Improvements
   ========================================= */

/* Makes the hero panel scrollable for the extra content */
.auth-hero {
  overflow-y: auto;
  align-items: flex-start;
}

.auth-hero-content {
  max-width: 460px;
  padding: 48px 40px;
}

.hero-headline {
  margin-top: 16px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  color: white;
  opacity: 1;
}

/* Hero CTA Buttons */
.btn-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 14px 28px;
  background: white;
  color: var(--color-primary-700);
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: all var(--transition-normal);
  width: 100%;
  justify-content: center;
}

.btn-hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.btn-hero-cta-outline {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: none;
  backdrop-filter: blur(8px);
  margin-top: 12px;
}

.btn-hero-cta-outline:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: white;
}

/* Ethiopian Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(8px);
}

/* How It Works */
.hero-how-it-works {
  margin-top: 28px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
}

.hiw-title {
  color: white;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  opacity: 0.8;
}

.hiw-steps {
  display: flex;
  gap: 12px;
}

.hiw-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.hiw-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-primary-700);
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hiw-step-text {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
}

/* Sample Lesson Preview */
.hero-sample-preview {
  margin-top: 20px;
}

.sample-preview-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.sample-preview-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  backdrop-filter: blur(8px);
}

.sample-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sample-row:last-child {
  border-bottom: none;
}

.sample-key {
  font-weight: 700;
  color: white;
  min-width: 52px;
  flex-shrink: 0;
}

.sample-val {
  opacity: 0.85;
}

.sample-more {
  font-size: 12px;
  opacity: 0.6;
  justify-content: center;
  font-style: italic;
  padding-top: 8px;
}

/* Testimonials */
.hero-testimonials {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.testimonial-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  backdrop-filter: blur(8px);
}

.testimonial-text {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  line-height: 1.5;
  font-style: italic;
  margin-bottom: 6px;
}

.testimonial-author {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 600;
}

/* Auth panel CTA footer */
.auth-cta-footer {
  margin-top: 20px;
}

.auth-cta-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-100);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--color-primary-700);
  font-weight: 500;
}

/* Spinner for button loading state */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* =========================================
   Settings Screen
   ========================================= */
.settings-main {
  padding: 16px;
  overflow-y: auto;
  height: calc(100vh - 64px);
}

.settings-container {
  max-width: 1000px;
  margin: 0 auto;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section-title {
  color: var(--color-primary);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-left: 16px;
}

.settings-list {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-outline-variant);
  overflow: hidden;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--color-outline-variant);
  cursor: pointer;
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.setting-info .material-icons-round {
  color: var(--color-on-surface-variant);
}

.setting-text h4 {
  font-size: 16px;
  color: var(--color-on-surface);
  margin-bottom: 2px;
}

.setting-text p {
  font-size: 12px;
  color: var(--color-on-surface-variant);
  margin: 0;
}

.setting-item select {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-outline-variant);
  background: var(--color-surface);
  color: var(--color-on-surface);
  font-family: inherit;
  font-size: 14px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-outline);
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--color-primary);
}

input:checked+.slider:before {
  transform: translateX(20px);
}

/* Dark Theme overrides — FikerLearn Dark Roast Coffee & Gold */
body.dark-theme {
  --cream: #140D08;
  --beige: #2E1D13;
  --tan: #4A301E;
  --brown: #E4C09E;
  --brown-mid: #CCAA8A;
  --brown-dark: #FEFAF7;
  --espresso: #FEFAF7;
  --gold: #E5BE54;
  --gold-light: #FCE198;
  --gold-dark: #CFA032;
  --success: #6CB254;
  --error: #E74C3C;
  --warning: #F39C12;
  --white: #1D130B;
  --surface: #20150D;
  --surface-2: #1A1009;
  --surface-3: #2B1B10;
  --border: #3A2517;
  --border-soft: #2B1B10;
  --text-primary: #FEFAF7;
  --text-secondary: #E5D5C6;
  --text-tertiary: #A68E7A;

  --color-primary: #E4C09E;
  --color-primary-light: #FCE198;
  --color-primary-dark: #8B5E3C;
  --color-accent: #E5BE54;

  --color-surface: #20150D;
  --color-surface-dim: #140D08;
  --color-surface-container: #1A1009;
  --color-surface-container-high: #2B1B10;

  --color-on-surface: #FEFAF7;
  --color-on-surface-variant: #E5D5C6;
  --color-outline: #3A2517;
  --color-outline-variant: #2B1B10;

  background-color: #140D08;
  color: #FEFAF7;
}

body.dark-theme .app-header {
  background-color: #140D08;
  border-bottom: 1px solid #3A2517;
}

body.dark-theme .card,
body.dark-theme .template-card,
body.dark-theme .wizard-card,
body.dark-theme .lesson-plan-card {
  background-color: #20150D;
  border-color: #3A2517;
}

body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea {
  background-color: #1A1009;
  border-color: #3A2517;
  color: #FEFAF7;
}

body.dark-theme input:focus,
body.dark-theme select:focus,
body.dark-theme textarea:focus {
  border-color: #E5BE54;
  box-shadow: 0 0 0 3px rgba(229, 190, 84, 0.2);
}

/* =========================================
   AI Magic Fill
   ========================================= */

/* AI Generate Section */
.ai-generate-section {
  margin-top: 24px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.06) 0%, rgba(99, 102, 241, 0.06) 100%);
  border: 2px dashed rgba(168, 85, 247, 0.25);
  border-radius: var(--radius-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.ai-generate-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(168, 85, 247, 0.05), transparent 70%),
    radial-gradient(circle at 70% 50%, rgba(99, 102, 241, 0.05), transparent 70%);
  pointer-events: none;
}

.ai-section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #7c3aed;
  position: relative;
  z-index: 1;
}

.ai-section-header .material-icons-round {
  font-size: 22px;
  color: #a855f7;
}

.ai-section-desc {
  font-size: 13px;
  color: var(--color-on-surface-variant);
  margin-bottom: 18px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

.btn-ai-generate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 36px;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 50%, #8b5cf6 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4), 0 0 30px rgba(168, 85, 247, 0.15);
  transition: all var(--transition-normal);
  position: relative;
  z-index: 1;
  overflow: hidden;
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.btn-ai-generate:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5), 0 0 40px rgba(168, 85, 247, 0.2);
}

.btn-ai-generate:active {
  transform: translateY(0) scale(0.98);
}

.btn-ai-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
  animation: none;
}

.btn-ai-generate .material-icons-round {
  font-size: 20px;
}

/* AI Loading Dots */
.ai-loading-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.ai-loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
  animation: aiDotPulse 1.4s ease-in-out infinite;
}

.ai-loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes aiDotPulse {

  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  40% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* AI-filled field indicator */
.ai-filled {
  position: relative;
}

.ai-filled::after {
  content: 'auto_awesome';
  font-family: 'Material Icons Round';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 14px;
  color: var(--gold, #D4A843);
  pointer-events: none;
}

/* AI status badge on daily plan headers */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(99, 102, 241, 0.12));
  color: #7c3aed;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  animation: fadeIn 0.3s ease;
}

/* AI loading overlay enhancement */
.loading-overlay.ai-loading .loading-spinner {
  background: linear-gradient(135deg, #faf5ff, #eef2ff);
  border: 1px solid rgba(139, 92, 246, 0.15);
}

.loading-overlay.ai-loading .spinner {
  border-color: rgba(139, 92, 246, 0.15);
  border-top-color: #a855f7;
}

.loading-overlay.ai-loading .loading-spinner p {
  color: #6d28d9;
  font-weight: 700;
}

.ai-loading-steps {
  margin-top: 12px;
  font-size: 13px;
  color: var(--color-on-surface-variant);
}

.ai-loading-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.ai-loading-step.active {
  opacity: 1;
  color: #7c3aed;
  font-weight: 600;
}

.ai-loading-step.done {
  opacity: 0.7;
  color: var(--color-success);
}

.ai-loading-step .material-icons-round {
  font-size: 16px;
}

/* Auth error message style */
.auth-error-msg {
  background: var(--color-error-light);
  border: 1px solid #fca5a5;
  color: var(--color-error);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}

/* =========================================
   Template Gallery
   ========================================= */
.template-gallery-section {
  margin-bottom: 32px;
  animation: slideUp 0.5s ease 0.1s both;
}

.template-gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.template-card {
  background: var(--color-surface);
  border: 2px solid var(--color-outline-variant);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.template-card:hover {
  border-color: var(--color-primary-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.template-card.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-50);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15), var(--shadow-md);
}

.template-card-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.4);
}

.template-card.selected .template-card-check {
  display: flex;
  animation: scaleIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.template-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--color-primary-100);
  color: var(--color-primary-800);
  width: fit-content;
}

.template-card.selected .template-badge {
  background: var(--color-primary);
  color: white;
}

.template-preview-svg {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-outline-variant);
  background: #fafafa;
  overflow: hidden;
}

.template-card-info h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-on-surface);
  margin-bottom: 4px;
}

.template-card-info p {
  font-size: 13px;
  color: var(--color-on-surface-variant);
  line-height: 1.5;
}

.template-card.selected .template-card-info h4 {
  color: var(--color-primary-dark);
}

/* Template chip shown in wizard header */
.template-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--color-primary-100);
  color: var(--color-primary-800);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--color-primary-200);
}

/* =========================================
   Daily Wizard Fields (Option 2)
   ========================================= */
.daily-only {
  display: none;
}

.weekly-only {
  display: contents;
}

body.template-daily .daily-only {
  display: contents;
}

body.template-daily .weekly-only {
  display: none;
}

/* =========================================
   Daily PDF Preview — Option 2 (Landscape)
   ========================================= */
#pdf-daily-pages .pdf-page.landscape {
  width: 297mm;
  min-height: 210mm;
  padding: 8mm 12mm;
  font-family: 'Times New Roman', serif;
  font-size: 9pt;
  background: white;
  display: flex;
  flex-direction: column;
}

/* Daily plan header */
.daily-pdf-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 8px;
  text-align: center;
}

.daily-pdf-school-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  padding: 4px;
  margin-bottom: 6px;
  background: #f8f8f8;
  color: #1a1a1a;
  font-family: 'Times New Roman', serif;
}

.daily-pdf-school-name {
  font-size: 13pt;
  font-weight: 700;
  text-decoration: underline;
  letter-spacing: 0.02em;
}

.daily-pdf-doc-title {
  font-size: 11pt;
  font-weight: 700;
  text-decoration: underline;
  margin-top: 4px;
}

/* Metadata lines */
.daily-pdf-meta {
  border: 1px solid #999;
  border-bottom: none;
  padding: 3px 6px;
  display: grid;
  gap: 0;
  margin-bottom: 0;
  font-size: 8.5pt;
}

.daily-pdf-meta-row {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #bbb;
  padding: 3px 0;
  flex-wrap: wrap;
}

.daily-pdf-meta-row:last-child {
  border-bottom: none;
}

.daily-pdf-meta-field {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.daily-pdf-meta-field .meta-label {
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.daily-pdf-meta-field .meta-line {
  flex: 1;
  border-bottom: 1px solid #333;
  min-width: 40px;
  height: 14px;
  display: flex;
  align-items: flex-end;
  font-weight: 400;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding-bottom: 1px;
}

/* Stage table */
.daily-pdf-stage-table {
  width: 100%;
  border-collapse: collapse;
  flex: 1;
  font-size: 8.5pt;
  margin-top: 0;
}

.daily-pdf-stage-table th,
.daily-pdf-stage-table td {
  border: 1px solid #555;
  padding: 3px 4px;
  vertical-align: top;
  line-height: 1.4;
}

.daily-pdf-stage-table thead th {
  background: #fff;
  font-weight: 700;
  text-align: center;
  font-size: 8pt;
  vertical-align: middle;
}

.daily-pdf-stage-table .col-stage {
  width: 24%;
  font-weight: 700;
  font-size: 8pt;
  vertical-align: middle;
}

.daily-pdf-stage-table .col-time {
  width: 8%;
  text-align: center;
  font-size: 8pt;
  vertical-align: middle;
}

.daily-pdf-stage-table .col-teacher {
  width: 34%;
}

.daily-pdf-stage-table .col-student {
  width: 34%;
}

/* Stage name cell — vertically spans multiple learner rows */
.daily-pdf-stage-name {
  font-weight: 700;
  font-size: 8pt;
  line-height: 1.3;
}

/* Learner support sub-rows */
.daily-pdf-learner-label {
  font-weight: 600;
  font-size: 7.5pt;
  color: #333;
  border-top: 1px solid #999;
}

.daily-pdf-learner-label:first-child {
  border-top: none;
}

/* Signature block */
.daily-pdf-signatures {
  margin-top: 8px;
  font-size: 8pt;
  border-top: 1px solid #999;
  padding-top: 6px;
}

.daily-pdf-sig-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 6px;
}

.daily-pdf-sig-label {
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.daily-pdf-sig-line {
  flex: 1;
  border-bottom: 1px solid #333;
  height: 16px;
  min-width: 60px;
  display: flex;
  align-items: flex-end;
  font-size: 7.5pt;
  padding-bottom: 1px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.daily-pdf-sig-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 24px;
}

/* =========================================
   Weekly PDF Preview & Print
   ========================================= */
.pdf-main {
  padding: 20px;
  display: flex;
  justify-content: center;
}

.pdf-pages-wrapper {
  width: 100%;
  max-width: 1200px;
}

.pdf-page {
  background: #fff;
  color: #000;
  font-family: 'Inter', 'Times New Roman', serif;
  font-size: 8pt;
  line-height: 1.35;
  padding: 20px 28px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  border: 1px solid #ddd;
  overflow: hidden;
}

.pdf-page.landscape {
  min-height: 580px;
}

/* Header block */
.pdf-header-block {
  text-align: center;
  margin-bottom: 8px;
}

.pdf-header-top {
  display: flex;
  justify-content: space-between;
  font-size: 7pt;
  color: #555;
  margin-bottom: 4px;
}

.pdf-date-stamp {
  font-size: 7pt;
}

.pdf-app-label {
  font-size: 7pt;
  font-weight: 600;
}

.pdf-school-name {
  font-size: 13pt;
  font-weight: 700;
  margin-bottom: 2px;
}

.pdf-doc-title {
  font-size: 10pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

/* Metadata table */
.pdf-meta-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 6px;
  font-size: 8pt;
}

.pdf-meta-table td {
  border: 1px solid #333;
  padding: 3px 6px;
  vertical-align: top;
}

.pdf-meta-table .label-cell {
  font-weight: 700;
  background: #f5f5f5;
  white-space: nowrap !important;
  width: 8% !important;
}

.pdf-meta-table .value-cell {
  width: 17% !important;
  white-space: normal !important;
  word-wrap: break-word;
}

/* Main data table */
.pdf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 7.5pt;
  table-layout: fixed;
}

.pdf-table th,
.pdf-table td {
  border: 1px solid #333;
  padding: 3px 4px;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.pdf-table thead th {
  background: #f0f0f0;
  font-weight: 700;
  font-size: 7.5pt;
  text-align: center;
  padding: 4px 3px;
}

.pdf-table .day-cell {
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
  background: #fafafa;
}

.pdf-table .stage-cell {
  font-weight: 600;
  font-size: 7pt;
  text-align: center;
  white-space: nowrap;
  background: #fafafa;
}

/* Footer sections */
.pdf-footer-section {
  margin-top: 10px;
}

.pdf-footer-section .footer-label {
  font-weight: 700;
  font-size: 8.5pt;
  margin: 0 0 3px 0;
}

.pdf-footer-section .footer-box {
  border: 1px solid #333;
  padding: 6px 8px;
  min-height: 36px;
  font-size: 7.5pt;
  line-height: 1.4;
}

/* Signature table */
.pdf-sig-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 8pt;
}

.pdf-sig-table .sig-td {
  padding: 6px 8px;
  vertical-align: bottom;
  width: 33.33%;
}

.pdf-sig-table .sig-sub {
  font-size: 7pt;
  color: #666;
  display: block;
  margin-bottom: 2px;
}

.pdf-sig-line {
  border-bottom: 1px solid #333;
  height: 18px;
  min-width: 80px;
}



/* =========================================
   Daily PDF Landscape Pages
   ========================================= */
#pdf-daily-pages .pdf-page.landscape {
  min-height: auto;
}

.daily-pdf-header {
  text-align: center;
  margin-bottom: 6px;
}

.daily-pdf-doc-title {
  font-size: 10pt;
  font-weight: 700;
  margin-bottom: 4px;
}

.daily-pdf-stage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 7.5pt;
  table-layout: fixed;
  margin-top: -1px;
}

.daily-pdf-stage-table th,
.daily-pdf-stage-table td {
  border: 1px solid #333;
  padding: 3px 4px;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.daily-pdf-stage-table thead th {
  background: #f0f0f0;
  font-weight: 700;
  font-size: 7pt;
  text-align: center;
  padding: 4px 3px;
}

.daily-pdf-stage-table .col-stage {
  width: 24%;
}

.daily-pdf-stage-table .col-time {
  width: 8%;
}

.daily-pdf-stage-table .col-teacher {
  width: 34%;
}

.daily-pdf-stage-table .col-student {
  width: 34%;
}

.daily-pdf-stage-name {
  font-weight: 600;
  font-size: 7pt;
  line-height: 1.3;
}

/* =========================================
   Stage Editor (Wizard Step 3)
   ========================================= */
.stage-editor {
  background: var(--color-surface);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: slideUp 0.3s ease;
}

.stage-editor-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--color-primary-50) 0%, var(--color-surface) 100%);
  border-bottom: 2px solid var(--color-primary-100);
  font-weight: 700;
  font-size: 15px;
  color: var(--color-primary-dark);
}

.stage-editor-header .material-icons-round {
  font-size: 22px;
  color: var(--color-primary);
}

.stage-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.stage-block {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-outline-variant);
}

.stage-block:last-child {
  border-bottom: none;
}

.stage-block-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--color-on-surface);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--color-outline-variant);
}

.label-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--color-primary-100);
  color: var(--color-primary-dark);
  letter-spacing: 0.02em;
}

/* Side-by-side Teacher + Student Activity */
.activity-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Time field — compact inline */
.stage-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.stage-time-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-on-surface-variant);
  white-space: nowrap;
  margin-bottom: 0;
}

.stage-time-row input[type="number"] {
  width: 80px;
  padding: 8px 10px;
  border: 2px solid var(--color-outline-variant);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 14px;
  text-align: center;
  outline: none;
  transition: border-color var(--transition-fast);
}

.stage-time-row input[type="number"]:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

/* =========================================
   Responsive — small screens
   ========================================= */
@media (max-width: 640px) {
  .template-gallery-grid {
    grid-template-columns: 1fr;
  }

  .activity-row {
    grid-template-columns: 1fr;
  }

  .stage-block {
    padding: 12px 14px;
  }
}



/* =========================================
   Global Footer
   ========================================= */
.site-footer {
  margin-top: 16px;
  padding: 12px 16px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-soft);
}

.site-footer p {
  margin: 0;
  line-height: 1.4;
}
/* =========================================
   UI & UX Transformation Enhancements
   ========================================= */

/* 1. Language Toggle Button */
.btn-lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-primary-50);
  color: var(--color-primary-700);
  border: 1px solid var(--color-primary-200);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-lang-toggle:hover {
  background: var(--color-primary-100);
  border-color: var(--color-primary-500);
  transform: translateY(-1px);
}

body.dark-theme .btn-lang-toggle {
  background: rgba(13, 148, 136, 0.15);
  color: var(--color-primary-200);
  border-color: rgba(20, 184, 166, 0.3);
}

/* 2. Offline Indicator */
.offline-indicator-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  animation: pulse-offline 2s infinite ease-in-out;
}

@keyframes pulse-offline {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

body.dark-theme .offline-indicator-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

/* 3. Template Gallery Visual Thumbnails */
.template-thumbnail {
  width: 100%;
  height: 90px;
  background: var(--color-surface-dim);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-outline-variant);
  margin-bottom: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.template-card:hover .template-thumbnail,
.template-card.selected .template-thumbnail {
  border-color: var(--color-primary-500);
  background: var(--color-primary-50);
}

body.dark-theme .template-thumbnail {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--outline-dark);
}

body.dark-theme .template-card.selected .template-thumbnail {
  background: rgba(13, 148, 136, 0.1);
  border-color: var(--color-primary-500);
}

.thumb-header-bar {
  display: flex;
  gap: 6px;
  align-items: center;
}

.thumb-line {
  height: 4px;
  background: var(--color-primary-600);
  border-radius: 2px;
  width: 40px;
}

.thumb-line.short {
  width: 24px;
  background: var(--color-outline);
}

.thumb-grid-weekly {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  flex: 1;
}

.thumb-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.thumb-box {
  background: var(--color-surface);
  border: 1px solid var(--color-outline-variant);
  border-radius: 3px;
  flex: 1;
}

body.dark-theme .thumb-box {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.thumb-rows-daily {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.thumb-row-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-outline-variant);
  border-radius: 3px;
  padding: 3px 6px;
  flex: 1;
}

body.dark-theme .thumb-row-item {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.thumb-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-primary-500);
}

.thumb-bar {
  height: 3px;
  background: var(--color-outline);
  border-radius: 2px;
  flex: 1;
}

/* 4. Wizard Step 3 (Lesson Stages) Tabbed & Collapsible UI */
.stages-step-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stage-day-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px 2px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.stage-day-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--color-surface);
  color: var(--color-on-surface-variant);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.stage-day-tab:hover {
  border-color: var(--color-primary-500);
  color: var(--color-primary-700);
  background: var(--color-primary-50);
}

.stage-day-tab.active {
  background: var(--color-primary-600);
  color: #ffffff;
  border-color: var(--color-primary-700);
  box-shadow: var(--shadow-sm);
}

.tab-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-outline);
}

.stage-day-tab.completed .tab-badge-dot {
  background: #22c55e;
}

.stage-day-tab.active .tab-badge-dot {
  background: #ffffff;
}

.stage-cards-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stage-card {
  background: var(--color-surface);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.stage-card.expanded {
  border-color: var(--color-primary-300);
  box-shadow: var(--shadow-sm);
}

body.dark-theme .stage-card {
  background: var(--surface-dark);
  border-color: var(--outline-dark);
}

body.dark-theme .stage-card.expanded {
  border-color: var(--color-primary-600);
}

.stage-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--color-surface-dim);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

body.dark-theme .stage-card-header {
  background: rgba(255, 255, 255, 0.03);
}

.stage-card-header:hover {
  background: var(--color-primary-50);
}

body.dark-theme .stage-card-header:hover {
  background: rgba(13, 148, 136, 0.1);
}

.stage-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stage-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.stage-icon-circle.intro { background: #e0f2fe; color: #0284c7; }
.stage-icon-circle.pres { background: #fef3c7; color: #d97706; }
.stage-icon-circle.stab { background: #dcfce7; color: #16a34a; }

.stage-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-on-surface);
}

.stage-meta-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stage-time-chip {
  padding: 3px 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-on-surface-variant);
}

.stage-chevron {
  transition: transform var(--transition-fast);
  color: var(--color-on-surface-variant);
}

.stage-card.expanded .stage-chevron {
  transform: rotate(180deg);
}

.stage-card-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid var(--color-outline-variant);
}

.stage-card:not(.expanded) .stage-card-body {
  display: none;
}

.stage-day-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--color-outline-variant);
}

/* 5. Enhanced AI Progress Modal & Loading Card */
.loading-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 440px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  text-align: center;
  border: 1px solid var(--color-outline-variant);
}

body.dark-theme .loading-card {
  background: var(--surface-dark);
  border-color: var(--outline-dark);
}

.ai-progress-modal {
  margin-top: 18px;
  text-align: left;
}

.ai-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ai-modal-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 14px;
  color: var(--color-primary-600);
}

.ai-countdown-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #eef2ff;
  color: #4f46e5;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}

.ai-progress-track {
  width: 100%;
  height: 6px;
  background: var(--color-surface-container-high);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}

.ai-progress-fill {
  width: 25%;
  height: 100%;
  background: linear-gradient(90deg, #0d9488, #14b8a6, #f59e0b);
  border-radius: 3px;
  transition: width 0.8s ease-in-out;
}

.ai-step-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--color-on-surface-variant);
  transition: color var(--transition-fast);
}

.ai-step-item.active {
  color: var(--color-primary-700);
  font-weight: 600;
}

.ai-step-item.completed {
  color: #16a34a;
}

.ai-step-item .ai-step-icon {
  font-size: 18px;
}

.ai-step-item.active .ai-step-icon {
  color: var(--color-primary-600);
}

.ai-step-item.completed .ai-step-icon {
  color: #22c55e;
}

/* 6. Word Export Button */
.btn-word-export {
  background: #185abd !important;
  color: #ffffff !important;
  border: 1px solid #10438a !important;
}

.btn-word-export:hover {
  background: #10438a !important;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* 7. Legal Card (Dark Mode Compliant) */
.legal-card {
  background: var(--color-surface);
  border: 1px solid var(--color-outline-variant);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  color: var(--color-on-surface);
  transition: all var(--transition-fast);
}

body.dark-theme .legal-card {
  background: var(--surface-dark);
  border-color: var(--outline-dark);
}

/* =========================================
   FikerLearn Badge & Pill Enhancements
   ========================================= */
.badge-fiker {
  display: inline-flex;
  align-items: center;
  background: var(--grad-gold);
  color: #2C1A0E;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(212, 168, 67, 0.32);
  margin-left: 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Header pill buttons */
.btn-lang-toggle {
  border-radius: 9999px !important;
  border: 1.5px solid var(--border) !important;
  background: var(--color-surface) !important;
  color: var(--text-primary) !important;
  font-weight: 600 !important;
}

.offline-indicator-badge {
  border-radius: 9999px !important;
}

/* =========================================
   Space-Efficient Dashboard Layout (2-Column)
   ========================================= */

/* Compact Welcome Banner */
.welcome-card {
  background: var(--grad-dark);
  border-radius: 20px;
  border: 1px solid rgba(212, 168, 67, 0.25);
  padding: 18px 24px !important;
  color: #FEFAF7;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px !important;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.4s ease;
}

.welcome-card-content {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.welcome-text h2 {
  font-size: 22px !important;
  font-weight: 800;
  color: #F0C96A;
  margin-bottom: 2px !important;
}

.welcome-text p {
  color: #E8D5BF;
  font-size: 13.5px !important;
  margin: 0;
  opacity: 0.9;
}

.welcome-banner-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.welcome-stats-compact {
  display: flex;
  gap: 18px;
  align-items: center;
}

.stat-item-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.academic-year-stat {
  border-left: 1px solid rgba(232, 213, 191, 0.2);
  padding-left: 18px;
}

.stat-num {
  font-size: 22px;
  font-weight: 800;
  color: #F0C96A;
  line-height: 1.1;
}

.stat-year {
  font-size: 15px !important;
  font-weight: 700;
  color: #F0C96A;
  margin-top: 3px;
}

.stat-lbl {
  font-size: 11px;
  color: #C9A882;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* 2-Column Responsive Workspace Grid */
.dashboard-workspace-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: stretch;
}

/* Left Column: Templates */
.dashboard-templates-col {
  display: flex;
  flex-direction: column;
}

.templates-compact-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  margin-bottom: 0;
}

.template-card-compact {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--color-surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.template-card-compact:hover {
  border-color: var(--gold);
  background: rgba(240, 201, 106, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 168, 67, 0.2);
}

.template-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.template-card-compact .template-thumbnail {
  width: 74px;
  height: 54px;
  flex-shrink: 0;
  margin: 0;
  border-radius: 8px;
  padding: 4px;
}

.template-compact-info {
  flex: 1;
  min-width: 0;
}

.template-compact-header {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.template-compact-header h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.template-compact-info p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Right Column: Search Bar */
.dashboard-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  border: 1.5px solid var(--border);
  border-radius: 9999px;
  padding: 6px 14px;
  margin-bottom: 12px;
  transition: border-color var(--transition-fast);
}

.dashboard-search-bar:focus-within {
  border-color: var(--brown);
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.2);
}

.dashboard-search-bar .search-icon {
  color: var(--text-tertiary);
  font-size: 18px;
}

.dashboard-search-bar input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  padding: 4px 0 !important;
  font-size: 13.5px !important;
  color: var(--text-primary) !important;
  outline: none !important;
  box-shadow: none !important;
}

.dashboard-search-bar .clear-icon {
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 16px;
}

/* High-Density Recent Plans List */
.recent-plans-dense-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-row-dense {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  min-height: 52px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.plan-row-dense:hover {
  border-color: var(--brown);
  transform: translateX(2px);
  box-shadow: var(--shadow-sm);
}

.plan-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.plan-row-icon,
.plan-row-emoji {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--brown);
  flex-shrink: 0;
}

.plan-row-icon .material-icons-round {
  font-size: 18px;
  color: var(--brown);
}

.plan-row-content {
  min-width: 0;
  flex: 1;
}

.plan-row-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-row-subject {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-primary);
}

.plan-row-sep {
  color: var(--text-tertiary);
  font-size: 12px;
}

.plan-row-topic {
  font-weight: 500;
  font-size: 13.5px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-row-subline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-size: 11.5px;
}

.plan-chip-grade {
  font-weight: 600;
  background: var(--surface-3);
  color: var(--brown-mid);
  padding: 1px 6px;
  border-radius: 4px;
}

.plan-chip-type {
  font-size: 11px;
  color: var(--text-tertiary);
}

.plan-row-date {
  color: var(--text-tertiary);
  font-size: 11px;
}

.plan-row-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.plan-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn-sm {
  width: 30px !important;
  height: 30px !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--text-secondary) !important;
  transition: all var(--transition-fast) !important;
}

.icon-btn-sm:hover {
  background: var(--surface-3) !important;
  color: var(--brown) !important;
}

.icon-btn-sm.icon-delete:hover {
  background: var(--error-light) !important;
  color: var(--error) !important;
}

.icon-btn-sm .material-icons-round {
  font-size: 16px !important;
}

/* Hide FAB on desktop */
@media (min-width: 901px) {
  .fab {
    display: none !important;
  }
}

/* Mobile responsive adjustments */
@media (max-width: 900px) {
  .dashboard-workspace-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .welcome-banner-right {
    width: 100%;
    justify-content: space-between;
  }

  .welcome-stats-compact {
    border-right: none;
    padding-right: 0;
  }

  .welcome-actions-row {
    width: 100%;
  }

  .welcome-actions-row .btn {
    flex: 1;
  }
}

/* Dark Theme overrides for new components */
body.dark-theme .template-card-compact {
  background-color: #20150D;
  border-color: #3A2517;
}

body.dark-theme .template-card-compact:hover {
  border-color: var(--gold);
}

body.dark-theme .template-card-compact.selected {
  background: rgba(229, 190, 84, 0.12);
  border-color: #E5BE54;
}



body.dark-theme .dashboard-search-bar {
  background-color: #20150D;
  border-color: #3A2517;
}

body.dark-theme .plan-row-dense {
  background-color: #20150D;
  border-color: #3A2517;
}

body.dark-theme .plan-row-dense:hover {
  border-color: var(--gold);
  background-color: #261910;
}

body.dark-theme .plan-row-icon,
body.dark-theme .plan-row-emoji {
  background: #1A1009;
  border-color: #3A2517;
}

body.dark-theme .plan-row-icon .material-icons-round {
  color: var(--gold);
}

body.dark-theme .plan-chip-grade {
  background: #2B1B10;
  color: #E5BE54;
}

/* =========================================
   Mobile & Tablet Responsiveness System
   ========================================= */

/* Desktop defaults for components */
.daily-form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mobile-only-menu-item {
  display: none !important;
}

/* Contain PDF Preview horizontally */
.pdf-main {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  max-width: 100vw;
  box-sizing: border-box;
}

/* Tablet Viewports (641px - 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
  .dashboard-main,
  .wizard-main,
  .myplans-main,
  .settings-main {
    padding: 16px !important;
  }

  .dashboard-workspace-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .welcome-banner-right {
    width: 100%;
    justify-content: space-between;
  }

  .welcome-stats-compact {
    gap: 14px;
  }
}

/* Mobile Viewports (<640px) */
@media (max-width: 640px) {
  /* Global page containment */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  /* Header Optimization */
  .app-header {
    padding: 8px 12px !important;
  }

  .app-header .header-left {
    gap: 8px;
    min-width: 0;
  }

  .app-header .badge-fiker {
    display: none !important;
  }

  .app-header .header-title {
    font-size: 17px !important;
    white-space: nowrap;
  }

  .app-header .header-logo-icon {
    height: 24px !important;
  }

  .app-header #sync-btn,
  .app-header #notif-btn {
    display: none !important;
  }

  .mobile-only-menu-item {
    display: flex !important;
  }

  .btn-lang-toggle {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  /* Screen Main Containers */
  .dashboard-main,
  .wizard-main,
  .myplans-main,
  .settings-main,
  .policy-main {
    padding: 12px 10px !important;
  }

  /* Welcome Card & Stats */
  .welcome-card {
    padding: 14px !important;
    border-radius: 16px !important;
    margin-bottom: 14px !important;
  }

  .welcome-card-content {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .welcome-text h2 {
    font-size: 19px !important;
  }

  .welcome-text p {
    font-size: 12.5px !important;
  }

  .welcome-banner-right {
    width: 100% !important;
  }

  .welcome-stats-compact {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
    justify-items: center;
    text-align: center;
    padding: 0 !important;
    border-right: none !important;
  }

  .stat-item-compact {
    width: 100%;
    text-align: center;
  }

  .stat-num {
    font-size: 17px !important;
  }

  .stat-lbl {
    font-size: 10.5px !important;
    white-space: nowrap;
  }

  .stat-year {
    font-size: 12px !important;
  }

  .academic-year-stat {
    border-left: 1px solid rgba(232, 213, 191, 0.2) !important;
    padding-left: 4px !important;
  }

  /* 2-tier Stacked Plan Row */
  .plan-row-dense {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }

  .plan-row-left {
    width: 100% !important;
    min-width: 0 !important;
  }

  .plan-row-right {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    padding-top: 6px !important;
    border-top: 1px dashed var(--border-soft) !important;
  }

  .plan-row-actions {
    gap: 4px !important;
  }

  .icon-btn-sm {
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
  }

  .icon-btn-sm .material-icons-round {
    font-size: 18px !important;
  }

  /* Plan Cards in My Plans */
  .plan-card {
    padding: 12px 14px !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
  }

  .plan-card-icon {
    width: 38px !important;
    height: 38px !important;
  }

  .plan-card-title {
    font-size: 14px !important;
  }

  .plan-card-meta {
    font-size: 12px !important;
  }

  /* Daily form grid inside wizard */
  .daily-form-grid-2col {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Wizard Sticky Bottom Navigation */
  .wizard-container {
    padding-bottom: 76px !important;
  }

  .wizard-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: rgba(254, 250, 247, 0.96) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    padding: 10px 16px !important;
    margin: 0 !important;
    border-top: 1px solid var(--border-soft) !important;
    z-index: 95 !important;
    box-shadow: 0 -4px 16px rgba(43, 27, 16, 0.1) !important;
    box-sizing: border-box !important;
  }

  body.dark-theme .wizard-nav {
    background: rgba(20, 13, 8, 0.96) !important;
    border-top-color: #3A2517 !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5) !important;
  }

  .wizard-nav .btn {
    min-height: 42px !important;
    padding: 8px 16px !important;
    font-size: 13.5px !important;
  }

  /* PDF Preview Screen Header */
  #pdf-screen .header-right {
    gap: 4px !important;
  }

  #pdf-screen .header-right .btn {
    padding: 6px 8px !important;
    font-size: 12px !important;
  }

  #pdf-screen .header-right .btn .btn-icon {
    font-size: 16px !important;
    margin-right: 2px !important;
  }

  /* Legal and Settings Screens */
  .legal-card {
    padding: 14px !important;
  }
}
