/* ==========================================================================
   FINLYTICS - Sistema de Monitoreo Financiero y Contabilidad
   Hoja de estilos base (complementa a Tailwind CSS via CDN)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Variables de diseno
   -------------------------------------------------------------------------- */
:root {
    --fin-base-900: #070b14;
    --fin-base-800: #0b1120;
    --fin-base-700: #111a2e;
    --fin-base-600: #1a2540;
    --fin-base-500: #243049;
    --fin-borde: rgba(148, 163, 184, 0.14);
    --fin-borde-fuerte: rgba(148, 163, 184, 0.28);
    --fin-texto: #e2e8f5;
    --fin-texto-suave: #94a3b8;
    --fin-acento: #38bdf8;
    --fin-exito: #22c55e;
    --fin-aviso: #f59e0b;
    --fin-error: #ef4444;
    --fin-sombra-suave: 0 10px 30px -12px rgba(2, 6, 23, 0.75);
    --fin-sombra-alta: 0 26px 60px -22px rgba(2, 6, 23, 0.92);
    --fin-radio: 1rem;
}

/* --------------------------------------------------------------------------
   2. Reset y tipografia base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    color: var(--fin-texto);
    background-color: var(--fin-base-900);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
}

/* Numeros tabulares para columnas de dinero perfectamente alineadas */
.tabular,
.font-numerica,
td.monto,
.kpi-valor {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum';
}

/* --------------------------------------------------------------------------
   3. Alpine.js - evita el parpadeo de contenido antes de inicializar
   -------------------------------------------------------------------------- */
[x-cloak] {
    display: none !important;
}

[x-cloak='inline'] {
    display: inline !important;
}

/* --------------------------------------------------------------------------
   4. Utilidades de recorte de texto
   -------------------------------------------------------------------------- */
.line-clamp-1,
.line-clamp-2,
.line-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.line-clamp-1 { -webkit-line-clamp: 1; line-clamp: 1; }
.line-clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.line-clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }

.truncar {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   5. Scrollbars finas y elegantes
   -------------------------------------------------------------------------- */
.scroll-fino {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.scroll-fino::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.scroll-fino::-webkit-scrollbar-track {
    background: transparent;
}

.scroll-fino::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.28);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.scroll-fino::-webkit-scrollbar-thumb:hover {
    background-color: rgba(56, 189, 248, 0.55);
}

.scroll-fino::-webkit-scrollbar-corner {
    background: transparent;
}

/* Tablas que se desplazan en horizontal en pantallas estrechas: se marca el
   borde derecho con un degradado para que el usuario sepa que hay mas columnas.
   El degradado se ancla con position:sticky dentro del contenedor scrollable
   para que acompanie al desplazamiento. */
.tabla-desliza {
    position: relative;
}

@media (max-width: 767px) {
    .tabla-desliza::after {
        content: '';
        position: sticky;
        right: 0;
        top: 0;
        float: right;
        width: 2.25rem;
        height: 100%;
        pointer-events: none;
        background: linear-gradient(to right, rgba(11, 17, 32, 0), rgba(11, 17, 32, 0.92));
    }
}

/* Scrollbar global del documento */
body::-webkit-scrollbar {
    width: 10px;
}

body::-webkit-scrollbar-track {
    background: var(--fin-base-900);
}

body::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    border: 2px solid var(--fin-base-900);
}

body::-webkit-scrollbar-thumb:hover {
    background-color: rgba(56, 189, 248, 0.5);
}

/* Oculta la barra pero mantiene el scroll (carruseles de filtros) */
.sin-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sin-scrollbar::-webkit-scrollbar {
    display: none;
}

/* --------------------------------------------------------------------------
   6. Superficies, tarjetas y efecto glass
   -------------------------------------------------------------------------- */
.superficie {
    background-color: rgba(17, 26, 46, 0.72);
    border: 1px solid var(--fin-borde);
    border-radius: var(--fin-radio);
    box-shadow: var(--fin-sombra-suave);
}

.glass {
    background-color: rgba(11, 17, 32, 0.68);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid var(--fin-borde);
}

.tarjeta-hover {
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.32s ease;
    will-change: transform;
}

.tarjeta-hover:hover {
    transform: translateY(-4px);
    border-color: var(--fin-borde-fuerte);
    box-shadow: var(--fin-sombra-alta);
}

/* Borde con degradado sutil para tarjetas destacadas */
.borde-gradiente {
    position: relative;
    isolation: isolate;
}

.borde-gradiente::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(140deg, rgba(56, 189, 248, 0.45), rgba(56, 189, 248, 0) 45%, rgba(168, 85, 247, 0.35));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: -1;
}

/* --------------------------------------------------------------------------
   7. Formularios coherentes en modo oscuro
   -------------------------------------------------------------------------- */
input,
select,
textarea,
button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: none;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid rgba(56, 189, 248, 0.75);
    outline-offset: 2px;
    border-radius: 0.5rem;
}

/* Autofill: Chrome pinta fondo blanco, lo neutralizamos */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
select:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-text-fill-color: var(--fin-texto);
    -webkit-box-shadow: 0 0 0 1000px rgba(17, 26, 46, 0.98) inset;
    box-shadow: 0 0 0 1000px rgba(17, 26, 46, 0.98) inset;
    caret-color: var(--fin-texto);
    transition: background-color 100000s ease-in-out 0s;
}

::placeholder {
    color: rgba(148, 163, 184, 0.55);
    opacity: 1;
}

/* Selects nativos: flecha propia y sin apariencia del sistema */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2394a3b8'%3E%3Cpath d='M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.05rem;
    /* !important es necesario: las utilidades de Tailwind (px-4, px-3.5) son
       selectores de clase y ganan por especificidad al selector de etiqueta,
       dejando la flecha encima del texto de la opcion mas larga. */
    padding-right: 2.35rem !important;
}

select option {
    background-color: var(--fin-base-700);
    color: var(--fin-texto);
}

textarea {
    resize: vertical;
    min-height: 4.5rem;
}

/* Inputs de fecha: icono del calendario visible en modo oscuro */
input[type='date']::-webkit-calendar-picker-indicator,
input[type='datetime-local']::-webkit-calendar-picker-indicator,
input[type='month']::-webkit-calendar-picker-indicator {
    filter: invert(0.75) sepia(0.2) saturate(3) hue-rotate(170deg);
    cursor: pointer;
    opacity: 0.8;
}

input[type='date']::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Oculta las flechas de los inputs numericos */
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type='number'] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Buscadores: quita la X nativa de WebKit */
input[type='search']::-webkit-search-decoration,
input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-results-button,
input[type='search']::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
}

/* Checkbox y radio con acento del sistema */
input[type='checkbox'],
input[type='radio'] {
    accent-color: var(--fin-acento);
    cursor: pointer;
}

/* Estado deshabilitado uniforme */
input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   8. Botones e interacciones
   -------------------------------------------------------------------------- */
button,
[role='button'] {
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.16s ease, background-color 0.2s ease,
                border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:not(:disabled):active,
[role='button']:not([aria-disabled='true']):active {
    transform: scale(0.97);
}

/* Brillo que recorre el boton principal */
.boton-brillo {
    position: relative;
    overflow: hidden;
}

.boton-brillo::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transform: skewX(-18deg);
    transition: left 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.boton-brillo:hover::after {
    left: 130%;
}

/* --------------------------------------------------------------------------
   9. Tablas
   -------------------------------------------------------------------------- */
table {
    border-collapse: separate;
    border-spacing: 0;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: rgba(11, 17, 32, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: rgba(36, 48, 73, 0.42);
}

/* Fila recien modificada: destello para retroalimentar la accion */
.fila-resaltada,
tr.fila-resaltada:hover {
    animation: destello 1.5s ease-out;
}

@keyframes destello {
    0%   { background-color: rgba(56, 189, 248, 0.28); }
    35%  { background-color: rgba(56, 189, 248, 0.18); }
    100% { background-color: transparent; }
}

/* Encabezados ordenables */
th.ordenable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

th.ordenable:hover {
    color: var(--fin-acento);
}

/* --------------------------------------------------------------------------
   10. Insignias de estado animadas
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.5;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge .punto {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    background-color: currentColor;
    flex: 0 0 auto;
}

/* Punto latiente para estados que requieren atencion */
.badge-latido .punto {
    animation: latido 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes latido {
    0%, 100% { opacity: 1;   transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.72); }
}

/* Aura suave alrededor del punto de estado pagado */
.punto-aura {
    position: relative;
}

.punto-aura::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 999px;
    background-color: currentColor;
    opacity: 0.28;
    animation: aura 2s ease-out infinite;
}

@keyframes aura {
    0%   { transform: scale(0.7); opacity: 0.35; }
    70%  { transform: scale(1.7); opacity: 0; }
    100% { transform: scale(1.7); opacity: 0; }
}

/* --------------------------------------------------------------------------
   11. Animaciones de apoyo (usadas por x-transition y estados de carga)
   -------------------------------------------------------------------------- */
@keyframes aparecer {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes aparecer-escala {
    from { opacity: 0; transform: scale(0.94) translateY(14px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

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

@keyframes girar {
    to { transform: rotate(360deg); }
}

@keyframes brillo-barrido {
    100% { transform: translateX(100%); }
}

.anim-aparecer      { animation: aparecer 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }
.anim-aparecer-esc  { animation: aparecer-escala 0.36s cubic-bezier(0.22, 1, 0.36, 1) both; }
.anim-flotar        { animation: flotar 7s ease-in-out infinite; }
.anim-girar         { animation: girar 0.9s linear infinite; }

/* Retardos escalonados para listas y tarjetas KPI */
.retardo-1 { animation-delay: 0.06s; }
.retardo-2 { animation-delay: 0.12s; }
.retardo-3 { animation-delay: 0.18s; }
.retardo-4 { animation-delay: 0.24s; }
.retardo-5 { animation-delay: 0.30s; }
.retardo-6 { animation-delay: 0.36s; }

/* --------------------------------------------------------------------------
   12. Esqueletos de carga (skeleton)
   -------------------------------------------------------------------------- */
.esqueleto {
    position: relative;
    overflow: hidden;
    background-color: rgba(36, 48, 73, 0.55);
    border-radius: 0.65rem;
}

.esqueleto::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.18), transparent);
    animation: brillo-barrido 1.5s infinite;
}

/* --------------------------------------------------------------------------
   13. Notificaciones (toasts)
   -------------------------------------------------------------------------- */
#contenedor-notificaciones {
    pointer-events: none;
}

#contenedor-notificaciones > * {
    pointer-events: auto;
}

.notificacion {
    box-shadow: var(--fin-sombra-alta);
}

.notificacion-barra {
    transform-origin: left center;
    animation: barra-progreso linear forwards;
}

@keyframes barra-progreso {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* --------------------------------------------------------------------------
   14. Modales y bloqueo de scroll
   -------------------------------------------------------------------------- */
body.modal-abierto {
    overflow: hidden;
}

.velo-modal {
    background-color: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* --------------------------------------------------------------------------
   15. Fondos decorativos (login y encabezados)
   -------------------------------------------------------------------------- */
.malla-fondo {
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
    background-size: 44px 44px;
    background-position: center center;
}

.degradado-radial {
    background:
        radial-gradient(circle at 18% 12%, rgba(56, 189, 248, 0.16), transparent 42%),
        radial-gradient(circle at 82% 82%, rgba(168, 85, 247, 0.14), transparent 46%),
        var(--fin-base-900);
}

.mancha-luz {
    position: absolute;
    border-radius: 999px;
    filter: blur(80px);
    opacity: 0.4;
    pointer-events: none;
}

/* Texto con degradado */
.texto-degradado {
    background: linear-gradient(120deg, #38bdf8, #818cf8 55%, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

/* --------------------------------------------------------------------------
   16. Graficas (Chart.js)
   -------------------------------------------------------------------------- */
.lienzo-grafica {
    position: relative;
    width: 100%;
}

.lienzo-grafica canvas {
    display: block;
    width: 100% !important;
}

/* --------------------------------------------------------------------------
   17. Barras de progreso
   -------------------------------------------------------------------------- */
.progreso {
    height: 0.5rem;
    border-radius: 999px;
    background-color: rgba(36, 48, 73, 0.85);
    overflow: hidden;
}

.progreso > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #0ea5e9, #22d3ee);
    transition: width 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------------------
   18. Menu lateral responsivo
   -------------------------------------------------------------------------- */
#menu-lateral {
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.enlace-menu {
    position: relative;
}

.enlace-menu::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #38bdf8, #818cf8);
    transform: translateY(-50%);
    transition: height 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.enlace-menu.activo::before {
    height: 62%;
}

/* --------------------------------------------------------------------------
   19. Tooltips ligeros basados en atributo
   -------------------------------------------------------------------------- */
[data-tip] {
    position: relative;
}

[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 0.3rem 0.55rem;
    border-radius: 0.5rem;
    background-color: rgba(2, 6, 23, 0.96);
    border: 1px solid var(--fin-borde-fuerte);
    color: var(--fin-texto);
    font-size: 0.68rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    pointer-events: none;
    z-index: 60;
}

[data-tip]:hover::after,
[data-tip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* --------------------------------------------------------------------------
   20. Seleccion de texto
   -------------------------------------------------------------------------- */
::selection {
    background-color: rgba(56, 189, 248, 0.32);
    color: #f8fafc;
}

/* --------------------------------------------------------------------------
   21. Accesibilidad
   -------------------------------------------------------------------------- */
.solo-lectores {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------------------------------------
   22. Ajustes responsivos
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .glass {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    #contenedor-notificaciones {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.9rem;
        width: auto;
    }

    .badge {
        font-size: 0.68rem;
        padding: 0.18rem 0.55rem;
    }
}

/* --------------------------------------------------------------------------
   23. Impresion (estados de cuenta / reportes)
   -------------------------------------------------------------------------- */
@media print {
    body {
        background: #ffffff !important;
        color: #0f172a !important;
    }

    #menu-lateral,
    header,
    #contenedor-notificaciones,
    .no-imprimir,
    button {
        display: none !important;
    }

    .superficie,
    .glass {
        background: #ffffff !important;
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
    }

    a[href]::after {
        content: '';
    }
}

/* --------------------------------------------------------------------------
   24. FINLYTICS 2.0 · Controles reutilizables
   -------------------------------------------------------------------------- */
.fin-label {
    display: block;
    margin-bottom: .45rem;
    font-size: .69rem;
    line-height: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
}
.fin-input,
.fin-select {
    width: 100%;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 1rem;
    background: #0b1220;
    color: #f8fafc;
    padding: .72rem .9rem;
    font-size: .82rem;
    line-height: 1.25rem;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.fin-input::placeholder { color: #475569; }
.fin-input:focus,
.fin-select:focus {
    border-color: rgba(56,189,248,.55);
    box-shadow: 0 0 0 4px rgba(14,165,233,.10);
}
textarea.fin-input { resize: vertical; min-height: 5rem; }
.fin-select { width: auto; min-width: 8rem; }
.fin-th {
    padding: .8rem 1rem;
    text-align: left;
    font-size: .66rem;
    line-height: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
    white-space: nowrap;
}
.fin-td { padding: .78rem 1rem; vertical-align: middle; }
.icon-btn {
    display: inline-grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    flex: 0 0 auto;
    border-radius: .85rem;
    background: rgba(255,255,255,.05);
    color: #94a3b8;
    transition: transform .18s ease, color .18s ease, background-color .18s ease;
}
.icon-btn:hover { color: #38bdf8; background: rgba(14,165,233,.12); }
.icon-btn:active { transform: scale(.92); }
.stat-mini {
    min-width: 0;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: .9rem;
    background: rgba(2,6,23,.38);
    padding: .7rem .65rem;
    text-align: center;
}
.stat-mini span { display: block; font-size: .6rem; color: #64748b; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.stat-mini strong { display: block; margin-top: .28rem; color: #e2e8f0; font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --------------------------------------------------------------------------
   25. Tema claro · mantiene contraste y jerarquia visual
   -------------------------------------------------------------------------- */
.theme-light body {
    background: #f1f5f9 !important;
    color: #334155 !important;
}
.theme-light .bg-base-900 { background-color: #f1f5f9 !important; }
.theme-light .bg-base-800 { background-color: #ffffff !important; }
.theme-light .bg-base-700 { background-color: #f8fafc !important; }
.theme-light .bg-base-600 { background-color: #e2e8f0 !important; }
.theme-light .bg-base-900\/40,
.theme-light .bg-base-900\/60,
.theme-light .bg-base-900\/95 { background-color: rgba(241,245,249,.92) !important; }
.theme-light .text-white { color: #0f172a !important; }
.theme-light .text-slate-200,
.theme-light .text-slate-300 { color: #334155 !important; }
.theme-light .text-slate-400 { color: #475569 !important; }
.theme-light .text-slate-500 { color: #64748b !important; }
.theme-light .text-slate-600 { color: #64748b !important; }
.theme-light .text-slate-700 { color: #94a3b8 !important; }
.theme-light [class*="border-white/"] { border-color: rgba(148,163,184,.25) !important; }
.theme-light [class*="bg-white/5"] { background-color: rgba(148,163,184,.10) !important; }
.theme-light [class*="bg-white/10"] { background-color: rgba(148,163,184,.16) !important; }
.theme-light [class*="hover:bg-white/10"]:hover { background-color: rgba(100,116,139,.13) !important; }
.theme-light .fin-input,
.theme-light .fin-select,
.theme-light input.bg-base-900,
.theme-light select.bg-base-900,
.theme-light textarea.bg-base-900 {
    background: #f8fafc !important;
    border-color: #dbe3ee !important;
    color: #0f172a !important;
}
.theme-light .fin-input::placeholder,
.theme-light input::placeholder,
.theme-light textarea::placeholder { color: #94a3b8 !important; }
.theme-light .fin-input:focus,
.theme-light .fin-select:focus {
    background: #ffffff !important;
    border-color: rgba(14,165,233,.55) !important;
}
.theme-light .stat-mini { background: #f8fafc; border-color: #e2e8f0; }
.theme-light .stat-mini strong { color: #1e293b; }
.theme-light .glass { background: rgba(255,255,255,.82); }
.theme-light .shadow-black\/60,
.theme-light .shadow-black\/70 { --tw-shadow-color: rgba(15,23,42,.12) !important; }
.theme-light canvas { filter: none; }

@media (max-width: 640px) {
    .fin-select { width: 100%; }
}

/* --------------------------------------------------------------------------
   26. Finlytics 2.2 · Centro documental
   -------------------------------------------------------------------------- */
.doc-stat-card {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 1.25rem;
    background: #0b1120;
}
.doc-stat-icon {
    width: 2.65rem;
    height: 2.65rem;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: .9rem;
}
.doc-stat-card p {
    margin: 0;
    color: #64748b;
    font-size: .61rem;
    line-height: .9rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.doc-stat-card strong {
    display: block;
    margin-top: .18rem;
    color: #f8fafc;
    font-size: 1.05rem;
    line-height: 1.35rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   27. Tema claro 2.2 · corrige barra superior, capas translucidas y toasts
   -------------------------------------------------------------------------- */
.theme-light header.sticky {
    background: rgba(248,250,252,.94) !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 0 rgba(15,23,42,.03);
}
.theme-light #menu-lateral {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}
.theme-light [class*="bg-base-900/"] { background-color: rgba(248,250,252,.82) !important; }
.theme-light [class*="bg-base-800/"] { background-color: rgba(255,255,255,.92) !important; }
.theme-light [class*="bg-base-700/"] { background-color: rgba(248,250,252,.96) !important; }
.theme-light .doc-stat-card { background: #ffffff; border-color: #e2e8f0; }
.theme-light .doc-stat-card strong { color: #0f172a; }
.theme-light .doc-stat-card p { color: #64748b; }
.theme-light select option { background: #ffffff !important; color: #0f172a !important; }
.theme-light #contenedor-notificaciones > div {
    background: rgba(255,255,255,.97) !important;
    box-shadow: 0 18px 40px rgba(15,23,42,.12) !important;
}
.theme-light #contenedor-notificaciones .text-white { color: #0f172a !important; }
.theme-light iframe { border-color: #e2e8f0 !important; }

@media (max-width: 640px) {
    .doc-stat-card { padding: .85rem; }
    .doc-stat-icon { width: 2.4rem; height: 2.4rem; }
}


/* Mantiene texto claro sobre acciones y superficies de color en tema claro. */
.theme-light [class*="bg-gradient-to-"][class~="text-white"],
.theme-light button[class*="bg-sky-5"][class~="text-white"],
.theme-light button[class*="bg-indigo-5"][class~="text-white"],
.theme-light button[class*="bg-cyan-5"][class~="text-white"],
.theme-light button[class*="bg-violet-5"][class~="text-white"],
.theme-light button[class*="bg-emerald-5"][class~="text-white"],
.theme-light button[class*="bg-rose-5"][class~="text-white"],
.theme-light a[class*="bg-gradient-to-"][class~="text-white"] {
    color: #ffffff !important;
}

/* Finlytics 2.5 · tablas administrativas */
.th-fin{
    padding:.8rem 1rem;
    text-align:left;
    font-size:.65rem;
    line-height:1rem;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.08em;
    color:#64748b;
    white-space:nowrap;
}
.theme-light .th-fin{color:#64748b}
.theme-light .bg-base-800 .th-fin{background:transparent}
