/* ==========================================================================
   Planeador Docente de Inglés - Colegio Simón Bolívar 2026-2027
   Design System: High-Legibility, Mobile-First & Executive Educational Aesthetics
   ========================================================================== */

:root {
  /* Core Color Tokens */
  --csb-primary: #002060;
  --csb-primary-dark: #001238;
  --csb-accent: #1e40af;
  --csb-cyan: #83caeb;
  --csb-cyan-light: #e0f2fe;
  --csb-cyan-dark: #0284c7;

  /* Moment Colors (High Contrast & Clear Identification) */
  --moment-warmup: #d97706;
  --moment-warmup-bg: #fffbeb;
  --moment-warmup-border: #f59e0b;

  --moment-pres: #2563eb;
  --moment-pres-bg: #eff6ff;
  --moment-pres-border: #3b82f6;

  --moment-pract: #059669;
  --moment-pract-bg: #ecfdf5;
  --moment-pract-border: #10b981;

  --moment-prod: #7c3aed;
  --moment-prod-bg: #f5f3ff;
  --moment-prod-border: #8b5cf6;

  --moment-closure: #db2777;
  --moment-closure-bg: #fdf2f8;
  --moment-closure-border: #ec4899;

  --moment-assess: #0891b2;
  --moment-assess-bg: #ecfeff;
  --moment-assess-border: #06b6d4;

  /* Surfaces & Backgrounds */
  --bg-gradient: linear-gradient(135deg, #f0f7ff 0%, #f8fafc 50%, #f1f5f9 100%);
  --surface-card: rgba(255, 255, 255, 0.95);
  --surface-card-hover: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.82);
  --border-glass: #cbd5e1;
  --border-input: #cbd5e1;
  --border-input-focus: #0284c7;

  /* High Legibility Text Colors */
  --text-main: #0f172a;        /* Deep slate for ultra-clear readability */
  --text-body: #1e293b;        /* High contrast body text */
  --text-secondary: #334155;   /* Crisp secondary label text */
  --text-muted: #475569;       /* Legible muted text (not washed out) */
  --text-inverse: #ffffff;

  /* Shadows */
  --shadow-sm: 0 2px 5px rgba(0, 32, 96, 0.05);
  --shadow-md: 0 4px 14px rgba(0, 32, 96, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 32, 96, 0.12);
  --shadow-xl: 0 20px 35px rgba(0, 32, 96, 0.16);

  /* Geometry & Transitions */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Global */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-body);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Glassmorphism Card Utility */
.glass-card {
  background: var(--surface-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Header Navbar
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(203, 213, 225, 0.85);
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  height: 46px;
  width: auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

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

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--csb-primary);
  line-height: 1.2;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.nav-btn:hover {
  background: #ffffff;
  color: var(--csb-primary);
  border-color: var(--csb-primary);
}

.btn-primary-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-inverse);
  background: linear-gradient(135deg, #002060 0%, #1e40af 100%);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 32, 96, 0.25);
  transition: var(--transition);
}

.btn-primary-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 32, 96, 0.35);
  background: linear-gradient(135deg, #00174a 0%, #1d3596 100%);
}

.btn-primary-download:active {
  transform: translateY(0);
}

/* ==========================================================================
   App Container & Control Panel
   ========================================================================== */
.app-container {
  max-width: 1540px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

.control-panel {
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Grade Tabs */
.grade-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.grade-tab {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.grade-tab:hover {
  background: #ffffff;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.grade-tab.active {
  background: #ffffff;
  border-color: var(--csb-primary);
  box-shadow: 0 4px 14px rgba(0, 32, 96, 0.12);
}

.tab-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #e2e8f0;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.15rem;
  transition: var(--transition);
}

.grade-tab.active .tab-badge {
  background: var(--csb-primary);
  color: #ffffff;
}

.tab-info {
  display: flex;
  flex-direction: column;
}

.tab-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

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

/* Week Selector Wrapper */
.week-selector-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.selector-field {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 340px;
}

.field-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.select-container {
  position: relative;
  flex: 1;
}

.form-select {
  width: 100%;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--csb-primary);
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.form-select:focus {
  border-color: var(--csb-cyan-dark);
  box-shadow: 0 0 0 3px rgba(131, 202, 235, 0.35);
}

/* Week Summary Badges */
.week-summary-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.86rem;
  font-weight: 600;
}

.teacher-chip {
  background: #e2e8f0;
  color: #1e293b;
}

.unit-chip {
  background: var(--csb-cyan-light);
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.hours-chip {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Guidelines Banner */
.guidelines-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
  border: 1.5px solid #86efac;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  color: #0f172a;
  box-shadow: var(--shadow-sm);
}

.banner-icon {
  font-size: 1.4rem;
}

.banner-content {
  flex: 1;
  line-height: 1.5;
}

.btn-refresh-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  background: #ffffff;
  color: var(--csb-primary);
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-refresh-all:hover {
  background: #f8fafc;
  border-color: var(--csb-cyan-dark);
  box-shadow: 0 2px 6px rgba(0, 32, 96, 0.1);
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-ai-generate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  border: 1.5px solid #6366f1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.btn-ai-generate:hover {
  background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}


/* ==========================================================================
   Mobile Day Selector Tabs (Shown on Phone & iPad)
   ========================================================================== */
.mobile-day-selector {
  display: none; /* Hidden by default on desktop */
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.mobile-day-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--csb-primary);
  white-space: nowrap;
}

.day-pills {
  display: flex;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
}

.day-pill {
  flex: 1;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: var(--transition);
}

.day-pill:hover {
  background: #e2e8f0;
  color: var(--csb-primary);
}

.day-pill.active {
  background: var(--csb-primary);
  color: #ffffff;
  border-color: var(--csb-primary);
  box-shadow: 0 2px 8px rgba(0, 32, 96, 0.25);
}

.day-pill.btn-show-all {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

.day-pill.btn-show-all.active {
  background: #1e40af;
  color: #ffffff;
  border-color: #1e40af;
}

/* ==========================================================================
   Weekly Days Grid (Monday to Friday)
   ========================================================================== */
.days-container {
  display: grid;
  grid-template-columns: repeat(5, minmax(250px, 1fr));
  gap: 16px;
  align-items: start;
}

/* Day Card */
.day-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: var(--transition);
}

.day-card:hover {
  box-shadow: var(--shadow-xl);
  border-color: var(--csb-cyan);
}

.day-card.is-suspension {
  background: #fff1f2;
  border-color: #fecdd3;
}

/* Day Card Header */
.day-card-header {
  padding: 14px 16px;
  background: #f8fafc;
  border-bottom: 1.5px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.day-title-group {
  display: flex;
  flex-direction: column;
}

.day-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--csb-primary);
}

.day-date {
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 600;
}

.day-meta-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.badge-hours {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 700;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* Day Card Body */
.day-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Section Box */
.card-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.section-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 5px;
}

.subject-input {
  width: 100%;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--csb-primary);
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition);
}

.subject-input:focus {
  border-color: var(--csb-cyan-dark);
  box-shadow: 0 0 0 3px rgba(131, 202, 235, 0.3);
}

/* 5 Didactic Moments List */
.moments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid #e2e8f0;
}

.moment-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.moment-block.warmup { border-left-color: var(--moment-warmup); background: #fffdfa; }
.moment-block.presentation { border-left-color: var(--moment-pres); background: #fafcff; }
.moment-block.practice { border-left-color: var(--moment-pract); background: #f9fefb; }
.moment-block.production { border-left-color: var(--moment-prod); background: #fdfaff; }
.moment-block.closure { border-left-color: var(--moment-closure); background: #fffafc; }
.moment-block.assessment { border-left-color: var(--moment-assess); background: #fafffe; }

.moment-header {
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}

.moment-block.warmup .moment-header { color: #b45309; }
.moment-block.presentation .moment-header { color: #1d4ed8; }
.moment-block.practice .moment-header { color: #047857; }
.moment-block.production .moment-header { color: #6d28d9; }
.moment-block.closure .moment-header { color: #be185d; }
.moment-block.assessment .moment-header { color: #0e7490; }

.moment-textarea {
  width: 100%;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  resize: vertical;
  min-height: 52px;
  outline: none;
  transition: var(--transition);
}

.moment-textarea:focus {
  border-color: var(--csb-cyan-dark);
  box-shadow: 0 0 0 2px rgba(131, 202, 235, 0.3);
}

/* Materials & Homework */
.field-textarea {
  width: 100%;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-main);
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  resize: vertical;
  min-height: 48px;
  outline: none;
  transition: var(--transition);
}

.field-textarea:focus {
  border-color: var(--csb-cyan-dark);
  box-shadow: 0 0 0 3px rgba(131, 202, 235, 0.3);
}

/* Card Footer Actions */
.day-card-footer {
  padding: 10px 16px;
  background: #f8fafc;
  border-top: 1.5px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-card-action {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}

.btn-card-action:hover {
  background: #f8fafc;
  color: var(--csb-primary);
  border-color: var(--csb-primary);
}

.btn-card-action.btn-card-ai {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border-color: #a5b4fc;
  color: #4f46e5;
}

.btn-card-action.btn-card-ai:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  border-color: #6366f1;
}


/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  padding: 16px;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  transform: translateY(20px);
  transition: var(--transition);
  overflow: hidden;
}

.modal-overlay.open .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1.5px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--csb-primary);
}

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

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-desc {
  font-size: 0.94rem;
  color: var(--text-secondary);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1.5px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-primary {
  padding: 9px 20px;
  font-size: 0.92rem;
  font-weight: 700;
  background: var(--csb-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary:hover {
  background: var(--csb-primary-dark);
}

.btn-secondary {
  padding: 9px 20px;
  font-size: 0.92rem;
  font-weight: 700;
  background: #ffffff;
  color: var(--text-secondary);
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: #f1f5f9;
}

/* Schedule Table */
.schedule-table-wrapper {
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  overflow-x: auto;
}

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

.schedule-table th,
.schedule-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.92rem;
}

.schedule-table th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--csb-primary);
}

.input-hour {
  width: 100%;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.9rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
}

.input-hour:focus {
  border-color: var(--csb-cyan-dark);
}

.teacher-meta-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 0.92rem;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  outline: none;
}

.form-input:focus {
  border-color: var(--csb-cyan-dark);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 90vw;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: #ffffff;
  color: var(--text-main);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border-left: 5px solid var(--csb-primary);
  font-size: 0.94rem;
  font-weight: 600;
  animation: slideIn 0.3s ease forwards;
}

.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN (Tablets, iPads & Mobile Phones)
   ========================================================================== */

/* Tablets & Small Desktops (<= 1200px) */
@media (max-width: 1200px) {
  .days-container {
    overflow-x: auto;
    padding-bottom: 12px;
  }
  .day-card {
    min-width: 270px;
  }
}

/* Tablets & iPads (<= 1024px) */
@media (max-width: 1024px) {
  .mobile-day-selector {
    display: flex;
  }

  /* Single Day Active Mode on Mobile/Tablet unless 'show-all-days' is set */
  .days-container:not(.show-all-days) {
    display: flex;
    flex-direction: column;
  }

  .days-container:not(.show-all-days) .day-card {
    display: none;
    width: 100%;
  }

  .days-container:not(.show-all-days) .day-card.active-mobile-day {
    display: flex;
  }

  /* When viewing all days on mobile/tablet */
  .days-container.show-all-days {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .days-container.show-all-days .day-card {
    width: 100%;
  }
}

/* Mobile Phones (<= 768px) */
@media (max-width: 768px) {
  .navbar {
    padding: 10px 16px;
  }

  .brand-logo {
    height: 38px;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .brand-subtitle {
    font-size: 0.76rem;
  }

  .nav-actions {
    gap: 8px;
  }

  .nav-btn {
    padding: 7px 10px;
    font-size: 0.84rem;
  }

  .btn-primary-download {
    padding: 8px 14px;
    font-size: 0.88rem;
  }

  .app-container {
    padding: 14px 12px 30px;
  }

  .control-panel {
    padding: 14px 16px;
    gap: 12px;
  }

  .grade-tabs {
    gap: 8px;
  }

  .grade-tab {
    padding: 10px 8px;
    gap: 8px;
    justify-content: center;
  }

  .tab-badge {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .tab-title {
    font-size: 0.92rem;
  }

  .tab-subtitle {
    display: none; /* Keep tabs clean on small screens */
  }

  .week-selector-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .selector-field {
    min-width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .form-select {
    font-size: 0.94rem;
    padding: 10px 14px;
  }

  .week-summary-badges {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
  }

  .badge-chip {
    width: 100%;
    justify-content: flex-start;
  }

  .guidelines-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
  }

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

  .teacher-meta-fields {
    grid-template-columns: 1fr;
  }
}

/* Very Small Phones (<= 440px) */
@media (max-width: 440px) {
  .brand-subtitle {
    display: none;
  }

  .nav-btn-text {
    display: none; /* Shows icon ⏰ on smallest screens */
  }

  .download-text {
    font-size: 0.82rem;
  }

  .day-pill {
    padding: 6px 8px;
    font-size: 0.82rem;
  }
}
