/* ══════════════════════════════════════════════════════════════════════
   SiCoFaP — Tema visual "Aqua Glow"
   Capa puramente estética: se carga después de los estilos base.
   Todo va dentro de @media screen para NO afectar ninguna impresión
   (recibos, reportes, PDFs). Para desactivar el tema basta con quitar
   el <link> a este archivo en includes/header.php y login.php.
   ══════════════════════════════════════════════════════════════════════ */

@media screen {

:root {
    --aq-50:  #f0f9ff;
    --aq-100: #e0f2fe;
    --aq-200: #bae6fd;
    --aq-300: #7dd3fc;
    --aq-400: #38bdf8;
    --aq-500: #0ea5e9;
    --aq-600: #0284c7;
    --aq-700: #0369a1;
    --aq-900: #0c4a6e;
    --aq-cyan: #22d3ee;
    --aq-teal: #2dd4bf;
    --aq-grad: linear-gradient(135deg, #0369a1 0%, #0ea5e9 50%, #22d3ee 100%);
    --aq-glow: 0 0 0 1px rgba(14,165,233,0.10), 0 10px 30px -8px rgba(14,165,233,0.28);
    --card-bg: rgba(255,255,255,0.78);
    --card-border: rgba(255,255,255,0.85);
    --card-shadow: 0 1px 2px rgba(12,74,110,0.04), 0 8px 28px -10px rgba(12,74,110,0.14);
}

::selection { background: rgba(14,165,233,0.25); color: inherit; }

/* ── Fondo animado tipo "aurora acuática" ───────────────────────────── */
body {
    background-color: #eef8ff !important;
    background-image:
        radial-gradient(ellipse 80% 60% at 100% 0%,  rgba(14,165,233,0.16) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 0% 100%,  rgba(34,211,238,0.14) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 50% 50%,  rgba(186,230,253,0.25) 0%, transparent 70%) !important;
}
body::before,
body::after {
    content: '';
    position: fixed;
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
    opacity: 0.55;
}
body::before {
    width: 46vmax; height: 46vmax;
    top: -14vmax; right: -12vmax;
    background: radial-gradient(circle, rgba(56,189,248,0.40), rgba(14,165,233,0) 68%);
}
body::after {
    width: 40vmax; height: 40vmax;
    bottom: -16vmax; left: 8vmax;
    background: radial-gradient(circle, rgba(45,212,191,0.32), rgba(34,211,238,0) 70%);
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */
aside.sidebar {
    background:
        radial-gradient(120% 50% at 0% 0%, rgba(14,165,233,0.22) 0%, transparent 60%),
        radial-gradient(120% 40% at 100% 100%, rgba(34,211,238,0.16) 0%, transparent 60%),
        linear-gradient(180deg, #072540 0%, #04172b 55%, #020e1c 100%) !important;
    border-right: 1px solid rgba(56,189,248,0.18) !important;
    box-shadow: 6px 0 30px -6px rgba(2,14,28,0.55) !important;
}
/* Olas al pie del sidebar (estáticas: sin costo de repintado) */
aside.sidebar::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 90px;
    pointer-events: none;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 90' preserveAspectRatio='none'%3E%3Cpath d='M0 40 C64 70 128 10 192 40 C256 70 320 10 384 40 C448 70 512 10 512 40 L512 90 L0 90Z' fill='rgba(14,165,233,0.13)'/%3E%3C/svg%3E") repeat-x 0 bottom / 512px 90px,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 70' preserveAspectRatio='none'%3E%3Cpath d='M0 35 C85 10 170 60 256 35 C341 10 426 60 512 35 L512 70 L0 70Z' fill='rgba(34,211,238,0.10)'/%3E%3C/svg%3E") repeat-x 0 bottom / 512px 60px;
    z-index: 0;
}
aside.sidebar > * { position: relative; z-index: 1; }
aside.sidebar > button { position: absolute; z-index: 10; }

.sidebar-logo-area {
    background: linear-gradient(135deg, rgba(2,132,199,0.55) 0%, rgba(3,105,161,0.25) 55%, rgba(34,211,238,0.12) 100%) !important;
    border-bottom: 1px solid transparent !important;
    border-image: linear-gradient(90deg, rgba(56,189,248,0), rgba(56,189,248,0.75), rgba(34,211,238,0)) 1 !important;
    box-shadow: 0 6px 22px -6px rgba(14,165,233,0.40) !important;
}
.sidebar-logo-area h1 {
    background: linear-gradient(90deg, #ffffff 0%, #bae6fd 40%, #ffffff 60%, #7dd3fc 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.02em;
}
@keyframes aqShine { to { background-position: 200% center; } }

.logo-anim {
    background: linear-gradient(135deg, #0369a1, #0ea5e9, #22d3ee, #38bdf8, #0284c7) !important;
    background-size: 300% 300% !important;
    box-shadow: 0 0 16px rgba(14,165,233,0.55);
}
@keyframes aqPulseGlow {
    0%, 100% { box-shadow: 0 0 12px rgba(14,165,233,0.45); }
    50%      { box-shadow: 0 0 24px rgba(34,211,238,0.80); }
}

.sidebar-section-label {
    color: #3b82a6 !important;
    display: flex; align-items: center; gap: 8px;
}
.sidebar-section-label::after {
    content: '';
    flex: 1; height: 1px;
    background: linear-gradient(90deg, rgba(56,189,248,0.35), rgba(56,189,248,0));
}

.sidebar-link {
    color: #9bd8f5 !important;
    border-radius: 12px !important;
    margin: 1px 0;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease !important;
}
.sidebar-link i { transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), color 0.2s, filter 0.2s !important; }
.sidebar-link:hover {
    background: linear-gradient(90deg, rgba(14,165,233,0.16), rgba(14,165,233,0.02)) !important;
    color: #e0f2fe !important;
}
.sidebar-link:hover i { transform: scale(1.18); filter: drop-shadow(0 0 6px rgba(56,189,248,0.75)); }
.sidebar-link.active {
    background: linear-gradient(90deg, rgba(14,165,233,0.38) 0%, rgba(34,211,238,0.10) 70%, rgba(34,211,238,0) 100%) !important;
    color: #ffffff !important;
    box-shadow: inset 0 0 0 1px rgba(56,189,248,0.22), 0 6px 18px -8px rgba(14,165,233,0.65);
}
.sidebar-link.active span { color: #ffffff !important; font-weight: 600; }
.sidebar-link.active::before {
    width: 4px !important;
    background: linear-gradient(to bottom, #22d3ee, #0ea5e9) !important;
    box-shadow: 0 0 14px rgba(34,211,238,0.9) !important;
}
@media (min-width: 1024px) {
}

aside.sidebar .scrollbar-thin::-webkit-scrollbar { width: 6px; }
aside.sidebar .scrollbar-thin::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(56,189,248,0.6), rgba(34,211,238,0.35));
}

/* ── Topbar ──────────────────────────────────────────────────────────── */
header.topbar {
    background: rgba(255,255,255,0.72) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid rgba(255,255,255,0.6) !important;
    box-shadow: 0 6px 24px -12px rgba(12,74,110,0.25) !important;
    position: sticky;
}
header.topbar::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #0ea5e9 30%, #22d3ee 55%, #38bdf8 75%, transparent);
    opacity: 0.85;
    pointer-events: none;
}
@keyframes aqLine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
header.topbar h2 {
    background: linear-gradient(90deg, #0c4a6e, #0284c7 60%, #0ea5e9);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800 !important;
    letter-spacing: -0.01em;
}
.dark-toggle {
    background: linear-gradient(135deg, rgba(14,165,233,0.14), rgba(34,211,238,0.10)) !important;
    box-shadow: inset 0 0 0 1px rgba(14,165,233,0.18);
}
.dark-toggle:hover { box-shadow: inset 0 0 0 1px rgba(14,165,233,0.35), 0 0 16px rgba(14,165,233,0.35); }
.user-dropdown {
    background: rgba(255,255,255,0.97) !important;
    box-shadow: 0 24px 50px -12px rgba(12,74,110,0.35) !important;
}
.user-dropdown > div:first-child {
    background: var(--aq-grad) !important;
    position: relative; overflow: hidden;
}

/* ── Entrada suave del contenido (solo en la primera carga) ──────────── */
html:not(.theme-ready) main > * {
    animation: aqRise 0.55s cubic-bezier(0.22,1,0.36,1) backwards;
}
html:not(.theme-ready) main > *:nth-child(2) { animation-delay: 0.05s; }
html:not(.theme-ready) main > *:nth-child(3) { animation-delay: 0.10s; }
html:not(.theme-ready) main > *:nth-child(4) { animation-delay: 0.15s; }
html:not(.theme-ready) main > *:nth-child(5) { animation-delay: 0.20s; }
html:not(.theme-ready) main > *:nth-child(n+6) { animation-delay: 0.25s; }
@keyframes aqRise { from { opacity: 0; transform: translateY(14px); } }

/* ── Tarjetas (glassmorphism) ────────────────────────────────────────── */
main .bg-white.rounded-2xl,
main .bg-white.rounded-xl,
.glass-card {
    background-color: var(--card-bg) !important;
    border-color: var(--card-border) !important;
    box-shadow: var(--card-shadow) !important;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
main .bg-white.rounded-2xl:hover,
main .bg-white.rounded-xl:hover {
    box-shadow: 0 1px 2px rgba(12,74,110,0.04), 0 14px 36px -12px rgba(14,165,233,0.32) !important;
    border-color: rgba(125,211,252,0.55) !important;
}
/* Modales y paneles flotantes: más opacos para que se lean bien */
main .fixed .bg-white.rounded-2xl,
main .bg-white.rounded-2xl.shadow-xl,
main .bg-white.rounded-2xl.shadow-2xl {
    background-color: rgba(255,255,255,0.97) !important;
    box-shadow: 0 30px 70px -15px rgba(12,74,110,0.45) !important;
}
.stat-card { position: relative; overflow: hidden; }
.stat-card::after {
    content: '';
    position: absolute; top: 0; left: -60%;
    width: 50%; height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255,255,255,0.45), transparent);
    transform: skewX(-18deg);
    pointer-events: none;
    transition: left 0.7s ease;
}
.stat-card:hover::after { left: 120%; }

/* Íconos en cajitas de color: un pequeño brillo */
main .w-10.h-10.rounded-xl,
main .w-12.h-12.rounded-xl,
main .w-11.h-11.rounded-xl {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6), 0 6px 14px -8px rgba(12,74,110,0.35);
}

/* ── Botones ─────────────────────────────────────────────────────────── */
main a[class*="from-aqua-500"], main button[class*="from-aqua-500"],
main a.bg-aqua-500, main button.bg-aqua-500,
main a.bg-aqua-600, main button.bg-aqua-600 {
    background-image: linear-gradient(135deg, #0284c7 0%, #0ea5e9 55%, #22d3ee 100%) !important;
    background-size: 160% 160% !important;
    background-position: 0% 50%;
    box-shadow: 0 8px 20px -8px rgba(14,165,233,0.65), inset 0 1px 0 rgba(255,255,255,0.25) !important;
    transition: background-position 0.4s ease, box-shadow 0.25s ease, filter 0.2s ease !important;
}
main a[class*="from-aqua-500"]:hover, main button[class*="from-aqua-500"]:hover,
main a.bg-aqua-500:hover, main button.bg-aqua-500:hover,
main a.bg-aqua-600:hover, main button.bg-aqua-600:hover {
    background-position: 100% 50%;
    box-shadow: 0 12px 26px -8px rgba(14,165,233,0.80), inset 0 1px 0 rgba(255,255,255,0.3) !important;
    filter: brightness(1.05);
}
main a[class*="rounded-xl"],
main button[class*="rounded-xl"] {
    transition-property: background-color, background-position, border-color, color, box-shadow, filter !important;
    transition-duration: 0.22s !important;
}
main a[class*="rounded-xl"]:active,
main button[class*="rounded-xl"]:active { filter: brightness(0.95); }

/* ── Formularios ─────────────────────────────────────────────────────── */
main input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
main select,
main textarea {
    background-color: rgba(255,255,255,0.85);
    transition: border-color 0.2s ease, box-shadow 0.25s ease, background-color 0.2s ease;
}
main input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
main select:focus,
main textarea:focus {
    border-color: #38bdf8 !important;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(14,165,233,0.14), 0 6px 16px -10px rgba(14,165,233,0.6) !important;
    outline: none;
}
main input[type="checkbox"], main input[type="radio"] { accent-color: #0ea5e9; }

/* ── Tablas ──────────────────────────────────────────────────────────── */
main table thead {
    background: linear-gradient(180deg, rgba(240,249,255,0.95), rgba(224,242,254,0.85)) !important;
}
main table thead th {
    color: #0c4a6e !important;
    border-bottom: 1px solid rgba(14,165,233,0.18) !important;
}
main table tbody tr { transition: background-color 0.18s ease, box-shadow 0.18s ease; }
main table tbody tr:hover {
    background: linear-gradient(90deg, rgba(14,165,233,0.09), rgba(14,165,233,0.02)) !important;
    box-shadow: inset 3px 0 0 #0ea5e9;
}

/* Alertas flash */
main > .border-l-4:first-child {
    box-shadow: 0 10px 26px -14px rgba(12,74,110,0.4);
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.main-wrap > footer span.font-semibold {
    background: linear-gradient(90deg, #0284c7, #22d3ee, #0ea5e9, #0284c7) !important;
    -webkit-background-clip: text !important; background-clip: text !important;
}

/* ── Scrollbar general ───────────────────────────────────────────────── */
html { scrollbar-color: rgba(14,165,233,0.55) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #38bdf8, #0284c7);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #22d3ee, #0369a1); background-clip: padding-box; }

/* ── SweetAlert2 ─────────────────────────────────────────────────────── */
.swal2-popup:not(.swal2-toast) {
    border-radius: 22px !important;
    box-shadow: 0 30px 80px -20px rgba(12,74,110,0.55) !important;
}
.swal2-popup.swal2-toast {
    border-radius: 14px !important;
    box-shadow: 0 14px 34px -12px rgba(12,74,110,0.45) !important;
}
.swal2-styled { border-radius: 12px !important; font-weight: 600 !important; }
.swal2-timer-progress-bar { background: linear-gradient(90deg, #0ea5e9, #22d3ee) !important; }

/* Tooltip del sidebar mini */
#sidebar-mini-tip {
    background: linear-gradient(135deg, #072540, #0c4a6e) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 0 14px rgba(14,165,233,0.35) !important;
}

/* ════════════════ MODO OSCURO ════════════════ */
html.dark body {
    background-color: #020b18 !important;
    background-image:
        radial-gradient(ellipse 80% 60% at 100% 0%, rgba(14,165,233,0.14) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 0% 100%, rgba(34,211,238,0.10) 0%, transparent 60%) !important;
}
html.dark body::before { opacity: 0.30; }
html.dark body::after  { opacity: 0.22; }

html.dark header.topbar {
    background: rgba(2,12,26,0.70) !important;
    border-bottom: 1px solid rgba(56,189,248,0.12) !important;
}
html.dark header.topbar h2 {
    background: linear-gradient(90deg, #e0f2fe, #7dd3fc 60%, #22d3ee);
    -webkit-background-clip: text; background-clip: text;
}
html.dark main .bg-white.rounded-2xl,
html.dark main .bg-white.rounded-xl,
html.dark .glass-card,
html.dark .stat-card {
    background-color: rgba(6,28,56,0.62) !important;
    border-color: rgba(56,189,248,0.14) !important;
    box-shadow: 0 10px 30px -12px rgba(0,0,0,0.6), inset 0 1px 0 rgba(125,211,252,0.06) !important;
}
html.dark main .bg-white.rounded-2xl:hover,
html.dark main .bg-white.rounded-xl:hover {
    border-color: rgba(56,189,248,0.32) !important;
    box-shadow: 0 14px 36px -12px rgba(14,165,233,0.30), inset 0 1px 0 rgba(125,211,252,0.08) !important;
}
html.dark main .fixed .bg-white.rounded-2xl,
html.dark main .bg-white.rounded-2xl.shadow-xl,
html.dark main .bg-white.rounded-2xl.shadow-2xl { background-color: #061c38 !important; }
html.dark .stat-card::after { background: linear-gradient(105deg, transparent, rgba(125,211,252,0.12), transparent); }
html.dark main .w-10.h-10.rounded-xl,
html.dark main .w-12.h-12.rounded-xl,
html.dark main .w-11.h-11.rounded-xl { box-shadow: inset 0 0 0 1px rgba(125,211,252,0.10); }

html.dark main input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
html.dark main select:focus,
html.dark main textarea:focus {
    background-color: #031326 !important;
    box-shadow: 0 0 0 4px rgba(14,165,233,0.20), 0 0 18px -4px rgba(34,211,238,0.45) !important;
}
html.dark main table thead { background: linear-gradient(180deg, rgba(7,37,64,0.95), rgba(4,26,56,0.95)) !important; }
html.dark main table thead th { color: #7dd3fc !important; }
html.dark main table tbody tr:hover {
    background: linear-gradient(90deg, rgba(14,165,233,0.14), rgba(14,165,233,0.03)) !important;
}
html.dark .user-dropdown { background: rgba(4,26,56,0.92) !important; }

} /* fin @media screen */

/* Accesibilidad: sin animaciones para quien las desactiva en su sistema */
@media screen and (prefers-reduced-motion: reduce) {
    body::before, body::after, aside.sidebar::after, header.topbar::after,
    .logo-anim, .sidebar-logo-area h1, main > *, .main-wrap > footer span.font-semibold {
        animation: none !important;
    }
}


/* ══════════════════════════════════════════════════════════════════════
   LOGIN
   ══════════════════════════════════════════════════════════════════════ */
@media screen {

.login-panel-left {
    background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 30%, #0284c7 55%, #0ea5e9 80%, #22d3ee 100%) !important;
}

.login-hero-icon {
    box-shadow: 0 0 0 8px rgba(255,255,255,0.06), 0 0 40px rgba(186,230,253,0.45);
    animation: aqLoginFloat 5s ease-in-out infinite;
}
@keyframes aqLoginFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.login-hero h1 { text-shadow: 0 4px 24px rgba(2,30,70,0.45); letter-spacing: -0.01em; }

.login-feature {
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), background 0.3s ease, box-shadow 0.3s ease;
}
.login-feature:hover {
    transform: translateX(6px);
    background: rgba(255,255,255,0.16) !important;
    box-shadow: 0 10px 26px -10px rgba(2,30,70,0.55);
}

.login-panel-right {
    background:
        radial-gradient(90% 60% at 100% 0%, rgba(14,165,233,0.12), transparent 60%),
        radial-gradient(80% 50% at 0% 100%, rgba(34,211,238,0.10), transparent 60%),
        #ffffff !important;
    position: relative;
}
.login-form-container { animation: aqRise 0.7s cubic-bezier(0.22,1,0.36,1) backwards; }
.login-title {
    background: linear-gradient(90deg, #0c4a6e, #0284c7, #0ea5e9);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 26px !important;
}
.login-logo-icon { box-shadow: 0 0 18px rgba(14,165,233,0.55); }

.input-wrap input:focus {
    box-shadow: 0 0 0 4px rgba(14,165,233,0.14), 0 8px 18px -12px rgba(14,165,233,0.7) !important;
}

.btn-login {
    background: linear-gradient(135deg, #0369a1 0%, #0ea5e9 55%, #22d3ee 100%) !important;
    background-size: 180% 180% !important;
    position: relative;
    overflow: hidden;
    transition: background-position 0.45s ease, box-shadow 0.25s ease, transform 0.2s ease !important;
}
.btn-login::after {
    content: '';
    position: absolute; top: 0; left: 0;
    width: 45%; height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255,255,255,0.45), transparent);
    transform: translateX(-160%) skewX(-20deg);
    animation: aqSweep 3.8s ease-in-out infinite;
}
@keyframes aqSweep { 0%, 60% { transform: translateX(-160%) skewX(-20deg); } 100% { transform: translateX(300%) skewX(-20deg); } }
.btn-login:hover {
    background-position: 100% 50% !important;
    box-shadow: 0 12px 28px -8px rgba(14,165,233,0.75) !important;
}

} /* fin @media screen (login) */

@media screen and (prefers-reduced-motion: reduce) {
    .login-panel-left, .login-hero-icon, .login-form-container,
    .login-logo-icon, .btn-login::after { animation: none !important; }
}
