/* =========================================================
   Reporte de Asistencia de Club - CBTa256
   ========================================================= */

.cbta256-reporte-asistencia-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ── Mensajes de status ─────────────────────────────────── */
.reporte-status-message {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.97em;
    animation: slideDown 0.3s ease;
}
.reporte-msg-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.reporte-msg-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.reporte-msg-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ── Sin club ───────────────────────────────────────────── */
.sin-club-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 40px auto;
}
.sin-club-content { color: #7f8c8d; }
.sin-club-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    color: #95a5a6;
}
.sin-club-card h3 {
    color: #2c3e50;
    font-size: 1.4em;
    margin-bottom: 10px;
}

/* ── Selector de club ───────────────────────────────────── */
.selector-club-container {
    background: white;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.selector-club-container label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1em;
    white-space: nowrap;
}
.selector-icon { font-size: 1.2em; }
.selector-club-select {
    padding: 8px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
    color: #2c3e50;
    min-width: 200px;
    flex: 1;
    cursor: pointer;
    transition: border-color 0.25s;
}
.selector-club-select:focus {
    outline: none;
    border-color: #667eea;
}

/* ── Header total alumnos ───────────────────────────────── */
.club-totales-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 24px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 1.05em;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}
.club-totales-header strong {
    font-size: 1.3em;
    font-weight: 700;
}

/* ── Contenedor con scroll fijo ─────────────────────────── */
.tabla-reporte-wrapper {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.09);
    overflow: hidden;
    margin-bottom: 80px; /* espacio para el footer fijo */
}

.tabla-reporte-scroll {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 320px);
    min-height: 200px;
}

/* ── Tabla principal ────────────────────────────────────── */
.tabla-reporte-asistencia {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.93em;
}

/* Cabecera fija */
.tabla-reporte-asistencia thead {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: #34495e;
}
.tabla-reporte-asistencia thead th {
    background-color: #34495e;
    color: white;
    padding: 13px 12px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    border-right: 1px solid #455a6e;
}

/* Columna nombre — primera columna fija */
.col-fija {
    position: sticky;
    left: 0;
    z-index: 10;
}
.tabla-reporte-asistencia thead th.col-fija {
    z-index: 30; /* por encima del scroll y del sticky del thead */
    text-align: left;
    min-width: 200px;
}
.tabla-reporte-asistencia tbody td.col-fija {
    background: white;
    border-right: 2px solid #dee2e6;
    text-align: left;
    min-width: 200px;
    font-weight: 500;
    color: #2c3e50;
}

/* Columna resumen — segunda columna fija */
.col-fija-segunda {
    position: sticky;
    left: 200px; /* debe coincidir con min-width de col-fija */
    z-index: 10;
}
.tabla-reporte-asistencia thead th.col-fija-segunda {
    z-index: 30;
    min-width: 130px;
}
.tabla-reporte-asistencia tbody td.col-fija-segunda {
    background: white;
    border-right: 2px solid #dee2e6;
    min-width: 130px;
    text-align: center;
}

/* Filas */
.tabla-reporte-asistencia tbody tr {
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.15s;
}
.tabla-reporte-asistencia tbody tr:hover td {
    background-color: #f4f6ff;
}
.tabla-reporte-asistencia tbody tr:hover td.col-fija,
.tabla-reporte-asistencia tbody tr:hover td.col-fija-segunda {
    background-color: #f4f6ff;
}

.tabla-reporte-asistencia tbody td {
    padding: 11px 10px;
    vertical-align: middle;
}

/* Celdas de fecha */
.col-fecha-celda {
    text-align: center;
    min-width: 56px;
}

/* Sin registro */
.celda-sin-registro { background-color: #fafafa; }
.celda-vacia {
    color: #ccc;
    font-size: 1em;
    display: block;
}

/* ── Resumen de asistencia ──────────────────────────────── */
.resumen-num {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95em;
}
.resumen-pct {
    font-size: 0.88em;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-block;
    margin-left: 2px;
}

/* Porcentajes */
.pct-ok     { color: #27ae60; }
.pct-amarillo { color: #e67e22; }
.pct-rojo   { color: #e74c3c; }

/* Fondo de celda resumen según porcentaje */
td.pct-amarillo { background-color: #fff8e6 !important; }
td.pct-rojo     { background-color: #fff0f0 !important; }

/* ── Checkboxes personalizados ──────────────────────────── */
.chk-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    position: relative;
    width: 30px;
    height: 30px;
}

.chk-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.chk-mark {
    display: block;
    width: 26px;
    height: 26px;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    background: #f0f0f0;
    transition: background 0.2s, border-color 0.2s;
    position: relative;
}

/* Check marcado */
.chk-label input[type="checkbox"]:checked ~ .chk-mark {
    background: #2c5fdb;
    border-color: #2c5fdb;
}

/* Palomita */
.chk-mark::after {
    content: '';
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}
.chk-label input[type="checkbox"]:checked ~ .chk-mark::after {
    display: block;
}

/* Hover en checkboxes no marcados */
.chk-label:hover .chk-mark {
    border-color: #667eea;
}

/* ── Footer guardar (fijo) ──────────────────────────────── */
.reporte-footer-guardar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255,255,255,0.97);
    border-top: 2px solid #e0e0e0;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    z-index: 500;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}

.btn-guardar-reporte {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 11px 30px;
    border-radius: 7px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s, transform 0.15s;
}
.btn-guardar-reporte.btn-guardar-activo {
    background: #27ae60;
}
.btn-guardar-reporte.btn-guardar-activo:hover {
    background: #219a52;
    transform: translateY(-1px);
}

.btn-descargar-csv {
    background: #2980b9;
    color: white;
    border: none;
    padding: 11px 30px;
    border-radius: 7px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s, transform 0.15s;
}
.btn-descargar-csv:hover {
    background: #2471a3;
    transform: translateY(-1px);
}

.cambios-pendientes-label {
    font-size: 0.92em;
    color: #e67e22;
    font-weight: 500;
}

/* ── Sin datos ──────────────────────────────────────────── */
.reporte-no-data {
    text-align: center;
    color: #95a5a6;
    font-style: italic;
    padding: 40px !important;
}

/* ── Loader ─────────────────────────────────────────────── */
.reporte-loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.88);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.reporte-loader-overlay .loader-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 0.9s linear infinite;
}
.reporte-loader-overlay p {
    margin-top: 16px;
    color: #2c3e50;
    font-size: 1em;
}

/* ── Animaciones ────────────────────────────────────────── */
@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes slideDown {
    from { transform: translateY(-16px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .cbta256-reporte-asistencia-wrapper { padding: 10px; }

    .tabla-reporte-scroll {
        max-height: calc(100vh - 260px);
    }

    .selector-club-container {
        flex-direction: column;
        align-items: stretch;
    }
    .selector-club-select { min-width: 100%; }

    .tabla-reporte-asistencia thead th.col-fija,
    .tabla-reporte-asistencia tbody td.col-fija {
        min-width: 140px;
    }
    .col-fija-segunda {
        left: 140px;
    }
    .tabla-reporte-asistencia thead th.col-fija-segunda,
    .tabla-reporte-asistencia tbody td.col-fija-segunda {
        min-width: 110px;
    }

    .reporte-footer-guardar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 16px;
    }
    .btn-guardar-reporte { width: 100%; text-align: center; }
    .btn-descargar-csv   { width: 100%; text-align: center; }
}
