/* ==========================================================
   UASD CUPOS & PROGRAMACIÓN DOCENTE - DESIGN SYSTEM
   ========================================================== */

:root {
  --primary: #0b2b68;
  --primary-light: #1e40af;
  --primary-dark: #071940;
  --secondary: #f59e0b;
  --secondary-hover: #d97706;
  
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  
  --info: #3b82f6;
  --info-bg: #eff6ff;
  
  --bg-main: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  
  --border-color: #e2e8f0;
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 20px;
  --border-radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-glass: 0 8px 32px 0 rgba(11, 43, 104, 0.12);
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.45;
  font-size: 13.5px;
  min-height: 100vh;
  padding-bottom: 76px; /* Espacio para la barra de navegación inferior */
}

/* App Header */
.app-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  color: var(--text-inverse);
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-branding {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.header-logo-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  background: transparent;
  flex-shrink: 0;
}

.header-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
  display: block;
}

.header-titles h1 {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.header-titles .periodo-badge {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.periodo-pulse {
  width: 7px;
  height: 7px;
  background-color: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.header-actions button {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
}

.header-actions button:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Main Container */
.main-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

/* Search Card Container */
.search-card {
  background: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-glass);
  border: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

@media (min-width: 640px) {
  .form-row {
    flex-direction: row;
  }
  .form-group-campus {
    flex: 1.2;
  }
  .form-group-clave {
    flex: 1.5;
  }
}

.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.3rem;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  height: 44px;
  padding: 0 0.85rem 0 2.5rem;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

.form-control-clave {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.btn-search {
  height: 44px;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-hover) 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--border-radius-sm);
  padding: 0 1.4rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.3);
}

.btn-search:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.45);
}

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

/* Quick Subject Chips & Infinite Live Marquee */
.quick-chips-wrapper {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
  overflow: hidden;
}

.quick-chips-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  gap: 0.5rem;
}

.quick-chips-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  letter-spacing: -0.01em;
}

.ticker-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  opacity: 0.85;
}

@media (max-width: 480px) {
  .ticker-hint {
    display: none;
  }
}

/* Contenedor con degradado lateral (fade-in / fade-out) */
.ticker-marquee-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 0.25rem 0;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 24s linear infinite;
  will-change: transform;
}

/* Pausar automáticamente al pasar el cursor o al tocar en móvil */
.ticker-track:hover,
.ticker-track:active,
.ticker-track.is-paused {
  animation-play-state: paused;
}

.ticker-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-right: 0.5rem;
}

.chip-btn {
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.76rem;
  padding: 0.32rem 0.75rem;
  border-radius: var(--border-radius-full);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chip-btn:hover {
  background: #eff6ff;
  border-color: var(--primary-light);
  color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(11, 43, 104, 0.12);
}

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

/* Punto verde de señal en tiempo real */
.chip-live-dot {
  width: 6px;
  height: 6px;
  background-color: var(--success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  animation: dotBlink 2s infinite ease-in-out;
}

@keyframes dotBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Animación continua e infinita de derecha a izquierda */
@keyframes marqueeScroll {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

/* Filters & Results Toolbar */
.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  padding: 0.4rem 0.2rem;
}

.results-stats {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.stats-count {
  color: var(--primary);
  font-weight: 700;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: var(--border-radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.filter-toggle.active {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: #065f46;
}

.filter-toggle input[type="checkbox"] {
  accent-color: var(--success);
  width: 16px;
  height: 16px;
}

.filter-input-wrapper {
  position: relative;
}

.filter-input {
  height: 38px;
  padding: 0 0.85rem 0 2rem;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-full);
  font-size: 0.85rem;
  width: 170px;
  transition: var(--transition);
}

.filter-input:focus {
  outline: none;
  width: 220px;
  border-color: var(--primary-light);
}

.filter-input-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Sections Grid & Cards */
.sections-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .sections-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.section-card {
  background: var(--bg-surface);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.15rem;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.section-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.section-card.has-cupos {
  border-left: 5px solid var(--success);
}

.section-card.no-cupos {
  border-left: 5px solid var(--danger);
  opacity: 0.85;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.section-badge-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.badge-seccion {
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--border-radius-sm);
}

.badge-tipo {
  background: #f1f5f9;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--border-radius-sm);
}

.badge-modalidad {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--border-radius-sm);
}

.badge-modalidad.virtual {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-modalidad.presencial {
  background: #fef3c7;
  color: #92400e;
}

.badge-modalidad.semipresencial {
  background: #f3e8ff;
  color: #6b21a8;
}

.nrc-copy-btn {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  transition: var(--transition);
}

.nrc-copy-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.card-profesor {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.card-details {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.detail-item i {
  color: var(--primary-light);
  width: 16px;
  text-align: center;
}

/* Card Cupos Status Footer */
.card-cupos-footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border-color);
}

.cupos-bar-wrapper {
  margin-bottom: 0.5rem;
}

.cupos-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.cupos-progress-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.cupos-progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.cupos-progress-fill.success {
  background: linear-gradient(90deg, #10b981, #059669);
}

.cupos-progress-fill.danger {
  background: linear-gradient(90deg, #ef4444, #b91c1c);
}

.cupos-status-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.green {
  background: var(--success);
}

.status-dot.red {
  background: var(--danger);
}

/* Empty / Initial State */
.state-container {
  text-align: center;
  padding: 2.5rem 1.25rem;
  background: var(--bg-surface);
  border-radius: var(--border-radius-md);
  border: 1px dashed var(--border-color);
  box-shadow: var(--shadow-sm);
}

.state-icon {
  width: 56px;
  height: 56px;
  background: #e0e7ff;
  color: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1rem auto;
}

.state-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.state-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  max-width: 460px;
  margin: 0 auto 1.2rem auto;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0;
  z-index: 99;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 1rem;
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
  position: relative;
}

.nav-item i {
  font-size: 1.2rem;
}

.nav-item.active {
  color: var(--primary);
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: 18px;
  background: var(--secondary);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--border-radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Modal Styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-content {
  background: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  max-width: 500px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
}

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

.modal-header h3 {
  font-size: 1.15rem;
  color: var(--primary);
  font-weight: 700;
}

.modal-close-btn {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

/* ==========================================================
   SIDE DRAWER / MENÚ HAMBURGUESA
   ========================================================== */

.header-menu-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: var(--transition);
  margin-right: 0.35rem;
}

.header-menu-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.header-action-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: var(--transition);
  margin-right: 0.4rem;
}

.header-action-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.side-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: var(--bg-surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.side-drawer.open {
  transform: translateX(0);
}

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

.drawer-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.drawer-branding h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.drawer-subtitle {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
}

.drawer-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-body {
  padding: 1.25rem 1rem;
  flex: 1;
  overflow-y: auto;
}

.drawer-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin: 0.75rem 0.5rem 0.5rem 0.5rem;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: none;
  background: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.drawer-nav-item i {
  font-size: 1.15rem;
  color: var(--primary-light);
  width: 22px;
  text-align: center;
}

.drawer-nav-item:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.drawer-nav-item.active {
  background: #eff6ff;
  color: var(--primary);
  font-weight: 700;
}

.badge-new {
  background: #22c55e;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: var(--border-radius-full);
  margin-left: auto;
}

.drawer-badge {
  background: var(--secondary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  padding: 0 0.35rem;
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

.drawer-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle);
}

.drawer-cloud-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: #15803d;
  font-weight: 600;
}

.drawer-version {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ==========================================================
   VISTA: DIRECTORIO DE PROFESORES
   ========================================================== */

.prof-card {
  background: var(--bg-surface);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  overflow: hidden;
  transition: var(--transition);
}

.prof-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.prof-card-header {
  padding: 1rem 1.15rem;
  background: linear-gradient(to right, #f8fafc, #ffffff);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.prof-info-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.prof-avatar {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 2px 6px rgba(11, 43, 104, 0.2);
}

.prof-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.prof-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.prof-stats-badges {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.badge-prof-count {
  background: #e0e7ff;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--border-radius-full);
}

.badge-prof-cupos {
  background: var(--success-bg);
  color: #065f46;
  border: 1px solid var(--success-border);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--border-radius-full);
}

.prof-sections-list {
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.prof-section-row {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.prof-section-row:hover {
  background: #ffffff;
  border-color: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.prof-sec-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.prof-sec-subject {
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--primary);
}

.prof-sec-details {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.76rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.prof-sec-details span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Modal de Detalle de Asignatura */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (min-width: 480px) {
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.detail-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 0.65rem 0.85rem;
}

.detail-box-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.detail-box-val {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ==========================================================
   EXPLORADOR DE CARRERAS Y PENSUMS
   ========================================================== */

/* Barra de búsqueda moderna unificada */
.carrera-search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-full);
  padding: 0.35rem 0.55rem 0.35rem 1rem;
  margin-bottom: 0.85rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.carrera-search-box:focus-within {
  background: #ffffff;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), 0 4px 14px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.carrera-search-icon {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-right: 0.65rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.carrera-search-box:focus-within .carrera-search-icon {
  color: var(--primary);
  transform: scale(1.1);
}

.carrera-search-field {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 500;
  padding: 0.4rem 0;
  min-width: 0;
}

.carrera-search-field::placeholder {
  color: #94a3b8;
  font-weight: 400;
  font-size: 0.84rem;
}

.carrera-clear-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.carrera-clear-btn:hover {
  color: var(--danger);
  transform: scale(1.1);
}

.carrera-search-badge {
  background: #eff6ff;
  color: var(--primary);
  font-size: 0.70rem;
  font-weight: 700;
  padding: 0.28rem 0.65rem;
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.45rem;
  user-select: none;
  white-space: nowrap;
  border: 1px solid #dbeafe;
}

.carrera-facultad-chips {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.carrera-facultad-chips::-webkit-scrollbar {
  display: none;
}

.carrera-facultad-chips .chip-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(11, 43, 104, 0.25);
}

.carreras-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .carreras-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .carreras-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.carrera-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.carrera-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.carrera-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary), var(--secondary));
  opacity: 0;
  transition: var(--transition);
}

.carrera-card:hover::before {
  opacity: 1;
}

.carrera-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.carrera-card-icon {
  width: 40px;
  height: 40px;
  background: #e0e7ff;
  color: var(--primary);
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.carrera-card:hover .carrera-card-icon {
  background: var(--primary);
  color: #ffffff;
}

.carrera-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.carrera-card-facultad {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.15rem;
}

.carrera-card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.carrera-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.75rem;
}

.carrera-subject-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  transition: var(--transition);
}

.carrera-subject-item:hover {
  background: #ffffff;
  border-color: var(--primary-light);
  transform: translateX(2px);
}

.carrera-subject-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.carrera-subject-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.carrera-subject-meta {
  font-size: 0.70rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================
   GUÍA ESTUDIANTIL Y FAQ - OPTIMIZACIÓN SEO & ADSENSE
   ========================================================== */
.guide-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.guide-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.guide-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #e0e7ff;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--border-radius-full);
  margin-bottom: 0.65rem;
}

.guide-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.3;
  margin-bottom: 0.6rem;
}

.guide-intro {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.guide-grid-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.guide-step-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 1rem;
}

.guide-step-box h4 {
  font-size: 0.95rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.guide-step-box p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.faq-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  transition: var(--transition);
}

.faq-item[open] {
  background: #ffffff;
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.faq-question {
  padding: 1rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-question::after {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  padding: 0 1.25rem 1rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.faq-answer p {
  margin: 0;
}
