:root {
    --acad-navy: #0f2942;
    --acad-navy-2: #173d63;
    --acad-accent: #f59e0b;
    --acad-bg: #f1f5f9;
    --acad-border: #e2e8f0;
    --acad-text: #1e293b;
    --acad-muted: #64748b;
}

body {
    background-color: var(--acad-bg);
    color: var(--acad-text);
    font-family: 'Segoe UI', system-ui, -apple-system, Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.875rem;
}

/* Pantallas Auth (Login / Recuperar / Restablecer) */
body.auth-body {
    background: radial-gradient(circle at top right, #1e40af 0%, #0f2942 45%, #091929 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
}

.auth-wrapper {
    width: 100%;
    max-width: 900px;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.auth-brand-side {
    background: linear-gradient(155deg, #0f2942 0%, #173d63 60%, #1e40af 100%);
    color: #ffffff;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.auth-brand-side::after {
    content: "";
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.14);
    pointer-events: none;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 0.65rem;
}

.feature-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.12);
    color: #fbbf24;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-form-side {
    padding: 2.2rem;
    background: #ffffff;
}

.captcha-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-box img {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    background: #f8fafc;
}

.demo-btn {
    transition: all 0.15s ease;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.78rem;
}

.demo-btn:hover {
    background: #eef2ff;
    border-color: #93c5fd;
    transform: translateY(-1px);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
}

.auth-card-header {
    background: linear-gradient(135deg, #0f2942 0%, #173d63 100%);
    border-bottom: 3px solid #f59e0b;
}

/* Navbar institucional */
.navbar-acad {
    background: linear-gradient(135deg, var(--acad-navy) 0%, var(--acad-navy-2) 100%);
    border-bottom: 3px solid var(--acad-accent);
}

.navbar-acad .navbar-brand {
    font-weight: 800;
    letter-spacing: -0.01em;
}

.navbar-acad .nav-link {
    color: rgba(255, 255, 255, 0.85);
    border-radius: 0.5rem;
    padding: 0.42rem 0.75rem;
    margin: 0 2px;
    transition: all 0.18s ease;
    font-weight: 500;
}

.navbar-acad .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.12);
}

.navbar-acad .nav-link.active {
    color: #fff !important;
    background-color: rgba(245, 158, 11, 0.22);
    border: 1px solid rgba(245, 158, 11, 0.45);
}

/* Barra de migas de pan */
.breadcrumb-bar {
    background: #ffffff;
    border-bottom: 1px solid var(--acad-border);
    padding: 0.65rem 1.5rem;
    font-size: 0.82rem;
    color: var(--acad-muted);
}

/* Tarjetas Bootstrap mejoradas */
.card-panel {
    background: #ffffff;
    border: 1px solid var(--acad-border);
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.65rem rgba(15, 41, 66, 0.05);
}

.panel-header-gray {
    background: linear-gradient(to bottom, #f8fafc 0%, #eef2f6 100%);
    color: var(--acad-navy);
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
}

/* Hero y tarjetas del dashboard */
.hero-banner {
    background: linear-gradient(135deg, var(--acad-navy) 0%, #1d4ed8 100%);
    color: #ffffff;
    border-radius: 0.9rem;
    box-shadow: 0 0.5rem 1.5rem rgba(15, 41, 66, 0.16);
    position: relative;
    overflow: hidden;
}

.hero-banner::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    pointer-events: none;
}

.module-card {
    background: #fff;
    border: 1px solid var(--acad-border);
    border-radius: 0.85rem;
    box-shadow: 0 0.15rem 0.65rem rgba(15, 41, 66, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.75rem 1.5rem rgba(15, 41, 66, 0.1);
    border-color: #cbd5e1;
}

.icon-box {
    width: 44px;
    height: 44px;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.76rem;
    flex-shrink: 0;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--acad-border);
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.5rem rgba(15, 41, 66, 0.04);
}

/* Tablas académicas */
.table-acad,
.table-notas {
    border-color: var(--acad-border);
}

.table-acad thead th,
.table-notas thead th {
    background: linear-gradient(to bottom, #f8fafc 0%, #edf2f7 100%);
    color: var(--acad-navy);
    font-weight: 700;
    vertical-align: middle;
    border-color: #cbd5e1;
    font-size: 0.79rem;
}

.table-acad tbody tr:hover:not(.fila-feriado):not(.fila-hoy) {
    background-color: #f8fafc;
}

/* Guía 14 & Guía 15: Feriados y Clase Hoy */
.fila-feriado,
.fila-feriado > td {
    background-color: #fde8ea !important;
    color: #991b1b;
}

.fila-hoy,
.fila-hoy > td {
    background-color: #fef9c3 !important;
}

.fila-hoy > td:first-child {
    border-left: 4px solid var(--acad-accent);
}

/* Botones de acción en tablas */
.btn-icono {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    padding: 0.28rem 0.55rem;
    border-radius: 0.4rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-icono:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

/* Guía 15: Leyenda */
.leyenda-box {
    display: inline-block;
    border: 1px solid var(--acad-border);
    background: #ffffff;
    padding: 0.5rem 1.15rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

/* Guía 16: Botón terracota cerrar aporte y toast superior derecho */
.btn-cerrar-aporte {
    background-color: #d6766d;
    border: 1px solid #c46158;
    color: #fff;
    font-size: 0.77rem;
    border-radius: 0.4rem;
    transition: 0.15s;
}

.btn-cerrar-aporte:hover:not(:disabled) {
    background-color: #c25b52;
    color: #fff;
}

.btn-cerrar-aporte:disabled {
    background-color: #9e6b66;
    border-color: #8b5b56;
    color: #fff;
}

.btn-xs {
    padding: 0.2rem 0.52rem;
    font-size: 0.74rem;
    line-height: 1.3;
    border-radius: 0.35rem;
}

.toast-alerta {
    position: fixed;
    top: 74px;
    right: 20px;
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    padding: 0.75rem 1.15rem;
    border-radius: 0.55rem;
    font-weight: 600;
    font-size: 0.83rem;
    z-index: 1060;
    max-width: 440px;
    box-shadow: 0 0.5rem 1.25rem rgba(153, 27, 27, 0.14);
}

/* Modales y formularios Bootstrap */
.modal-content {
    border: 0;
    border-radius: 0.85rem;
    overflow: hidden;
    box-shadow: 0 1.2rem 2.6rem rgba(15, 41, 66, 0.24);
}

.modal-header {
    background: linear-gradient(135deg, var(--acad-navy) 0%, var(--acad-navy-2) 100%) !important;
    color: #ffffff;
}

.modal-header .modal-title {
    color: #ffffff !important;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.card {
    border-color: var(--acad-border);
    border-radius: 0.75rem;
}

.card-header {
    border-top-left-radius: 0.75rem !important;
    border-top-right-radius: 0.75rem !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.16);
}

/* Footer */
.footer-acad {
    background: var(--acad-navy);
    color: rgba(255, 255, 255, 0.78);
    border-top: 2px solid rgba(245, 158, 11, 0.55);
}

/* Reporte imprimible (Guía 14) */
body.reporte-body {
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    font-size: 0.82rem;
    color: #1e293b;
    background: #fff;
}

.titulo-inst {
    color: #0f2942;
    font-weight: 800;
    line-height: 1.15;
    font-size: 1rem;
}

.logo-inst-box {
    width: 46px;
    height: 46px;
    background: #0f2942;
    color: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.table-rep th {
    background: #edf2f7;
    color: #0f2942;
    border: 1px solid #94a3b8;
    text-align: center;
    vertical-align: middle;
}

.table-rep td {
    border: 1px solid #cbd5e1;
    vertical-align: middle;
}

@media print {
    .no-print { display: none !important; }
    body.reporte-body { padding: 0 !important; }
}
