/* ==============================
   Estilos Generales
============================== */
body {
    background-color: #f8f9fa;  /* Fondo gris claro */
    font-family: 'Arial', sans-serif;
}

h1, h2, h3 {
    font-weight: 600;
    color: #333;
}

.container {
    max-width: 1600px;
}

h1 {
    font-size: 2rem;
}

.card, form {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

form label, .form-label {
    font-weight: 500;
}

form input, form select, form button {
    border-radius: 10px;
    padding: 10px;
}

form .form-control, form .form-select {
    font-size: 1rem;
}

/* ==============================
   Botones Personalizados
============================== */
.btn {
    margin-right: 5px;
}

.btn-primary {
    background-color: #007bff;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #0069d9;
}

.btn-danger {
    background-color: #dc3545;
    border: none;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-warning {
    background-color: #ffc107;
    border: none;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-custom {
    background-color: #ffcccb;  /* Rosa claro */
    color: white;
    border-radius: 10px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    width: 100%; /* Asegura que ocupe todo el ancho en formularios */
    text-align: center;
    transition: background-color 0.3s ease;
}

.btn-custom:hover {
    background-color: #f7c8d7;  /* Rosa pastel */
}

.btn-custom:focus {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(255, 194, 193, 0.5);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
}

/* ==============================
   Estilos Específicos de Páginas
============================== */
.bg-rosa {
    background-color: #f7c8d7;  /* Rosa pastel */
}

/* Estilos de los formularios */
form {
    margin-top: 30px;
}

form button {
    margin-top: 10px;
    width: auto;
    padding: 0.5rem;
    float: right;
}

/* ==============================
   Alertas
============================== */
.alert-warning {
    font-size: 0.9rem;
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}


/* ==============================
   Toggle de Turnos en tabla de horarios
============================== */
.hidden {
    display: none;
}

.turno-mañana {
    background-color: #ffe6e6; /* Rosa muy claro */
}

.turno-tarde {
    background-color: #fff5cc; /* Amarillo claro */
}

.turno-vespertino {
    background-color: #e6f0ff; /* Azul claro */
}

.bg-rosa-modulos {
    background-color: #f7c8d7;  /* Rosa pastel para módulos */
    font-weight: bold;
}

.toggle-button {
    cursor: pointer;
    font-weight: bold;
    user-select: none;
}

.toggle-icon {
    display: inline-block;
    width: 1em;
    transition: transform 0.3s ease;
}

/* Botones de toggle para cada turno con el mismo color que la tabla */
.btn-turno-m {
    background-color: #f7c8d7; /* mismo rosa que .bg-rosa */
    color: #333;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    margin-right: 5px;
    cursor: pointer;
    font-weight: bold;
}

.btn-turno-t {
    background-color: #fff3cd; /* un amarillo pastel para diferenciar, puedes cambiar */
    color: #333;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    margin-right: 5px;
    cursor: pointer;
    font-weight: bold;
}

.btn-turno-v {
    background-color: #e6f0ff; /* azul pastel para vespertino */
    color: #333;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    margin-right: 5px;
    cursor: pointer;
    font-weight: bold;
}

/* Efecto hover */
.toggle-button:hover {
    opacity: 0.8;
}


/* ==============================
   CALIFICACIONES - Inputs y Tabla
============================== */

/* Tabla */
.calificaciones-page .tabla-calificaciones th,
.calificaciones-page .tabla-calificaciones td {
    text-align: center;
    vertical-align: middle;
    padding: 8px;
}

.calificaciones-page .table-bordered {
    border: 2px solid #ddd;
}

.calificaciones-page .thead-dark th {
    background-color: #343a40;
    color: #fff;
}

/* Inputs de notas */
.calificaciones-page .input-nota {
    color: #000 !important;             /* Texto negro */
    background-color: #fff !important;  /* Fondo blanco */
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    width: 70px;
    height: 36px;
    margin: 0 auto;
    transition: all 0.2s ease-in-out;
}

/* Quitar flechas del input number */
.calificaciones-page .input-nota::-webkit-outer-spin-button,
.calificaciones-page .input-nota::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.calificaciones-page .input-nota {
    -moz-appearance: textfield;
}

/* Cuando el input está vacío */
.calificaciones-page .input-nota:placeholder-shown {
    color: #777;
}

/* Cuando tiene valor (nota cargada) */
.calificaciones-page .input-nota[value]:not([value=""]) {
    background-color: #eafbea; /* Verde claro */
    border-color: #8bc34a;
}

/* Efecto al pasar o seleccionar */
.calificaciones-page .input-nota:hover,
.calificaciones-page .input-nota:focus {
    background-color: #fdfdfd;
    border-color: #007bff;
    box-shadow: 0 0 3px rgba(0, 123, 255, 0.3);
}

/* Paginación */
.calificaciones-page .pagination-container {
    margin-top: 20px;
}
.calificaciones-page .pagination-container a {
    margin-right: 10px;
}


/* ======= Editar Notificación Page ======= */
.editar-notificacion-page h2 {
    color: #343a40;
    font-weight: 600;
}

.editar-notificacion-page .form-editar-notificacion textarea {
    resize: vertical;
    min-height: 150px;
}

.editar-notificacion-page .btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.editar-notificacion-page .btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
}

.editar-notificacion-page .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

.editar-notificacion-page .btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* ======= Listar Notificaciones Page ======= */
.listar-notificaciones-page h2 {
    color: #343a40;
    font-weight: 600;
}

.listar-notificaciones-page .table {
    border: 2px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    background-color: #fff;
}

.listar-notificaciones-page .table th {
    background-color: #343a40;
    color: #fff;
    text-align: center;
}

.listar-notificaciones-page .table td {
    text-align: center;
    vertical-align: middle;
}

.listar-notificaciones-page .btn {
    transition: all 0.2s ease-in-out;
}

.listar-notificaciones-page .btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}

.listar-notificaciones-page .btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.listar-notificaciones-page .btn-info:hover {
    background-color: #0dcaf0;
    border-color: #0dcaf0;
}

.listar-notificaciones-page .btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.listar-notificaciones-page .btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
}

/* ======= Ver Notificación Page ======= */
.ver-notificacion-page h2 {
    font-weight: 600;
    color: #343a40;
}

.ver-notificacion-page .alert-info {
    border-left: 5px solid #0dcaf0;
    background-color: #e7f8fc;
    color: #0c5460;
}

.ver-notificacion-page .alert-info h5 {
    font-size: 1.25rem;
    color: #0d6efd;
}

.ver-notificacion-page .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    transition: all 0.2s ease-in-out;
}

.ver-notificacion-page .btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}


/* ==============================
   Estilos para Asistencias (historial)
============================== */
/* ======= Historial de Asistencia ======= */
.historial-asistencia-page .badge {
    font-size: 1.1em;
}

.historial-asistencia-page .table th,
.historial-asistencia-page .table td {
    text-align: center;
}

.historial-asistencia-page .pagination-container {
    margin-top: 20px;
    text-align: center;
}

.historial-asistencia-page .pagination-container a {
    margin: 0 5px;
}

.historial-asistencia-page .table-bordered {
    border: 2px solid #ddd;
}

.historial-asistencia-page .thead-dark th {
    background-color: #343a40;
    color: white;
}

.historial-asistencia-page .stats-container {
    margin-top: 20px;
    font-weight: bold;
}

.historial-asistencia-page .filter-form {
    margin-top: 20px;
}

/* === COLUMNA ESTUDIANTE STICKY === */

.sticky-col {
    position: sticky;
    left: 0;
    background-color: white !important;  /* Fondo totalmente blanco */
    z-index: 100;  /* Más alto para evitar superposiciones */
    box-shadow: 3px 0 6px rgba(0,0,0,0.15);  /* Separación visual */
}


.sticky-header {
    position: sticky;
    left: 0;
    background: #343a40 !important;
    z-index: 60;
}

/* ==============================
   Estilos para Calificaciones
============================== */

/* ====== Inputs sin Bootstrap (nota-input) ====== */
.calificaciones-page .nota-input,
.calificaciones-page input.nota-input {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;

    display: inline-block;
    width: 70px;
    height: 36px;
    padding: 6px 8px;
    box-sizing: border-box;

    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    color: #000 !important;
    background-color: #fff !important;

    border: 1px solid #cfcfcf;
    border-radius: 6px;

    outline: none;
    transition: all 0.15s ease;
    z-index: 3;
}

/* Quita flechas */
.calificaciones-page .nota-input::-webkit-outer-spin-button,
.calificaciones-page .nota-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.calificaciones-page .nota-input[type=number] {
    -moz-appearance: textfield;
}

/* Valor ingresado */
.calificaciones-page .nota-input[value]:not([value=""]) {
    background-color: #eafbea !important;
    border-color: #8bc34a !important;
}

/* Focus */
.calificaciones-page .nota-input:focus {
    box-shadow: 0 0 4px rgba(0,123,255,0.18);
    border-color: #007bff;
}

.calificaciones-page td {
    overflow: visible !important;
}

/* =======================
   Scroll calificaciones  
======================= */

.tabla-contenedor {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    position: relative;

    background: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    padding-bottom: 2px;
}

/* Tabla ancha para scroll */
.tabla-calificaciones {
    width: max-content;
    border-collapse: separate;
}

/* ==========================
   Sticky SOLO columna Estudiante
========================== */

.sticky-col-calif {
    position: sticky;
    left: 0;                /* SE PEGA AL BORDE IZQUIERDO */
    background: #fff !important;
    z-index: 40;
    box-shadow: 3px 0 4px rgba(0,0,0,0.2);
    font-weight: bold;
}

.sticky-header-calif {
    position: sticky;
    left: 0;
    background: #343a40 !important;
    color: #fff;
    z-index: 50;
    box-shadow: 3px 0 4px rgba(0,0,0,0.2);
}

/* Asegura el borde derecho de la columna sticky */
.sticky-col-calif,
.sticky-header-calif {
    border-right: 2px solid #ddd !important;
}

/* calificaciones cuatrimestrales */

.calificaciones-container {
  padding: 0;
  margin: 0;

}

.tabla-calificaciones {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.tabla-calificaciones th,
.tabla-calificaciones td {
  border: 1px solid #ccc;
  padding: 10px 12px;
  text-align: center;
  font-size: 12px;
}

.tabla-calificaciones th {
  background-color: #f0f0f0;
  font-size: 14px;
  padding: 15px;
}

.promedio-col {
  background-color: #f7f7f7;
}

.nivel-desempeno-col {
  background-color: #e0f7fa;
}

.inasistencias-col {
  background-color: #fff9c4;
}

.table-container {
  padding: 0;
  margin: 0;
}

.input-note {
  width: 70px;
  text-align: center;
  font-size: 12px;
}

.input-note[type=number]::-webkit-inner-spin-button,
.input-note[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-note[type=number] {
    -moz-appearance: textfield;
}


select.form-control {
  font-size: 12px;
}

@media (max-width: 768px) {
  .tabla-calificaciones {
    font-size: 10px;
  }
}
.calificaciones-container form {
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

/* El recuadro cubre todo el ancho de la tabla */
.calificaciones-container .table-container {
  width: max-content; /* el contenedor se expande tanto como la tabla */
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

/* Contenedor que permite sticky */
.scroll-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

/* Asegura que exista scroll */
.tabla-calificaciones {
    min-width: 1400px;
}

/* Sticky columna estudiante */
.sticky-col-cuatrim {
    position: sticky;
    left: 0;
    background-color: white;
    z-index: 100;
    box-shadow: 3px 0 4px rgba(0,0,0,0.15);
}


/* ===========================
   Estilos para Ver_Asistencia para estudiantes
   =========================== */
.asistencia-table th,
.asistencia-table td {
    text-align: center;
    vertical-align: middle;
}

.asistencia-table {
    border: 2px solid #ddd;
}

.asistencia-table thead th {
    background-color: #343a40;
    color: white;
}

.asistencia-table .badge {
    font-size: 1.1em;
}



/* ==============================
   Estilos para Libro Tema
============================== */

/* Contenedor que permite scroll horizontal */

.tabla-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ANCHO FIJO */
.tabla-fija {
    width: 980px; /* Ajustar a un valor que sí funcione para columnas largas */
    border-collapse: collapse;
    table-layout: fixed;
}

/* Todas las celdas */
.tabla-fija th,
.tabla-fija td {
    padding: 8px;
    border: 1px solid #ccc;
    vertical-align: top;
    white-space: normal;
    word-break: break-word;
}

/* Anchos de columnas */
.col-fecha { width: 120px; }
.col-unidad { width: 80px; }
.col-numero { width: 80px; }

.col-contenido { width: 200px; }      
.col-actividades { width: 200px; }
.col-observaciones { width: 100px; }

.col-acciones { width: 300px; }

/* calendario */

