/* =============================================================
   COMPONENTES UI NEMBACH — SISTEMA DE GESTIÓN DOCENTE EMS
============================================================= */

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark, #4c0519));
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-hover), var(--color-primary-dark, #4c0519));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.btn-secondary {
  background-color: var(--bg-card-subtle);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--border-color);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.btn-success {
  background-color: var(--color-success);
  color: white;
}
.btn-danger {
  background-color: var(--color-danger);
  color: white;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

/* Tarjetas */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.card:hover {
  border-color: rgba(131, 24, 67, 0.2);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Grid de Métricas / StatCards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.primary { background-color: var(--color-primary-light); color: var(--color-primary); }
.stat-icon.success { background-color: var(--color-success-light); color: var(--color-success); }
.stat-icon.warning { background-color: var(--color-warning-light); color: var(--color-warning); }
.stat-icon.danger  { background-color: var(--color-danger-light); color: var(--color-danger); }

.stat-body {
  flex: 1;
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 900;
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
}

.stat-sub {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Tarjetas de Impartición (M1) */
.imparticion-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
}

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

.imparticion-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.imparticion-subject {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.imparticion-group-badge {
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.imparticion-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  background-color: var(--bg-card-subtle);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  text-align: center;
}

.imparticion-metric-item .val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.imparticion-metric-item .lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

/* Semáforo del Parcial (RF-M1-004) */
.progress-traffic-light {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.progress-track {
  height: 8px;
  background-color: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.progress-bar-fill.green { background: linear-gradient(90deg, #10b981, #059669); }
.progress-bar-fill.amber { background: linear-gradient(90deg, #f59e0b, #d97706); }
.progress-bar-fill.red   { background: linear-gradient(90deg, #ef4444, #dc2626); }

/* Bandeja de Pendientes Global (RF-M1-003) */
.pending-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pending-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-card-subtle);
  border-left: 4px solid var(--border-color);
  transition: all 0.2s ease;
  cursor: pointer;
}

.pending-item:hover {
  background-color: var(--border-color);
  transform: translateX(3px);
}

.pending-item.CRITICA { border-left-color: var(--color-danger); }
.pending-item.ALTA    { border-left-color: var(--color-warning); }
.pending-item.MEDIA   { border-left-color: var(--color-info); }

.pending-content {
  flex: 1;
}

.pending-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

/* Alertas SIAT (RF-M1-002) */
.siat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.siat-badge.observacion {
  background-color: var(--color-warning-light);
  color: var(--color-warning);
  border: 1px solid rgba(217, 119, 6, 0.3);
}

.siat-badge.seguimiento {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

/* Pase de Lista (RF-M4-001) */
.attendance-grid-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background-color: var(--bg-card);
}

/* =============================================================
   SISTEMA DE TABLAS ARMONIZADAS (TAMAÑO UNIFORME 12PX)
   ============================================================= */
.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
}

.table th {
  padding: 0.65rem 0.85rem;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background-color: var(--bg-card-subtle);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  vertical-align: middle;
}

.table td {
  padding: 0.65rem 0.85rem;
  font-size: 12px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table tbody tr {
  transition: background-color 0.15s ease;
}

.table tbody tr:hover {
  background-color: var(--bg-card-subtle);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.attendance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.4;
}

.attendance-table th, .attendance-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  font-size: 12px;
  vertical-align: middle;
}

.attendance-table th {
  background-color: var(--bg-card-subtle);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mark-btn-group {
  display: inline-flex;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.mark-btn {
  width: 32px;
  height: 32px;
  border: none;
  background-color: var(--bg-card);
  font-weight: 900;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mark-btn:not(:last-child) {
  border-right: 1px solid var(--border-color);
}

.mark-btn:hover {
  background-color: var(--bg-card-subtle);
}

.mark-btn.active.P { background-color: #10b981; color: white; }
.mark-btn.active.F { background-color: #ef4444; color: white; }
.mark-btn.active.R { background-color: #f59e0b; color: white; }
.mark-btn.active.J { background-color: #0284c7; color: white; }

/* Croquis / Mapa de Asientos (RF-M4-002) */
.classroom-map-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 1.5rem;
  background-color: var(--bg-card-subtle);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-color);
}

.desk-seat {
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.desk-seat:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
}

.desk-seat.presente   { border-color: #10b981; background-color: rgba(16, 185, 129, 0.08); }
.desk-seat.falta      { border-color: #ef4444; background-color: rgba(239, 68, 68, 0.08); }
.desk-seat.retardo    { border-color: #f59e0b; background-color: rgba(245, 158, 11, 0.08); }
.desk-seat.justificado{ border-color: #0284c7; background-color: rgba(2, 132, 199, 0.08); }

.desk-name {
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
}

.desk-status-pill {
  font-size: 0.68rem;
  font-weight: 900;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
}

/* Evidencias Formativas (RF-M5-001) */
.rubros-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.rubro-column {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.rubro-title {
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-primary);
}

.rubro-total-badge {
  font-size: 0.85rem;
  font-weight: 900;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.evidencia-card-item {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Captura Grupal Matricial tipo Excel (RF-M5-003) */
.excel-matrix-table {
  width: 100%;
  border-collapse: collapse;
}

.excel-matrix-table th, .excel-matrix-table td {
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.6rem;
  font-size: 0.82rem;
}

.excel-input-cell {
  width: 100%;
  padding: 0.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.excel-input-cell:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: var(--bg-card);
  box-shadow: 0 0 0 2px var(--color-primary-light);
}

/* Muro de la Agenda / Post-its Pastel (RF-M10-001) */
.postit-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.postit-card {
  padding: 1.25rem;
  border-radius: 4px;
  box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.12);
  color: #1e293b;
  position: relative;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--font-sans);
}

.postit-card:hover {
  transform: rotate(-1deg) scale(1.02);
  box-shadow: 4px 8px 16px rgba(0, 0, 0, 0.18);
}

.postit-pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #dc2626;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.6), 0 2px 4px rgba(0, 0, 0, 0.3);
}

.postit-title {
  font-size: 0.95rem;
  font-weight: 800;
  margin-top: 0.5rem;
}

.postit-text {
  font-size: 0.82rem;
  margin-top: 0.35rem;
  line-height: 1.4;
}

.postit-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.75;
}

/* Formato Oficial de Documentos / Reportes M8 */
.official-doc-replica {
  background-color: white;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: var(--shadow-xl);
  font-family: 'Times New Roman', Times, serif;
}

.doc-official-header {
  text-align: center;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.doc-official-header h2 {
  font-size: 1.1rem;
  font-weight: 900;
  color: #0f172a;
  text-transform: uppercase;
}

.doc-official-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
}

.doc-folio-stamp {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: #f1f5f9;
  border: 1px solid #94a3b8;
  font-family: monospace;
  font-weight: 800;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.doc-signatures-box {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
  margin-top: 3.5rem;
  text-align: center;
}

.sig-line {
  border-top: 1px solid #0f172a;
  padding-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Lienzo de Firma en Pantalla (RF-M7-005) */
.signature-pad-canvas {
  width: 100%;
  height: 140px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-card-subtle);
  cursor: crosshair;
}

/* Modal y Popups */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal-dialog {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-dialog.lg {
  max-width: 900px;
}

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

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.25s ease;
}
.toast.success { background-color: var(--color-success); }
.toast.error   { background-color: var(--color-danger); }
.toast.info    { background-color: var(--color-info); }

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* =============================================================
   MÓDULOS INTEGRADOS: CATÁLOGOS, CALENDARIO & EVIDENCIAS EXCEL
============================================================= */

/* Pestañas de Navegación de Catálogos y Evidencias */
.nav-tabs-wrapper {
  display: flex;
  overflow-x: auto;
  gap: 0.5rem;
  background-color: var(--bg-card);
  padding: 0.5rem 0.75rem 0 0.75rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: 2px solid var(--border-color);
}

.nav-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-tab-item:hover {
  color: var(--text-primary);
  background-color: var(--bg-card-subtle);
}

.nav-tab-item.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.badge-counter {
  font-size: 0.7rem;
  font-weight: 900;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-card-subtle);
  color: var(--text-secondary);
}

.nav-tab-item.active .badge-counter {
  background-color: var(--color-primary);
  color: white;
}

/* Modal Drag and Drop Excel */
.dropzone-box {
  border: 2px dashed var(--border-color);
  background-color: var(--bg-card-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone-box:hover, .dropzone-box.dragover {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
}

/* Calendario Escolar SEMS / DGETI */
.calendar-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
  background-color: var(--border-color);
  padding: 0.5rem;
  border-radius: var(--radius-lg);
}

.calendar-col-header {
  text-align: center;
  padding: 0.5rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--text-secondary);
  background-color: var(--bg-card);
  border-radius: var(--radius-sm);
}

.calendar-day-box {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  min-height: 110px;
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.calendar-day-box:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.calendar-day-box.empty {
  background-color: var(--bg-app);
  opacity: 0.4;
  pointer-events: none;
}

.calendar-day-box.today {
  border-color: var(--color-primary);
  background: linear-gradient(to bottom, var(--color-primary-light), var(--bg-card));
}

.calendar-day-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-day-digit {
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--text-primary);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
}

.calendar-day-box.today .calendar-day-digit {
  background-color: var(--color-primary);
  color: white;
}

.calendar-btn-add {
  opacity: 0;
  font-size: 0.75rem;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
}

.calendar-day-box:hover .calendar-btn-add {
  opacity: 1;
}

.cal-milestone-tag {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1.15;
  text-transform: uppercase;
}

.cal-milestone-OFICIAL     { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.cal-milestone-EVALUACION   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.cal-milestone-ACADEMIA     { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
.cal-milestone-ADMIN        { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.cal-milestone-SUSPENSION   { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }
.cal-milestone-TUTORIA      { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

.cal-milestone-clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.cal-milestone-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.12);
  filter: brightness(0.95);
}

.cal-sticker-item {
  border-radius: 6px;
  padding: 0.35rem 0.45rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-size: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  cursor: grab;
  border: 1px solid rgba(0,0,0,0.08);
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.cal-sticker-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cal-sticker-item:active {
  cursor: grabbing;
}

.cal-sticker-item.is-dragging-source {
  opacity: 0.3 !important;
  transform: scale(0.96) !important;
  border: 2px dashed #f59e0b !important;
}

.cal-sticker-title {
  font-weight: 800;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stk-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 17px;
  padding: 0 4px;
  font-size: 0.65rem;
  font-weight: 900;
  border-radius: 4px;
  background: #0f172a;
  color: #ffffff;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
  letter-spacing: -0.02em;
}

.cal-sticker-desc {
  font-size: 0.65rem;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Desglose Inferior de Avisos y Notas de Agenda */
.cal-desglose-section {
  margin-top: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

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

.cal-desglose-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.cal-desglose-table th {
  background: var(--bg-card-subtle);
  color: var(--text-secondary);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

.cal-desglose-row {
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s ease;
}

.cal-desglose-row:hover {
  background-color: var(--bg-card-subtle);
}

.cal-desglose-row td {
  padding: 0.75rem;
  vertical-align: top;
}

/* Post-it Drag & Drop Elements */
.cal-sticker-floating-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  box-shadow: 0 18px 36px rgba(0,0,0,0.22), 0 6px 12px rgba(0,0,0,0.14);
  transform: rotate(3deg) scale(1.05);
  border: 2px dashed #f59e0b;
  transition: transform 0.12s ease, border-color 0.12s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  will-change: transform, left, top;
}

.cal-sticker-floating-ghost.outside-calendar-frame {
  border-color: #ef4444 !important;
  background-color: #fee2e2 !important;
  transform: rotate(-4.5deg) scale(0.96) !important;
  box-shadow: 0 20px 38px rgba(239, 68, 68, 0.4) !important;
}

.cal-sticker-ghost-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-top: 0.3rem;
  background: rgba(0,0,0,0.06);
  color: #1e293b;
}

.outside-calendar-frame .cal-sticker-ghost-badge {
  background: #dc2626 !important;
  color: #ffffff !important;
}

/* Resaltado del día destino en el calendario */
.calendar-day-box.cal-drop-target {
  border: 2px dashed #f59e0b !important;
  background-color: #fffbeb !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.28), var(--shadow-md) !important;
  transform: scale(1.02);
  z-index: 5;
}

/* Marco del calendario con indicador activo durante el arrastre */
.calendar-days-grid.cal-drag-active {
  outline: 2px dashed #f59e0b;
  outline-offset: 4px;
  transition: outline-color 0.2s ease;
}

.calendar-days-grid.cal-drag-active.drag-is-outside {
  outline-color: #ef4444;
}

/* Captura Grupal Excel Grid */
.excel-grid-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background-color: var(--bg-card);
  box-shadow: var(--shadow-sm);
  max-height: 620px;
  position: relative;
}

.excel-grid-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
  min-width: 950px;
}

.excel-grid-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--bg-card-subtle);
  border-bottom: 2px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  padding: 0.55rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.excel-grid-table th.header-group-proc {
  background-color: #fef3c7 !important;
  color: #78350f !important;
  border-bottom: 2px solid #f59e0b;
}

.excel-grid-table th.header-group-conc {
  background-color: #e0f2fe !important;
  color: #0369a1 !important;
  border-bottom: 2px solid #0ea5e9;
}

.excel-grid-table th.header-group-act {
  background-color: #d1fae5 !important;
  color: #065f46 !important;
  border-bottom: 2px solid #10b981;
}

.excel-grid-table th.header-group-total {
  background-color: #ffe4e6 !important;
  color: #881337 !important;
  border-bottom: 2px solid #f43f5e;
}

.excel-grid-table td {
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  padding: 0.35rem 0.5rem;
  background-color: var(--bg-card);
}

.excel-grid-table tr:hover td {
  background-color: var(--bg-card-subtle);
}

/* Columnas Fijas (Sticky Left) en Matriz */
.sticky-col-num {
  position: sticky !important;
  left: 0 !important;
  z-index: 6 !important;
  background-color: var(--bg-card) !important;
  width: 48px;
  text-align: center;
}

.sticky-col-matricula {
  position: sticky !important;
  left: 48px !important;
  z-index: 6 !important;
  background-color: var(--bg-card) !important;
  width: 125px;
}

.sticky-col-nombre {
  position: sticky !important;
  left: 173px !important;
  z-index: 6 !important;
  background-color: var(--bg-card) !important;
  min-width: 220px;
  box-shadow: 4px 0 6px -2px rgba(0, 0, 0, 0.08);
}

.excel-grid-table th.sticky-col-num,
.excel-grid-table th.sticky-col-matricula,
.excel-grid-table th.sticky-col-nombre {
  z-index: 15 !important;
  background-color: var(--bg-card-subtle) !important;
}

.excel-cell-input {
  width: 100%;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  text-align: center;
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  outline: none;
  transition: all 0.15s ease;
}

.excel-cell-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-light);
  background-color: white;
}

.excel-cell-input:disabled {
  background-color: var(--bg-card-subtle);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.8;
}

.excel-cell-input.reprobado {
  background-color: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.excel-cell-input.aprobado {
  background-color: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}

.promedio-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-weight: 900;
  font-family: monospace;
  font-size: 0.85rem;
}

.promedio-badge.aprobado {
  background-color: var(--color-success-light);
  color: var(--color-success);
  border: 1px solid #a7f3d0;
}

.promedio-badge.reprobado {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
  border: 1px solid #fecaca;
}

/* Barra Slider y Navegación de Tabla */
.excel-slider-bar {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  color: #f8fafc;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid #334155;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.excel-jump-btn {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.excel-jump-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateY(-1px);
}

.excel-jump-btn:active {
  transform: scale(0.96);
}

/* Rúbrica Táctil Cards */
.rubrica-tactil-card {
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  background-color: var(--bg-card);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  text-align: center;
}

.rubrica-tactil-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.rubrica-tactil-card.active {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.feedback-chip {
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card-subtle);
  color: var(--text-secondary);
  transition: all 0.15s ease;
  user-select: none;
}

.feedback-chip:hover {
  background-color: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.feedback-chip.selected {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* Captura Individual Split View */
.individual-split-view {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .individual-split-view {
    grid-template-columns: 1fr;
  }
}

.student-list-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 600px;
  overflow-y: auto;
}

.student-item-card {
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background-color: var(--bg-card-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.student-item-card:hover {
  background-color: var(--border-color);
}

.student-item-card.active {
  background-color: var(--color-primary-light);
  border-color: var(--color-primary);
}

.doc-signatures-box-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
  text-align: center;
}

.talon-recortable {
  margin-top: 2.25rem;
  border-top: 1.5px dashed #64748b;
  padding-top: 1rem;
  font-size: 11px;
}

/* =============================================================
   ESTILOS DE IMPRESIÓN PROFESIONAL (PDF Y PAPEL TAMAÑO CARTA)
============================================================= */
@media print {
  @page {
    size: letter portrait;
    margin: 1.2cm 1.5cm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .app-sidebar, 
  .app-topbar, 
  .no-print, 
  button, 
  .btn, 
  .modal-header,
  .modal-footer {
    display: none !important;
  }

  .app-main {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Modo impresión directa desde modal de citatorio / reporte */
  body.printing-citatorio-modal {
    background: #ffffff !important;
  }

  body.printing-citatorio-modal .app-main > *:not(.modal-overlay) {
    display: none !important;
  }

  body.printing-citatorio-modal .modal-overlay {
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    display: block !important;
    z-index: auto !important;
    backdrop-filter: none !important;
  }

  body.printing-citatorio-modal .modal-dialog {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  body.printing-citatorio-modal .modal-body {
    padding: 0 !important;
    margin: 0 !important;
  }

  .official-doc-replica {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    max-width: 100% !important;
    width: 100% !important;
    background: #ffffff !important;
    color: #000000 !important;
    page-break-inside: avoid;
  }

  .talon-recortable {
    page-break-inside: avoid;
    margin-top: 2rem !important;
    border-top: 1.5px dashed #64748b !important;
    padding-top: 1rem !important;
  }

  /* =============================================================
     SOPORTE DE IMPRESIÓN HORIZONTAL PARA CALENDARIO & AVISOS
  ============================================================= */
  body.printing-calendar-landscape {
    background: #ffffff !important;
    color: #000000 !important;
  }

  body.printing-calendar-landscape .app-sidebar,
  body.printing-calendar-landscape .app-topbar,
  body.printing-calendar-landscape .cal-screen-header,
  body.printing-calendar-landscape #btn-nuevo-sticker,
  body.printing-calendar-landscape #btn-imprimir-calendario,
  body.printing-calendar-landscape #btn-mes-prev,
  body.printing-calendar-landscape #btn-mes-next,
  body.printing-calendar-landscape .btn-filter-cat,
  body.printing-calendar-landscape .calendar-btn-add,
  body.printing-calendar-landscape .btn-del-sticker,
  body.printing-calendar-landscape .stk-drag-handle {
    display: none !important;
  }

  body.printing-calendar-landscape .cal-print-official-header {
    display: block !important;
    margin-bottom: 0.5rem !important;
  }

  body.printing-calendar-landscape .app-main {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.printing-calendar-landscape .calendar-layout {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.printing-calendar-landscape .cal-month-bar-card {
    border: none !important;
    padding: 0 0 0.35rem 0 !important;
    box-shadow: none !important;
    margin-bottom: 0.35rem !important;
  }

  /* Cuadrícula de días en formato horizontal de alta densidad */
  body.printing-calendar-landscape .calendar-days-grid {
    background-color: transparent !important;
    gap: 0 !important;
    border: 1.5px solid #64748b !important;
    border-radius: 4px !important;
    padding: 0 !important;
    page-break-inside: avoid !important;
    margin-bottom: 0.65rem !important;
  }

  body.printing-calendar-landscape .calendar-col-header {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    font-size: 0.68rem !important;
    font-weight: 900 !important;
    padding: 0.25rem !important;
    border-radius: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-calendar-landscape .calendar-day-box {
    min-height: 64px !important;
    height: auto !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0 !important;
    padding: 0.2rem 0.25rem !important;
    background-color: #ffffff !important;
    page-break-inside: avoid !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-calendar-landscape .calendar-day-box.empty {
    background-color: #f8fafc !important;
    opacity: 1 !important;
  }

  body.printing-calendar-landscape .calendar-day-digit {
    font-size: 0.72rem !important;
    font-weight: 900 !important;
    width: 18px !important;
    height: 18px !important;
  }

  body.printing-calendar-landscape .calendar-day-box.today .calendar-day-digit {
    background-color: #0f172a !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Post-its / stickers en la cuadrícula impresa: compactos y con número visible */
  body.printing-calendar-landscape .cal-sticker-item {
    padding: 0.15rem 0.25rem !important;
    margin-bottom: 0.15rem !important;
    border: 1px solid rgba(0,0,0,0.2) !important;
    box-shadow: none !important;
    cursor: default !important;
    page-break-inside: avoid !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-calendar-landscape .cal-sticker-title {
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
  }

  body.printing-calendar-landscape .cal-sticker-desc {
    display: none !important;
  }

  body.printing-calendar-landscape .stk-num-badge {
    min-width: 16px !important;
    height: 14px !important;
    font-size: 0.6rem !important;
    padding: 0 3px !important;
    font-weight: 900 !important;
    background: #0f172a !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-calendar-landscape .cal-milestone-tag {
    font-size: 0.58rem !important;
    padding: 0.1rem 0.25rem !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Sección de Desglose de Avisos */
  body.printing-calendar-landscape .cal-desglose-section {
    box-shadow: none !important;
    border: 1.5px solid #64748b !important;
    border-radius: 4px !important;
    padding: 0.55rem 0.75rem !important;
    margin-top: 0.4rem !important;
    page-break-inside: auto !important;
    background: #ffffff !important;
  }

  body.printing-calendar-landscape .cal-desglose-table {
    font-size: 0.72rem !important;
  }

  body.printing-calendar-landscape .cal-desglose-table th {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    font-size: 0.65rem !important;
    padding: 0.3rem 0.4rem !important;
    border: 1px solid #cbd5e1 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-calendar-landscape .cal-desglose-table td {
    padding: 0.35rem 0.45rem !important;
    line-height: 1.35 !important;
    border: 1px solid #e2e8f0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-calendar-landscape .cal-desglose-row {
    page-break-inside: avoid !important;
  }
}

/* =============================================================
   MÓDULO DE CONFIGURACIÓN VISUAL, TEMAS PASTELES & TIPOGRAFÍA
============================================================= */
.theme-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.15rem;
}

.theme-card-option {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  background-color: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

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

.theme-card-option.active {
  border-color: var(--color-primary);
  background-color: var(--bg-card);
  box-shadow: 0 0 0 3px var(--color-primary-light), var(--shadow-sm);
}

.theme-card-option .active-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 900;
}

.theme-card-option.active .active-indicator {
  display: flex;
}

.theme-swatch-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.theme-swatch-circle {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.font-card-option {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  background-color: var(--bg-card);
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.font-card-option:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.font-card-option.active {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
  box-shadow: 0 0 0 2px var(--color-primary);
}

.size-pill-option {
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background-color: var(--bg-card);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.size-pill-option:hover {
  border-color: var(--color-primary);
}

.size-pill-option.active {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
  font-weight: 800;
}

.color-chip-option {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-color);
  background-color: var(--bg-card);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.18s ease;
}

.color-chip-option:hover {
  border-color: var(--color-primary);
}

.color-chip-option.active {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

/* =============================================================
   MENÚ FLOTANTE DE TEMAS (POPOVER EN EL ÍCONO DEL TOPBAR)
   ============================================================= */
.theme-dropdown-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.theme-popover-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px -6px rgba(0, 0, 0, 0.22), 0 8px 16px -4px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  animation: themePopoverFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes themePopoverFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.theme-popover-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.theme-popover-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.theme-popover-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.15rem;
}

.theme-popover-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.theme-item-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  background: var(--bg-card-subtle);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
}

.theme-item-btn:hover {
  border-color: var(--color-primary);
  background-color: var(--bg-card);
  transform: translateX(2px);
}

.theme-item-btn.active {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.theme-item-info {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
}

.theme-item-emoji {
  font-size: 1.2rem;
  line-height: 1;
}

.theme-item-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-item-tag {
  font-size: 0.67rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-item-palette {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.theme-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  display: inline-block;
}

.theme-active-check {
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--color-primary);
  margin-left: 0.35rem;
  flex-shrink: 0;
}

.theme-popover-footer {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
}

.theme-popover-footer a {
  color: var(--color-primary);
  font-weight: 800;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.theme-popover-footer a:hover {
  text-decoration: underline;
}

/* =============================================================
   INPUTS CON VISUALIZADOR DE CONTRASEÑA / PIN (OJITO)
============================================================= */
.password-toggle-wrapper,
.pin-toggle-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-toggle-wrapper input {
  width: 100%;
  padding-right: 2.75rem !important;
  box-sizing: border-box;
}

.pin-toggle-wrapper input {
  width: 100%;
  padding-left: 2.75rem !important;
  padding-right: 2.75rem !important;
  text-align: center;
  letter-spacing: 0.35em;
  font-weight: 900;
  box-sizing: border-box;
}

.btn-toggle-eye {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: all 0.18s ease;
  z-index: 3;
  user-select: none;
}

.btn-toggle-eye:hover {
  color: var(--color-primary);
  background-color: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .btn-toggle-eye:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

.btn-toggle-eye:active {
  transform: translateY(-50%) scale(0.92);
}

.btn-toggle-eye svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  pointer-events: none;
}

/* =============================================================
   SELECTOR GLOBAL DE ESCUELA / PLANTEL & TURNOS (MULTI-PLANTEL)
   ============================================================= */
.school-selector-wrapper {
  position: relative;
  display: inline-block;
  z-index: 50;
}

.school-selector-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.85rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  user-select: none;
  max-width: 320px;
}

.school-selector-btn:hover {
  border-color: var(--color-primary);
  background: var(--bg-card-subtle);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.school-selector-btn:active {
  transform: translateY(0) scale(0.98);
}

.school-selector-icon {
  font-size: 1.15rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.school-selector-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  line-height: 1.2;
}

.school-selector-label {
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.school-selector-turno {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 0.02em;
}

.school-selector-chevron {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  margin-left: 0.2rem;
}

.school-selector-wrapper.open .school-selector-chevron {
  transform: rotate(180deg);
}

/* Menú Desplegable Flotante de Escuelas */
.school-selector-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 330px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 1000;
  animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.school-dropdown-header {
  padding: 0.45rem 0.65rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.school-dropdown-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.25rem 0;
}

.school-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1.5px solid transparent;
  background: transparent;
  text-align: left;
  width: 100%;
}

.school-dropdown-item:hover {
  background: var(--bg-card-subtle);
  border-color: var(--border-color);
}

.school-dropdown-item.active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}

.school-item-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.school-item-name {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.school-dropdown-item.active .school-item-name {
  color: var(--color-primary);
}

.school-item-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Badges de Turno */
.badge-turno {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.badge-turno-matutino {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-turno-vespertino {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

.badge-turno-nocturno {
  background: #e2e8f0;
  color: #1e293b;
  border: 1px solid #cbd5e1;
}

.badge-turno-mixto {
  background: #ccfbf1;
  color: #0f766e;
  border: 1px solid #99f6e4;
}

.badge-turno-completo {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.school-dropdown-footer {
  padding-top: 0.4rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.school-dropdown-btn-action {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 800;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--color-primary);
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
}

.school-dropdown-btn-action:hover {
  background: var(--bg-card-subtle);
}

@media (max-width: 768px) {
  .school-selector-btn {
    max-width: 180px;
    padding: 0.25rem 0.6rem;
  }
  .school-selector-label {
    max-width: 100px;
    font-size: 0.76rem;
  }
  .school-selector-turno {
    font-size: 0.62rem;
  }
  .school-selector-dropdown {
    width: 290px;
  }
}

