.inicio{
    display: grid;
    justify-content: center;
    justify-items: stretch;
    align-items: start;
    height: 100%;
    width: 100%;
    padding-top: 1rem;
    margin-top: 1rem;
}
img{
    border-radius: 2rem;
}
input[type=text]{
    text-align: center;
}
.alert{
    display: flex;
    justify-content: center;
}
.d-grid{
    padding-top: 1rem;
    padding-bottom: 1rem;
}
.form-control{
    text-align: center;
}
#miFormulario{
    display: inline-flex;
    justify-content: center;
}

.obligatorio::after{
    content: "*";
    color: red;
}
.border{
    border-radius: 2rem;
    padding: 2rem;
  
  }
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: auto;
}
thead{ 
    vertical-align: middle !important;
}
.div-img-fluid{
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: transparent;
}
.img-banner{
    height: 200px;
}


@keyframes parpadeo {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.img-banner {
    animation: parpadeo 2s linear infinite;
}


/* ---------- Navidad (solo en temporada, ver temporada.py) ---------- */

/* Nieve: un solo canvas encima de todo que no recibe clics (navidad.js) */
.nieve-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2000;
}

/* Guirnalda de luces bajo la barra oscura */
.navidad-luces {
    position: relative;
    padding-bottom: 14px;
}
.navidad-luces::before,
.navidad-luces::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    height: 10px;
    pointer-events: none;
    background-repeat: repeat-x;
    background-size: 96px 10px;
}
.navidad-luces::before {
    background-image:
        radial-gradient(circle at 12px 5px, #ff3b3b 3.5px, transparent 4.5px),
        radial-gradient(circle at 60px 5px, #ffd23f 3.5px, transparent 4.5px);
    animation: luces 1.6s steps(1, end) infinite;
}
.navidad-luces::after {
    background-image:
        radial-gradient(circle at 36px 5px, #2ecc71 3.5px, transparent 4.5px),
        radial-gradient(circle at 84px 5px, #3ba7ff 3.5px, transparent 4.5px);
    animation: luces 1.6s steps(1, end) infinite 0.8s;
}
@keyframes luces {
    0%   { opacity: 1; }
    50%  { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
    .nieve-canvas { display: none; }
    .navidad-luces::before,
    .navidad-luces::after { animation: none; }
}

/* Asistente IA (footer.html + static/js/ia.js) */
.ia-panel, .ia-fab{
    --ia-verde: #198754;
    --ia-oscuro: #1f2a30;
    --ia-oscuro-2: #2c3b43;
    --ia-fondo: #f4f6f8;
    --ia-borde: #e3e7eb;
    --ia-sombra: 0 18px 45px rgba(15, 23, 30, .22), 0 3px 10px rgba(15, 23, 30, .10);
}
.ia-fab{
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1080;
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    font-size: 1.45rem;
    color: #fff;
    background: linear-gradient(145deg, var(--ia-oscuro-2), var(--ia-oscuro));
    border: 2px solid rgba(25, 135, 84, .85);
    box-shadow: 0 10px 25px rgba(15, 23, 30, .28);
    transition: transform .2s ease, box-shadow .2s ease;
}
.ia-fab:hover, .ia-fab:focus-visible{
    color: #fff;
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 14px 30px rgba(15, 23, 30, .32), 0 0 0 6px rgba(25, 135, 84, .14);
}
.ia-fab-entra{
    animation: ia-pop .22s ease-out;
}
.ia-panel{
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1080;
    width: 380px;
    max-width: calc(100vw - 2rem);
    height: 560px;
    max-height: calc(100vh - 2.5rem);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 1.25rem;
    overflow: hidden;
    background: var(--ia-fondo);
    box-shadow: var(--ia-sombra) !important;
    transform-origin: bottom right;
}
.ia-panel.d-none{
    display: none !important;
}
.ia-entra{
    animation: ia-abre .24s cubic-bezier(.2, .8, .3, 1);
}
.ia-entra-min{
    animation: ia-pop .2s ease-out;
}
.ia-sale{
    animation: ia-cierra .16s ease-in forwards;
}
@keyframes ia-abre{
    from{ opacity: 0; transform: translateY(14px) scale(.96); }
    to{ opacity: 1; transform: none; }
}
@keyframes ia-cierra{
    to{ opacity: 0; transform: translateY(10px) scale(.97); }
}
@keyframes ia-pop{
    from{ opacity: 0; transform: scale(.9); }
    to{ opacity: 1; transform: none; }
}
.ia-header{
    color: #fff;
    background: linear-gradient(135deg, var(--ia-oscuro-2), var(--ia-oscuro));
    border: 0;
    border-radius: 0 !important;
    padding: .65rem .7rem .65rem .85rem;
    user-select: none;
}
.ia-avatar-wrap{
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}
.ia-avatar{
    width: 34px;
    height: 34px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .85);
}
.ia-avatar-wrap::after{
    content: "";
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2fd17c;
    border: 2px solid var(--ia-oscuro);
}
.ia-titulo{
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}
.ia-titulo b{
    font-size: .95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ia-titulo small{
    font-size: .72rem;
    color: rgba(255, 255, 255, .65);
}
.ia-hbtn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: rgba(255, 255, 255, .8);
    background: transparent;
    font-size: .9rem;
    transition: background .15s ease, color .15s ease, transform .2s ease;
}
.ia-hbtn:hover, .ia-hbtn:focus-visible{
    color: #fff;
    background: rgba(255, 255, 255, .14);
    outline: none;
}
.ia-hbtn:active{
    transform: scale(.92);
}
.ia-hbtn-min .fa-solid{
    transition: transform .25s ease;
}
.ia-log{
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    padding: 1rem .9rem;
    background: var(--ia-fondo);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, .18) transparent;
}
.ia-log::-webkit-scrollbar{
    width: 6px;
}
.ia-log::-webkit-scrollbar-thumb{
    background: rgba(0, 0, 0, .18);
    border-radius: 3px;
}
.ia-msg{
    max-width: 85%;
    padding: .55rem .8rem;
    border-radius: 1.05rem;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
    font-size: .92rem;
    text-align: left;
}
.ia-msg:last-child, .ia-confirm:last-child{
    animation: ia-msg .2s ease-out;
}
@keyframes ia-msg{
    from{ opacity: 0; transform: translateY(6px); }
    to{ opacity: 1; transform: none; }
}
.ia-bot{
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--ia-borde);
    border-bottom-left-radius: .35rem;
    box-shadow: 0 1px 2px rgba(15, 23, 30, .05);
}
.ia-user{
    align-self: flex-end;
    color: #fff;
    background: linear-gradient(135deg, var(--ia-oscuro-2), var(--ia-oscuro));
    border-bottom-right-radius: .35rem;
    box-shadow: 0 2px 6px rgba(15, 23, 30, .15);
}
.ia-typing{
    display: inline-flex;
    gap: .3rem;
    align-items: center;
    padding: .7rem .85rem;
}
.ia-typing span{
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9aa5ad;
    animation: ia-punto 1.1s infinite ease-in-out;
}
.ia-typing span:nth-child(2){ animation-delay: .15s; }
.ia-typing span:nth-child(3){ animation-delay: .3s; }
@keyframes ia-punto{
    0%, 70%, 100%{ opacity: .35; transform: translateY(0); }
    35%{ opacity: 1; transform: translateY(-4px); }
}
.ia-err{
    align-self: flex-start;
    background: #fdecee;
    border: 1px solid #f5c2c7;
    color: #842029;
}
.ia-msg code{
    color: var(--ia-verde);
    background: rgba(25, 135, 84, .08);
    padding: 0 .25rem;
    border-radius: .3rem;
}
.ia-form{
    display: flex;
    gap: .5rem;
    align-items: flex-end;
    padding: .65rem .7rem;
    border-top: 1px solid var(--ia-borde);
    background: #fff;
}
.ia-form .form-control{
    text-align: left;
    resize: none;
    border-radius: 1.2rem;
    max-height: 120px;
    padding: .5rem .9rem;
    background: var(--ia-fondo);
    border-color: transparent;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.ia-form .form-control:focus{
    background: #fff;
    border-color: rgba(25, 135, 84, .45);
    box-shadow: 0 0 0 .2rem rgba(25, 135, 84, .12);
}
.ia-form .btn{
    border-radius: 50%;
    width: 2.6rem;
    height: 2.6rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(25, 135, 84, .3);
    transition: transform .15s ease, box-shadow .15s ease;
}
.ia-form .btn:hover:not(:disabled){
    transform: translateY(-1px);
}
.ia-form .btn:disabled{
    box-shadow: none;
}
/* Minimizado: una píldora con el avatar y el nombre. */
.ia-panel.ia-min{
    height: auto;
    width: 270px;
    border-radius: 999px;
}
.ia-panel.ia-min > :not(.card-header){
    display: none !important;
}
.ia-panel.ia-min .ia-header{
    cursor: pointer;
    padding: .45rem .45rem .45rem .5rem;
}
.ia-panel.ia-min #ia-nuevo{
    display: none;
}
.ia-panel.ia-min .ia-hbtn-min .fa-solid{
    transform: rotate(180deg);
}
@media (max-width: 576px){
    .ia-panel{
        right: .5rem;
        left: .5rem;
        bottom: .5rem;
        width: auto;
        max-width: none;
        height: calc(100vh - 1rem);
    }
    .ia-panel.ia-min{
        left: auto;
        width: 250px;
    }
    .ia-fab{
        right: 1rem;
        bottom: 1rem;
    }
}
.ia-confirm{
    align-self: stretch;
    background: #fff8e1;
    border: 1px solid #ffe08a;
    border-radius: 1rem;
    padding: .65rem .8rem;
    font-size: .9rem;
    text-align: left;
    box-shadow: 0 1px 3px rgba(153, 116, 4, .08);
}
.ia-confirm-texto{
    white-space: pre-wrap;
    word-break: break-word;
}
.ia-confirm-texto .fa-solid{
    color: #997404;
}
.ia-confirm-botones{
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    margin-top: .5rem;
}
.ia-confirm-botones .btn{
    border-radius: 1rem;
}
@media (prefers-reduced-motion: reduce){
    .ia-entra, .ia-entra-min, .ia-sale, .ia-fab-entra, .ia-msg, .ia-confirm, .ia-typing span{
        animation: none !important;
    }
}

/* ── Herramientas del módem en /BotiCAM (solo admin, js/herramientas.js) ──
   Tarjeta con los colores de Bootstrap (sirve igual en modo día y noche);
   los tres botones del mismo ancho y alto. */
.herr-wrap{
    margin: 1rem auto 1.5rem;
    width: 100%;
    max-width: 780px;
    padding: 1.1rem 1.25rem 1.25rem;
    border-radius: 1rem;
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    border: 1px solid var(--bs-border-color, #dee2e6);
    box-shadow: 0 8px 24px rgba(15, 23, 30, .08);
    animation: herr-entra .25s ease-out;
}
@keyframes herr-entra{ from{ opacity: 0; transform: translateY(6px); } to{ opacity: 1; transform: none; } }
.herr-titulo{
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: .9rem;
}
.herr-titulo .fa-solid{ color: var(--bs-success, #198754); margin-right: .35rem; }
.herr-botones{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
}
.herr-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    min-height: 2.9rem;
    padding: .55rem .75rem;
    border-radius: .65rem;
    font-weight: 600;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .15s ease;
}
.herr-btn:hover, .herr-btn:focus-visible{
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 23, 30, .15);
}
.herr-btn:disabled{ transform: none; box-shadow: none; }
.herr-cargando .fa-solid:first-child{ animation: fa-spin 1s linear infinite; }
.herr-resultado{
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bs-border-color, #dee2e6);
    text-align: center;
}
.herr-resumen{
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1.25rem;
    justify-content: center;
    margin-bottom: .75rem;
    font-size: .92rem;
    color: var(--bs-secondary-color, #6c757d);
}
.herr-resumen b{ color: var(--bs-body-color, #212529); }
.herr-resumen .fa-solid, .herr-resumen .fa-regular{ color: var(--bs-success, #198754); margin-right: .2rem; }
.herr-tabla{ margin-bottom: 0; font-size: .9rem; }
.herr-mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.herr-fila-bloq td{ opacity: .7; }
.herr-bloquear, .herr-permitir{
    border-radius: .5rem;
    padding: .15rem .6rem;
    font-size: .82rem;
    font-weight: 600;
}
.herr-bloquear{ color: var(--bs-danger, #dc3545); border: 1px solid var(--bs-danger, #dc3545); background: transparent; }
.herr-bloquear:hover{ color: #fff; background: var(--bs-danger, #dc3545); }
.herr-permitir{ color: var(--bs-success, #198754); border: 1px solid var(--bs-success, #198754); background: transparent; }
.herr-permitir:hover{ color: #fff; background: var(--bs-success, #198754); }
.herr-espera{ color: var(--bs-secondary-color, #6c757d); padding: .5rem; }
@media (max-width: 640px){
    .herr-wrap{ padding: .9rem; border-radius: .85rem; }
    .herr-botones{ grid-template-columns: 1fr; }
}

/* ── Modo noche (static/js/tema.js) ── */
.tema-toggle{
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
[data-bs-theme="dark"] .herr-wrap{ box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
/* El chat del asistente tiene blancos propios: en modo noche, tonos oscuros. */
[data-bs-theme="dark"] .ia-panel{ --ia-fondo: #1b2227; --ia-borde: #2f3a41; }
[data-bs-theme="dark"] .ia-bot{ background: #262f35; color: #e6ebee; }
[data-bs-theme="dark"] .ia-form{ background: #1f272c; }
[data-bs-theme="dark"] .ia-form .form-control{ color: #e6ebee; }
[data-bs-theme="dark"] .ia-form .form-control:focus{ background: #263037; }
[data-bs-theme="dark"] .ia-err{ background: #3a1d21; color: #f1aeb5; }

/* ── Menú de la cuenta (botón ☰ de la barra) ── */
.menu-cuenta-wrap{ background: #1c2125; }
.menu-cuenta{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: 780px;
    margin: 0 auto;
    padding: .9rem 1.1rem;
}
.menu-cuenta-usuario{ display: flex; align-items: center; gap: .75rem; color: #e9ecef; }
.menu-cuenta-avatar{
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(25, 135, 84, .18);
    color: #3ddc97;
    border: 1px solid rgba(61, 220, 151, .35);
}
.menu-cuenta-datos{ display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.menu-cuenta-datos small{ color: rgba(233, 236, 239, .6); font-size: .78rem; }
.menu-cuenta-datos b{ font-size: 1rem; }
.menu-cuenta-salir{
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem 1.1rem;
    border-radius: .65rem;
    font-weight: 600;
    color: #ff8a95;
    background: rgba(220, 53, 69, .12);
    border: 1px solid rgba(220, 53, 69, .45);
    transition: background .15s ease, color .15s ease, transform .15s ease;
}
.menu-cuenta-salir:hover, .menu-cuenta-salir:focus-visible{
    color: #fff;
    background: #dc3545;
    transform: translateY(-1px);
}
@media (max-width: 480px){
    .menu-cuenta{ flex-direction: column; align-items: stretch; }
    .menu-cuenta-salir{ justify-content: center; }
}
/* El logo de abajo es un JPG con fondo blanco: en modo noche, recortado en círculo. */
[data-bs-theme="dark"] .img-banner{ border-radius: 50%; }
[data-bs-theme="dark"] .div-img-fluid{ background: transparent; }

/* ── Barra principal: sesión a la izquierda, logo al centro, salir a la derecha ── */
.barra-principal{ padding-top: .6rem; padding-bottom: .9rem; }
.barra-grid{
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: 0 1rem;
}
.barra-izq{ display: flex; align-items: center; gap: .65rem; justify-self: start; min-width: 0; color: #e9ecef; }
.barra-izq .menu-cuenta-datos b{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16rem; }
.barra-centro{ justify-self: center; margin: 0; display: inline-flex; align-items: center; gap: .5rem; }
.barra-der{ display: flex; align-items: center; gap: .6rem; justify-self: end; }
@media (max-width: 768px){
    .barra-grid{ grid-template-columns: 1fr auto; grid-template-areas: "centro centro" "izq der"; row-gap: .6rem; }
    .barra-centro{ grid-area: centro; }
    .barra-izq{ grid-area: izq; }
    .barra-der{ grid-area: der; }
    .barra-centro b{ font-size: 1rem; }
}
@media (max-width: 420px){
    .barra-txt{ display: none; }           /* en pantallas muy chicas, solo el ícono de salir */
    .menu-cuenta-salir{ padding: .55rem .8rem; }
}
.usuario-linea{ display: inline-flex; align-items: center; gap: .3rem; }
.ojo-usuario{
    border: 0;
    background: transparent;
    color: rgba(233, 236, 239, .6);
    padding: 0 .15rem;
    font-size: .78rem;
    line-height: 1;
    cursor: pointer;
}
.ojo-usuario:hover, .ojo-usuario:focus-visible{ color: #3ddc97; }

/* ── Asistente incrustado en la consola dm (/ia/widget) ── */
.ia-embebido{ margin: 0; background: transparent; overflow: hidden; }
.ia-embebido .ia-fab{ display: none !important; }
.ia-embebido .ia-panel{
    position: static;
    display: flex !important;
    width: 100%;
    max-width: none;
    height: 100vh;
    max-height: none;
    border-radius: 0;
    border: 0;
    box-shadow: none !important;
}
.ia-sin-sesion{ height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.ia-sin-sesion-card{ text-align: center; display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.ia-sin-sesion-card .fa-robot{ font-size: 2rem; color: #198754; }
.ia-avatar-dm svg{ display: block; border-radius: 12px; }
