/* =====================================================================
   TEMA "FIESTA" — mismo lenguaje visual que el login
   Cristal oscuro + degradados violeta / rosa / dorado + animaciones
   Se carga DESPUÉS de los estilos de cada página para poder unificarlos.
   ===================================================================== */

@property --angulo {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

:root {
    --t-violeta: #7c3aed;
    --t-rosa: #ec4899;
    --t-dorado: #fbbf24;
    --t-azul: #3b82f6;
    --t-verde: #34d399;
    --t-rojo: #fb7185;
    --t-panel: rgba(15, 23, 42, .62);
    --t-panel-fuerte: rgba(15, 23, 42, .88);
    --t-borde: rgba(255, 255, 255, .10);
    --t-texto: #e2e8f0;
    --t-suave: #94a3b8;
    --t-grad: linear-gradient(135deg, #7c3aed, #ec4899);
    --t-sombra: 0 10px 40px rgba(0, 0, 0, .35);
}

/* =====================================================================
   FONDO (compartido por panel, recibos, bienvenida y errores)
   ===================================================================== */
body.tema,
body.tema-fondo {
    color: var(--t-texto);
    background:
        linear-gradient(rgba(2, 6, 23, .78), rgba(15, 23, 42, .86)),
        url('../assets/img/fondoLogin.jpeg') center / cover fixed no-repeat,
        #0b1020;
    background-attachment: fixed;
}

.fx-aurora {
    position: fixed;
    inset: -20%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(40% 40% at 20% 30%, rgba(124, 58, 237, .40), transparent 70%),
        radial-gradient(35% 35% at 80% 25%, rgba(236, 72, 153, .30), transparent 70%),
        radial-gradient(45% 45% at 60% 85%, rgba(59, 130, 246, .30), transparent 70%);
    filter: blur(30px);
    animation: t-aurora 18s ease-in-out infinite alternate;
}

@keyframes t-aurora {
    0%   { transform: translate3d(-3%, -2%, 0) rotate(0deg) scale(1); }
    50%  { transform: translate3d(3%, 2%, 0) rotate(8deg) scale(1.08); }
    100% { transform: translate3d(-2%, 3%, 0) rotate(-6deg) scale(1.03); }
}

.fx-haz {
    position: fixed;
    top: -30vh;
    width: 36vmax;
    height: 140vh;
    z-index: 0;
    opacity: .14;
    mix-blend-mode: screen;
    pointer-events: none;
    clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%);
    transform-origin: 50% 0;
}
.fx-haz.a { left: 12%;  background: linear-gradient(180deg, rgba(236, 72, 153, .9), transparent 75%); animation: t-barrido 11s ease-in-out infinite alternate; }
.fx-haz.b { right: 6%;  background: linear-gradient(180deg, rgba(96, 165, 250, .9), transparent 75%); animation: t-barrido 13s ease-in-out infinite alternate-reverse; }

@keyframes t-barrido {
    from { transform: rotate(-22deg); }
    to   { transform: rotate(22deg); }
}

#fx-fiesta {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

body.tema #layoutSidenav,
body.tema-fondo > .t-contenido {
    position: relative;
    z-index: 1;
}

/* =====================================================================
   BARRA SUPERIOR
   ===================================================================== */
body.tema .sb-topnav {
    background: linear-gradient(90deg, rgba(15, 23, 42, .82), rgba(46, 16, 101, .62));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--t-borde);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
}

body.tema .sb-topnav .navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: .3px;
    background: linear-gradient(90deg, #fff, var(--t-dorado), var(--t-rosa), #fff);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent !important;
    animation: t-brillo 6s linear infinite;
}

body.tema .sb-topnav .navbar-brand img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 50%;
    -webkit-text-fill-color: initial;
    box-shadow: 0 0 18px rgba(251, 191, 36, .45);
}

@keyframes t-brillo { to { background-position: -250% 0; } }

body.tema #sidebarToggle { color: #cbd5e1; transition: color .2s, transform .2s; }
body.tema #sidebarToggle:hover { color: var(--t-dorado); transform: rotate(90deg); }

body.tema .sb-topnav .nav-link { color: #cbd5e1 !important; }
body.tema .sb-topnav .nav-link:hover { color: var(--t-dorado) !important; }

/* =====================================================================
   MENÚ LATERAL
   ===================================================================== */
body.tema .sb-sidenav {
    background: linear-gradient(180deg, rgba(15, 23, 42, .78), rgba(2, 6, 23, .86));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--t-borde);
    box-shadow: 8px 0 40px rgba(0, 0, 0, .35);
}

body.tema .sb-sidenav .nav-link {
    color: #cbd5e1;
    border-radius: 14px;
    margin: 4px 12px;
    overflow: hidden;
    transition: background .25s ease, transform .25s ease, box-shadow .25s ease, color .25s;
}

body.tema .sb-sidenav .nav-link i {
    color: #a78bfa;
    transition: transform .3s ease, color .25s;
}

body.tema .sb-sidenav .nav-link:hover {
    background: linear-gradient(90deg, rgba(124, 58, 237, .28), rgba(236, 72, 153, .14));
    color: #fff;
    transform: translateX(5px);
}

body.tema .sb-sidenav .nav-link:hover i {
    color: var(--t-dorado);
    transform: scale(1.25) rotate(-8deg);
}

body.tema .sb-sidenav .nav-link.active {
    background: var(--t-grad);
    color: #fff !important;
    box-shadow: 0 8px 24px rgba(124, 58, 237, .45);
}

body.tema .sb-sidenav .nav-link.active i { color: #fff; }

body.tema .sb-sidenav .nav-link.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-20deg);
    animation: t-destello 4s ease-in-out infinite;
}

@keyframes t-destello {
    0%, 60% { left: -80%; }
    100% { left: 140%; }
}

body.tema .sb-sidenav .sb-sidenav-menu-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--t-suave);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin: 20px 18px 6px;
}

body.tema .sb-sidenav .sb-sidenav-menu-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, .15), transparent);
}

body.tema .sb-sidenav-footer {
    background: rgba(255, 255, 255, .04);
    border-top: 1px solid var(--t-borde);
    color: var(--t-suave);
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.sb-user-avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    background: var(--t-grad);
    box-shadow: 0 0 0 2px rgba(251, 191, 36, .6), 0 6px 18px rgba(124, 58, 237, .45);
}

body.tema .sb-sidenav-footer strong { color: #fff; display: block; line-height: 1.2; }

body.sb-sidenav-toggled .sb-sidenav-footer > div:last-child { display: none; }
body.sb-sidenav-toggled .sb-sidenav-footer { justify-content: center; }

/* =====================================================================
   TÍTULOS Y TEXTOS
   ===================================================================== */
body.tema main h1,
body.tema .page-title,
body.tema .dashboard-title-main {
    font-weight: 800;
    letter-spacing: .2px;
    background: linear-gradient(90deg, #fff 0%, #fde68a 45%, #f9a8d4 75%, #fff 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: t-brillo 8s linear infinite;
}

body.tema h2, body.tema h3, body.tema h4, body.tema h5, body.tema h6 { color: #f1f5f9; }

body.tema .text-muted,
body.tema .text-secondary,
body.tema small.text-muted { color: var(--t-suave) !important; }

body.tema .text-dark { color: #f1f5f9 !important; }
body.tema .text-primary { color: #c4b5fd !important; }
body.tema .text-success { color: var(--t-verde) !important; }
body.tema .text-danger { color: var(--t-rojo) !important; }
body.tema .text-warning { color: var(--t-dorado) !important; }
body.tema .text-info { color: #67e8f9 !important; }

body.tema a { color: #c4b5fd; }
body.tema a:hover { color: var(--t-dorado); }
body.tema a.text-decoration-none { color: inherit; }

body.tema hr { border-color: var(--t-borde); opacity: 1; }

body.tema .section-title {
    color: var(--t-dorado);
    display: flex;
    align-items: center;
    gap: 10px;
}
body.tema .section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(251, 191, 36, .4), transparent);
}

body.tema .folio-text { color: #fde68a; }
body.tema .info-list dt { color: var(--t-suave); }
body.tema .info-list dd { color: #f1f5f9; }
body.tema .payment-total { color: #fff; }
body.tema .payment-success { color: var(--t-verde); }
body.tema .payment-danger { color: var(--t-rojo); }

body.tema .de-wrap { color: #e2e8f0; }
body.tema .de-wrap strong { color: #fff; }
body.tema .de-wrap .de-dot { color: var(--t-dorado); }

body.tema .breadcrumb { background: transparent; }
body.tema .breadcrumb-item a { color: #c4b5fd; }
body.tema .breadcrumb-item.active { color: var(--t-dorado); }
body.tema .breadcrumb-item + .breadcrumb-item::before { color: var(--t-suave); }

/* =====================================================================
   TARJETAS (cristal)
   ===================================================================== */
body.tema .card,
body.tema .card-pro,
body.tema .client-card,
body.tema .event-card,
body.tema .dashboard-card,
body.tema .card-resumen,
body.tema .payment-box,
body.tema .payment-summary,
body.tema .detalle-evento {
    position: relative;
    color: var(--t-texto);
    background: var(--t-panel);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--t-borde);
    border-radius: 20px;
    box-shadow: var(--t-sombra);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

body.tema .payment-summary,
body.tema .payment-box,
body.tema .detalle-evento,
body.tema .card-resumen {
    background: rgba(255, 255, 255, .05);
    box-shadow: none;
    border-radius: 16px;
}

body.tema .card .card { background: rgba(255, 255, 255, .04); box-shadow: none; }

/* destello que sigue al mouse (lo posiciona tema.js) */
body.tema .card:not(.stats-card)::before,
body.tema .dashboard-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .10), transparent 60%);
    opacity: 0;
    transition: opacity .3s;
}
body.tema .card:hover::before,
body.tema .dashboard-card:hover::before { opacity: 1; }

body.tema .card:hover { border-color: rgba(167, 139, 250, .35); }

body.tema .dashboard-card:hover {
    transform: translateY(-6px);
    border-color: rgba(251, 191, 36, .45);
    box-shadow: 0 18px 50px rgba(124, 58, 237, .35) !important;
}

body.tema .card-header,
body.tema .card-footer,
body.tema .card-header.bg-white {
    background: rgba(255, 255, 255, .04) !important;
    border-color: var(--t-borde);
    color: #f1f5f9;
}

body.tema .card-header.fw-bold { letter-spacing: .3px; }

body.tema .bg-white { background: var(--t-panel) !important; }
body.tema .bg-light { background: rgba(255, 255, 255, .05) !important; color: var(--t-texto); }

/* cabeceras de formularios (cliente / evento) */
body.tema .client-card-header,
body.tema .event-card-header {
    background: linear-gradient(135deg, rgba(124, 58, 237, .55), rgba(236, 72, 153, .35));
    border-bottom: 1px solid var(--t-borde);
    position: relative;
    overflow: hidden;
}

body.tema .client-card-header::after,
body.tema .event-card-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .18), transparent);
    transform: skewX(-20deg);
    animation: t-destello 5s ease-in-out infinite;
}

body.tema .client-icon,
body.tema .event-icon {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .2);
    box-shadow: 0 0 28px rgba(251, 191, 36, .25);
    animation: t-flotar 4s ease-in-out infinite;
}

@keyframes t-flotar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* tarjetas de estadísticas */
body.tema .stats-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: var(--t-panel);
    border: 1px solid var(--t-borde);
    color: var(--t-texto);
    box-shadow: var(--t-sombra);
}

body.tema .stats-card::before {
    content: '';
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    top: -45px;
    right: -35px;
    background: rgba(255, 255, 255, .07);
}

body.tema .stats-card::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--t-violeta), var(--t-rosa), var(--t-dorado));
}

body.tema .stats-card:hover { transform: translateY(-5px); box-shadow: 0 18px 44px rgba(124, 58, 237, .35); }

body.tema .stats-card h2,
body.tema .stats-card h3 { font-variant-numeric: tabular-nums; }

body.tema .stats-primary { background: linear-gradient(135deg, rgba(124, 58, 237, .85), rgba(236, 72, 153, .75)); color: #fff; }
body.tema .stats-success { background: linear-gradient(135deg, rgba(5, 150, 105, .85), rgba(20, 184, 166, .75)); color: #fff; }
body.tema .stats-danger  { background: linear-gradient(135deg, rgba(225, 29, 72, .85), rgba(244, 63, 94, .7)); color: #fff; }
body.tema .stats-primary::after, body.tema .stats-success::after, body.tema .stats-danger::after { background: rgba(255, 255, 255, .5); }

/* iconos del dashboard */
body.tema .dashboard-icon {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .15);
    box-shadow: 0 0 26px var(--glow, rgba(124, 58, 237, .35));
    transition: transform .35s ease;
}
body.tema .dashboard-card:hover .dashboard-icon { transform: scale(1.12) rotate(-6deg); }
body.tema .dashboard-clientes { --glow: rgba(59, 130, 246, .5); }
body.tema .dashboard-eventos  { --glow: rgba(236, 72, 153, .5); }
body.tema .dashboard-pagos    { --glow: rgba(52, 211, 153, .5); }
body.tema .dashboard-reportes { --glow: rgba(249, 115, 22, .5); }
body.tema .dashboard-clientes .dashboard-icon { background: rgba(59, 130, 246, .28); color: #bfdbfe; }
body.tema .dashboard-eventos .dashboard-icon  { background: rgba(236, 72, 153, .28); color: #fbcfe8; }
body.tema .dashboard-pagos .dashboard-icon    { background: rgba(52, 211, 153, .25); color: #a7f3d0; }
body.tema .dashboard-reportes .dashboard-icon { background: rgba(249, 115, 22, .28); color: #fed7aa; }
body.tema .dashboard-title { color: #fff; }
body.tema .dashboard-subtitle { color: var(--t-suave); }

/* =====================================================================
   TABLAS
   ===================================================================== */
body.tema .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--t-texto);
    --bs-table-border-color: rgba(255, 255, 255, .08);
    --bs-table-accent-bg: transparent;
    --bs-table-striped-bg: rgba(255, 255, 255, .03);
    --bs-table-hover-bg: transparent;
    --bs-table-hover-color: #fff;
    color: var(--t-texto);
    border-color: rgba(255, 255, 255, .08);
}

body.tema .table > :not(caption) > * > * {
    background-color: transparent;
    color: inherit;
    border-bottom-color: rgba(255, 255, 255, .08);
    box-shadow: none;
}

body.tema .table thead,
body.tema .table-light,
body.tema .table th {
    background: rgba(255, 255, 255, .05) !important;
    color: #cbd5e1 !important;
}

body.tema .table thead th {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--t-dorado) !important;
    border-bottom: 1px solid rgba(251, 191, 36, .3);
    white-space: nowrap;
}

body.tema .table tbody tr {
    transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}

body.tema .table tbody tr:hover {
    background: linear-gradient(90deg, rgba(124, 58, 237, .16), rgba(236, 72, 153, .08));
    transform: none;
    box-shadow: inset 3px 0 0 var(--t-rosa);
}

/* evita que folios y montos se partan en varias líneas */
body.tema #datatablesSimple td,
body.tema #datatablesSimple th { white-space: nowrap; }
body.tema #datatablesSimple td,
body.tema #datatablesSimple th { padding: .7rem .5rem; font-size: .9rem; }
body.tema #datatablesSimple th { font-size: .72rem; }
body.tema #datatablesSimple td .fw-semibold { white-space: normal; min-width: 96px; }
body.tema #datatablesSimple [class*="badge-"] { min-width: 0 !important; padding: 5px 9px; font-size: 11.5px; }
body.tema #datatablesSimple .datatable-sorter { padding-right: 14px; }
body.tema #datatablesSimple .btn-view { padding: 7px 11px; }

body.tema .table-warning, body.tema .table-warning > td { background: rgba(251, 191, 36, .12) !important; color: #fde68a; }

body.tema .cliente-avatar {
    background: var(--t-grad);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, .45), 0 6px 16px rgba(124, 58, 237, .4);
}

/* =====================================================================
   BOTONES
   ===================================================================== */
:is(body.tema, body.tema-fondo) .btn {
    font-weight: 600;
    border: none;
    position: relative;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, filter .25s ease, background-position .5s ease;
}

:is(body.tema, body.tema-fondo) .btn:hover { transform: translateY(-2px); }
:is(body.tema, body.tema-fondo) .btn:active { transform: translateY(0) scale(.97); }

/* principales: violeta → rosa */
:is(body.tema, body.tema-fondo) .btn-primary,
:is(body.tema, body.tema-fondo) .btn-new,
:is(body.tema, body.tema-fondo) .btn-view,
:is(body.tema, body.tema-fondo) .btn-save,
:is(body.tema, body.tema-fondo) .btn-update,
:is(body.tema, body.tema-fondo) .btn-print {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    background-size: 200% 200%;
    color: #fff;
    box-shadow: 0 8px 24px rgba(124, 58, 237, .4);
}
:is(body.tema, body.tema-fondo) .btn-primary:hover,
:is(body.tema, body.tema-fondo) .btn-new:hover,
:is(body.tema, body.tema-fondo) .btn-view:hover,
:is(body.tema, body.tema-fondo) .btn-save:hover,
:is(body.tema, body.tema-fondo) .btn-update:hover,
:is(body.tema, body.tema-fondo) .btn-print:hover {
    background-position: 100% 100%;
    color: #fff;
    box-shadow: 0 14px 34px rgba(236, 72, 153, .45);
}

/* brillo que cruza los botones principales */
:is(body.tema, body.tema-fondo) .btn-primary::after,
:is(body.tema, body.tema-fondo) .btn-new::after,
:is(body.tema, body.tema-fondo) .btn-save::after,
:is(body.tema, body.tema-fondo) .btn-update::after,
:is(body.tema, body.tema-fondo) .btn-payment::after,
:is(body.tema, body.tema-fondo) .btn-print::after {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
    transform: skewX(-20deg);
    animation: t-destello 4s ease-in-out infinite;
    pointer-events: none;
}

/* pagos / éxito: esmeralda */
:is(body.tema, body.tema-fondo) .btn-success,
:is(body.tema, body.tema-fondo) .btn-payment {
    background: linear-gradient(135deg, #059669, #14b8a6);
    color: #fff;
    box-shadow: 0 8px 24px rgba(20, 184, 166, .35);
}
:is(body.tema, body.tema-fondo) .btn-success:hover,
:is(body.tema, body.tema-fondo) .btn-payment:hover { color: #fff; box-shadow: 0 14px 34px rgba(20, 184, 166, .5); }

/* editar: azul → cian */
:is(body.tema, body.tema-fondo) .btn-edit,
:is(body.tema, body.tema-fondo) .btn-info {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    color: #fff;
    box-shadow: 0 6px 20px rgba(6, 182, 212, .3);
}
:is(body.tema, body.tema-fondo) .btn-edit:hover,
:is(body.tema, body.tema-fondo) .btn-info:hover { color: #fff; box-shadow: 0 12px 28px rgba(6, 182, 212, .5); }

/* peligro: rosa → rojo */
:is(body.tema, body.tema-fondo) .btn-danger,
:is(body.tema, body.tema-fondo) .btn-cancel,
:is(body.tema, body.tema-fondo) .btn-delete {
    background: linear-gradient(135deg, #e11d48, #f43f5e);
    color: #fff;
    box-shadow: 0 6px 20px rgba(244, 63, 94, .35);
}
:is(body.tema, body.tema-fondo) .btn-danger:hover,
:is(body.tema, body.tema-fondo) .btn-cancel:hover,
:is(body.tema, body.tema-fondo) .btn-delete:hover { color: #fff; box-shadow: 0 12px 30px rgba(244, 63, 94, .55); }

/* aviso: dorado */
:is(body.tema, body.tema-fondo) .btn-warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #1e1b4b;
    box-shadow: 0 6px 20px rgba(251, 191, 36, .35);
}
:is(body.tema, body.tema-fondo) .btn-warning:hover { color: #1e1b4b; box-shadow: 0 12px 30px rgba(251, 191, 36, .55); }

/* secundarios: cristal */
:is(body.tema, body.tema-fondo) .btn-secondary,
:is(body.tema, body.tema-fondo) .btn-back,
:is(body.tema, body.tema-fondo) .btn-history,
:is(body.tema, body.tema-fondo) .btn-outline-secondary,
:is(body.tema, body.tema-fondo) .btn-light {
    background: rgba(255, 255, 255, .08);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, .16);
    box-shadow: none;
}
:is(body.tema, body.tema-fondo) .btn-secondary:hover,
:is(body.tema, body.tema-fondo) .btn-back:hover,
:is(body.tema, body.tema-fondo) .btn-history:hover,
:is(body.tema, body.tema-fondo) .btn-outline-secondary:hover,
:is(body.tema, body.tema-fondo) .btn-light:hover {
    background: rgba(255, 255, 255, .16);
    color: #fff;
    border-color: rgba(251, 191, 36, .5);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
}

:is(body.tema, body.tema-fondo) .btn:disabled,
:is(body.tema, body.tema-fondo) .btn.disabled { opacity: .6; transform: none; }

:is(body.tema, body.tema-fondo) .btn .t-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
    transform: scale(0);
    animation: t-ripple .6s ease-out;
    pointer-events: none;
}
@keyframes t-ripple { to { transform: scale(4); opacity: 0; } }

/* =====================================================================
   FORMULARIOS
   ===================================================================== */
body.tema .form-label { color: #cbd5e1; font-weight: 600; }

body.tema .form-control,
body.tema .form-select,
body.tema textarea.form-control {
    background-color: rgba(255, 255, 255, .06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    transition: border-color .25s, box-shadow .25s, background-color .25s;
}

body.tema .form-control::placeholder { color: #64748b; }

body.tema .form-control:focus,
body.tema .form-select:focus {
    background-color: rgba(255, 255, 255, .10);
    color: #fff;
    border-color: var(--t-dorado);
    box-shadow: 0 0 0 .2rem rgba(251, 191, 36, .16), 0 0 24px rgba(251, 191, 36, .12);
}

body.tema .form-control:disabled,
body.tema .form-control[readonly] { background-color: rgba(255, 255, 255, .03); color: var(--t-suave); }

body.tema .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23cbd5e1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

body.tema .form-select option,
body.tema select option { background: #0f172a; color: #e2e8f0; }

body.tema input[type="date"],
body.tema input[type="datetime-local"] { color-scheme: dark; }

body.tema .input-group-text {
    background: rgba(255, 255, 255, .08);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, .12);
}

body.tema .input-group:focus-within .input-group-text {
    color: var(--t-dorado);
    border-color: var(--t-dorado);
}

body.tema .form-check-input {
    background-color: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .3);
}
body.tema .form-check-input:checked {
    background-color: var(--t-violeta);
    border-color: var(--t-rosa);
    box-shadow: 0 0 12px rgba(236, 72, 153, .5);
}
body.tema .form-check-label { color: #e2e8f0; }

body.tema .invalid-feedback,
body.tema .text-danger { color: var(--t-rojo); }

/* =====================================================================
   BADGES
   ===================================================================== */
body.tema .badge-days,
body.tema .badge-days-warning,
body.tema .badge-status-warning {
    background: rgba(251, 191, 36, .14);
    color: #fcd34d;
    border: 1px solid rgba(251, 191, 36, .35);
}
body.tema .badge-days-finished,
body.tema .badge-done {
    background: rgba(148, 163, 184, .14);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, .3);
}
body.tema .badge-status-success,
body.tema .badge-status-active,
body.tema .badge-events {
    background: rgba(52, 211, 153, .14);
    color: #6ee7b7;
    border: 1px solid rgba(52, 211, 153, .35);
}
body.tema .badge-status-danger,
body.tema .badge-status-cancel {
    background: rgba(251, 113, 133, .14);
    color: #fda4af;
    border: 1px solid rgba(251, 113, 133, .35);
}
body.tema .badge-count {
    background: var(--t-grad);
    color: #fff;
    box-shadow: 0 4px 14px rgba(124, 58, 237, .4);
}

body.tema .badge.bg-success { background: rgba(52, 211, 153, .16) !important; color: #6ee7b7 !important; border: 1px solid rgba(52, 211, 153, .35); }
body.tema .badge.bg-warning { background: rgba(251, 191, 36, .16) !important; color: #fcd34d !important; border: 1px solid rgba(251, 191, 36, .35); }
body.tema .badge.bg-danger  { background: rgba(251, 113, 133, .16) !important; color: #fda4af !important; border: 1px solid rgba(251, 113, 133, .35); }
body.tema .badge.bg-primary { background: rgba(124, 58, 237, .25) !important; color: #ddd6fe !important; border: 1px solid rgba(167, 139, 250, .4); }
body.tema .badge.bg-secondary { background: rgba(148, 163, 184, .16) !important; color: #cbd5e1 !important; border: 1px solid rgba(148, 163, 184, .3); }
body.tema .badge.bg-info { background: rgba(34, 211, 238, .16) !important; color: #67e8f9 !important; border: 1px solid rgba(34, 211, 238, .35); }

/* =====================================================================
   ALERTAS, MODALES, MENÚS
   ===================================================================== */
body.tema .alert { border-radius: 16px; border: 1px solid var(--t-borde); background: var(--t-panel); color: var(--t-texto); }
body.tema .alert-custom,
body.tema .alert-warning { background: rgba(251, 191, 36, .1); color: #fde68a; border-color: rgba(251, 191, 36, .35); box-shadow: none; }
body.tema .alert-danger { background: rgba(127, 29, 29, .35); color: #fecaca; border-color: rgba(248, 113, 113, .45); }
body.tema .alert-success { background: rgba(6, 78, 59, .4); color: #a7f3d0; border-color: rgba(52, 211, 153, .4); }

body.tema .modal-content {
    background: var(--t-panel-fuerte);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: var(--t-texto);
    border: 1px solid var(--t-borde);
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 60px rgba(124, 58, 237, .2);
}
body.tema .modal-header,
body.tema .modal-footer { border-color: var(--t-borde); }
body.tema .btn-close { filter: invert(1) grayscale(1) brightness(2); opacity: .7; }
body.tema .modal-backdrop.show { opacity: .65; }
body.tema .modal.fade .modal-dialog { transition: transform .35s cubic-bezier(.2, .9, .3, 1.2); }

body.tema .dropdown-menu {
    background: var(--t-panel-fuerte);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--t-borde);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
    padding: 8px;
}
body.tema .dropdown-item { color: #e2e8f0; border-radius: 10px; }
body.tema .dropdown-item:hover,
body.tema .dropdown-item:focus { background: linear-gradient(90deg, rgba(124, 58, 237, .35), rgba(236, 72, 153, .2)); color: #fff; }
body.tema .dropdown-divider { border-color: var(--t-borde); }

/* =====================================================================
   FOOTER
   ===================================================================== */
body.tema footer,
body.tema footer.bg-light {
    background: transparent !important;
    border-top: 1px solid var(--t-borde);
}
body.tema footer .text-muted { color: var(--t-suave) !important; }

/* =====================================================================
   TABLAS DINÁMICAS (simple-datatables)
   ===================================================================== */
body.tema .datatable-wrapper,
body.tema .datatable-container { color: var(--t-texto); }

body.tema .datatable-top,
body.tema .datatable-bottom { padding: 10px 0; color: var(--t-suave); }

body.tema .datatable-input,
body.tema .datatable-search input,
body.tema .datatable-selector,
body.tema .datatable-dropdown select {
    background: rgba(255, 255, 255, .06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 12px;
    padding: 7px 12px;
    outline: none;
}
body.tema .datatable-input:focus,
body.tema .datatable-search input:focus {
    border-color: var(--t-dorado);
    box-shadow: 0 0 0 .2rem rgba(251, 191, 36, .16);
}
body.tema .datatable-selector option,
body.tema .datatable-dropdown select option { background: #0f172a; color: #e2e8f0; }

body.tema .datatable-info { color: var(--t-suave); }

body.tema .datatable-pagination a,
body.tema .datatable-pagination button,
body.tema .datatable-pagination-list-item-link {
    color: #cbd5e1;
    border-radius: 10px;
    transition: background .2s, color .2s;
}
body.tema .datatable-pagination a:hover,
body.tema .datatable-pagination button:hover,
body.tema .datatable-pagination-list-item:not(.datatable-hidden):not(.datatable-disabled):not(.datatable-active) .datatable-pagination-list-item-link:hover {
    background: rgba(124, 58, 237, .3);
    color: #fff;
}
body.tema .datatable-pagination .datatable-active a,
body.tema .datatable-pagination .datatable-active button,
body.tema .datatable-active .datatable-pagination-list-item-link {
    background: var(--t-grad);
    color: #fff;
    box-shadow: 0 4px 14px rgba(124, 58, 237, .45);
}

body.tema .datatable-table > thead > tr > th { border-bottom: 1px solid rgba(251, 191, 36, .3); }
body.tema .datatable-sorter { color: var(--t-dorado); }
body.tema .datatable-sorter::before { border-top-color: rgba(251, 191, 36, .45); }
body.tema .datatable-sorter::after { border-bottom-color: rgba(251, 191, 36, .45); }
body.tema .datatable-ascending .datatable-sorter::after,
body.tema .datatable-descending .datatable-sorter::before { border-color: var(--t-dorado); }
body.tema .datatable-empty { color: var(--t-suave); text-align: center; }

/* =====================================================================
   SWEETALERT2
   ===================================================================== */
.swal2-popup {
    background: rgba(15, 23, 42, .94) !important;
    backdrop-filter: blur(18px);
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 22px !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 60px rgba(124, 58, 237, .25) !important;
}
.swal2-title { color: #fff !important; }
.swal2-html-container { color: #cbd5e1 !important; }
.swal2-popup.swal2-toast { border-radius: 16px !important; }
.swal2-timer-progress-bar { background: linear-gradient(90deg, #7c3aed, #ec4899, #fbbf24) !important; }
.swal2-confirm {
    background: linear-gradient(135deg, #7c3aed, #ec4899) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 22px rgba(124, 58, 237, .4) !important;
}
.swal2-cancel {
    background: rgba(255, 255, 255, .1) !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    border-radius: 12px !important;
}
.swal2-styled:focus { box-shadow: 0 0 0 3px rgba(251, 191, 36, .35) !important; }

/* =====================================================================
   ANIMACIONES DE ENTRADA (las activa tema.js)
   ===================================================================== */
body.tema.t-ready .t-reveal {
    opacity: 0;
    transform: translateY(22px) scale(.98);
}
body.tema.t-ready .t-reveal.t-in {
    opacity: 1;
    transform: none;
    transition: opacity .6s ease, transform .6s cubic-bezier(.2, .9, .3, 1.15);
    transition-delay: var(--t-delay, 0s);
}
/* barra de desplazamiento */
body.tema ::-webkit-scrollbar { width: 10px; height: 10px; }
body.tema ::-webkit-scrollbar-track { background: rgba(255, 255, 255, .03); }
body.tema ::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #7c3aed, #ec4899); border-radius: 10px; }

body.tema ::selection { background: rgba(236, 72, 153, .5); color: #fff; }

/* =====================================================================
   COMPONENTES COMPARTIDOS (bienvenida y errores)
   ===================================================================== */
.t-centro {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.t-card-luz {
    position: relative;
    width: 100%;
    max-width: 520px;
    border-radius: 28px;
    padding: 2px;
    background: conic-gradient(from var(--angulo), #7c3aed, #ec4899, #fbbf24, #3b82f6, #7c3aed);
    animation: t-giro 6s linear infinite, t-entrada .9s cubic-bezier(.2, .9, .3, 1.2) both;
    box-shadow: 0 25px 80px rgba(0, 0, 0, .55), 0 0 60px rgba(124, 58, 237, .25);
}
@keyframes t-giro { to { --angulo: 360deg; } }
@keyframes t-entrada {
    from { opacity: 0; transform: translateY(40px) scale(.94); }
    to   { opacity: 1; transform: none; }
}

.t-card-luz .t-interior {
    border-radius: 26px;
    padding: 40px 34px 32px;
    text-align: center;
    background: rgba(15, 23, 42, .8);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.t-logo {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto 18px;
    animation: t-flotar 4s ease-in-out infinite;
}
.t-logo::before,
.t-logo::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(251, 191, 36, .55);
    animation: t-onda 2.8s ease-out infinite;
}
.t-logo::after { animation-delay: 1.4s; border-color: rgba(236, 72, 153, .5); }
@keyframes t-onda {
    from { transform: scale(.92); opacity: .9; }
    to   { transform: scale(1.35); opacity: 0; }
}
.t-logo img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 34px rgba(251, 191, 36, .35);
}

.t-titulo {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 10px;
    background: linear-gradient(90deg, #fff, #fbbf24, #ec4899, #fff);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: t-brillo 5s linear infinite;
}

.t-codigo {
    font-size: clamp(5rem, 22vw, 8rem);
    font-weight: 900;
    line-height: 1;
    margin: 0 0 6px;
    background: linear-gradient(135deg, #7c3aed, #ec4899, #fbbf24);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: t-brillo 4s linear infinite;
    filter: drop-shadow(0 0 28px rgba(236, 72, 153, .45));
}

.t-texto { color: #cbd5e1; line-height: 1.7; margin-bottom: 24px; }

.t-boton {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 28px;
    border-radius: 14px;
    border: 0;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    box-shadow: 0 8px 26px rgba(124, 58, 237, .45);
    transition: transform .25s, box-shadow .25s;
    position: relative;
    overflow: hidden;
}
.t-boton:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(236, 72, 153, .5); }
.t-boton::after {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
    transform: skewX(-20deg);
    animation: t-destello 3.5s ease-in-out infinite;
}

.t-pie { margin-top: 22px; font-size: 13px; color: #94a3b8; }

/* =====================================================================
   HOJAS IMPRESAS (recibo e historial): el papel sigue siendo blanco
   ===================================================================== */
body.tema-fondo .documento,
body.tema-fondo .recibo {
    border-radius: 22px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, .5), 0 0 60px rgba(124, 58, 237, .2);
    animation: t-entrada .7s cubic-bezier(.2, .9, .3, 1.2) both;
}
/* el papel mantiene texto oscuro (el fondo de la página es oscuro) */
body.tema-fondo .documento,
body.tema-fondo .recibo { color: #1e293b; }
body.tema-fondo .documento :is(h1, h2, h3, h4, h5, h6),
body.tema-fondo .recibo :is(h1, h2, h3, h4, h5, h6) { color: #0f172a; -webkit-text-fill-color: initial; }
body.tema-fondo .documento .text-muted,
body.tema-fondo .recibo .text-muted { color: #64748b !important; }
body.tema-fondo .documento .text-primary,
body.tema-fondo .recibo .text-primary { color: #0d6efd !important; }
body.tema-fondo .documento .text-success,
body.tema-fondo .recibo .text-success { color: #198754 !important; }
body.tema-fondo .documento .text-danger,
body.tema-fondo .recibo .text-danger { color: #dc3545 !important; }

body.tema-fondo .recibo-header,
body.tema-fondo .header {
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, #7c3aed, #ec4899, #fbbf24) 1;
}

@media (max-width: 576px) {
    .t-card-luz .t-interior { padding: 30px 20px 24px; }
    .t-titulo { font-size: 1.6rem; }
}

@media print {
    .fx-aurora, .fx-haz, #fx-fiesta { display: none !important; }
    body.tema-fondo { background: #fff !important; }
    body.tema-fondo .documento,
    body.tema-fondo .recibo { animation: none; box-shadow: none; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .fx-aurora, .fx-haz, #fx-fiesta { display: none !important; }
    body.tema *, body.tema *::before, body.tema *::after,
    .t-card-luz, .t-logo, .t-logo::before, .t-logo::after, .t-titulo, .t-codigo, .t-boton::after {
        animation: none !important;
        transition: none !important;
    }
    body.tema.t-ready .t-reveal { opacity: 1; transform: none; }
}
