/* Estilos globales para todo menos el login (el login se maneja en login.css) */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: radial-gradient(circle at 10% 20%, #c2d3fa 0, #c2d3fa 45%, #c2d3fa 100%);
    color: #3f4042ff;
}

/* Loader global */
#loader {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 10% 20%, rgba(27, 48, 94, 0.23), rgba(15,23,42,0.96));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#loader.loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-inner {
    text-align: center;
    color: #e5e7eb;
}

.loader-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid rgba(148,163,184,0.6);
    border-top-color: #38bdf8;
    border-right-color: #6366f1;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 10px;
}

.loader-inner p {
    font-size: 14px;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Topbar y layout principal */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(23, 37, 84, 0.92);
    backdrop-filter: blur(16px);
    color: #f9fafb;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.logo {
    font-weight: 700;
}

.topbar .user {
    font-size: 0.85rem;
    margin-right: 0.6rem;
}

.container {
    display: flex;
    min-height: calc(100vh - 56px - 40px);
    padding: 1.25rem;
    gap: 1rem;
}


/* Sidebar glass 
.sidebar {
    width: 240px;
    height: 100vh;
    overflow-y: auto; 
    overflow-x: hidden;
    background: #111827;
    padding-top: 20px;
    position: fixed;
    top: 60px; /* altura del topbar 
    left: 0;
    transition: transform 0.3s ease;
}*/


.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 0.5rem;
}

.sidebar a {
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.95rem;
    display: block;
    padding: 0.35rem 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s, transform 0.1s;
}

.sidebar a:hover {
    background: rgba(37, 99, 235, 0.15);
    transform: translateX(2px);
}

/*.content {
    flex: 1;
    padding: 0.5rem;
}

 Sidebar oculto 
.sidebar {
    transform: translateX(-250px);
}*/

/* Sidebar visible */
.sidebar-open {
    transform: translateX(0);
}

.content {
    margin-left: 260px;
    width: calc(100% - 260px);
    max-width: 100%;
    transition: margin-left .3s ease, width .3s ease;
}


.sidebar-open ~ .content {
    margin-left: 260px;
}
/* Cuando el sidebar está cerrado → el contenido ocupa toda la pantalla */
.sidebar.closed ~ .content {
    margin-left: 0 !important;
    width: 100% !important;
}



/* Tarjetas clásicas (para CRUD) */
.card {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    color: #111827;
}

.card + .card {
    margin-top: 1rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Botones y tablas */
.btn {
    display: inline-block;
    background: #2563eb;
    color: #ffffff;
    padding: 0.45rem 0.9rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #6b7280;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
}

.btn-danger {
    background: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th,
.table td {
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.table th {
    background: #f9fafb;
}

/* Formularios genéricos */
.form-group {
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
}

/* Alertas */
.alert {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.alert-danger {
    background: #fee2e2;
    color: #b91c1c;
}

/* Footer */
.footer {
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    background: transparent;
    color: #9ca3af;
}

/* Dashboard glassmorphism */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.dashboard-header h1 {
    font-size: 1.5rem;
    color: #0a214e;
}

.dashboard-header p {
    font-size: 0.9rem;
    color: #0a214e;
}

.dashboard-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chip {
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(15,23,42,0.8);
    border: 1px solid rgba(148, 163, 184, 0.7);
}

.chip-secondary {
    background: rgba(5, 40, 117, 0.788);
    border-color: rgba(59, 130, 246, 0.7);
}

/* Tarjetas glass para KPIs y gráficos */
.glass-card {
    background: rgba(2, 36, 117, 0.78);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.55);
    box-shadow: 0 20px 45px rgba(0,0,0,0.55);
    backdrop-filter: blur(18px);
}

.glass-cardalum {
    background: rgba(192, 231, 150, 0.78);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.55);
    box-shadow: 0 20px 45px rgba(0,0,0,0.55);
    backdrop-filter: blur(18px);
}

.glass-card-ultimos {
    background: rgba(205, 205, 250, 0.78);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.55);
    box-shadow: 0 20px 45px rgba(0,0,0,0.55);
    backdrop-filter: blur(18px);
}

.glass-card2 {
    background: rgba(1, 77, 35, 0.78);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.55);
    box-shadow: 0 20px 45px rgba(0,0,0,0.55);
    backdrop-filter: blur(18px);
}
.glass-card3 {
    background: rgba(119, 117, 2, 0.78);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.55);
    box-shadow: 0 20px 45px rgba(0,0,0,0.55);
    backdrop-filter: blur(18px);
}
.glass-card4 {
    background: rgba(114, 57, 3, 0.78);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.55);
    box-shadow: 0 20px 45px rgba(0,0,0,0.55);
    backdrop-filter: blur(18px);
}
.glass-card5 {
    background: rgba(215, 250, 205, 0.78);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.55);
    box-shadow: 0 20px 45px rgba(0,0,0,0.55);
    backdrop-filter: blur(18px);
}
.glass-card6 {
    background: rgba(198, 239, 252, 0.78);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.55);
    box-shadow: 0 20px 45px rgba(0,0,0,0.55);
    backdrop-filter: blur(18px);
}

/* KPIs */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

.kpi-card {
    position: relative;
    overflow: hidden;
}

.kpi-label {
    font-size: 0.8rem;
    color: #e8ebf0;
    margin-bottom: 0.35rem;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #e6e8ec;
}

.kpi-sub {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Tarjetas de gráfico */
.chart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 0.85rem;
}

.card-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.card-header-inline h2 {
    font-size: 1rem;
    color: #2c2c2e;
}

.card-subtitle {
    font-size: 0.8rem;
    color: #000026;
    margin-bottom: 0.5rem;
}

.tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.35);
    border: 1px solid rgba(59,130,246,0.7);
}

.tag-soft {
    background: rgba(148,163,184,0.35);
    border-color: rgba(59, 130, 246, 0.7);
}

/* Tabla del dashboard */
.table-dashboard {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    background: rgba(255, 255, 255,0.5);
}

.table-dashboard th {
    background: rgba(15,23,42,0.9);
    color: #e5e7eb;
    border-bottom-color: rgba(55,65,81,0.85);
}

.table-dashboard td {
    border-bottom-color: rgba(55,65,81,0.6);
    color: #070708;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.badge-success {
    background: rgba(22,163,74,0.25);
    color: #bbf7d0;
}

.badge-muted {
    background: rgba(148,163,184,0.35);
    color: #e5e7eb;
}

/* Responsive */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    .chart-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .sidebar {
        border-radius: 0.75rem;
        padding: 0.75rem;
    }
    .topbar {
        padding-inline: 1rem;
    }
}

/* PANEL ADMIN VISUAL */
.admin-panel {
    text-align: center;
    padding: 1rem;
}

.admin-title {
    font-size: 2rem;
    margin-bottom: 1.8rem;
    color: #3b82f6;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.4rem;
    padding: 0 2rem;
}

.admin-card {
    background: rgba(255,255,255,0.12);
    border-radius: 1rem;
    padding: 1.2rem;
    text-decoration: none;
    color: white;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.admin-card img {
    width: 90px;
    height: 90px;
    margin-bottom: 0.8rem;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
}

.admin-card p {
    font-size: 1rem;
    font-weight: 600;
}

/* Hover animado */
.admin-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 10px 28px rgba(0,0,0,0.45);
    background: rgba(255,255,255,0.20);
}

/* RESPONSIVE */
@media (max-width: 600px) {
    .admin-title {
        font-size: 1.6rem;
    }

    .admin-card img {
        width: 70px;
        height: 70px;
    }

    .admin-card {
        padding: 1rem;
    }
}

/* ACCIONES DE TABLA CON ICONOS */
.actions {
    display: flex;
    gap: 0.45rem;
}

.icon-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    background: rgba(255,255,255,0.08);
    transition: 0.2s ease;
    border: 1px solid rgba(255,255,255,0.15);
    cursor: pointer;
}

/* Hover general */
.icon-btn:hover {
    transform: scale(1.12);
    background: rgba(255,255,255,0.18);
}

/* EDITAR */
.edit-btn {
    color: #38bdf8; /* celeste */
}

/* ELIMINAR */
.delete-btn {
    color: #f87171; /* rojo suave */
}

.delete-btn:hover {
    background: rgba(248,113,113,0.25);
}

/* BOTÓN HAMBURGUESA SIEMPRE VISIBLE */
.hamburger {
    position: fixed;
    top: 12px;
    left: 12px;
    font-size: 26px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    z-index: 1200;
    backdrop-filter: blur(8px);
    color: white;
    transition: 0.2s ease;
}

.hamburger:hover {
    transform: scale(1.1);
}

/* SIDEBAR para pantallas grandes y pequeñas 
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 240px;
    z-index: 1100;
    background: rgba(23, 37, 84, 0.95);
    backdrop-filter: blur(8px);
    padding-top: 70px;
    transition: transform 0.3s ease;
}*/

/* Oculto por defecto */
.sidebar.closed {
    transform: translateX(-260px);
}

/* HAMBURGUESA ANIMADA */
.hamburger {
    position: fixed;
    top: 14px;
    left: 14px;
    width: 34px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 2000;
    background: none;
    border: none;
    padding: 0;
}

.hamburger span {
    display: block;
    height: 4px;
    width: 100%;
    background: white;
    border-radius: 6px;
    transition: 0.35s ease;
}

/* ESTADO CERRADO → forma de X */
.hamburger.active span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

/* SIDEBAR */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto; 
    overflow-x: hidden;
    width: 260px;
    height: 100%;
    background: rgba(23,37,84,0.92);
    backdrop-filter: blur(8px);
    padding-top: 70px;
    transition: transform 0.3s ease-in-out;
    z-index: 1500;
}

/* Oculto */
.sidebar.closed {
    transform: translateX(-260px);
}

/* --- TABLAS RESPONSIVAS --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px; /* evita que la tabla se rompa en móviles */
}

.table th, .table td {
    padding: 10px 12px;
    white-space: nowrap; /* evita que el texto salte de línea */
}

/* Opcional pero recomendado: sombreado entre filas */
.table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.03);
}

/* Botones en tabla: centrarlos en móviles */
.table .actions {
    display: flex;
    gap: 6px;
}

.sidebar-title {
    margin-top: 20px;
    margin-bottom: 5px;
    padding-left: 18px;
    font-size: 13px;
    font-weight: bold;
    color: #9ea6c6;
    text-transform: uppercase;
}

.sidebar ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== MALLA CURRICULAR STYLE ===== */

.malla-container {
    padding: 25px;
    margin: 20px;
    border-radius: 14px;
}

.malla-title {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 15px;
}

.label-grade {
    font-size: 16px;
    font-weight: 500;
}

.select-grade {
    margin-top: 5px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #aaa;
    background: #fff;
    font-size: 15px;
}

.malla-divider {
    margin: 20px 0;
    opacity: 0.2;
}

.malla-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.add-btn {
    padding: 10px 18px;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    font-size: 14px;
}

.malla-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
}

/* TARJETA */
.malla-card {
    background: #0d1220;
    border-radius: 15px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: 0.2s ease;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.malla-card:hover {
    transform: translateY(-4px);
    background: #12182b;
}

.malla-icon {
    font-size: 28px;
}

.malla-course {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.malla-delete {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    transition: 0.2s;
}

.malla-delete:hover {
    transform: scale(1.2);
    color: #f87171;
}

/* ===== CREATE MALLA STYLE ===== */

.malla-create-card {
    max-width: 500px;
    margin: 40px auto;
    background: #0d1220;
    padding: 25px 28px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.malla-create-title {
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.malla-create-sub {
    color: #cbd5e1;
    margin-bottom: 20px;
}

.malla-label {
    display: block;
    font-size: 15px;
    margin-bottom: 5px;
    color: #d1d5db;
}

.malla-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #374151;
    background: #ffffff;
    font-size: 15px;
    color: #111827;
    transition: 0.2s;
}

.malla-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 4px rgba(37, 99, 235, 0.6);
    outline: none;
}

.malla-btns {
    margin-top: 25px;
    display: flex;
    gap: 12px;
}

.malla-btn-primary {
    padding: 10px 18px;
    background: #2563eb;
    color: #fff;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: 0.2s ease;
}

.malla-btn-primary:hover {
    background: #1d4ed8;
}

.malla-btn-secondary {
    padding: 10px 18px;
    background: #475569;
    color: #fff;
    border-radius: 10px;
    font-size: 15px;
    text-decoration: none;
    transition: 0.2s ease;
}

.malla-btn-secondary:hover {
    background: #374151;
}

.malla-container {
    padding: 25px;
}

.malla-title {
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 20px;
}

.label-grade {
    font-weight: bold;
}

.select-grade {
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #3b82f6;
    font-size: 16px;
    margin-top: 8px;
    margin-bottom: 20px;
}

.malla-divider {
    margin: 15px 0;
}

.malla-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.add-btn-floating {
    background: #2563eb;
    color: white;
    padding: 10px 15px;
    border-radius: 50px;
    font-size: 20px;
    text-decoration: none;
    transition: 0.3s;
}

.add-btn-floating:hover {
    background: #1e40af;
}

.malla-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.malla-card {
    background: white;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.10);
    text-align: center;
    border-left: 5px solid #3b82f6;
    transition: transform .2s, box-shadow .2s;
    position: relative;
}

.malla-card:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.malla-icon {
    font-size: 35px;
    margin-bottom: 10px;
}

.malla-course {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.malla-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
}

.malla-delete:hover {
    color: red;
}

.malla-empty {
    font-style: italic;
    color: gray;
    text-align: center;
    padding: 15px;
}

.malla-container {
    padding: 25px;
}

.malla-title {
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 20px;
    color: black;
}

.label-grade {
    font-weight: bold;
}

.select-grade {
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #3b82f6;
    font-size: 16px;
    margin-top: 8px;
    margin-bottom: 20px;
    background: #ffffff;
    color: black;
}

.select-grade option {
    background: #0f172a;
    color: #e5e7eb;
}

.malla-divider {
    margin: 15px 0;
    opacity: .3;
}

.malla-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.add-btn-floating {
    background: #2563eb;
    color: white;
    padding: 10px 15px;
    border-radius: 999px;
    font-size: 20px;
    text-decoration: none;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(37,99,235,0.5);
}

.add-btn-floating:hover {
    background: #1e40af;
    transform: translateY(-1px);
}

.malla-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}

.malla-card {
    position: relative;
    border-radius: 14px;
    padding: 18px 16px 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    text-align: left;
    border-left: 4px solid #3b82f6;
    transition: transform .18s, box-shadow .18s, background .18s, border-color .18s;
    background: radial-gradient(circle at top left, rgba(148,163,184,0.25), #020617);
}

.malla-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.55);
}

/* Colores por área */
.malla-card--mate {
    border-left-color: #22c55e;
}

.malla-card--comu {
    border-left-color: #f97316;
}

.malla-card--default {
    border-left-color: #3b82f6;
}

.malla-icon {
    font-size: 30px;
    margin-bottom: 8px;
}

.malla-course {
    font-size: 17px;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 6px;
}

.malla-subareas {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.malla-chip {
    font-size: 11px;
    background: rgba(15,23,42,0.9);
    color: #e5e7eb;
    border-radius: 999px;
    padding: 3px 8px;
    border: 1px solid rgba(148,163,184,0.6);
}

.malla-delete {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #f87171;
    transition: transform .2s, color .2s;
}

.malla-delete:hover {
    transform: scale(1.15);
    color: #ef4444;
}

.malla-empty {
    font-style: italic;
    color: #9ca3af;
    text-align: center;
    padding: 15px;
}

/* CONTENEDORES */
.docente-aula-container,
.docente-asignar-container {
    padding: 25px;
}

/* TÍTULOS */
.titulo-modulo {
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 15px;
}

.subtitulo {
    margin-top: 20px;
    margin-bottom: 12px;
    font-size: 20px;
}

/* TARJETAS DE AULA */
.aula-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 15px;
}

.aula-card {
    padding: 18px;
    background: rgba(255,255,255,0.05);
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    transition: 0.25s;
}

.aula-card:hover {
    transform: translateY(-3px);
}

/* INFO AULA */
.aula-info h3 {
    font-size: 18px;
    margin: 0 0 8px 0;
}

.badge-turno, .badge-nivel {
    background: rgba(255,255,255,0.14);
    padding: 3px 8px;
    border-radius: 6px;
    margin-right: 6px;
    font-size: 12px;
}

.btn-asignar {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 14px;
    background: #2563eb;
    color: white;
    border-radius: 8px;
    text-decoration: none;
}

.btn-asignar:hover {
    background: #1d4ed8;
}

/* ------------------------
      TUTOR
------------------------- */
.bloque-tutor {
    padding: 15px;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    margin-bottom: 15px;
}

.select-docente {
    padding: 10px;
    border-radius: 8px;
    width: 100%;
    margin-bottom: 10px;
}

.btn-guardar-tutor,
.btn-guardar-docente {
    padding: 8px 12px;
    background: #16a34a;
    color: white;
    border: none;
    border-radius: 6px;
}

.btn-guardar-tutor:hover,
.btn-guardar-docente:hover {
    background: #15803d;
}

/* ------------------------
      CURSOS
------------------------- */
.curso-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
    gap: 15px;
}

.curso-card {
    padding: 18px;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.curso-nombre {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px;
}

.btn-eliminar {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    font-size: 20px;
    border: none;
    cursor: pointer;
}

.btn-eliminar:hover {
    color: #ef4444;
    transform: scale(1.15);
}

.btn-copiar {
    padding: 6px 12px;
    background: #0ea5e9;
    color: white;
    border-radius: 6px;
    margin-top: 8px;
}

.btn-copiar:hover {
    background: #0284c7;
}

.tutor-nombre {
    margin-top: 10px;
    font-size: 14px;
    color: #124b96;
}

.tutor-nombre strong {
    color: #124b96;
}

.sin-tutor {
    color: #f87171; /* rojo suave */
}

.resumen-cursos {
    color: #0c3c72;
    font-size: 14px;
    margin-top: 5px;
}

.filtro-nivel {
    margin-bottom: 20px;
}

.filtro-nivel select {
    padding: 8px;
    border-radius: 6px;
}

.horario-container {
    padding: 30px;
}

.horario-title {
    font-size: 26px;
    margin-bottom: 15px;
}

.filtro-docente select {
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.docente-label {
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: bold;
}

.horario-actions {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.horario-delete {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 12px;
    color: #fecaca;
}

.horario-item {
    position: relative;
}



/* ---- Estilos opcionales para mostrar el colapso ---- */
    .sidebar-title {
        margin-top: 15px;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-weight: bold;
    }

    .sidebar-title span.arrow {
        transition: transform .3s;
    }

    .collapsed .arrow {
        transform: rotate(-90deg);
    }

    .submenu {
        margin-left: 10px;
        overflow: hidden;
        transition: height .3s ease;
    }

/* Tarjetas glass para Periodo de evaluacion */
.glass-card-eval {
    background: rgba(215, 223, 241, 0.78);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.55);
    box-shadow: 0 20px 45px rgba(0,0,0,0.55);
    backdrop-filter: blur(18px);
}

.comunicado-wrapper {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.comunicado-card {
    background: #ffffff;
    width: 100%;
    max-width: 720px;
    padding: 30px;
    border-radius: 14px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

.comunicado-title {
    margin: 0;
    font-size: 1.5rem;
    color: #1e3a8a;
}

.comunicado-subtitle {
    margin-bottom: 25px;
    color: #64748b;
    font-size: 0.95rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* dos columnas iguales */
    gap: 0.75rem 1rem;
}


.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5f5;
    font-size: 0.95rem;
}

.form-group textarea {
    resize: vertical;
}

.form-group small {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #64748b;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 25px;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-primary:hover {
    background: #1e40af;
}


/* ===========================
   COMUNICADO - VISTA DETALLE
=========================== */

.comunicado-view {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    padding: 2rem;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

.comunicado-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comunicado-header h1 {
    margin: 0;
    font-size: 1.6rem;
    color: #1f2937;
}

.comunicado-header .meta {
    margin-top: .4rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.comunicado-autor {
    margin-bottom: 1.5rem;
    color: #4b5563;
    font-size: .95rem;
}

.comunicado-autor .rol {
    color: #6b7280;
    margin-left: .5rem;
}

.comunicado-body {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 2rem;
    white-space: normal;
}

/* ADJUNTOS */
.comunicado-adjuntos {
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
}

.comunicado-adjuntos ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comunicado-adjuntos li {
    margin-bottom: .5rem;
}

.comunicado-adjuntos a {
    text-decoration: none;
    color: #2563eb;
    font-weight: 500;
}

.comunicado-adjuntos a:hover {
    text-decoration: underline;
}

/* PRIORIDAD */
.badge.prioridad {
    padding: .3rem .7rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.prioridad.normal {
    background: #e5e7eb;
    color: #374151;
}

.badge.prioridad.alta {
    background: #fee2e2;
    color: #991b1b;
}

.badge.prioridad.urgente {
    background: #fecaca;
    color: #7f1d1d;
}

.comunicado-destino {
    margin-bottom: 1.5rem;
    background: #f9fafb;
    border-left: 4px solid #2563eb;
    padding: .8rem 1rem;
    border-radius: 8px;
}

.comunicado-destino ul {
    margin: .5rem 0 0;
    padding-left: 1.2rem;
}

.comunicado-destino li {
    margin-bottom: .3rem;
    font-size: .95rem;
    color: #374151;
}

.destino-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
    margin-top: .5rem;
}

.radio-item {
    display: block;
    margin-bottom: .5rem;
    font-weight: 500;
    cursor: pointer;
}

.destino-sub {
    margin-left: 1.5rem;
    margin-top: .5rem;
    padding-left: .5rem;
    border-left: 3px solid #2563eb;
}

.hidden {
    display: none;
}

.comunicado-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.btn-action {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-edit {
    background: #e0f2fe;
    color: #0369a1;
}

.btn-edit:hover {
    background: #bae6fd;
}

.btn-delete {
    background: #fee2e2;
    color: #b91c1c;
}

.btn-delete:hover {
    background: #fecaca;
}

.btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 10px 18px;
    margin-left: 10px;

    background: #f1f5f9;        /* gris claro */
    color: #334155;             /* texto oscuro */
    border-radius: 10px;

    font-weight: 600;
    text-decoration: none;

    transition: all 0.2s ease;
    border: 1px solid #cbd5e1;
}

.btn-cancel:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateY(-1px);
}

.nivel-box {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
    background: #f8fafc;
}

.nivel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 15px;
}

.aulas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    padding-left: 10px;
}

.aula-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.destino-sub.hidden {
    display: none;
}

.niveles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columnas */
    gap: 20px;
}

.nivel-column {
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
}

.nivel-title {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

.aula-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 14px;
}

.adjuntos-box {
    margin-top: 25px;
}

/* GRID DE ADJUNTOS */
.adjuntos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

/* TARJETA GENERAL */
.adjunto-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px;
    position: relative;
    height: auto;              /* 🔥 clave */
    max-height: 230px;         /* 🔥 reduce altura total */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.adjunto-card span {
    display: block;
    margin-top: 6px;
    font-weight: 500;
    text-align: center;
}

/* IMÁGENES */
.adjunto-card.image img {
    max-height: 130px;         /* 🔥 antes seguro era grande */
    width: 100%;
    object-fit: contain;
    border-radius: 6px;
}


/* PDF */
.adjunto-card.pdf iframe {
    width: 100%;
    height: 120px;             /* 🔥 CLAVE */
    border-radius: 6px;
}

.adjunto-card.file {
    text-align: center;
    padding: 20px;
}

.btn-delete-adjunto {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(220,38,38,.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: none;
}

.adjunto-card {
    position: relative;
    background: #f9fafb;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
}

.adjunto-card:hover .btn-delete-adjunto {
    display: block;
}

/* IMÁGENES MÁS PEQUEÑAS */
.adjunto-card img {
    width: 100%;
    max-height: 90px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 4px;
}

/* PDF MÁS COMPACTO */
.adjunto-card iframe {
    width: 100%;
    height: 90px;
    border-radius: 6px;
    margin-bottom: 4px;
}

/* NOMBRE DE ARCHIVO */
/* NOMBRE DE ARCHIVO */
.adjunto-card span,
.adjunto-card a {
    font-size: 12px;
    margin-top: 6px;
    text-align: center;
    word-break: break-word;
}

mark {
    background-color: #fde68a;
    padding: 0 2px;
    border-radius: 3px;
}

#cumple-banner {
    background: linear-gradient(90deg, #fbbf24, #f472b6);
    color: #1f2937;
    padding: 12px;
    text-align: center;
    font-weight: bold;
    border-radius: 6px;
    margin: 10px;
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.balloon {
    position: fixed;
    bottom: -100px;
    width: 30px;
    height: 40px;
    border-radius: 50%;
    opacity: 0.8;
    animation: floatUp linear infinite;
    z-index: 9999;
}

@keyframes floatUp {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-120vh);
    }
}

/* ====== ADMIN GENERAL ====== */

.page-header {
    margin-bottom: 20px;
}

.page-header h2 {
    margin: 0;
    font-size: 22px;
}

.page-header p {
    margin: 4px 0 0;
    color: #666;
    font-size: 14px;
}

/* ====== CARDS ====== */

.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* ====== FORM ====== */

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 13px;
    color: #444;
}

.form-group input {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    min-width: 200px;
}

.form-group input:focus {
    outline: none;
    border-color: #2c6bed;
}

/* ====== BUTTONS ====== */

.btn-primary {
    background: #2c6bed;
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary:hover {
    background: #1f55c8;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.btn-danger:hover {
    background: #c0392b;
}

/* ====== TABLE ====== */

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: #f5f7fa;
}

.table th,
.table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.table th {
    text-align: left;
    font-weight: 600;
}

.table tr:hover {
    background: #fafafa;
}

.center {
    text-align: center;
}

/* FILTROS */
.biblioteca-filtros {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

/* GRID */
.biblioteca-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

/* CARD */
.biblioteca-card {
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
    transition: transform .15s ease, box-shadow .15s ease;
}

.biblioteca-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0,0,0,.08);
}

/* TOP */
.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-icon {
    font-size: 28px;
}

.card-tipo {
    font-size: 12px;
    color: #6b7280;
}

/* BODY */
.card-body h4 {
    font-size: 15px;
    margin: 10px 0 6px;
}

.card-body p {
    font-size: 13px;
    color: #555;
    max-height: 45px;
    overflow: hidden;
}

/* META */
.card-meta {
    margin: 8px 0;
}

.badge {
    background: #2563eb;
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
}

.card-preview {
    width: 100%;
    height: 130px;          /* 🔥 ajusta si quieres */
    border-radius: 10px;
    margin-bottom: 8px;
}

.card-preview.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    font-size: 36px;
    color: #6b7280;
}

.card-preview iframe {
    width: 100%;
    height: 100%;
}


/* ACTIONS */
.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-open {
    background: #16a34a;
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
}

.btn-delete {
    color: #dc2626;
    font-size: 16px;
    text-decoration: none;
}

/* =========================
   RESPONSIVE BIBLIOTECA
========================= */

/* GRID BASE (ya existente, reforzado) */
.biblioteca-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

/* FILTROS */
.biblioteca-filtros {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

/* CARD */
.biblioteca-card {
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* PREVIEW */
.card-preview {
    width: 100%;
    height: 130px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: #f3f4f6;
}

/* =========================
   📱 MOBILE (≤ 640px)
========================= */
@media (max-width: 640px) {

    /* filtros en columna */
    .biblioteca-filtros {
        flex-direction: column;
        gap: 8px;
    }

    .biblioteca-filtros select {
        width: 100%;
        font-size: 16px; /* evita zoom iOS */
    }

    /* grid: 1 columna */
    .biblioteca-grid {
        grid-template-columns: 1fr;
    }

    /* cards más compactas */
    .biblioteca-card {
        padding: 12px;
    }

    .card-preview {
        height: 160px;
    }

    .card-body h4 {
        font-size: 16px;
    }

    .card-body p {
        font-size: 14px;
    }

    /* botones grandes para dedo */
    .card-actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn-open {
        width: 100%;
        text-align: center;
        padding: 10px;
        font-size: 15px;
    }
}

/* =========================
   📱 TABLET (641px – 1024px)
========================= */
@media (min-width: 641px) and (max-width: 1024px) {

    /* grid: 2 columnas */
    .biblioteca-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-preview {
        height: 150px;
    }
}

/* =========================
   🖥️ DESKTOP (≥ 1025px)
========================= */
@media (min-width: 1025px) {

    /* grid fluido */
    .biblioteca-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* =========================
   FUENTE BIBLIOTECA
========================= */
.biblioteca-form,
.biblioteca-form h2,
.biblioteca-form input,
.biblioteca-form textarea,
.biblioteca-form select,
.biblioteca-form button {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* TÍTULO */
.biblioteca-form h2 {
    font-weight: 600;
    font-size: 22px;
    margin-bottom: 16px;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* INPUTS */
.biblioteca-form .form-control {
    font-size: 14.5px;
    border-radius: 10px;
    padding: 10px 12px;
}

/* PLACEHOLDER */
.biblioteca-form ::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* BOTÓN */
.biblioteca-form button {
    font-weight: 600;
    border-radius: 10px;
    padding: 10px 16px;
}

/* =========================
   CONTENEDOR
========================= */
.biblioteca-form {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 20px;
}

/* =========================
   TÍTULO
========================= */
.biblioteca-form h2 {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 600;
    font-size: 22px;
    margin-bottom: 18px;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =========================
   CARD DEL FORM
========================= */
.biblioteca-card-form {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid #e5e7eb;
}

/* =========================
   GRID DEL FORM
========================= */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

/* textarea ocupa todo el ancho */
.form-grid textarea {
    grid-column: span 2;
    min-height: 90px;
}

/* input file ocupa todo el ancho */
.file-input {
    grid-column: span 2;
}

/* =========================
   CONTROLES
========================= */
.biblioteca-card-form .form-control {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14.5px;
    border-radius: 10px;
    padding: 10px 12px;
}

/* =========================
   ACCIONES
========================= */
.form-actions {
    margin-top: 20px;
    text-align: right;
}

.form-actions .btn {
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 10px;
}

/* =========================
   📱 RESPONSIVE
========================= */
@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid textarea,
    .file-input {
        grid-column: span 1;
    }

    .form-actions {
        text-align: center;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* ===============================
   AULA VIRTUAL
================================ */
.aula-virtual {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.av-title {
    text-align: center;
    font-size: 34px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 20px;
}

/* ===============================
   FILTRO
================================ */
.av-filter-card {
    background: #0b74ff;
    color: #fff;
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.av-filter-card h3 {
    margin-bottom: 12px;
    font-size: 18px;
}

.av-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
}

.av-filter-grid .form-control {
    border-radius: 8px;
}

/* ===============================
   TABS
================================ */
.av-tab {
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    background: #e5e7eb;
    color: #374151;
    font-weight: 600;
    transition: 0.2s;
}

.av-tab:hover {
    background: #d1d5db;
}

.av-tab.active {
    background: #1e3a8a;
    color: #fff;
}

/*.av-tabs button {
    padding: 8px 14px;
    border-radius: 8px 8px 0 0;
    border: none;
    background: #e5e7eb;
    cursor: pointer;
}

.av-tabs a {
    padding: 8px 14px;
    border-radius: 8px 8px 0 0;
    border: none;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
}

.av-tabs button.active {
    background: #2563eb;
    color: #fff;
}*/

/* ===============================
   CONTENIDO
================================ */
.av-content {
    background: #fff;
    border-radius: 0 10px 10px 10px;
    padding: 20px;
}

.av-empty {
    text-align: center;
    color: #6b7280;
    font-size: 18px;
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 768px) {
    .av-filter-grid {
        grid-template-columns: 1fr;
    }

    .av-tabs {
        flex-direction: column;
    }
    


}

/* ===============================
   GRID
================================ */
.av-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

/* ===============================
   CARD
================================ */
.av-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

/* ===============================
   PREVIEW
================================ */
.av-card-preview {
    width: 100%;
    height: 150px;
    border: none;
    background: #f3f4f6;
}

.av-card-preview.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    background: #f1f5f9;
}

/* ===============================
   BODY
================================ */
.av-card-body {
    padding: 10px 12px;
}

.av-card-body h4 {
    font-size: 14.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.av-card-body small {
    color: #6b7280;
}

/* ===============================
   ACTIONS
================================ */
.av-card-actions {
    margin-top: auto;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-open {
    background: #2563eb;
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
}

.btn-open:hover {
    background: #1d4ed8;
}

/* ===============================
   ACCIONES SUPERIORES
================================ */
.av-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

/* ===============================
   BOTÓN NUEVO MATERIAL
================================ */
.btn-new-material {
    background: #22c55e;
    color: #fff;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-new-material:hover {
    background: #16a34a;
}

.av-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.btn-finalizar {
    background-color: #f59e0b; /* naranja */
    color: #fff;
    border: none;
}

.btn-finalizar:hover {
    background-color: #d97706;
    color: #fff;
}

/* ===== DESTINATARIOS AULA PRO ===== */

#aula-box{
    margin-top:15px;
    display:flex;
    flex-direction:column;
    gap:18px;
}

.nivel-card{
    border:1px solid #e0e0e0;
    border-radius:10px;
    padding:15px 18px;
    background:#fafafa;
}

.nivel-header{
    margin-bottom:10px;
    font-size:16px;
    color:#1a237e;
}

.aulas-grid{
    display:grid;
    grid-template-columns: repeat(auto-fill, minmax(150px,1fr));
    gap:8px 15px;
}

.aula-item{
    font-size:14px;
    display:flex;
    align-items:center;
    gap:6px;
}

/* ===============================
   COMUNICADO FULL WIDTH FIX
================================*/

.comunicado-full {
    width: 100%;
    padding: 30px 40px;
}

.comunicado-full .comunicado-card{
    max-width: 100% !important;
    width: 100% !important;
}

/* FORM DOS COLUMNAS REALES */
.comunicado-grid-2{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap:20px;
}

.comunicado-grid-1{
    grid-column: 1 / -1;
}

/* DESTINATARIOS PRO */
.destinatarios-pro{
    margin-top:15px;
    padding:15px;
    border-radius:12px;
    background:#f8fafc;
    border:1px solid #e2e8f0;
}

/* NIVEL CARD */
.nivel-pro{
    margin-bottom:18px;
    padding:14px 16px;
    border-radius:12px;
    background:#ffffff;
    border:1px solid #e5e7eb;
}

/* GRID DE AULAS PERFECTO */
.aulas-pro{
    display:grid;
    grid-template-columns: repeat(auto-fill, minmax(180px,1fr));
    gap:10px 25px;
    margin-top:10px;
}

/* CHECK + TEXTO PEGADOS */
.aula-pro{
    display:flex;
    align-items:center;
    gap:8px;
    font-size:14px;
}

.hidden{
    display: none !important;
}

/* ===== FIX SOLO PARA COMUNICADOS ===== */

.aula-item{
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: auto !important;
    margin: 6px 0 !important;
}

.aula-item input{
    margin: 0 !important;
}

.nivel-header label{
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: auto !important;
}

.nivel-card{
    margin-bottom: 18px;
    padding: 14px 18px;
    border: 1px solid #e3e6f0;
    border-radius: 10px;
    background: #fff;
}

.aulas-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px 20px;
    margin-top: 10px;
}

/* =========================================
   FIX DEFINITIVO PARA COMUNICADOS (labels)
   ========================================= */

.comunicado-card label{
    display: inline-flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 8px !important;
    width: auto !important;
}

.comunicado-card .aula-item{
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.comunicado-card .nivel-header label{
    font-weight: 600;
}

.comunicado-card .aulas-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px 18px;
    margin-top: 10px;
}

/* =========================================
   FIX DEFINITIVO CHECKBOX COMUNICADOS
   ========================================= */

.comunicado-card input[type="checkbox"]{
    margin-left: 0 !important;
    margin-right: 6px !important;
    position: relative !important;
}

.comunicado-card label{
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    justify-content: flex-start !important;
}

/* ==========================================
   FIX AISLADO DESTINATARIOS COMUNICADO
   ========================================== */

.comunicado-fix label{
    display: inline-flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 6px !important;
}

.comunicado-fix .aulas-grid{
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px 40px !important;
}

.comunicado-fix .aula-item{
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.comunicado-fix .nivel-header label{
    font-weight: 600;
}

/* ==========================
   NOTIFICATION BELL
========================== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.noti-wrapper {
    position: relative;
    margin-right: 20px;
}

.badge1 {
    position: absolute;
    top: -6px;
    right: -8px;
    background: red;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 50%;
}

.dropdown-noti {
    position: absolute;
    top: 35px;   /* 👈 justo debajo */
    right: 0;    /* 👈 alineado a la derecha */
    width: 280px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    display: none;
    z-index: 9999;
    overflow: hidden;
}

.dropdown-noti a {
    display: block;
    padding: 12px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
}

.dropdown-noti a:hover {
    background: #f3f4f6;
}

.noti-unread {
    background: #fef3c7;
}

.dropdown-noti.show {
    display: block;
}

.noti-empty {
    padding: 15px;
    text-align: center;
    color: #6b7280;
}

.bell {
    cursor: pointer;
    font-size: 20px;
    position: relative;
}

.notification-bell {
    cursor: pointer;
    font-size: 20px;
    position: relative;
}

.notification-count {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 50%;
    display: none;
}

.notification-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 35px;
    width: 300px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    z-index: 999;
}

.notification-header {
    padding: 10px;
    font-weight: bold;
    border-bottom: 1px solid #eee;
}

.notification-body {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 10px;
    border-bottom: 1px solid #f1f1f1;
    font-size: 14px;
}

.notification-item:hover {
    background: #f5f5f5;
}

.notification-empty {
    padding: 15px;
    text-align: center;
    color: #64748b;
}

.notification-dropdown a {
    display: block;
    padding: 10px;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    transition: background .2s ease;
}

.notification-dropdown a:hover {
    background: #f1f5f9;
}

.noti-unread {
    background: #eef2ff;
    font-weight: 600;
}

.noti-read {
    opacity: .6;
}
