* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #e9f0f5; padding: 20px; color: #1e2a3e; }
.container { max-width: 1400px; margin: 0 auto; background: white; border-radius: 20px; box-shadow: 0 8px 20px rgba(0,0,0,0.1); overflow: hidden; }
header { background: linear-gradient(135deg, #1e3c72, #2a5298); color: white; padding: 20px 30px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
header h1 { font-size: 1.6rem; margin-bottom: 5px; }
header p { font-size: 0.9rem; opacity: 0.9; }
.user-info { background: rgba(255,255,255,0.2); padding: 8px 16px; border-radius: 40px; font-size: 0.9rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-info button { padding: 4px 12px; }
.tabs { display: flex; background: #f0f4f8; border-bottom: 1px solid #cbd5e1; flex-wrap: wrap; }
.tab-btn { background: transparent; border: none; padding: 12px 24px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: 0.2s; color: #2c3e66; }
.tab-btn.active { background: white; border-bottom: 3px solid #2a5298; color: #1e3c72; }
.tab-btn.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.tab-content { display: none; padding: 25px 30px; animation: fade 0.2s ease; }
.tab-content.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.login-container { max-width: 400px; margin: 100px auto; background: white; border-radius: 20px; padding: 30px; box-shadow: 0 8px 20px rgba(0,0,0,0.1); text-align: center; }
.login-container input { width: 100%; margin: 10px 0; padding: 12px; border-radius: 12px; border: 1px solid #ccc; }
.login-container button { width: 100%; padding: 12px; background: #2a5298; color: white; border: none; border-radius: 12px; font-weight: bold; cursor: pointer; }
.error-msg { color: red; margin-top: 10px; }
.config-group { margin-bottom: 30px; border: 1px solid #e2e8f0; border-radius: 16px; padding: 18px; background: #fefefe; }
.config-group h3 { font-size: 1.2rem; margin-bottom: 15px; color: #1e3c72; border-left: 4px solid #2a5298; padding-left: 12px; }
select, input, button, textarea { padding: 8px 12px; border-radius: 12px; border: 1px solid #ccc; font-size: 0.9rem; }
button { background: #2a5298; color: white; border: none; cursor: pointer; font-weight: bold; transition: 0.2s; }
button:hover { background: #1e3c72; }
.btn-secondary { background: #4b6e8a; }
.btn-danger { background: #dc3545; }
.btn-success { background: #28a745; }
.btn-comentario { background: #17a2b8; padding: 4px 8px; font-size: 0.8rem; }
.btn-comentario:disabled { background: #6c757d; opacity: 0.5; cursor: not-allowed; }
.periodo-panel { background: #f0f4f8; border-radius: 16px; padding: 15px; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.periodo-info { background: #f0f4f8; border-radius: 16px; padding: 15px; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.periodo-opcion { display: flex; align-items: center; gap: 8px; background: white; padding: 5px 12px; border-radius: 40px; border: 1px solid #cbd5e1; cursor: pointer; }
.periodo-opcion input { width: 18px; height: 18px; cursor: pointer; }
.periodo-opcion label { cursor: pointer; font-weight: normal; margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.8rem; overflow-x: auto; display: block; }
th, td { border: 1px solid #cbd5e1; padding: 8px 6px; text-align: center; vertical-align: middle; }
th { background: #eef2ff; font-weight: 600; }
input.calif { width: 55px; text-align: center; }
input:disabled, select:disabled { background-color: #e9ecef; color: #6c757d; cursor: not-allowed; }
.stats-box { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 30px; }
.stat-card { background: #f1f5f9; border-radius: 20px; padding: 15px 20px; flex: 1; min-width: 160px; text-align: center; }
.stat-number { font-size: 2rem; font-weight: 800; color: #1e3c72; }
.action-bar { margin-bottom: 20px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.inline-select { display: inline-flex; align-items: center; gap: 8px; background: #f8fafc; padding: 5px 12px; border-radius: 40px; }
.footer-notes { font-size: 0.75rem; color: #4b5563; margin-top: 25px; text-align: center; border-top: 1px solid #e2e8f0; padding-top: 16px; }
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: center; }
.modal-content { background: white; border-radius: 20px; padding: 25px; max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto; }
.modal-content h3 { margin-bottom: 15px; }
.modal-content label { display: block; margin-top: 10px; font-weight: 600; }
.modal-content input, .modal-content select, .modal-content textarea { width: 100%; margin-top: 4px; }
.modal-buttons { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }
.btn-guardar-flotante {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-guardar-flotante:hover { transform: scale(1.02); box-shadow: 0 6px 16px rgba(0,0,0,0.4); }
.btn-guardar-flotante.btn-sync-pendiente {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #000;
    animation: pulse 1.2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.9; transform: scale(1.02); } }
.sync-status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #2a5298;
    color: white;
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 0.75rem;
    z-index: 1000;
    cursor: pointer;
    transition: 0.2s;
}
.sync-status:hover { background: #1e3c72; transform: scale(1.02); }
.sync-status.warning { background: #ffc107; color: #000; }
.sync-status.error { background: #dc3545; }
.sync-status.success { background: #28a745; }
.modulos-bar {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    background: #f8fafc;
    padding: 10px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.menu-toggle {
    display: none;
    background: #2a5298;
    color: white;
    border: none;
    font-size: 1.8rem;
    padding: 0 12px;
    border-radius: 12px;
    cursor: pointer;
    line-height: 1;
}
.modulos-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.btn-modulo {
    background: #4b6e8a;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: 0.2s;
    white-space: nowrap;
}
.btn-modulo:hover { background: #2a5298; transform: translateY(-1px); }
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .modulos-buttons {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #1e2a3e;
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        z-index: 1000;
        border-radius: 0 0 20px 20px;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
        border-top: 1px solid #cbd5e1;
    }
    .modulos-buttons.open { display: flex; }
    .btn-modulo { white-space: normal; text-align: center; width: 100%; }
    .tabs button { padding: 8px 12px; font-size: 0.8rem; }
    th, td { font-size: 0.7rem; padding: 4px; }
    input.calif { width: 45px; }
    .user-info { font-size: 0.7rem; }
    .user-info button { padding: 2px 8px; font-size: 0.7rem; }
    .btn-comentario { padding: 2px 4px; font-size: 0.7rem; }
    .btn-guardar-flotante { padding: 10px 18px; font-size: 0.9rem; bottom: 15px; right: 15px; }
    .sync-status { bottom: 15px; left: 15px; }
}
.toast-notification {
    position: fixed;
    bottom: 80px;
    left: 20px;
    background: #1e3c72;
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.85rem;
    z-index: 1001;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
@keyframes slideIn { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.alumno-nuevo { background: #fff3cd !important; border-left: 4px solid #ffc107 !important; }
.badge-pendiente { display: inline-block; background: #ffc107; color: #000; font-size: 10px; padding: 2px 6px; border-radius: 20px; margin-left: 8px; }
.logs-table-container { overflow-x: auto; max-height: 500px; overflow-y: auto; }
.logs-table { width: 100%; font-size: 0.75rem; border-collapse: collapse; }
.logs-table th, .logs-table td { padding: 6px 4px; border: 1px solid #cbd5e1; }
.logs-table th { background: #eef2ff; position: sticky; top: 0; }
.filter-row input { width: 100%; padding: 4px 6px; font-size: 0.7rem; border-radius: 8px; border: 1px solid #ccc; background: white; }
.filter-row th { background: #f8fafc; padding: 4px; }
.filter-bar {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    background: #f8fafc;
    padding: 10px 15px;
    border-radius: 12px;
}
.filter-bar label { font-weight: 600; color: #1e3c72; }
.filter-bar select { padding: 6px 12px; border-radius: 20px; background: white; }
.total-alumnos { font-size: 0.85rem; color: #4b5563; margin-left: auto; }