/* ==========================================================================
   ORIENTALFS_TEAMS — SIDEBAR & TOPBAR
   Selector de Cursos, Buscador Rápido y Navegación de Clases
   ========================================================================== */

/* Barra Lateral */
.sidebar {
  width: 290px;
  background-color: var(--surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  z-index: 20;
}

/* Cabecera de la Barra Lateral */
.sidebar-header {
  padding: 18px 20px 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--slate-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Selector de Curso Académico */
.course-selector-box {
  padding: 12px 18px;
  background-color: var(--slate-50);
  border-bottom: 1px solid var(--border-color);
}

.course-selector-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.btn-text-action,
button.btn-text-action,
.course-selector-label button.btn-text-action {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--primary-50, #eef2ff);
  border: 1px solid var(--primary-200, #c7d2fe);
  color: var(--primary-700, #4338ca);
  font-family: var(--font-sans, inherit);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: var(--radius-pill, 9999px);
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease-in-out;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-text-action:hover,
button.btn-text-action:hover,
.course-selector-label button.btn-text-action:hover {
  background-color: var(--primary-100, #e0e7ff);
  border-color: var(--primary-300, #a5b4fc);
  color: var(--primary-900, #312e81);
  transform: translateY(-0.5px);
}

.course-select-wrapper {
  position: relative;
}

.custom-select {
  width: 100%;
  padding: 8px 32px 8px 12px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-800);
  background-color: var(--surface);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm, 6px);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.custom-select:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100, rgba(99, 102, 241, 0.15));
}

.select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--slate-400);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.course-select-wrapper:focus-within .select-arrow {
  color: var(--primary-600);
}

/* Botón contextual de promoción a Curso Vigente */
.course-action-box {
  animation: fadeIn 0.2s ease;
}

.btn-vigente-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
  padding: 6px 10px;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.btn-vigente-action:hover {
  background-color: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
  transform: translateY(-0.5px);
}

/* Buscador Rápido */
.search-container {
  padding: 14px 18px 10px 18px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--slate-400);
  font-size: 1rem;
}

.search-input {
  width: 100%;
  padding: 8px 10px 8px 34px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--slate-800);
  background-color: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition-fast);
}
.search-input:focus {
  background-color: var(--surface);
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

/* Lista de Grupos / Clases con Acordeón por Etapas */
.classes-section {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
}

.classes-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Acordeón de Etapas Educativas */
.stage-group {
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: var(--surface);
}

.stage-header {
  padding: 10px 14px;
  background-color: var(--slate-50);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--slate-700);
  transition: var(--transition-fast);
}

.stage-header:hover {
  background-color: var(--slate-100);
  color: var(--slate-900);
}

.stage-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage-chevron {
  font-size: 0.65rem;
  color: var(--slate-400);
  transition: transform 0.2s ease;
}

.stage-group.collapsed .stage-chevron {
  transform: rotate(-90deg);
}

.stage-group.collapsed .stage-content {
  display: none;
}

.stage-content {
  list-style: none;
  padding: 3px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.class-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--slate-700);
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.class-item:hover {
  background-color: var(--slate-100);
  color: var(--slate-900);
}

.class-item.active {
  background-color: var(--primary-50);
  color: var(--primary-700);
  font-weight: 700;
}

/* Cabecera de Nivel Colapsable / Seleccionable */
.level-group-box {
  margin: 3px 0;
  border-radius: var(--radius-xs);
  transition: var(--transition-fast);
}

.level-header-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--slate-800);
  background-color: transparent;
  border: 1px solid transparent;
  user-select: none;
  transition: all 0.15s ease;
}

.level-header-item:hover {
  background-color: var(--slate-200);
  color: var(--slate-900);
}

.level-header-item.active {
  background-color: var(--primary-100) !important;
  border-color: var(--primary-300) !important;
  color: var(--primary-800) !important;
}

.level-chevron {
  font-size: 0.6rem;
  color: var(--slate-400);
  transition: transform 0.2s ease;
  margin-right: 4px;
}

.level-group-box.collapsed .level-chevron {
  transform: rotate(-90deg);
}

.level-group-box.collapsed .level-children {
  display: none;
}

.level-children {
  list-style: none;
  padding-left: 20px;
  margin-left: 14px;
  border-left: 1px solid var(--slate-200);
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
  margin-bottom: 6px;
}

/* Modal Gestor de Niveles */
.level-manager-row {
  transition: all 0.15s ease;
}
.level-manager-row:hover {
  background-color: #fff !important;
  border-color: var(--primary-300) !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.class-counts {
  display: flex;
  align-items: center;
  gap: 6px;
}

.count-total {
  font-size: 0.75rem;
  color: var(--slate-400);
  font-weight: 600;
}

.count-neae {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background-color: var(--neae-acnee-bg);
  color: var(--neae-acnee-text);
  border: 1px solid var(--neae-acnee-border);
  font-weight: 800;
}

/* Pie de la Barra Lateral: Estado Teams */
.sidebar-footer {
  padding: 14px 18px;
  background-color: var(--surface);
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
}

.orientadora-profile-pill:hover {
  background-color: var(--slate-100) !important;
  border-color: var(--primary-300) !important;
  box-shadow: var(--shadow-xs);
}

.teams-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background-color: var(--onedrive-bg);
  border: 1px solid #c7e0f4;
  border-radius: var(--radius-sm);
  color: var(--onedrive-blue);
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
}

/* Barra Superior del Viewport */
.topbar {
  height: 64px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.topbar-title h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.02em;
}

.topbar-title span {
  font-size: 0.8rem;
  color: var(--slate-500);
  font-weight: 500;
}

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

/* Modo Enfoque: Desactiva la barra lateral cuando se crea un alumno */
.sidebar.sidebar-focus-dimmed {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(40%);
  user-select: none;
  transition: opacity 0.25s ease, filter 0.25s ease;
}

/* Sugerencias de Comandos (#) en Buscadores */
.search-tag-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
  font-family: var(--font-sans);
  animation: fadeIn 0.12s ease-out;
}

.search-tag-suggestions.hidden {
  display: none !important;
}

.search-tag-header {
  padding: 6px 10px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--slate-400);
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-100);
}

.search-tag-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  cursor: pointer;
  transition: background 0.12s ease;
  border-bottom: 1px solid var(--slate-50);
}

.search-tag-item:last-child {
  border-bottom: none;
}

.search-tag-item:hover,
.search-tag-item.active {
  background: #eff6ff;
}

.search-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-700);
  background: #dbeafe;
  padding: 2px 7px;
  border-radius: 4px;
}

.search-tag-desc {
  font-size: 0.72rem;
  color: var(--slate-500);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

