:root {
    --color-p: #d1e7dd; /* Verde Bootstrap */
    --color-a: #f8d7da; /* Rojo Bootstrap */
    --color-j: #fff3cd; /* Amarillo Bootstrap */
}

body {
    background-color: #f8f9fa;
    font-family: 'Inter', sans-serif;
}

.logo-img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

.title-container {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 30px;
}

/* Grilla de asistencia */
.attendance-table-container {
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 15px;
    margin-bottom: 30px;
}

.attendance-table {
    border-collapse: collapse;
    width: max-content;
    margin-bottom: 0;
}

.attendance-table th, .attendance-table td {
    border: 1px solid #dee2e6;
    text-align: center;
    vertical-align: middle;
}

/* Primera columna: Nombre Alumno */
.col-student {
    min-width: 250px;
    text-align: left !important;
    padding-left: 10px !important;
    background-color: #e9ecef;
    position: sticky;
    left: 0;
    z-index: 2;
}

/* Rotación de encabezados de fecha */
.th-date {
    height: 140px;
    width: 30px;
    min-width: 30px;
    position: relative;
    vertical-align: bottom;
    padding: 0;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.th-date span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    padding-top: 10px;
    padding-bottom: 10px;
}

.th-date:hover {
    background-color: #f1f3f5;
}

.comment-indicator {
    position: absolute;
    top: 5px;
    right: 5px; /* Relative to the vertical th */
    width: 6px;
    height: 6px;
    background-color: #dc3545;
    border-radius: 50%;
    z-index: 10;
}

/* Celdas de asistencia */
.cell-attendance {
    width: 30px;
    min-width: 30px;
    height: 30px;
    cursor: pointer;
    font-weight: bold;
    user-select: none;
}

.cell-attendance:hover {
    opacity: 0.8;
}

.state-P {
    background-color: var(--color-p) !important;
    color: #0f5132;
}

.state-A {
    background-color: var(--color-a) !important;
    color: #842029;
}

.state-J {
    background-color: var(--color-j) !important;
    color: #664d03;
}

/* Columnas de Totales */
.col-total {
    min-width: 40px;
    font-weight: bold;
    background-color: #f8f9fa;
}

.total-row {
    background-color: #e9ecef;
    font-weight: bold;
}

/* Impresión */
@media print {
    body {
        background-color: white;
    }
    .no-print {
        display: none !important;
    }
    .attendance-table-container {
        box-shadow: none;
        padding: 0;
    }
    .attendance-table th, .attendance-table td {
        border-color: #000;
    }
    .col-student {
        position: static;
    }
    /* Forzar colores en impresión */
    .state-P { background-color: var(--color-p) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .state-A { background-color: var(--color-a) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .state-J { background-color: var(--color-j) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
