/* ============================================================
   Diseño «Cristal» (Modelo A) — solo apariencia.
   Todo va bajo .tema-cristal: con el diseño Clásico nada de esto aplica.
   Las pantallas son las mismas; cambian el menú, la barra de arriba,
   la portada (Inicio) y la pantalla de acceso.
   ============================================================ */

/* Piezas que solo existen en Cristal */
.brand-anio, .avatar-ini, .cr-solo { display: none; }

.tema-cristal {
    --cr-marino: #0F1C33;
    --cr-azul: #1E4FA8;
    --cr-dorado: #F2B544;
    --cr-texto: #0F1C33;
    --cr-suave: #5A6478;
    --cr-menu: rgba(12, 24, 48, .66);
    --cr-blur: 18px;
    --cr-gap: 16px;
    --sidebar-width: 264px;
    position: relative;
    background: #E9EEF6;
    font-family: 'Segoe UI', system-ui, sans-serif;
    isolation: isolate;
}

/* Fondo con manchas de color (lo que se ve a través del menú) */
.tema-cristal::before,
.tema-cristal::after {
    content: "";
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(100px);
}
.tema-cristal::before { width: 620px; height: 620px; left: -140px; top: -180px; background: #2A5BC4; opacity: .5; }
.tema-cristal::after  { width: 560px; height: 560px; right: -160px; bottom: -160px; background: #F2B544; opacity: .35; }

/* ── Menú flotante y transparente ── */
.tema-cristal .sidebar {
    top: var(--cr-gap); left: var(--cr-gap); bottom: var(--cr-gap);
    width: var(--sidebar-width);
    border-radius: 24px;
    background: var(--cr-menu);
    -webkit-backdrop-filter: blur(var(--cr-blur)) saturate(140%);
    backdrop-filter: blur(var(--cr-blur)) saturate(140%);
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 20px 50px rgba(12, 24, 48, .25);
    color: rgba(255, 255, 255, .85);
    padding: 6px 10px;
}
.tema-cristal .sidebar-brand { border-bottom: 0; padding: 1rem .6rem .6rem; gap: .5rem; }
.tema-cristal .sidebar-brand > i {
    width: 40px; height: 40px; border-radius: 12px; margin: 0 !important;
    background: var(--cr-dorado); color: var(--cr-marino);
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem;
}
.tema-cristal .brand-texto { display: flex; flex-direction: column; line-height: 1.15; }
.tema-cristal .brand-anio { display: block; font-size: .72rem; font-weight: 500; color: rgba(255, 255, 255, .6); }

.tema-cristal .nav-section-title { color: rgba(255, 255, 255, .5); letter-spacing: .12em; padding: .9rem .75rem .3rem; }
.tema-cristal .nav-item {
    border-left: 0;
    border-radius: 12px;
    padding: .55rem .75rem;
    margin: 1px 0;
    color: rgba(255, 255, 255, .82);
}
.tema-cristal .nav-item:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.tema-cristal .nav-item.active {
    background: rgba(255, 255, 255, .16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
    color: #fff;
}
.tema-cristal .nav-item.active::after {
    content: ""; margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--cr-dorado);
}

.tema-cristal .sidebar-footer { border-top: 1px solid rgba(255, 255, 255, .12); padding: .8rem .5rem .6rem; }
.tema-cristal .user-info { color: #fff; }
.tema-cristal .icono-usuario { display: none; }
.tema-cristal .avatar-ini {
    display: inline-flex; flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
    align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .18); font-weight: 700; font-size: .8rem;
}
.tema-cristal .user-info .text-muted { color: rgba(255, 255, 255, .6) !important; }
.tema-cristal .sidebar-footer .btn { border-radius: 10px; }
.tema-cristal .sidebar-footer .btn-outline-secondary { color: rgba(255, 255, 255, .8); border-color: rgba(255, 255, 255, .25); }
.tema-cristal .sidebar-footer .btn-outline-secondary:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* ── Contenido y barra de arriba de vidrio ── */
.tema-cristal .main-content { margin-left: calc(var(--sidebar-width) + var(--cr-gap) * 2); }
.tema-cristal .topbar {
    margin: var(--cr-gap) var(--cr-gap) 0 0;
    top: var(--cr-gap);
    border-radius: 18px;
    background: rgba(255, 255, 255, .7);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, .85);
    box-shadow: 0 8px 24px rgba(15, 28, 51, .06);
}
.tema-cristal .chip-anio {
    color: var(--cr-azul) !important; background: #E3ECFB; font-weight: 600;
    padding: .35rem .7rem; border-radius: 20px;
}
.tema-cristal .btn-campana {
    position: relative; width: 38px; height: 38px; border-radius: 12px;
    background: rgba(255, 255, 255, .85); color: var(--cr-texto);
    display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.tema-cristal .btn-campana .punto { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: #D92D20; }
.tema-cristal .page-body { padding: 1.25rem var(--cr-gap) 1.5rem 0; }

/* Tarjetas: blancas casi sólidas (se leen bien sobre el fondo y no pesan) */
.tema-cristal .card {
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 28, 51, .07);
}
.tema-cristal .card-header { border-radius: 18px 18px 0 0 !important; }

/* ── Portada (Inicio) ── */
.tema-cristal .cr-hero {
    border-radius: 24px; padding: 28px 32px; background: rgba(15, 28, 51, .88); color: #fff;
    display: flex; align-items: center; gap: 24px; box-shadow: 0 20px 50px rgba(15, 28, 51, .2);
}
.tema-cristal .cr-hero .cr-fecha { font-size: .8rem; color: var(--cr-dorado); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tema-cristal .cr-hero h1 { font-family: Georgia, 'Times New Roman', serif; font-size: 2.2rem; font-weight: 600; margin: .3rem 0; }
.tema-cristal .cr-hero .cr-sub { color: rgba(255, 255, 255, .75); }
.tema-cristal .cr-hero img { max-height: 92px; max-width: 120px; object-fit: contain; border-radius: 16px; background: rgba(255, 255, 255, .95); padding: 6px; }
.tema-cristal .cr-vidrio {
    border-radius: 18px; padding: 18px 20px;
    background: rgba(255, 255, 255, .74);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, .85);
    box-shadow: 0 10px 30px rgba(15, 28, 51, .07);
}
.tema-cristal .cr-titulo { font-weight: 700; color: var(--cr-texto); font-size: 1rem; }
.tema-cristal .cr-stat .cr-ico {
    width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.tema-cristal .cr-stat .cr-num { font-size: 1.75rem; font-weight: 700; color: var(--cr-texto); letter-spacing: -.02em; }
.tema-cristal .cr-stat .cr-lbl { font-size: .82rem; color: var(--cr-suave); }
.tema-cristal .cr-periodo .cr-barra { height: 8px; border-radius: 8px; background: #D6DEEC; overflow: hidden; }
.tema-cristal .cr-periodo .cr-barra > span { display: block; height: 100%; background: var(--cr-azul); }
.tema-cristal .cr-acceso {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
    background: rgba(255, 255, 255, .7); border: 1px solid rgba(255, 255, 255, .9);
    color: var(--cr-texto); font-weight: 600; text-decoration: none; font-size: .92rem;
}
.tema-cristal .cr-acceso:hover { background: #fff; }
.tema-cristal .cr-acceso .cr-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--cr-marino); color: var(--cr-dorado); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tema-cristal .cr-pendiente { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid rgba(15, 28, 51, .08); text-decoration: none; color: inherit; }
.tema-cristal .cr-pendiente:first-of-type { border-top: 0; }
.tema-cristal .cr-pendiente .cr-t { font-weight: 600; color: var(--cr-texto); font-size: .92rem; }
.tema-cristal .cr-pendiente .cr-d { font-size: .8rem; color: var(--cr-suave); }

/* ── Reducir transparencia (elegido por el usuario o por el sistema) ── */
.tema-cristal.reducir-transparencia .sidebar,
.tema-cristal.reducir-transparencia .topbar,
.tema-cristal.reducir-transparencia .cr-vidrio {
    -webkit-backdrop-filter: none; backdrop-filter: none;
}
.tema-cristal.reducir-transparencia .sidebar { background: var(--cr-marino); }
.tema-cristal.reducir-transparencia .topbar,
.tema-cristal.reducir-transparencia .cr-vidrio { background: #fff; }
.tema-cristal.reducir-transparencia::before,
.tema-cristal.reducir-transparencia::after { display: none; }
@media (prefers-reduced-transparency: reduce) {
    .tema-cristal .sidebar, .tema-cristal .topbar, .tema-cristal .cr-vidrio { -webkit-backdrop-filter: none; backdrop-filter: none; }
    .tema-cristal .sidebar { background: var(--cr-marino); }
    .tema-cristal .topbar, .tema-cristal .cr-vidrio { background: #fff; }
}

/* ── Celular: el menú vuelve a deslizarse desde la izquierda ── */
@media (max-width: 768px) {
    .tema-cristal .sidebar { top: 0; left: 0; bottom: 0; border-radius: 0 20px 20px 0; }
    .tema-cristal .main-content { margin-left: 0 !important; }
    .tema-cristal .topbar { margin: 8px 8px 0; top: 8px; }
    .tema-cristal .page-body { padding: .75rem .5rem; }
    .tema-cristal .cr-hero { flex-direction: column; align-items: flex-start; padding: 22px; }
    .tema-cristal .cr-hero h1 { font-size: 1.6rem; }
}

/* ── Impresión: sin efectos ── */
@media print {
    .tema-cristal { background: #fff; }
    .tema-cristal::before, .tema-cristal::after { display: none; }
    .tema-cristal .main-content { margin-left: 0; }
}

/* ============================================================
   Pantalla de acceso «Cristal»
   ============================================================ */
.acceso-cristal { min-height: 100vh; display: flex; background: #0F1C33; font-family: 'Segoe UI', system-ui, sans-serif; }
.acceso-cristal .ac-izq {
    flex: 1.25; position: relative; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: clamp(14px, 3vh, 30px); padding: clamp(24px, 4vw, 56px);
    background: #1B2C4D;
}
.acceso-cristal .ac-izq::before, .acceso-cristal .ac-izq::after {
    content: ""; position: absolute; border-radius: 50%; filter: blur(110px); pointer-events: none;
}
.acceso-cristal .ac-izq::before { width: 520px; height: 520px; left: -120px; top: -140px; background: #2A5BC4; opacity: .6; }
.acceso-cristal .ac-izq::after  { width: 460px; height: 460px; right: -100px; bottom: -120px; background: #F2B544; opacity: .35; }
.acceso-cristal .ac-tarjeta {
    position: relative; z-index: 1; width: 100%; max-width: 560px; text-align: center;
    padding: clamp(18px, 2.5vw, 30px); border-radius: 24px; color: #fff;
    background: rgba(15, 28, 51, .55);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, .16);
}
.acceso-cristal .ac-tarjeta img { max-height: 84px; max-width: 140px; object-fit: contain; border-radius: 16px; background: rgba(255,255,255,.95); padding: 6px; margin-bottom: 18px; }
.acceso-cristal .ac-tarjeta h2 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.3rem, 2.2vw, 2rem); font-weight: 600; line-height: 1.15; margin: 0; }
.acceso-cristal .ac-lema { color: rgba(255, 255, 255, .75); margin-top: 10px; }
.acceso-cristal .ac-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; justify-content: center; }
.acceso-cristal .ac-chips span { font-size: .8rem; padding: 6px 12px; border-radius: 20px; background: rgba(255, 255, 255, .12); }
.acceso-cristal .ac-der { width: 520px; max-width: 100%; background: #FAF8F3; display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 4vw, 56px) clamp(28px, 4vw, 64px); }
.acceso-cristal .ac-marca { display: flex; align-items: center; gap: 10px; margin-bottom: clamp(18px, 3vh, 36px); color: #0F1C33; font-weight: 700; font-size: 1.15rem; }
.acceso-cristal .ac-marca i { width: 40px; height: 40px; border-radius: 12px; background: #0F1C33; color: #F2B544; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.acceso-cristal h1 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.5rem, 2.2vw, 1.9rem); color: #0F1C33; margin: 0; }
.acceso-cristal .ac-ayuda { color: #5A6478; margin: 6px 0 24px; }
.acceso-cristal .ac-campo { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px; border-radius: 12px; background: #fff; border: 1.5px solid #D9D3C6; margin: 6px 0 16px; color: #6B6456; }
.acceso-cristal .ac-campo:focus-within { border-color: #1E4FA8; box-shadow: 0 0 0 3px rgba(30, 79, 168, .15); }
.acceso-cristal .ac-campo input { border: 0; outline: none; flex: 1; font-size: 1rem; background: transparent; color: #0F1C33; }
.acceso-cristal label { font-size: .82rem; font-weight: 700; color: #2B2A26; }
.acceso-cristal .ac-entrar { height: 52px; border-radius: 12px; border: 0; background: #0F1C33; color: #fff; font-size: 1rem; font-weight: 700; width: 100%; }
.acceso-cristal .ac-entrar:disabled { opacity: .7; }
.acceso-cristal .ac-pie { font-size: .8rem; color: #6B6456; margin-top: 26px; display: flex; align-items: center; gap: 8px; }
@media (max-width: 900px) {
    .acceso-cristal { flex-direction: column; }
    .acceso-cristal .ac-izq { padding: 24px; min-height: 260px; }
    .acceso-cristal .ac-der { width: 100%; padding: 32px 24px; }
}
@media (prefers-reduced-transparency: reduce) {
    .acceso-cristal .ac-tarjeta { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(15, 28, 51, .92); }
}

/* ── Logo de la aplicación (Datos del Centro), en los dos diseños ── */
.sidebar-brand .brand-logo {
    width: 32px; height: 32px; object-fit: contain; border-radius: 8px;
    background: #fff; padding: 2px; margin-right: .5rem; flex-shrink: 0;
}
.tema-cristal .sidebar-brand .brand-logo { width: 40px; height: 40px; border-radius: 12px; margin: 0; }
.acceso-cristal .ac-app-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 12px; background: #fff; padding: 3px; border: 1px solid #E7E1D4; }

/* ── Logo del centro en grande en la pantalla de acceso Cristal ── */
.acceso-cristal .ac-logo-grande {
    position: static; z-index: 1; display: block;
    width: clamp(130px, 20vw, 280px); max-height: 34vh;
    object-fit: contain;
    filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .35));
}
@media (max-width: 900px) {
    .acceso-cristal .ac-logo-grande { width: clamp(120px, 34vw, 170px); max-height: 170px; }
}

/* El título recibe el foco al navegar: sin recuadro */
.page-body h1:focus, .page-body h1:focus-visible { outline: none; }

/* Menú de usuario en la barra superior (Cristal) */
.tema-cristal .menu-usuario-btn {
    background: rgba(255, 255, 255, .85); color: var(--cr-texto);
    border-radius: 20px; font-weight: 600;
}
.tema-cristal .menu-usuario-btn:hover { background: #fff; filter: none; }
.tema-cristal .menu-usuario-pop { border-radius: 14px; }
