/* ============================================================
   ESE URDAIBAI — CSS Global
   Incluir en include_top.php:
   <link rel="stylesheet" href="ese_urdaibai.css">
   ============================================================ */

/* --- Google Font ------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

/* --- Variables de marca ------------------------------------ */
:root {
    --ese-azul:          #009DC4;
    --ese-azul-oscuro:   #007a99;
    --ese-azul-suave:    #e6f6fa;
    --ese-texto:         #1a2535;
    --ese-texto-suave:   #5a6a7a;
    --ese-borde:         #dde6ec;
    --ese-fondo:         #f5f8fa;
    --ese-blanco:        #ffffff;
    --ese-verde:         #1aab5f;
    --ese-radio:         12px;
    --ese-sombra:        0 2px 12px rgba(0,157,196,0.10);
    --ese-sombra-hover:  0 6px 24px rgba(0,157,196,0.20);
    --ese-font:          'Nunito', 'Segoe UI', sans-serif;
}

/* --- Base --------------------------------------------- */
body {
    font-family: var(--ese-font) !important;
    background: linear-gradient(180deg, #ffffff 0%, var(--ese-azul-suave) 100%) !important;    color: var(--ese-texto);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* ============================================================
   HEADER GLOBAL (include_top.php)
   ============================================================ */

/* Tabla wrapper del header */
body > table:first-of-type {
    max-width: 560px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 10px 16px 0 !important;
}

body > table:first-of-type img {
    max-height: 56px;
    width: auto;
}

/* Botón ir arriba */
.ir-arriba {
    display: none;
    position: fixed;
    bottom: 22px;
    right: 18px;
    background: var(--ese-azul);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,157,196,0.40);
    z-index: 999;
    transition: background 0.18s, transform 0.18s;
}

.ir-arriba:hover {
    background: var(--ese-azul-oscuro);
    transform: translateY(-2px);
}

/* ============================================================
   BOTÓN ATRÁS
   print_backButton() genera:
     <table class="table-boton-atras">
       <tr><td>
         <a class="texto_principal smaller boton_atras">← Atrás</a>
       </td></tr>
     </table>
   ============================================================ */

table.table-boton-atras {
    display: block !important;
    width: 100% !important;
    max-width: 560px !important;
    margin: 12px auto 0 !important;
    padding: 0 16px !important;
    border: none !important;
    background: transparent !important;
}

table.table-boton-atras tr,
table.table-boton-atras td {
    display: block !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

a.boton_atras {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 18px !important;
    background: var(--ese-blanco) !important;
    color: var(--ese-azul) !important;
    border: 2px solid var(--ese-azul) !important;
    border-radius: 30px !important;
    font-family: var(--ese-font) !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s !important;
    line-height: 1 !important;
    letter-spacing: 0.1px !important;
}

a.boton_atras:hover {
    background: var(--ese-azul) !important;
    color: var(--ese-blanco) !important;
    box-shadow: 0 4px 14px rgba(0,157,196,0.30) !important;
}

/* ============================================================
   FOOTER (include_bottom.php)
   ============================================================ */
.ese-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 32px 16px 40px;  /* AUMENTADO: arriba 32px, abajo 40px */
    font-size: 0.8rem;
    color: var(--ese-texto-suave);
    font-family: var(--ese-font);
    border-top: 1px solid var(--ese-borde);
    margin-top: 30px;  /* Separación del contenido anterior */
}

.ese-footer img {
    max-height: 26px;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.ese-footer img:hover {
    opacity: 1;
}

/* Ajuste para la última tarjeta */
.ese-card:last-of-type {
    margin-bottom: 10px;
}
/* ============================================================
   CONTENEDOR PÁGINA
   ============================================================ */
.ese-page {
    max-width: 520px;
    margin: 0 auto;
    padding: 0 16px 56px;
}

/* ============================================================
   TÍTULO DE PÁGINA
   ============================================================ */
.ese-titulo-pagina {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--ese-texto);
    text-align: center;
    margin: 28px 0 22px;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

/* ============================================================
   SELECTOR DE AÑO
   ============================================================ */
.ese-year-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 26px;
}

.ese-year-tab a {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ese-azul);
    background: var(--ese-blanco);
    border: 2px solid var(--ese-azul);
    text-decoration: none;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.ese-year-tab a:hover,
.ese-year-tab a.active {
    background: var(--ese-azul);
    color: var(--ese-blanco);
    box-shadow: 0 2px 10px rgba(0,157,196,0.28);
}

/* ============================================================
   CARD REFERENCIA
   ============================================================ */
.ese-card {
    background: var(--ese-blanco);
    border-radius: var(--ese-radio);
    box-shadow: var(--ese-sombra);
    margin-bottom: 14px;
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.22s, transform 0.18s;
    border: 1px solid var(--ese-borde);
    animation: ese-fadein 0.28s ease both;
}

.ese-card:hover {
    box-shadow: var(--ese-sombra-hover);
    transform: translateY(-2px);
}

/* Barra de acento superior */
.ese-card::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--ese-azul), #00c6ee);
}

.ese-card a.ese-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 16px 18px 14px;
}

/* --- Badge NUEVO ------------------------------------------ */
.ese-badge-nuevo {
    position: absolute;
    top: 16px;
    right: 14px;
    background: var(--ese-azul);
    color: #fff;
    font-size: 0.70rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0,157,196,0.35);
    animation: ese-pulse 2.2s infinite;
}

@keyframes ese-pulse {
    0%, 100% { box-shadow: 0 2px 6px rgba(0,157,196,0.35); }
    50%       { box-shadow: 0 2px 16px rgba(0,157,196,0.65); }
}

/* --- Header card ------------------------------------------ */
.ese-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-right: 0;
}

/* Cuando hay badge NUEVO reservamos espacio a la derecha */
.ese-card--has-badge .ese-card-header {
    padding-right: 64px;
}

.ese-nombre-contacto {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--ese-texto);
    margin: 0 0 4px;
    line-height: 1.2;
}

.ese-nombre-contacto.no-visto { color: var(--ese-azul); }

.ese-referente {
    font-size: 0.83rem;
    color: var(--ese-texto-suave);
    margin: 0;
    font-weight: 600;
}

.ese-referente.no-visto {
    color: var(--ese-azul);
    font-weight: 700;
}

.ese-fecha-card {
    font-size: 0.78rem;
    color: var(--ese-texto-suave);
    white-space: nowrap;
    margin-top: 3px;
    font-weight: 600;
}

.ese-fecha-card.no-visto {
    color: var(--ese-azul);
    font-weight: 700;
}

/* --- Separador -------------------------------------------- */
.ese-card-divider {
    height: 1px;
    background: var(--ese-borde);
    margin: 0 0 12px;
}

/* --- Filas de datos --------------------------------------- */
.ese-dato-fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.87rem;
}

.ese-dato-fila + .ese-dato-fila {
    border-top: 1px solid var(--ese-fondo);
}

.ese-dato-etiqueta {
    color: var(--ese-texto-suave);
    font-weight: 600;
    font-size: 0.83rem;
    min-width: 90px;
}

.ese-dato-valor {
    color: var(--ese-texto);
    font-weight: 700;
    text-align: right;
}

.ese-dato-valor.no-visto { color: var(--ese-azul); }

.ese-sin-valorar {
    color: var(--ese-texto-suave);
    font-style: italic;
    font-weight: 500;
}

.ese-gnc-completado {
    color: var(--ese-verde);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ese-gnc-pendiente {
    color: var(--ese-texto-suave);
    font-style: italic;
    font-weight: 500;
}

.ese-gnc-fecha {
    font-size: 0.77rem;
    font-weight: 500;
    color: var(--ese-texto-suave);
}

.ese-gnc-fecha.no-visto {
    color: var(--ese-azul);
    font-weight: 700;
}

/* --- Footer card ------------------------------------------ */
.ese-card-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--ese-borde);
    text-align: center;
}

.ese-ver-detalles {
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--ese-azul);
    letter-spacing: 0.2px;
}

.ese-ver-detalles::after { content: ' →'; }

/* --- Estado vacío ----------------------------------------- */
.ese-vacio {
    text-align: center;
    padding: 48px 24px;
    background: var(--ese-blanco);
    border-radius: var(--ese-radio);
    border: 2px dashed var(--ese-borde);
    color: var(--ese-texto-suave);
    font-size: 0.92rem;
    font-weight: 600;
}

/* --- Animación entrada ------------------------------------ */
@keyframes ese-fadein {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ese-card:nth-child(1)  { animation-delay: 0.03s; }
.ese-card:nth-child(2)  { animation-delay: 0.08s; }
.ese-card:nth-child(3)  { animation-delay: 0.13s; }
.ese-card:nth-child(4)  { animation-delay: 0.18s; }
.ese-card:nth-child(5)  { animation-delay: 0.23s; }
.ese-card:nth-child(6)  { animation-delay: 0.28s; }
.ese-card:nth-child(7)  { animation-delay: 0.33s; }
.ese-card:nth-child(8)  { animation-delay: 0.38s; }
.ese-card:nth-child(9)  { animation-delay: 0.43s; }
.ese-card:nth-child(10) { animation-delay: 0.48s; }

/* ============================================================
   SECCIÓN TÍTULO (h2 dentro de página)
   ============================================================ */
.ese-subtitulo {
    text-align: center;
    font-size: 0.90rem;
    color: var(--ese-texto-suave);
    margin: -14px 0 22px;
    font-weight: 600;
}

.ese-seccion-titulo {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ese-azul);
    margin: 28px 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--ese-azul-suave);
    letter-spacing: -0.2px;
}

/* ============================================================
   CARD SIMPLE (sin acento superior, sin hover fuerte)
   ============================================================ */
.ese-card--simple {
    padding: 14px 16px;
    animation: none;
}

.ese-card--simple::before {
    display: none;
}

/* ============================================================
   LINK WRAP (card entera clickable desde fuera)
   ============================================================ */
a.ese-card-link-wrap {
    display: block;
    text-decoration: none;
    color: inherit;
    margin-bottom: 14px;
}

a.ese-card-link-wrap .ese-card {
    margin-bottom: 0;
    transition: box-shadow 0.22s, transform 0.18s;
}

a.ese-card-link-wrap:hover .ese-card {
    box-shadow: var(--ese-sombra-hover);
    transform: translateY(-2px);
}

/* ============================================================
   BOLD helper
   ============================================================ */
.ese-bold { font-weight: 800 !important; }

/* ============================================================
   BOTÓN
   ============================================================ */
.ese-btn {
    display: inline-block;
    padding: 9px 20px;
    background: var(--ese-azul);
    color: var(--ese-blanco);
    border: none;
    border-radius: 30px;
    font-family: var(--ese-font);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s, box-shadow 0.18s;
    box-shadow: 0 2px 8px rgba(0,157,196,0.20);
    -webkit-appearance: none;
    appearance: none;
}

.ese-btn:hover {
    background: var(--ese-azul-oscuro);
    box-shadow: 0 4px 14px rgba(0,157,196,0.35);
}

.ese-btn--full {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.ese-btn-icon {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    color: var(--ese-azul);
    border: 2px solid var(--ese-azul);
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.18s;
}

.ese-btn-icon:hover {
    background: var(--ese-azul-suave);
}

/* ============================================================
   INPUTS
   ============================================================ */
.ese-input {
    padding: 8px 12px;
    border: 1.5px solid var(--ese-borde);
    border-radius: 8px;
    font-family: var(--ese-font);
    font-size: 0.88rem;
    color: var(--ese-texto);
    background: var(--ese-blanco);
    outline: none;
    transition: border-color 0.18s;
}

.ese-input:focus {
    border-color: var(--ese-azul);
}

.ese-input--full {
    width: 100%;
    box-sizing: border-box;
}

.ese-input--fecha { width: 44px; text-align: center; }
.ese-input--ano   { width: 62px; text-align: center; }
.ese-input--search { flex: 1; min-width: 0; }

.ese-fecha-sep {
    font-weight: 700;
    color: var(--ese-texto-suave);
    padding: 0 2px;
}

/* ============================================================
   FORM CARD (formularios centrados)
   ============================================================ */
.ese-form-card {
    background: var(--ese-blanco);
    border-radius: var(--ese-radio);
    border: 1px solid var(--ese-borde);
    box-shadow: var(--ese-sombra);
    padding: 24px 20px;
    margin-bottom: 20px;
}

.ese-campo {
    margin-bottom: 16px;
}

.ese-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ese-texto-suave);
    margin-bottom: 6px;
}

/* ============================================================
   AVISOS / ALERTAS
   ============================================================ */
.ese-aviso {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.ese-aviso--ok {
    background: #e6f9f0;
    color: var(--ese-verde);
    border: 1px solid #b3ecd1;
}

.ese-aviso--error {
    background: #fdeaea;
    color: #c0392b;
    border: 1px solid #f5b7b7;
}

/* ============================================================
   FILTRO FECHAS (estadisticas)
   ============================================================ */
.ese-filtro-card {
    background: var(--ese-blanco);
    border-radius: var(--ese-radio);
    border: 1px solid var(--ese-borde);
    box-shadow: var(--ese-sombra);
    padding: 18px 20px;
    margin-bottom: 24px;
}

.ese-filtro-fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 10px;
}

.ese-filtro-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ese-texto-suave);
    min-width: 60px;
}

.ese-fecha-inputs {
    display: flex;
    align-items: center;
    gap: 2px;
}

.ese-filtro-accion {
    text-align: right;
    margin-top: 4px;
}



/* ============================================================
   BUSCADOR (asociados)
   ============================================================ */
.ese-buscador {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ese-buscador .ese-input--search {
    flex: 1 1 160px;
    min-width: 0;
}

.ese-buscador .ese-btn {
    flex-shrink: 0;
}

.ese-buscador .ese-btn-icon {
    flex-shrink: 0;
}

/* ============================================================
   TARJETAS DE ASOCIADOS - CORRECCIÓN
   ============================================================ */
.ese-card-link-wrap {
    display: block;
    text-decoration: none;
    color: inherit;
    margin-bottom: 16px;
    width: 100%;
}

.ese-card {
    width: 100%;
    box-sizing: border-box;
}

.ese-card-link {
    width: 100%;
    box-sizing: border-box;
}

/* Para el contenedor flex de cada tarjeta */
.ese-card-link > div {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap; /* Evita que se rompa */
}

/* Para la parte de información (nombre + empresa) */
.ese-card-link > div > div:nth-child(2) {
    flex: 1;
    min-width: 0; /* Permite que el texto se recorte con ellipsis si es necesario */
    white-space: normal;
    word-wrap: break-word;
}

/* Para el texto de acción (VER PERFIL →) */
.ese-card-link > div > div:last-child {
    flex-shrink: 0;
    white-space: nowrap; /* Evita que se rompa en múltiples líneas */
}

/* Si el nombre es muy largo, que no rompa el layout */
.ese-nombre-contacto {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* La empresa también con ellipsis si es muy larga */
.ese-referente {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   SELECTOR DE IDIOMA
   ============================================================ */
.ese-lang-selector {
    display: flex;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.ese-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    background: var(--ese-blanco);
    color: var(--ese-azul);
    border: 2px solid var(--ese-azul);
    border-radius: 40px;
    font-family: var(--ese-font);
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    min-width: 70px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.ese-lang-btn:hover {
    background: var(--ese-azul-suave);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,157,196,0.25);
}

.ese-lang-btn.ese-lang-active {
    background: var(--ese-azul);
    color: var(--ese-blanco);
    border-color: var(--ese-azul-oscuro);
    box-shadow: 0 4px 12px rgba(0,157,196,0.35);
}

/* ============================================================
   BOTÓN PDF ESPECÍFICO PARA ASOCIADOS
   ============================================================ */
.ese-btn-pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--ese-azul);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: var(--ese-font);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s, transform 0.18s;
    box-shadow: 0 2px 6px rgba(0,157,196,0.3);
}

.ese-btn-pdf:hover {
    background: var(--ese-azul-oscuro);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,157,196,0.4);
}

.ese-btn-pdf img, 
.ese-btn-pdf svg {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1); /* Si el icono es negro, lo vuelve blanco */
}
/* ============================================================
   BADGE PEQUEÑO EN ESQUINA
   ============================================================ */
.ese-badge-corner {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ff4d4d;
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 30px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    box-shadow: 0 3px 8px rgba(255,77,77,0.3);
    z-index: 2;
    line-height: 1.2;
}
/* ============================================================
   NIVEL DE INTERÉS (referencia.php)
   ============================================================ */
.ese-nivel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border: 2px solid var(--ese-borde);
    background: var(--ese-blanco);
    color: var(--ese-texto-suave);
    transition: all 0.15s ease;
    user-select: none;
}

.ese-nivel-btn--active {
    border-color: var(--ese-azul);
    background: var(--ese-azul-suave);
    color: var(--ese-azul);
}


/* ============================================================
   DESPLEGABLES DE SECCIÓN (fichas.php) TAREA 11883
   ============================================================ */

.ese-seccion-titulo {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--ese-azul-suave);
    padding: 12px 16px;
    border-radius: var(--ese-radio);
    transition: background 0.2s;
    border-bottom: none;
    margin: 16px 0 0;
    overflow: visible;
    white-space: normal;
}

.ese-seccion-titulo:hover {
    background-color: var(--ese-borde);
}

.ese-flecha {
    font-size: 0.75rem;
    display: inline-block;
    color: var(--ese-azul);
    flex-shrink: 0;
    margin-left: 8px;
}

.ese-flecha-card {
    font-size: 0.7rem;
    color: var(--ese-azul);
    display: inline-block;
}

/* Contenedor cerrado por defecto */
.ese-accordion-content {
    display: none !important;
    margin-top: 10px;
    padding: 0 5px;
}

.ese-accordion-content[style*="display: block"],
.ese-accordion-content[style*="display:block"] {
    display: block !important;
}

/* Texto truncado a 2 líneas en vista comprimida */
.ese-texto-truncado {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Detalle interno de la card */
.ese-card-detalle {
    display: none !important;
    padding-top: 10px;
    margin-top: 6px;
}

.ese-card-detalle[style*="display: block"],
.ese-card-detalle[style*="display:block"] {
    display: block !important;
}

/* Cuando la card se abre, quita el truncado del comentario */
.ese-card.abierta .ese-texto-truncado {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

/* Cursor pointer en cards que son clickables */
.ese-card[onclick] {
    cursor: pointer;
}


 
/* ============================================================
   MÓDULO EVENTOS — CALENDARIO (eventos_app.php) TAREA 11883
   ============================================================ */
 
/* --- Navegación mes --------------------------------------- */
.ese-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
 
.ese-cal-mes-titulo {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ese-texto);
    letter-spacing: -0.2px;
}
 
.ese-cal-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ese-blanco);
    border: 2px solid var(--ese-azul);
    color: var(--ese-azul);
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
    line-height: 1;
}
 
.ese-cal-nav-btn:hover {
    background: var(--ese-azul);
    color: var(--ese-blanco);
}
 
/* --- Grid calendario -------------------------------------- */
.ese-cal-grid-wrap {
    background: var(--ese-blanco);
    border-radius: var(--ese-radio);
    border: 1px solid var(--ese-borde);
    box-shadow: var(--ese-sombra);
    overflow: hidden;
    margin-bottom: 14px;
}
 
.ese-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}
 
/* Cabecera días de la semana */
.ese-cal-dow {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--ese-azul);
    padding: 8px 2px 6px;
    background: var(--ese-azul-suave);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
 
.ese-cal-dow--fin {
    color: var(--ese-texto-suave);
}
 
/* Celdas de día */
.ese-cal-celda {
    min-height: 46px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 6px 2px 4px;
    border-top: 1px solid var(--ese-borde);
    border-right: 1px solid var(--ese-borde);
    transition: background 0.15s;
    position: relative;
}
 
.ese-cal-celda:nth-child(7n) {
    border-right: none;
}
 
.ese-cal-celda--vacia {
    background: var(--ese-fondo);
}
 
.ese-cal-celda--fin .ese-cal-dia-num {
    color: var(--ese-texto-suave);
}
 
.ese-cal-celda--hoy .ese-cal-dia-num {
    background: var(--ese-azul);
    color: var(--ese-blanco);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}
 
.ese-cal-celda--con-evento {
    background: #f0fbff;
}
 
.ese-cal-celda--con-evento:hover {
    background: var(--ese-azul-suave);
}
 
.ese-cal-dia-num {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ese-texto);
    line-height: 24px;
    min-width: 24px;
    text-align: center;
}
 
/* Puntos de colores por tipo de evento */
.ese-cal-puntos {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 3px;
}
 
.ese-cal-punto {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
 
/* --- Leyenda ---------------------------------------------- */
.ese-cal-leyenda {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 6px;
}
 
.ese-cal-leyenda-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ese-texto-suave);
}
 
/* --- Cards de evento -------------------------------------- */
.ese-cal-evento-card {
    overflow: visible;
    padding: 0 !important;
    position: relative;
}
 
/* Reemplaza el ::before azul genérico con franja lateral de color */
.ese-cal-evento-card::before {
    display: none;
}
 
.ese-cal-franja {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    border-radius: var(--ese-radio) 0 0 var(--ese-radio);
}
 
/* Badge tipo encima del título */
.ese-cal-badge-tipo {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: flex-start;
    margin-left: 8px;
}
 
/* Descripción */
.ese-cal-descripcion {
    font-size: 0.85rem;
    color: var(--ese-texto-suave);
    line-height: 1.5;
    margin: 0;
}
 
/* --- Bloque asistencia ------------------------------------ */
.ese-cal-asistencia-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
 
.ese-cal-asistencia-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ese-texto-suave);
    white-space: nowrap;
}
 
.ese-cal-botones-asistencia {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
 
.ese-cal-btn-asiste {
    padding: 7px 16px;
    border: none;
    border-radius: 30px;
    font-family: var(--ese-font);
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    transition: opacity 0.18s, transform 0.15s;
    -webkit-appearance: none;
    appearance: none;
}
 
.ese-cal-btn-asiste:active {
    transform: scale(0.96);
    opacity: 0.85;
}
 
.ese-cal-btn-asiste--si {
    background: #1aab5f;
    color: #fff;
}
 
.ese-cal-btn-asiste--no {
    background: #e74c3c;
    color: #fff;
}
 
/* Estado ya respondido */
.ese-cal-respuesta {
    display: flex;
    align-items: center;
    font-size: 0.84rem;
    font-weight: 700;
    flex-wrap: wrap;
    gap: 4px;
}
 
.ese-cal-respuesta--si { color: #1aab5f; }
.ese-cal-respuesta--no { color: #e74c3c; }
 
.ese-cal-cambiar-btn {
    background: none;
    border: 1.5px solid var(--ese-borde);
    border-radius: 20px;
    padding: 4px 12px;
    font-family: var(--ese-font);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ese-texto-suave);
    cursor: pointer;
    transition: border-color 0.18s, color 0.18s;
    -webkit-appearance: none;
    appearance: none;
}
 
.ese-cal-cambiar-btn:hover {
    border-color: var(--ese-azul);
    color: var(--ese-azul);
}
 
/* Highlight temporal al hacer scroll desde el calendario */
@keyframes ese-cal-flash {
    0%   { box-shadow: 0 0 0 3px rgba(0,157,196,0.6); }
    100% { box-shadow: var(--ese-sombra); }
}
 
.ese-cal-highlight {
    animation: ese-cal-flash 1.8s ease-out forwards;
}


/* Gemini */

/* Mejora del grid para que no falten bordes */
.ese-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: var(--ese-borde); /* El color del fondo hace de borde */
    gap: 1px; /* Espacio de 1px entre celdas */
    border-bottom: 1px solid var(--ese-borde);
}

.ese-cal-celda {
    background-color: var(--ese-blanco); /* Fondo blanco para las celdas */
    min-height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 2px;
    transition: background 0.2s;
    cursor: default;
}

.ese-cal-celda--con-evento {
    cursor: pointer;
}

.ese-cal-celda--vacia {
    background-color: #f9fbfc;
}

/* Evitar que el scroll tape el evento con la cabecera fija */
[id^="scroll-dia-"] {
    scroll-margin-top: 80px; 
}

[id^="ev-"] {
    scroll-margin-top: 80px;
}


/* BLOQUE DE ESITLOS DE - FILTROS */

.ese-filtros-wrapper {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 20px;
    }
    .ese-filtro-grupo {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none; /* Ocultar scroll en Firefox */
    }
    .ese-filtro-grupo::-webkit-scrollbar { display: none; } /* Ocultar scroll en Chrome */

    .ese-filtro-label {
        font-size: 0.7rem;
        text-transform: uppercase;
        color: #999;
        font-weight: 800;
        margin-bottom: 4px;
        margin-left: 4px;
    }

    .ese-pill {
        background: #f0f4f8;
        color: #666;
        padding: 6px 14px;
        border-radius: 20px;
        font-size: 0.85rem;
        font-weight: 600;
        text-decoration: none;
        white-space: nowrap;
        border: 1px solid transparent;
        transition: all 0.2s;
    }
    .ese-pill.active {
        background: var(--ese-azul);
        color: #fff;
        box-shadow: 0 2px 6px rgba(0, 157, 196, 0.3);
    }

    .ese-rango-personalizado {
        display: flex;
        gap: 8px;
        margin-top: 10px;
        background: #f8fafc;
        padding: 10px;
        border-radius: 12px;
        align-items: center;
        border: 1px solid #e2e8f0;
    }
    .ese-input-fecha {
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        padding: 5px 8px;
        font-family: inherit;
        font-size: 0.85rem;
        color: #334155;
        outline: none;
        flex: 1;
    }
    .ese-btn-buscar {
        background: var(--ese-azul);
        color: white;
        border: none;
        padding: 6px 12px;
        border-radius: 8px;
        font-weight: 700;
    }
    
