﻿.historial-asistencia {
    --guinda: #790b26;
    --guinda-oscuro: #59081e;
    --texto: #173e6b;
    --texto-suave: #70839a;
    --borde: #eaded5;
    --crema: #fff8ef;
    --naranja: #ee8c0a;
    color: var(--texto);
}

/* Encabezado de la unidad */

.historial-curso {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 22px;
    margin-bottom: 25px;
    border: 1px solid #f5d7b1;
    border-radius: 14px;
    background: linear-gradient( 130deg, transparent 82%, rgba(235, 153, 42, 0.07) 82%, rgba(235, 153, 42, 0.07) 88%, transparent 88% ), linear-gradient(105deg, #fffaf3, #fcebd6);
}

.historial-curso-icono {
    flex: 0 0 82px;
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(145deg, #f5a11b, #d77900);
    box-shadow: 0 7px 18px rgba(210, 115, 0, 0.2);
    color: #fff;
    font-size: 31px;
}

.historial-etiqueta {
    display: block;
    margin-bottom: 7px;
    color: #d97700;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
}

.historial-curso-info h2 {
    margin: 0;
    color: #243149;
    font-size: 21px;
    font-weight: 800;
}

    .historial-curso-info h2 > span:first-child {
        color: var(--guinda);
    }

.historial-separador {
    margin: 0 5px;
    color: #c5a57c;
    font-weight: 400;
}

.historial-curso-info p {
    margin: 10px 0 0;
    color: #65778a;
    font-size: 14px;
}

    .historial-curso-info p i {
        margin-right: 5px;
    }

/* Título */

.historial-titulo-fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.historial-titulo {
    display: flex;
    align-items: center;
    gap: 13px;
}

.historial-titulo-icono {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #faedf0;
    color: var(--guinda);
    font-size: 23px;
}

.historial-titulo h3 {
    margin: 0 0 4px;
    color: var(--guinda-oscuro);
    font-size: 23px;
    font-weight: 800;
}

.historial-titulo p {
    margin: 0;
    color: #687f9a;
    font-size: 14px;
}

/* Botones */

.historial-btn-exportar,
.historial-btn-limpiar,
.historial-btn-ver,
.historial-btn-cerrar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.historial-btn-exportar {
    border: 1px solid #187b49;
    background: #16834b;
    color: #fff;
}

    .historial-btn-exportar:hover:not(:disabled) {
        background: #106a3c;
        transform: translateY(-1px);
    }

    .historial-btn-exportar i {
        font-size: 17px;
    }

.historial-btn-limpiar,
.historial-btn-cerrar {
    border: 1px solid #e6c9b7;
    background: #fff;
    color: var(--guinda);
}

    .historial-btn-limpiar:hover,
    .historial-btn-cerrar:hover {
        background: #fff4ed;
    }

.historial-btn-ver {
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid #ebd2d8;
    background: #fff;
    color: var(--guinda);
    font-size: 13px;
}

    .historial-btn-ver:hover:not(:disabled) {
        background: #faedf0;
    }

.historial-asistencia button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Resumen */

.historial-resumen {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.historial-resumen-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 86px;
    padding: 15px;
    border: 1px solid #eee4dc;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(78, 42, 36, 0.035);
}

.historial-resumen-icono {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    font-size: 19px;
}

.historial-resumen-card div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

    .historial-resumen-card div span {
        color: #75849a;
        font-size: 13px;
    }

.historial-resumen-card strong {
    color: #25344e;
    font-size: 23px;
    line-height: 1;
}

.color-guinda {
    background: #fae9ed;
    color: #930e32;
}

.color-verde {
    background: #e0f6e8;
    color: #15854c;
}

.color-naranja {
    background: #fff0d8;
    color: #db8100;
}

.color-gris {
    background: #eef1f5;
    color: #758499;
}

/* Filtros */

.historial-filtros {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 14px;
    padding: 18px;
    margin-bottom: 20px;
    border: 1px solid #eee2d8;
    border-radius: 12px;
    background: #fffcf9;
}

.historial-campo {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

    .historial-campo label {
        color: #4a6280;
        font-size: 13px;
        font-weight: 700;
    }

    .historial-campo input,
    .historial-campo select {
        width: 100%;
        height: 42px;
        padding: 0 11px;
        border: 1px solid #dce3eb;
        border-radius: 8px;
        outline: none;
        background: #fff;
        color: #244a75;
        font-size: 14px;
    }

        .historial-campo input:focus,
        .historial-campo select:focus {
            border-color: #b95769;
            box-shadow: 0 0 0 3px rgba(121, 11, 38, 0.08);
        }

/* Mensajes */

.historial-alerta {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 13px 15px;
    margin-bottom: 16px;
    border-radius: 9px;
    font-size: 14px;
}

.historial-alerta-error {
    border: 1px solid #f0c4c9;
    background: #fff0f1;
    color: #a12131;
}

.historial-alerta-info {
    border: 1px solid #b9e6cb;
    background: #edf9f1;
    color: #177445;
}

.historial-estado {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 150px;
    padding: 25px;
    border: 1px solid #eee4dc;
    border-radius: 12px;
    background: #fff;
    color: #71849b;
    text-align: center;
}

    .historial-estado i {
        color: #a66c78;
        font-size: 25px;
    }

/* Tabla */

.historial-tabla-card {
    overflow: hidden;
    border: 1px solid #eadfd7;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(70, 36, 33, 0.04);
}

.historial-tabla-titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 18px;
}

    .historial-tabla-titulo h4 {
        margin: 0 0 5px;
        color: var(--guinda-oscuro);
        font-size: 24px;
        font-weight: 800;
    }

        .historial-tabla-titulo h4 i {
            margin-right: 6px;
            color: var(--guinda);
        }

    .historial-tabla-titulo p {
        margin: 0;
        color: #8190a1;
        font-size: 18px;
    }

.historial-total-badge {
    padding: 7px 11px;
    border-radius: 20px;
    background: #f9edf0;
    color: var(--guinda);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.historial-tabla-scroll {
    width: 100%;
    overflow-x: auto;
}

.historial-tabla {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    font-size: 18px;
}

    .historial-tabla thead {
        background: linear-gradient(90deg, #810c29, #65071f);
        color: #fff;
    }

    .historial-tabla th {
        padding: 14px 15px;
        font-size: 15px;
        font-weight: 700;
        text-align: left;
        white-space: nowrap;
    }

    .historial-tabla td {
        padding: 14px 15px;
        border-bottom: 1px solid #f0ebe7;
        color: #294d76;
        vertical-align: middle;
    }

    .historial-tabla tbody tr:nth-child(even) {
        background: #fffcfa;
    }

    .historial-tabla tbody tr:hover {
        background: #fff8f3;
    }

    .historial-tabla td strong,
    .historial-tabla td small {
        display: block;
    }

    .historial-tabla td small {
        margin-top: 4px;
        color: #8a99aa;
        font-size: 13px;
        text-transform: capitalize;
    }

.historial-actividad {
    min-width: 220px;
    max-width: 330px;
    line-height: 1.45;
}

.historial-horario {
    white-space: nowrap;
}

    .historial-horario i {
        margin-right: 5px;
        color: #bd8b42;
    }

/* Etiquetas */

.historial-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-laborable,
.badge-completa {
    background: #e1f6e9;
    color: #16864e;
}

.badge-feriado,
.badge-parcial {
    background: #fff1dc;
    color: #c77700;
}

.badge-pendiente {
    background: #eff2f5;
    color: #718092;
}

.badge-falta {
    background: #fde8e9;
    color: #c52d3c;
}

.badge-justificado {
    background: #e7f1ff;
    color: #2971bc;
}

/* Progreso */

.historial-progreso {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}

.historial-progreso-linea {
    width: 70px;
    height: 10px;
    overflow: hidden;
    border-radius: 20px;
    background: #f1e9e5;
}

    .historial-progreso-linea span {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, #e7a038, #16874c);
    }

.historial-progreso strong {
    font-size: 14px;
    white-space: nowrap;
}

.historial-sin-dato {
    color: #8996a3;
    font-size: 15px;
}

/* Paginación */

.historial-paginacion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 18px;
    color: #71839a;
    font-size: 14px;
}

.historial-paginas {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .historial-paginas button {
        width: 34px;
        height: 34px;
        border: 1px solid #eadfd7;
        border-radius: 7px;
        background: #fff;
        color: var(--guinda);
        cursor: pointer;
    }

        .historial-paginas button:disabled {
            opacity: 0.45;
            cursor: not-allowed;
        }

.historial-pagina-actual {
    padding: 8px 12px;
    border-radius: 7px;
    background: var(--guinda);
    color: #fff;
    font-weight: 700;
}

/* Modal */

.historial-modal-fondo {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(29, 20, 24, 0.62);
}

.historial-modal {
    width: min(960px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

.historial-modal-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 20px 22px;
    border-bottom: 1px solid #eee7e2;
}

.historial-modal-titulo {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .historial-modal-titulo > span {
        width: 45px;
        height: 45px;
        display: grid;
        place-items: center;
        border-radius: 11px;
        background: #fae9ed;
        color: #790b26;
        font-size: 20px;
    }

    .historial-modal-titulo h3 {
        margin: 0 0 4px;
        color: #59081e;
        font-size: 20px;
    }

    .historial-modal-titulo p {
        margin: 0;
        color: #7a8a9c;
        font-size: 13px;
    }

.historial-modal-cerrar {
    width: 35px;
    height: 35px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #a46672;
    font-size: 18px;
    cursor: pointer;
}

    .historial-modal-cerrar:hover {
        background: #faedf0;
    }

.historial-modal-cuerpo {
    overflow-y: auto;
    padding: 20px 22px;
}

.historial-detalle-sesion {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 15px;
    padding: 16px;
    margin-bottom: 18px;
    border: 1px solid #f1dfcc;
    border-radius: 10px;
    background: #fff9f1;
}

    .historial-detalle-sesion > div {
        display: flex;
        align-items: flex-start;
        gap: 10px;
    }

    .historial-detalle-sesion i {
        margin-top: 3px;
        color: #cd7c19;
        font-size: 17px;
    }

    .historial-detalle-sesion span {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .historial-detalle-sesion small {
        color: #8a99a7;
        font-size: 12px;
    }

    .historial-detalle-sesion strong {
        color: #284e79;
        font-size: 13px;
        line-height: 1.4;
    }

.historial-detalle-resumen {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.historial-chip {
    padding: 8px 11px;
    border-radius: 8px;
    font-size: 12px;
}

    .historial-chip strong {
        margin-left: 5px;
    }

.chip-presente {
    background: #e1f6e9;
    color: #16864e;
}

.chip-tardanza {
    background: #fff1dc;
    color: #c77700;
}

.chip-falta {
    background: #fde8e9;
    color: #c52d3c;
}

.chip-justificado {
    background: #e7f1ff;
    color: #2971bc;
}

.chip-pendiente {
    background: #eff2f5;
    color: #718092;
}

.historial-detalle-scroll {
    border: 1px solid #f0e8e3;
    border-radius: 9px;
}

.historial-tabla-detalle {
    min-width: 610px;
}

.historial-modal-pie {
    display: flex;
    justify-content: flex-end;
    padding: 15px 22px;
    border-top: 1px solid #eee7e2;
}

@media (max-width: 1000px) {
    .historial-filtros {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .historial-btn-limpiar {
        width: fit-content;
    }
}

@media (max-width: 700px) {
    .historial-resumen {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .historial-curso {
        align-items: flex-start;
        padding: 16px;
    }

    .historial-curso-icono {
        flex-basis: 58px;
        width: 58px;
        height: 58px;
        font-size: 23px;
    }

    .historial-curso-info h2 {
        font-size: 17px;
    }

    .historial-detalle-sesion {
        grid-template-columns: 1fr 1fr;
    }

    .historial-detalle-actividad {
        grid-column: 1 / -1;
    }
}

@media (max-width: 450px) {
    .historial-filtros {
        grid-template-columns: 1fr;
    }

    .historial-resumen {
        gap: 8px;
    }

    .historial-resumen-card {
        padding: 10px;
    }

    .historial-resumen-icono {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .historial-titulo h3 {
        font-size: 20px;
    }
}


.btn-volver-sesiones {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: #790b26;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

    .btn-volver-sesiones:hover {
        color: #a90c32;
        text-decoration: underline;
    }

    .btn-volver-sesiones:focus-visible {
        outline: 2px solid #790b26;
        outline-offset: 4px;
        border-radius: 3px;
    }