/* ==========================================================================
   MelSeg Técnicos - Clean High-Performance Dark Theme
   Paleta: Azul Noche Profundo, Celestes, Verdes Esmeralda y Naranjas
   Optimizado para 60-120 FPS sin delay de scroll
   ========================================================================== */

:root {
    --glass-bg-base: #070d1a;
    --glass-surface-1: #0d1a30;
    --glass-surface-2: #112240;
    --glass-surface-3: #162a4d;
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-celeste: rgba(56, 189, 248, 0.22);
    --glass-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    
    /* Acentos */
    --accent-celeste: #38bdf8;
    --accent-verde: #22c55e;
    --accent-naranja: #f97316;
}

/* 1. Fondo Global ultra liviano (sin background-attachment: fixed) */
html, body, .fi-body, .fi-layout {
    background-color: var(--glass-bg-base) !important;
    background-image: linear-gradient(180deg, #0a1324 0%, #060b14 100%) !important;
    color: #f1f5f9 !important;
    min-height: 100vh !important;
}

/* 2. Barra Lateral (Sidebar) */
.fi-sidebar {
    background: #091224 !important;
    border-right: 1px solid var(--glass-border) !important;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2) !important;
}

.fi-sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.fi-sidebar-item-btn {
    border-radius: 10px !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
}

.fi-sidebar-item-btn:hover {
    background: rgba(56, 189, 248, 0.08) !important;
    color: var(--accent-celeste) !important;
}

/* Item activo de navegación con acento celeste */
.fi-sidebar-item-active .fi-sidebar-item-btn {
    background: rgba(56, 189, 248, 0.15) !important;
    border: 1px solid var(--glass-border-celeste) !important;
    color: var(--accent-celeste) !important;
    font-weight: 700 !important;
}

.fi-sidebar-item-active .fi-sidebar-item-icon {
    color: var(--accent-celeste) !important;
}

/* 3. Barra Superior (Topbar) */
.fi-topbar {
    background: #091224 !important;
    border-bottom: 1px solid var(--glass-border) !important;
}

/* 4. Tarjetas, Secciones y Widgets */
.fi-section,
.fi-ta-ctn,
.fi-wi-widget > div,
.fi-card {
    background: var(--glass-surface-1) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 16px !important;
    box-shadow: var(--glass-shadow) !important;
}

.fi-section-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* 5. Tablas */
.fi-ta-table {
    background: transparent !important;
}

.fi-ta-header-toolbar {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.fi-ta-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
}

.fi-ta-row:hover {
    background: rgba(56, 189, 248, 0.04) !important;
}

.fi-ta-header-cell {
    background: #081120 !important;
    color: #94a3b8 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.05em !important;
}

/* 6. Inputs y Formularios */
.fi-input-wrp {
    background: #070e1b !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
}

.fi-input-wrp:focus-within {
    border-color: var(--accent-celeste) !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25) !important;
}

.fi-input-wrp input,
.fi-input-wrp select,
.fi-input-wrp textarea {
    color: #f8fafc !important;
}

/* 7. Modales y Paneles Desplegables */
.fi-modal-window,
.fi-dropdown-panel {
    background: var(--glass-surface-2) !important;
    border: 1px solid var(--glass-border-celeste) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6) !important;
}

.fi-modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.fi-modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* 8. Botones con Estilo y Gradientes */
.fi-btn-color-primary {
    background: #0284c7 !important;
    border: 1px solid rgba(56, 189, 248, 0.4) !important;
    color: #ffffff !important;
    border-radius: 10px !important;
}

.fi-btn-color-primary:hover {
    background: #0369a1 !important;
}

.fi-btn-color-success {
    background: #16a34a !important;
    border: 1px solid rgba(34, 197, 94, 0.4) !important;
    color: #ffffff !important;
    border-radius: 10px !important;
}

.fi-btn-color-warning {
    background: #ea580c !important;
    border: 1px solid rgba(249, 115, 22, 0.4) !important;
    color: #ffffff !important;
    border-radius: 10px !important;
}

/* 9. Badges de Estado */
.fi-badge-color-primary {
    background: rgba(56, 189, 248, 0.15) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    color: #38bdf8 !important;
}

.fi-badge-color-success {
    background: rgba(34, 197, 94, 0.15) !important;
    border: 1px solid rgba(34, 197, 94, 0.35) !important;
    color: #4ade80 !important;
}

.fi-badge-color-warning {
    background: rgba(249, 115, 22, 0.15) !important;
    border: 1px solid rgba(249, 115, 22, 0.35) !important;
    color: #fb923c !important;
}

.fi-badge-color-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    color: #f87171 !important;
}

/* 10. Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #070d1a;
}
::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.25);
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.5);
}

/* 11. Corrección Global de Contraste para Modo Oscuro
   Asegura que textos con estilos inline oscuros (#1e293b, #0f172a, etc.)
   se vean siempre nítidos y claros en fondos oscuros / glassmorphism. */
.dark [style*="color: #1e293b"],
.dark [style*="color:#1e293b"],
.dark [style*="color: #0f172a"],
.dark [style*="color:#0f172a"],
.dark [style*="color: #111827"],
.dark [style*="color:#111827"],
.dark [style*="color: #000000"],
.dark [style*="color:#000000"],
.dark [style*="color: #000"],
.dark [style*="color:#000"],
.dark [style*="color: #334155"],
.dark [style*="color:#334155"],
.dark [style*="color: #1f2937"],
.dark [style*="color:#1f2937"] {
    color: #f8fafc !important;
}

.dark [style*="color: #64748b"],
.dark [style*="color:#64748b"],
.dark [style*="color: #475569"],
.dark [style*="color:#475569"] {
    color: #94a3b8 !important;
}