/* ============================================================
   ESEN Design System — capa de renovación visual
   Se carga DESPUÉS de style.css (Bootstrap 4 + tema sidebar).
   Tokens + tema claro/oscuro + overrides de componentes.
   ============================================================ */

/* ------------------------------------------------------------
   1. Tokens
   ------------------------------------------------------------ */
:root {
    /* Marca */
    --esen-primary: #3445b4;
    --esen-primary-hover: #2b3a9d;
    --esen-primary-active: #243287;
    --esen-primary-soft: #e9ecfb;
    --esen-primary-soft-ink: #2b3a9d;
    --esen-on-primary: #ffffff;

    /* Superficies */
    --esen-bg: #f4f5fa;
    --esen-surface: #ffffff;
    --esen-surface-2: #eef0f8;
    --esen-border: #e2e4f0;
    --esen-border-strong: #c9cde2;

    /* Texto */
    --esen-ink: #191c33;
    --esen-text: #2b2f4a;
    --esen-muted: #5d6280;

    /* Semánticos */
    --esen-success: #178a50;
    --esen-success-soft: #e3f5eb;
    --esen-success-ink: #116b3e;
    --esen-warning: #9a6a07;
    --esen-warning-soft: #fdf3dc;
    --esen-warning-ink: #7c5605;
    --esen-danger: #cf3434;
    --esen-danger-soft: #fdeaea;
    --esen-danger-ink: #a82626;
    --esen-info: #1670c2;
    --esen-info-soft: #e6f1fc;
    --esen-info-ink: #115a9c;

    /* Sidebar (marca comprometida) */
    --esen-sidebar-bg: #303fa9;
    --esen-sidebar-bg-deep: #28358f;
    --esen-sidebar-ink: #ffffff;
    --esen-sidebar-muted: rgba(232, 236, 255, 0.78);
    --esen-sidebar-line: rgba(255, 255, 255, 0.12);
    --esen-sidebar-hover: rgba(255, 255, 255, 0.09);
    --esen-sidebar-active: rgba(255, 255, 255, 0.16);
    --esen-sidebar-accent: #8fd8ff;

    /* Forma y elevación */
    --esen-radius-lg: 14px;
    --esen-radius: 10px;
    --esen-radius-sm: 8px;
    --esen-shadow-sm: 0 1px 2px rgba(22, 25, 58, 0.06);
    --esen-shadow: 0 1px 2px rgba(22, 25, 58, 0.05), 0 6px 20px rgba(22, 25, 58, 0.07);
    --esen-shadow-lg: 0 4px 12px rgba(22, 25, 58, 0.08), 0 16px 40px rgba(22, 25, 58, 0.12);

    /* Tipografía */
    --esen-font: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;

    /* Movimiento */
    --esen-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --esen-t-fast: 150ms;
    --esen-t: 220ms;

    /* z-index semántico */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-sidebar: 1030;
    --z-sidebar-toggle: 1040;
    --z-modal-backdrop: 1050;
    --z-modal: 1060;
    --z-toast: 1080;
}

html[data-theme='dark'] {
    --esen-primary: #5b6ce8;
    --esen-primary-hover: #6d7ff0;
    --esen-primary-active: #4c5dd6;
    --esen-primary-soft: rgba(109, 127, 240, 0.16);
    --esen-primary-soft-ink: #aab6fa;
    --esen-on-primary: #ffffff;

    --esen-bg: #0e1020;
    --esen-surface: #171a2e;
    --esen-surface-2: #1e2240;
    --esen-border: #272b4a;
    --esen-border-strong: #3a3f6b;

    --esen-ink: #eef0fc;
    --esen-text: #d6d9ee;
    --esen-muted: #9aa0c4;

    --esen-success: #37bd79;
    --esen-success-soft: rgba(55, 189, 121, 0.14);
    --esen-success-ink: #6fe0a8;
    --esen-warning: #e0a82e;
    --esen-warning-soft: rgba(224, 168, 46, 0.14);
    --esen-warning-ink: #f0c46a;
    --esen-danger: #ef6363;
    --esen-danger-soft: rgba(239, 99, 99, 0.14);
    --esen-danger-ink: #f79a9a;
    --esen-info: #4da3ed;
    --esen-info-soft: rgba(77, 163, 237, 0.14);
    --esen-info-ink: #8ec5f5;

    --esen-sidebar-bg: #131732;
    --esen-sidebar-bg-deep: #0f1228;
    --esen-sidebar-ink: #eef0fc;
    --esen-sidebar-muted: rgba(214, 217, 238, 0.72);
    --esen-sidebar-line: rgba(255, 255, 255, 0.08);
    --esen-sidebar-hover: rgba(255, 255, 255, 0.06);
    --esen-sidebar-active: rgba(109, 127, 240, 0.22);
    --esen-sidebar-accent: #7cc7ff;

    --esen-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --esen-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.35);
    --esen-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.5);
}

/* ------------------------------------------------------------
   2. Base
   ------------------------------------------------------------ */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--esen-font) !important;
    background-color: var(--esen-bg) !important;
    color: var(--esen-text) !important;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--esen-font);
    color: var(--esen-ink);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

p {
    color: var(--esen-text);
}

a {
    color: var(--esen-primary);
    transition: color var(--esen-t-fast) var(--esen-ease);
}

a:hover {
    color: var(--esen-primary-hover);
    text-decoration: none;
}

hr,
.featurette-divider {
    border-top: 1px solid var(--esen-border);
}

::selection {
    background: var(--esen-primary);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--esen-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.text-muted {
    color: var(--esen-muted) !important;
}

.text-success { color: var(--esen-success-ink) !important; }
.text-danger  { color: var(--esen-danger-ink) !important; }
.text-warning { color: var(--esen-warning-ink) !important; }
.text-info    { color: var(--esen-info-ink) !important; }
.text-primary { color: var(--esen-primary-soft-ink) !important; }

/* Sensación de click consistente en todo lo interactivo */
a,
button,
.btn,
[role='button'],
select.form-control,
input[type='checkbox'],
input[type='radio'],
summary {
    cursor: pointer;
}

a,
button {
    touch-action: manipulation;
}

.card a.btn:active,
.btn:active {
    transform: translateY(1px);
}

/* Clases utilitarias Bootstrap re-mapeadas a tokens (compatibilidad dark) */
.bg-light {
    background-color: var(--esen-surface-2) !important;
}

.bg-white {
    background-color: var(--esen-surface) !important;
}

.text-dark {
    color: var(--esen-ink) !important;
}

.list-group-item {
    background: var(--esen-surface);
    color: var(--esen-text);
    border-color: var(--esen-border);
}

.spinner-border,
.spinner-grow {
    vertical-align: -0.15em;
}

/* Scrollbar discreto */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--esen-border-strong) transparent;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-thumb {
    background: var(--esen-border-strong);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

/* ------------------------------------------------------------
   3. Shell: contenido y sidebar
   ------------------------------------------------------------ */
#content {
    background: var(--esen-bg);
    transition: background-color var(--esen-t) var(--esen-ease);
}

#content > * {
    max-width: 1080px;
}

/* Título de página */
#content > h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--esen-ink);
    margin-bottom: 1.5rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--esen-border);
}

/* --- Sidebar --- */
#sidebar {
    min-width: 272px;
    max-width: 272px;
    background: linear-gradient(180deg, var(--esen-sidebar-bg) 0%, var(--esen-sidebar-bg-deep) 100%);
    color: var(--esen-sidebar-ink);
    z-index: var(--z-sidebar);
}

#sidebar .p-4 {
    padding: 1.5rem 1.1rem !important;
}

/* Avatar del usuario */
#sidebar img.rounded {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 50% !important;
    border: 3px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    background: #fff;
}

/* Identidad del usuario (HeaderMenu) */
#sidebar .esen-user {
    text-align: center;
    margin: 0.9rem 0 1.4rem;
}

#sidebar .esen-user-name {
    display: block;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--esen-sidebar-ink);
    line-height: 1.35;
    margin: 0;
    letter-spacing: 0;
}

#sidebar .esen-user-carnet {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--esen-sidebar-accent);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    padding: 0.15rem 0.65rem;
    margin-top: 0.45rem;
}

#sidebar .esen-user-meta {
    display: block;
    font-size: 0.78rem;
    color: var(--esen-sidebar-muted);
    margin-top: 0.35rem;
}

/* Compatibilidad con el markup viejo de HeaderMenu (h1 .logo) */
#sidebar h1 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

#sidebar h1 .logo,
#sidebar h1 .logo span {
    color: var(--esen-sidebar-ink);
}

/* Navegación */
#sidebar ul.components {
    padding: 0;
    margin-bottom: 1.5rem !important;
}

#sidebar ul li {
    font-size: 0.92rem;
}

#sidebar ul li a {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    margin: 2px 0;
    border-bottom: none;
    border-radius: var(--esen-radius-sm);
    color: var(--esen-sidebar-muted);
    font-weight: 500;
    line-height: 1.3;
    transition: background-color var(--esen-t-fast) var(--esen-ease),
        color var(--esen-t-fast) var(--esen-ease);
}

#sidebar ul li a:hover {
    background: var(--esen-sidebar-hover);
    color: var(--esen-sidebar-ink);
}

#sidebar ul li a span.fa {
    width: 1.5rem;
    flex: 0 0 1.5rem;
    text-align: center;
    margin-right: 0.55rem !important;
    margin-left: 0 !important;
    color: var(--esen-sidebar-accent);
    font-size: 0.9rem;
}

#sidebar ul li.active > a {
    background: var(--esen-sidebar-active);
    color: var(--esen-sidebar-ink);
}

/* Cabeceras de grupo (CCESEN, Finanzas, Registro…) */
#sidebar ul li[class*='control-'] > a {
    margin-top: 0.8rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--esen-sidebar-ink);
}

#sidebar ul li[class*='control-'] > a span.fa {
    font-size: 0.72rem;
}

/* Sub-items indentados */
#sidebar ul li.registro a,
#sidebar ul li.finanzas a,
#sidebar ul li.ccesen a,
#sidebar ul li.direccionestudiantil a {
    padding-left: 1.1rem;
    font-size: 0.88rem;
}

/* Botón hamburguesa */
#sidebar .custom-menu {
    z-index: var(--z-sidebar-toggle);
}

#sidebar .custom-menu .btn,
#sidebar .custom-menu .btn.btn-primary {
    width: 44px;
    height: 44px;
    border-radius: 12px !important;
    background: var(--esen-primary) !important;
    border: none !important;
    box-shadow: var(--esen-shadow);
    color: #fff;
}

#sidebar .custom-menu .btn.btn-primary:after {
    display: none;
}

#sidebar .custom-menu .btn i {
    margin-right: 0;
    font-size: 16px;
}

#sidebar .custom-menu .btn.btn-primary:hover,
#sidebar .custom-menu .btn.btn-primary:focus {
    background: var(--esen-primary-hover) !important;
    border-color: transparent !important;
}

@media (max-width: 991.98px) {
    /* En móvil el botón flota siempre visible */
    #sidebar .custom-menu {
        position: fixed;
        top: 14px;
        left: 14px;
        right: auto;
        margin-right: 0;
    }

    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        overflow-y: auto;
        box-shadow: none;
    }

    #sidebar.active {
        box-shadow: var(--esen-shadow-lg);
    }

    /* Despeja el botón hamburguesa flotante (gana al pt-5 de Bootstrap) */
    #content,
    #content.pt-5 {
        padding-top: 4.75rem !important;
    }
}

/* --- Navegación por perfil (SideNav) --- */
.esen-nav {
    margin-bottom: 1.25rem;
}

/* Buscador del menú */
.esen-nav-search {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 0.9rem;
}

.esen-nav-search > .fa-search {
    position: absolute;
    left: 0.8rem;
    font-size: 0.78rem;
    color: var(--esen-sidebar-muted);
    pointer-events: none;
}

.esen-nav-search input {
    width: 100%;
    height: 38px;
    border-radius: var(--esen-radius);
    border: 1px solid var(--esen-sidebar-line);
    background: rgba(255, 255, 255, 0.08);
    color: var(--esen-sidebar-ink);
    font-family: var(--esen-font);
    font-size: 0.85rem;
    padding: 0 2.1rem 0 2.2rem;
    transition: background-color var(--esen-t-fast) var(--esen-ease),
        border-color var(--esen-t-fast) var(--esen-ease);
}

.esen-nav-search input::placeholder {
    color: var(--esen-sidebar-muted) !important;
}

.esen-nav-search input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.4);
}

.esen-nav-search input::-webkit-search-cancel-button {
    display: none;
}

.esen-nav-search button {
    position: absolute;
    right: 0.35rem;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--esen-sidebar-muted);
    cursor: pointer;
    font-size: 0.78rem;
}

.esen-nav-search button:hover {
    color: var(--esen-sidebar-ink);
    background: rgba(255, 255, 255, 0.1);
}

/* Listas e items */
.esen-nav-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.35rem;
}

.esen-nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    margin: 1px 0;
    border-radius: var(--esen-radius-sm);
    color: var(--esen-sidebar-muted);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.3;
    transition: background-color var(--esen-t-fast) var(--esen-ease),
        color var(--esen-t-fast) var(--esen-ease);
}

.esen-nav-link .fa {
    width: 1.35rem;
    flex: 0 0 1.35rem;
    text-align: center;
    font-size: 0.88rem;
    color: var(--esen-sidebar-accent);
}

.esen-nav-link:hover {
    background: var(--esen-sidebar-hover);
    color: var(--esen-sidebar-ink);
}

.esen-nav-link--active {
    background: var(--esen-sidebar-active);
    color: var(--esen-sidebar-ink);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.esen-nav-label {
    flex: 1 1 auto;
    min-width: 0;
}

/* Grupos colapsables */
.esen-nav-group {
    margin: 0.15rem 0;
}

.esen-nav-grouphead {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: none;
    border-radius: var(--esen-radius-sm);
    background: transparent;
    color: var(--esen-sidebar-ink);
    font-family: var(--esen-font);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: left;
    cursor: pointer;
    transition: background-color var(--esen-t-fast) var(--esen-ease);
}

.esen-nav-grouphead .fa:first-child {
    width: 1.35rem;
    flex: 0 0 1.35rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--esen-sidebar-accent);
}

.esen-nav-grouphead:hover {
    background: var(--esen-sidebar-hover);
}

.esen-nav-chevron {
    font-size: 0.6rem !important;
    color: var(--esen-sidebar-muted) !important;
    transition: transform var(--esen-t) var(--esen-ease);
}

.esen-nav-group--open .esen-nav-chevron {
    transform: rotate(180deg);
}

/* Animación de apertura (grid-rows 0fr→1fr) */
.esen-nav-groupbody {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--esen-t) var(--esen-ease);
}

.esen-nav-groupbody > div {
    overflow: hidden;
}

.esen-nav-group--open .esen-nav-groupbody {
    grid-template-rows: 1fr;
}

.esen-nav-group .esen-nav-list {
    padding-left: 0.85rem;
    margin: 0.1rem 0 0.4rem;
}

.esen-nav-noresult {
    color: var(--esen-sidebar-muted);
    font-size: 0.82rem;
    text-align: center;
    padding: 0.8rem 0;
    margin: 0;
}

/* Cerrar sesión: separado y al fondo */
.esen-nav-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--esen-sidebar-line);
}

.esen-nav-link--logout {
    color: var(--esen-sidebar-muted);
}

.esen-nav-link--logout .fa {
    color: #ffb4b4;
}

.esen-nav-link--logout:hover {
    background: rgba(207, 52, 52, 0.25);
    color: #fff;
}

/* Footer dentro del sidebar */
#sidebar .footer {
    border-top: 1px solid var(--esen-sidebar-line);
    padding-top: 1.1rem;
    margin-top: 0.5rem;
}

#sidebar .footer img {
    width: 56% !important;
    border-radius: 10px;
    padding: 6px;
    background: #fff;
}

#sidebar .footer p,
.footer p {
    color: var(--esen-sidebar-muted);
    font-size: 0.72rem;
    line-height: 1.5;
}

/* ------------------------------------------------------------
   4. Botones
   ------------------------------------------------------------ */
.btn {
    font-family: var(--esen-font);
    font-weight: 600;
    font-size: 0.92rem;
    border-radius: var(--esen-radius);
    padding: 0.5rem 1.1rem;
    transition: background-color var(--esen-t-fast) var(--esen-ease),
        border-color var(--esen-t-fast) var(--esen-ease),
        color var(--esen-t-fast) var(--esen-ease),
        box-shadow var(--esen-t-fast) var(--esen-ease),
        transform var(--esen-t-fast) var(--esen-ease);
}

.btn:active {
    transform: translateY(1px);
}

.btn:focus-visible {
    outline: 2px solid var(--esen-primary);
    outline-offset: 2px;
}

.btn.btn-primary {
    background: var(--esen-primary) !important;
    border-color: var(--esen-primary) !important;
    color: var(--esen-on-primary);
}

.btn.btn-primary:hover,
.btn.btn-primary:focus {
    background: var(--esen-primary-hover) !important;
    border-color: var(--esen-primary-hover) !important;
}

.btn.btn-primary:active {
    background: var(--esen-primary-active) !important;
}

.btn-secondary,
.btn-light {
    background: var(--esen-surface);
    border: 1px solid var(--esen-border-strong);
    color: var(--esen-text);
}

.btn-secondary:hover,
.btn-light:hover {
    background: var(--esen-surface-2);
    border-color: var(--esen-border-strong);
    color: var(--esen-ink);
}

.btn-success {
    background: var(--esen-success);
    border-color: var(--esen-success);
}

.btn-danger {
    background: var(--esen-danger);
    border-color: var(--esen-danger);
}

.btn-info {
    background: var(--esen-info);
    border-color: var(--esen-info);
}

.btn-warning {
    background: var(--esen-warning-soft);
    border-color: transparent;
    color: var(--esen-warning-ink);
}

.btn-warning:hover {
    background: var(--esen-warning);
    color: #fff;
}

.btn-outline-primary {
    color: var(--esen-primary-soft-ink);
    border-color: var(--esen-border-strong);
}

.btn-outline-primary:hover {
    background: var(--esen-primary);
    border-color: var(--esen-primary);
    color: #fff;
}

.btn-block {
    padding: 0.7rem 1.1rem;
}

.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    border-radius: var(--esen-radius-sm);
}

/* ------------------------------------------------------------
   5. Formularios
   ------------------------------------------------------------ */
label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--esen-ink);
    margin-bottom: 0.35rem;
}

.form-control,
.form-control:not([type='file']) {
    height: 44px !important;
    background: var(--esen-surface) !important;
    color: var(--esen-ink) !important;
    font-size: 16px;
    font-family: var(--esen-font);
    border: 1.5px solid var(--esen-border-strong) !important;
    border-radius: var(--esen-radius);
    padding: 0.5rem 0.85rem;
    transition: border-color var(--esen-t-fast) var(--esen-ease),
        box-shadow var(--esen-t-fast) var(--esen-ease),
        background-color var(--esen-t-fast) var(--esen-ease);
}

textarea.form-control {
    height: auto !important;
    min-height: 96px;
}

select.form-control {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235d6280' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.85rem center !important;
    padding-right: 2.2rem;
}

.form-control:focus,
.form-control:active {
    border-color: var(--esen-primary) !important;
    box-shadow: 0 0 0 3px var(--esen-primary-soft) !important;
    outline: none;
}

.form-control::-webkit-input-placeholder { color: var(--esen-muted) !important; }
.form-control::-moz-placeholder { color: var(--esen-muted) !important; }
.form-control:-ms-input-placeholder { color: var(--esen-muted) !important; }
.form-control::placeholder { color: var(--esen-muted) !important; }

.form-control:disabled,
.form-control[readonly] {
    background: var(--esen-surface-2) !important;
    color: var(--esen-muted) !important;
}

/* ------------------------------------------------------------
   6. Cards
   ------------------------------------------------------------ */
.card {
    background: var(--esen-surface);
    border: 1px solid var(--esen-border);
    border-radius: var(--esen-radius-lg);
    box-shadow: var(--esen-shadow-sm);
    margin-bottom: 1.25rem;
    transition: box-shadow var(--esen-t) var(--esen-ease),
        border-color var(--esen-t) var(--esen-ease);
    overflow: hidden;
}

.card-header {
    background: var(--esen-surface);
    border-bottom: 1px solid var(--esen-border);
    font-weight: 700;
    color: var(--esen-ink);
    padding: 0.9rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: var(--esen-surface-2);
    border-top: 1px solid var(--esen-border);
}

.card .card-title {
    color: var(--esen-ink);
    font-weight: 700;
}

.card .card-text {
    color: var(--esen-text);
}

/* ------------------------------------------------------------
   7. Tablas
   ------------------------------------------------------------ */
.table {
    color: var(--esen-text);
    margin-bottom: 0.5rem;
    font-variant-numeric: tabular-nums;
}

.table thead th,
.table thead td {
    border-top: none;
    border-bottom: 1px solid var(--esen-border);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--esen-muted);
    padding: 0.6rem 0.75rem;
    white-space: nowrap;
}

.table td,
.table th {
    border-top: 1px solid var(--esen-border);
    padding: 0.7rem 0.75rem;
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color var(--esen-t-fast) var(--esen-ease);
}

.table tbody tr:hover {
    background: var(--esen-surface-2);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--esen-surface-2);
}

.table-striped tbody tr:hover {
    background-color: var(--esen-primary-soft);
}

/* Neutralizar tablas dark de Bootstrap (quedaban negras) */
.table-dark,
.table-dark > th,
.table-dark > td,
.table.table-dark thead th {
    background-color: var(--esen-surface) !important;
    color: var(--esen-text) !important;
    border-color: var(--esen-border) !important;
}

.table.table-dark.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--esen-surface-2) !important;
}

.table-responsive {
    border-radius: var(--esen-radius);
}

/* ------------------------------------------------------------
   8. Alertas, badges, modales
   ------------------------------------------------------------ */
.alert {
    border: 1px solid transparent;
    border-radius: var(--esen-radius);
    padding: 0.9rem 1.1rem;
    font-size: 0.95rem;
}

.alert h1, .alert h2, .alert h3, .alert h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.alert-warning {
    background: var(--esen-warning-soft);
    border-color: transparent;
    color: var(--esen-warning-ink);
}

.alert-danger {
    background: var(--esen-danger-soft);
    border-color: transparent;
    color: var(--esen-danger-ink);
}

.alert-success {
    background: var(--esen-success-soft);
    border-color: transparent;
    color: var(--esen-success-ink);
}

.alert-info,
.alert-primary {
    background: var(--esen-info-soft);
    border-color: transparent;
    color: var(--esen-info-ink);
}

.badge {
    font-weight: 600;
    border-radius: 99px;
    padding: 0.3em 0.7em;
    font-size: 0.74rem;
}

.badge-secondary {
    background: var(--esen-surface-2);
    color: var(--esen-muted);
    border: 1px solid var(--esen-border);
}

.badge-primary {
    background: var(--esen-primary-soft);
    color: var(--esen-primary-soft-ink);
}

.modal-content {
    background: var(--esen-surface);
    color: var(--esen-text);
    border: 1px solid var(--esen-border);
    border-radius: var(--esen-radius-lg);
    box-shadow: var(--esen-shadow-lg);
}

.modal-header,
.modal-footer {
    border-color: var(--esen-border);
}

.modal-backdrop {
    z-index: var(--z-modal-backdrop);
}

.modal {
    z-index: var(--z-modal);
}

.dropdown-menu {
    background: var(--esen-surface);
    border: 1px solid var(--esen-border);
    border-radius: var(--esen-radius);
    box-shadow: var(--esen-shadow);
    z-index: var(--z-dropdown);
}

.dropdown-item {
    color: var(--esen-text);
}

.dropdown-item:hover {
    background: var(--esen-surface-2);
    color: var(--esen-ink);
}

/* Chips de estado propios */
.esen-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.38em 0.8em;
    border-radius: 99px;
    white-space: nowrap;
}

.esen-chip--success { background: var(--esen-success-soft); color: var(--esen-success-ink); }
.esen-chip--danger  { background: var(--esen-danger-soft);  color: var(--esen-danger-ink); }
.esen-chip--warning { background: var(--esen-warning-soft); color: var(--esen-warning-ink); }
.esen-chip--info    { background: var(--esen-info-soft);    color: var(--esen-info-ink); }
.esen-chip--neutral { background: var(--esen-surface-2);    color: var(--esen-muted); }

/* ------------------------------------------------------------
   9. Skeletons y estados vacíos
   ------------------------------------------------------------ */
@keyframes esen-shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

.esen-skel {
    display: block;
    border-radius: var(--esen-radius-sm);
    background: linear-gradient(90deg,
        var(--esen-surface-2) 25%,
        var(--esen-border) 50%,
        var(--esen-surface-2) 75%);
    background-size: 200% 100%;
    animation: esen-shimmer 1.6s linear infinite;
    min-height: 14px;
}

.esen-empty {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: var(--esen-surface);
    border: 1.5px dashed var(--esen-border-strong);
    border-radius: var(--esen-radius-lg);
    max-width: 560px;
}

.esen-empty-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--esen-primary-soft);
    color: var(--esen-primary-soft-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.esen-empty h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.esen-empty p {
    color: var(--esen-muted);
    font-size: 0.92rem;
    margin: 0 auto;
    max-width: 38ch;
}

/* ------------------------------------------------------------
   10. Visualizaciones (SVG propio)
   ------------------------------------------------------------ */
.esen-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.esen-stat {
    background: var(--esen-surface);
    border: 1px solid var(--esen-border);
    border-radius: var(--esen-radius-lg);
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--esen-shadow-sm);
}

.esen-stat-value {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--esen-ink);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.esen-stat-label {
    font-size: 0.83rem;
    color: var(--esen-muted);
    font-weight: 500;
    margin-top: 0.15rem;
}

.esen-stat--hero {
    background: linear-gradient(135deg, var(--esen-primary) 0%, var(--esen-primary-active) 100%);
    border: none;
}

.esen-stat--hero .esen-stat-value { color: #fff; }
.esen-stat--hero .esen-stat-label { color: rgba(255, 255, 255, 0.82); }

/* Donut */
.esen-donut {
    position: relative;
    display: inline-block;
}

.esen-donut svg {
    display: block;
    transform: rotate(-90deg);
}

.esen-donut-track {
    fill: none;
    stroke: var(--esen-surface-2);
}

.esen-donut-value {
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 900ms var(--esen-ease);
}

.esen-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: none;
}

.esen-donut-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--esen-ink);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.esen-donut-caption {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--esen-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.3rem;
}

/* Barras */
.esen-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
    height: 150px;
    padding-top: 0.5rem;
}

.esen-bar-col {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    min-width: 0;
}

.esen-bar-fill {
    width: 100%;
    max-width: 46px;
    border-radius: 7px 7px 3px 3px;
    background: var(--esen-primary);
    transition: height 700ms var(--esen-ease), background-color var(--esen-t-fast);
    position: relative;
}

.esen-bar-col:hover .esen-bar-fill {
    background: var(--esen-primary-hover);
}

.esen-bar-value {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--esen-ink);
    margin-bottom: 0.3rem;
    font-variant-numeric: tabular-nums;
}

.esen-bar-label {
    font-size: 0.72rem;
    color: var(--esen-muted);
    margin-top: 0.45rem;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Barra de progreso de nota dentro de tablas */
.esen-meter {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 130px;
}

.esen-meter-track {
    flex: 1 1 auto;
    height: 6px;
    border-radius: 99px;
    background: var(--esen-surface-2);
    overflow: hidden;
}

.esen-meter-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--esen-success);
    transition: width 700ms var(--esen-ease);
}

.esen-meter-fill--danger { background: var(--esen-danger); }
.esen-meter-fill--warning { background: var(--esen-warning); }

.esen-meter-num {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--esen-ink);
    font-variant-numeric: tabular-nums;
    min-width: 2.6ch;
    text-align: right;
}

/* ------------------------------------------------------------
   11. Horario por días (Home)
   ------------------------------------------------------------ */
.esen-week {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    align-items: start;
}

.esen-day {
    background: var(--esen-surface);
    border: 1px solid var(--esen-border);
    border-radius: var(--esen-radius-lg);
    padding: 1rem;
    box-shadow: var(--esen-shadow-sm);
}

.esen-day--today {
    border-color: var(--esen-primary);
    box-shadow: 0 0 0 3px var(--esen-primary-soft), var(--esen-shadow-sm);
}

.esen-day-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--esen-ink);
    margin-bottom: 0.75rem;
}

.esen-day--today .esen-day-name {
    color: var(--esen-primary-soft-ink);
}

.esen-class {
    display: flex;
    gap: 0.7rem;
    padding: 0.55rem 0;
    align-items: baseline;
}

.esen-class + .esen-class {
    border-top: 1px solid var(--esen-border);
}

.esen-class-time {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--esen-primary-soft-ink);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
}

.esen-class-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--esen-ink);
    line-height: 1.35;
}

.esen-class-sec {
    font-size: 0.76rem;
    color: var(--esen-muted);
    display: block;
    margin-top: 0.1rem;
}

/* ------------------------------------------------------------
   12. Login
   ------------------------------------------------------------ */
.esen-login {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: var(--esen-bg);
}

.esen-login-brand {
    flex: 1 1 46%;
    background: linear-gradient(160deg, var(--esen-sidebar-bg) 0%, var(--esen-sidebar-bg-deep) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3.5rem;
    position: relative;
    overflow: hidden;
}

/* Variante con fotografía del campus: la imagen va de fondo y un velo
   azul de marca garantiza el contraste del texto */
.esen-login-brand--photo {
    background-size: cover;
    background-position: center;
}

.esen-login-brand--photo .esen-login-brand-inner {
    position: relative;
    z-index: 1;
}

.esen-login-brand--photo::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(43, 55, 150, 0.92) 0%, rgba(32, 42, 118, 0.88) 100%);
    pointer-events: none;
}

.esen-login-brand::after {
    content: '';
    position: absolute;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    border: 90px solid rgba(255, 255, 255, 0.05);
    bottom: -260px;
    right: -200px;
    pointer-events: none;
}

.esen-login-brand img {
    width: 150px;
    border-radius: 14px;
    margin-bottom: 2rem;
}

.esen-login-brand h1 {
    color: #fff;
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    max-width: 18ch;
}

.esen-login-brand p {
    color: rgba(232, 236, 255, 0.8);
    font-size: 1rem;
    margin-top: 0.9rem;
    max-width: 42ch;
}

.esen-login-panel {
    flex: 1 1 54%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
}

.esen-login-card {
    width: 100%;
    max-width: 400px;
}

.esen-login-card h2 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
}

.esen-login-card > p {
    color: var(--esen-muted);
    font-size: 0.92rem;
    margin-bottom: 1.75rem;
}

/* Separador "o" entre login con credenciales y Microsoft */
.esen-login-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1.2rem 0;
    color: var(--esen-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.esen-login-divider::before,
.esen-login-divider::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: var(--esen-border);
}

/* Botón de inicio de sesión con cuenta institucional (Microsoft) */
.esen-btn-microsoft {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: var(--esen-surface);
    border: 1.5px solid var(--esen-border-strong);
    color: var(--esen-ink);
    font-weight: 600;
    padding: 0.6rem 1.1rem;
}

.esen-btn-microsoft:hover {
    background: var(--esen-surface-2);
    border-color: var(--esen-border-strong);
    color: var(--esen-ink);
}

.esen-btn-microsoft img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.esen-login-foot {
    margin-top: 2.5rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--esen-muted);
}

@media (max-width: 860px) {
    .esen-login {
        flex-direction: column;
    }

    .esen-login-brand {
        flex: 0 0 auto;
        padding: 2.2rem 1.6rem 2rem;
    }

    .esen-login-brand img {
        width: 92px;
        margin-bottom: 1.1rem;
    }

    .esen-login-panel {
        padding-top: 2rem;
    }
}

/* ------------------------------------------------------------
   13. Eventos
   ------------------------------------------------------------ */
.esen-event {
    display: flex;
    gap: 1.1rem;
    align-items: flex-start;
}

.esen-event-date {
    flex: 0 0 auto;
    width: 60px;
    text-align: center;
    background: var(--esen-primary-soft);
    border-radius: var(--esen-radius);
    padding: 0.5rem 0.25rem;
}

.esen-event-date .d {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--esen-primary-soft-ink);
    line-height: 1.1;
}

.esen-event-date .m {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--esen-primary-soft-ink);
}

.esen-event-body {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--esen-text);
}

.esen-event-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--esen-radius-sm);
}

/* ------------------------------------------------------------
   13b. E-Recursos
   ------------------------------------------------------------ */
.esen-tabs {
    display: inline-flex;
    background: var(--esen-surface-2);
    border: 1px solid var(--esen-border);
    border-radius: var(--esen-radius);
    padding: 4px;
    gap: 4px;
    margin-bottom: 1.25rem;
}

.esen-tab {
    border: none;
    background: transparent;
    color: var(--esen-muted);
    font-weight: 600;
    font-size: 0.88rem;
    font-family: var(--esen-font);
    padding: 0.45rem 1rem;
    border-radius: var(--esen-radius-sm);
    cursor: pointer;
    transition: background-color var(--esen-t-fast) var(--esen-ease),
        color var(--esen-t-fast) var(--esen-ease);
    white-space: nowrap;
}

.esen-tab:hover {
    color: var(--esen-ink);
}

.esen-tab--active {
    background: var(--esen-surface);
    color: var(--esen-primary-soft-ink);
    box-shadow: var(--esen-shadow-sm);
}

.esen-resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.1rem;
    text-align: left;
}

.esen-resource {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.esen-resource-logo {
    background: #fff;
    border-bottom: 1px solid var(--esen-border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    min-height: 110px;
}

.esen-resource-logo img {
    max-width: 70%;
    max-height: 72px;
    object-fit: contain;
}

.esen-resource .card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 0.65rem;
}

.esen-resource .card-body > .mt-auto {
    margin-top: auto !important;
}

/* ------------------------------------------------------------
   14. Toggle de tema
   ------------------------------------------------------------ */
.esen-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.5rem 0.9rem;
    border-radius: var(--esen-radius);
    border: 1px solid var(--esen-sidebar-line);
    background: rgba(255, 255, 255, 0.07);
    color: var(--esen-sidebar-ink);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--esen-t-fast) var(--esen-ease);
    margin-bottom: 1rem;
}

.esen-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--esen-sidebar-ink);
}

.esen-theme-toggle--page {
    width: auto;
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: var(--z-toast);
    background: var(--esen-surface);
    color: var(--esen-text);
    border: 1px solid var(--esen-border);
    box-shadow: var(--esen-shadow);
    margin-bottom: 0;
}

.esen-theme-toggle--page:hover {
    background: var(--esen-surface-2);
    color: var(--esen-ink);
}

/* ------------------------------------------------------------
   15. Animación de entrada del contenido (sutil, una vez)
   ------------------------------------------------------------ */
@keyframes esen-enter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

#content {
    animation: esen-enter 320ms var(--esen-ease) both;
}

/* ------------------------------------------------------------
   15b. Capa de pulido "woah" — jerarquía + microinteracciones
   ------------------------------------------------------------ */

/* Encabezado de página con barra de acento de marca.
   Eleva el h2 plano a un título con presencia. */
#content > h2 {
    position: relative;
    padding-left: 0.95rem;
}

#content > h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.1em;
    bottom: 0.25em;
    width: 4px;
    border-radius: 99px;
    background: linear-gradient(180deg, var(--esen-primary) 0%, var(--esen-primary-active) 100%);
}

/* Cards con elevación al pasar el cursor: dan sensación de profundidad
   y de que el contenido "responde". Solo donde aporta (no en formularios). */
.card {
    will-change: transform;
}

.card:hover {
    box-shadow: var(--esen-shadow);
    border-color: var(--esen-border-strong);
}

/* Cards claramente accionables (tienen un enlace/botón de acción dentro)
   reciben un lift más marcado. */
.esen-resource:hover,
.esen-day:hover,
.esen-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--esen-shadow);
}

.esen-stat {
    transition: transform var(--esen-t) var(--esen-ease),
        box-shadow var(--esen-t) var(--esen-ease);
}

/* Brillo sutil en la tarjeta hero de estadística (el dato protagonista) */
.esen-stat--hero {
    position: relative;
    overflow: hidden;
}

.esen-stat--hero::after {
    content: '';
    position: absolute;
    top: -60%;
    right: -10%;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

/* Entrada escalonada de las cards de una pantalla: cascada elegante
   en lugar de aparición simultánea. Solo afecta a hijos directos de #content. */
@keyframes esen-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

#content > .card,
#content > .esen-stat-grid,
#content > .esen-week,
#content > .esen-resource-grid,
#content > .alert,
#content > .esen-empty {
    animation: esen-rise 420ms var(--esen-ease) both;
}

#content > *:nth-child(2) { animation-delay: 40ms; }
#content > *:nth-child(3) { animation-delay: 90ms; }
#content > *:nth-child(4) { animation-delay: 140ms; }
#content > *:nth-child(5) { animation-delay: 190ms; }
#content > *:nth-child(6) { animation-delay: 240ms; }

/* Filas de tabla: realce de acento al pasar el cursor (lectura guiada) */
.table tbody tr {
    position: relative;
}

.table.table-hover tbody tr:hover,
.card .table tbody tr:hover {
    box-shadow: inset 3px 0 0 var(--esen-primary);
}

/* Botón primario con realce de profundidad al hover */
.btn.btn-primary {
    box-shadow: 0 1px 2px rgba(36, 50, 135, 0.15);
}

.btn.btn-primary:hover {
    box-shadow: 0 4px 14px rgba(52, 69, 180, 0.35);
}

/* Chips con micro-realce */
.esen-chip {
    transition: transform var(--esen-t-fast) var(--esen-ease);
}

/* Foco de teclado más visible y elegante en enlaces de navegación */
.esen-nav-link:focus-visible,
.esen-nav-grouphead:focus-visible {
    outline: 2px solid var(--esen-sidebar-accent);
    outline-offset: -2px;
}

/* ------------------------------------------------------------
   16. Reduced motion
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .esen-skel {
        animation: none;
        background: var(--esen-surface-2);
    }
}

/* ------------------------------------------------------------
   17. Dashboard / Home del alumno
   ------------------------------------------------------------ */

/* Grilla de dos columnas para los paneles inferiores (destacados + eventos).
   Colapsa a una sola columna en pantallas angostas. */
.esen-dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

/* --- Franja de avisos accionables --- */
.esen-alert-strip {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.esen-alert {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1.1rem;
    border-radius: var(--esen-radius-lg);
    background: var(--esen-surface);
    border: 1px solid var(--esen-border);
    border-left: 4px solid var(--esen-border-strong);
    box-shadow: var(--esen-shadow-sm);
}

.esen-alert--danger  { background: var(--esen-danger-soft);  border-left-color: var(--esen-danger); }
.esen-alert--warning { background: var(--esen-warning-soft); border-left-color: var(--esen-warning); }
.esen-alert--info    { background: var(--esen-info-soft);    border-left-color: var(--esen-info); }
.esen-alert--success { background: var(--esen-success-soft); border-left-color: var(--esen-success); }

.esen-alert-icon {
    flex: 0 0 auto;
    font-size: 1.15rem;
}

.esen-alert--danger  .esen-alert-icon { color: var(--esen-danger-ink); }
.esen-alert--warning .esen-alert-icon { color: var(--esen-warning-ink); }
.esen-alert--info    .esen-alert-icon { color: var(--esen-info-ink); }
.esen-alert--success .esen-alert-icon { color: var(--esen-success-ink); }

.esen-alert-text {
    flex: 1 1 auto;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--esen-ink);
    line-height: 1.35;
}

.esen-alert-cta {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .esen-alert {
        flex-wrap: wrap;
    }
    .esen-alert-cta {
        margin-left: calc(1.15rem + 0.85rem);
    }
}

/* --- Tiles de estado de servicio (Link sobre la base .esen-stat) --- */
.esen-tile {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    position: relative;
    align-items: flex-start;
}

.esen-tile:hover {
    text-decoration: none;
    color: inherit;
    border-color: var(--esen-primary);
}

.esen-tile-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--esen-primary-soft);
    color: var(--esen-primary-soft-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}

.esen-tile-body {
    flex: 1 1 auto;
    min-width: 0;
}

.esen-tile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}

.esen-tile-titulo {
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--esen-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.esen-tile-chevron {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    color: var(--esen-muted);
    opacity: 0;
    transition: opacity var(--esen-t-fast) var(--esen-ease),
        transform var(--esen-t-fast) var(--esen-ease);
}

.esen-tile:hover .esen-tile-chevron {
    opacity: 1;
    transform: translateX(2px);
}

/* --- Lista de accesos "lo más consultado" --- */
.esen-dash-links,
.esen-dash-eventos {
    list-style: none;
    margin: 0;
    padding: 0;
}

.esen-dash-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0.4rem;
    border-radius: var(--esen-radius);
    text-decoration: none;
    color: inherit;
    transition: background var(--esen-t-fast) var(--esen-ease);
}

.esen-dash-links li + li,
.esen-dash-eventos li + li {
    border-top: 1px solid var(--esen-border);
}

.esen-dash-link:hover {
    background: var(--esen-surface-2);
    text-decoration: none;
    color: inherit;
}

.esen-dash-link-icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--esen-primary-soft);
    color: var(--esen-primary-soft-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.esen-dash-link-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.esen-dash-link-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--esen-ink);
}

.esen-dash-link-desc {
    font-size: 0.8rem;
    color: var(--esen-muted);
}

.esen-dash-link-chevron {
    flex: 0 0 auto;
    color: var(--esen-muted);
}

/* --- Eventos compactos --- */
.esen-dash-evento {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.7rem 0.4rem;
    border-radius: var(--esen-radius);
    text-decoration: none;
    color: inherit;
    transition: background var(--esen-t-fast) var(--esen-ease);
}

.esen-dash-evento:hover {
    background: var(--esen-surface-2);
    text-decoration: none;
    color: inherit;
}

.esen-dash-evento-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.esen-dash-evento-titulo {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--esen-ink);
}

.esen-dash-evento-desc {
    font-size: 0.82rem;
    color: var(--esen-muted);
    line-height: 1.35;
}

.esen-dash-verlink {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--esen-primary-soft-ink);
}
