/* ==========================================================================
   CSS DESIGN SYSTEM - CONTROL DE CUENTAS ULTRASTFULL
   Estilo Premium Moderno (Glassmorphism, Neon Accents, Smooth Animations)
   ========================================================================== */

/* Google Font: Outfit */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette */
    --bg-dark-deep: #0b0f19;
    --bg-dark-surface: #121824;
    --glass-bg: rgba(22, 30, 49, 0.65);
    --glass-border: rgba(255, 255, 255, 0.07);
    --glass-border-focus: rgba(0, 242, 254, 0.4);
    
    /* Accents (Gradients) */
    --accent-cyan: #00f2fe;
    --accent-blue: #0072ff;
    --accent-purple: #9d4edd;
    --accent-purple-glow: rgba(157, 78, 221, 0.15);
    --accent-green: #00ff88;
    --accent-green-glow: rgba(0, 255, 136, 0.12);
    --accent-yellow: #ffb703;
    --accent-red: #ff3366;
    --accent-red-glow: rgba(255, 51, 102, 0.15);
    
    /* Text colors */
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    
    /* Fonts */
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Layout */
    --sidebar-width: 250px;
    --navbar-height: 56px;
    
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease-out;
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
body {
    background: radial-gradient(circle at 50% 0%, var(--bg-dark-surface) 0%, var(--bg-dark-deep) 100%) no-repeat fixed;
    background-color: var(--bg-dark-deep);
    color: var(--text-primary);
    font-family: var(--font-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark-deep);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: var(--transition-smooth);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* Typography Overrides */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary) !important;
}

p {
    font-weight: 400;
    color: var(--text-secondary);
}

/* ==========================================================================
   Glassmorphic Cards & Layout Containers
   ========================================================================== */
.glass-card {
    background: rgba(17, 24, 39, 0.94);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.28);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 242, 254, 0.25);
    box-shadow: 0 12px 40px 0 rgba(0, 242, 254, 0.1);
}

.glow-purple:hover {
    border-color: rgba(157, 78, 221, 0.35);
    box-shadow: 0 12px 40px 0 rgba(157, 78, 221, 0.15);
}

.glow-red:hover {
    border-color: rgba(255, 51, 102, 0.35);
    box-shadow: 0 12px 40px 0 rgba(255, 51, 102, 0.15);
}

/* ==========================================================================
   Navigation (Header & Sidebar)
   ========================================================================== */
/* Header */
.navbar-ultra {
    background: rgba(7, 9, 14, 0.90) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    padding: 0 1rem !important;
    z-index: 1040;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    transition: var(--transition-smooth);
}

.navbar-ultra .navbar-brand img {
    filter: drop-shadow(0 0 8px rgba(0, 255, 136, 0.3));
    transition: var(--transition-smooth);
}

.navbar-ultra .navbar-brand:hover img {
    transform: scale(1.05);
}

/* Drawer / Sidebar */
.offcanvas-ultra {
    background: rgba(11, 15, 25, 0.98) !important;
    border-right: 1px solid var(--glass-border) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

.nav-lateral .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1rem;
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition-smooth);
}

.nav-lateral .nav-link i {
    font-size: 1.2rem;
    transition: var(--transition-smooth);
}

.nav-lateral .nav-link:hover {
    color: var(--accent-cyan) !important;
    background: rgba(0, 242, 254, 0.08);
    transform: translateX(4px);
}

.nav-lateral .nav-link.active {
    color: #121212 !important;
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%) !important;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.nav-lateral .nav-link.active i {
    color: #121212;
}

/* ==========================================================================
   Buttons Custom Styling
   ========================================================================== */
.btn-ultra {
    background: linear-gradient(135deg, var(--accent-green) 0%, #00cc6a 100%);
    color: var(--bg-dark-deep) !important;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    letter-spacing: -0.01em;
    box-shadow: 0 4px 15px var(--accent-green-glow);
    transition: var(--transition-smooth);
}

.btn-ultra:hover {
    background: linear-gradient(135deg, #00ffaa 0%, #00b35c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.3);
}

.btn-ultra:active {
    transform: translateY(0);
}

.btn-purple {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #7209b7 100%);
    color: white !important;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    box-shadow: 0 4px 15px var(--accent-purple-glow);
    transition: var(--transition-smooth);
}

.btn-purple:hover {
    background: linear-gradient(135deg, #b5179e 0%, #560bad 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(157, 78, 221, 0.35);
}

.btn-danger-modern {
    background: linear-gradient(135deg, var(--accent-red) 0%, #e6004c 100%);
    color: white !important;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    box-shadow: 0 4px 15px var(--accent-red-glow);
    transition: var(--transition-smooth);
}

.btn-danger-modern:hover {
    background: linear-gradient(135deg, #ff4d7d 0%, #cc003f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 51, 102, 0.3);
}

.btn-warning-modern {
    background: linear-gradient(135deg, #ffb703 0%, #fb8500 100%);
    color: var(--bg-dark-deep) !important;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    box-shadow: 0 4px 15px rgba(255, 183, 3, 0.25);
    transition: var(--transition-smooth);
}

.btn-warning-modern:hover {
    background: linear-gradient(135deg, #ffc83b 0%, #e36400 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 183, 3, 0.4);
}


.btn-outline-glass {
    background: transparent;
    color: var(--text-primary) !important;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px 20px;
    transition: var(--transition-smooth);
}

.btn-outline-glass:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* ==========================================================================
   Form Controls / Inputs
   ========================================================================== */
.form-control, .form-select {
    background-color: rgba(11, 15, 25, 0.6) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 400;
    transition: var(--transition-smooth);
}

.form-control:focus, .form-select:focus {
    background-color: rgba(11, 15, 25, 0.8) !important;
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.2) !important;
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.8;
}

/* Fixes para inputs de tipo fecha y hora en dispositivos móviles y modo oscuro */
input[type="date"].form-control,
input[type="datetime-local"].form-control {
    color-scheme: dark !important;
    cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.85;
    padding: 4px;
    margin-right: -2px;
    transition: opacity 0.2s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

label.form-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   Badges (Estatus)
   ========================================================================== */
.badge-modern {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

.badge-active {
    background-color: rgba(0, 255, 136, 0.12);
    color: var(--accent-green) !important;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.badge-warning-modern {
    background-color: rgba(255, 183, 3, 0.12);
    color: var(--accent-yellow) !important;
    border: 1px solid rgba(255, 183, 3, 0.2);
}

.badge-danger-modern {
    background-color: rgba(255, 51, 102, 0.12);
    color: var(--accent-red) !important;
    border: 1px solid rgba(255, 51, 102, 0.2);
}

.badge-neutral {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary) !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.badge-pin {
    background-color: rgba(187, 134, 252, 0.15) !important;
    color: #bb86fc !important;
    border: 1px solid rgba(187, 134, 252, 0.3);
    font-family: monospace;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 4px 8px;
    letter-spacing: 0.05em;
    border-radius: 6px;
}

/* ==========================================================================
   Tables Style
   ========================================================================== */
.table-responsive {
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    overflow-x: auto;
    overflow-y: auto;
    max-height: 600px;
    min-height: 250px;
}

.table {
    margin-bottom: 0;
    background: transparent !important;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #111827 !important;
    color: var(--accent-cyan) !important;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.table td {
    padding: 16px 20px;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--glass-border);
    background: transparent !important;
    font-size: 0.95rem;
}

.table tbody tr {
    transition: var(--transition-fast);
}

.table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

.table-hover tbody tr:hover td {
    color: var(--text-primary) !important;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-content {
    background: rgba(17, 24, 39, 0.98) !important;
    border: 1px solid var(--glass-border-focus) !important;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-header {
    border-bottom: 1px solid var(--glass-border) !important;
    padding: 20px 24px;
}

.modal-footer {
    border-top: 1px solid var(--glass-border) !important;
    padding: 20px 24px;
}

.btn-close-white {
    filter: invert(1) grayscale(1) brightness(1.5);
    opacity: 0.7;
    transition: var(--transition-fast);
}

.btn-close-white:hover {
    opacity: 1;
}

/* ==========================================================================
   Dropdowns
   ========================================================================== */
.dropdown-menu-dark {
    background: rgba(17, 24, 39, 0.98) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.dropdown-item {
    color: var(--text-secondary) !important;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background-color: rgba(0, 242, 254, 0.08) !important;
    color: var(--accent-cyan) !important;
}

.dropdown-divider {
    border-top: 1px solid var(--glass-border) !important;
    margin: 6px 0;
}

/* Prevenir que el menú de opciones (dropdown) quede detrás de las tarjetas en vista móvil */
.venta-card:has(.dropdown-menu.show),
.cuenta-card:has(.dropdown-menu.show),
.glass-card:has(.dropdown-menu.show) {
    position: relative;
    z-index: 10 !important;
}

/* ==========================================================================
   KPIs & Dashboard Widgets
   ========================================================================== */
.kpi-wrapper {
    display: flex;
    flex-direction: column;
}

.kpi-title-modern {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.kpi-value-modern {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-top: 4px;
}

.kpi-growth {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 8px;
}

/* ==========================================================================
   PWA Installation Prompt
   ========================================================================== */
#btnInstalarPWA {
    border: 1px dashed var(--accent-cyan) !important;
    color: var(--accent-cyan) !important;
    background: transparent !important;
    font-weight: 700;
    border-radius: 12px;
    transition: var(--transition-smooth) !important;
}

#btnInstalarPWA:hover {
    background: rgba(0, 242, 254, 0.08) !important;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

/* ==========================================================================
   MOBILE & RESPONSIVE PERFECTION (Smartphones & Tablets)
   ========================================================================== */
@media (max-width: 768px) {
    :root {
        --navbar-height: 60px;
    }
    
    body {
        font-size: 0.9rem;
    }

    /* Container padding */
    .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
        margin-top: 1rem !important;
    }

    /* Glass card padding */
    .glass-card {
        padding: 16px !important;
        border-radius: 14px !important;
    }

    /* Header navbar compact */
    .navbar-ultra {
        padding: 0 1rem !important;
        height: 56px !important;
    }

    .navbar-brand img {
        height: 32px !important;
    }

    .navbar-brand h4 {
        font-size: 1.1rem !important;
    }

    /* KPIs in Dashboard on mobile */
    .kpi-card-dynamic {
        padding: 14px !important;
    }

    .kpi-value-modern {
        font-size: 1.5rem !important;
    }

    .kpi-title-modern {
        font-size: 0.72rem !important;
    }

    .kpi-icon-bg {
        font-size: 3.5rem !important;
        right: -5px !important;
        bottom: -10px !important;
    }

    /* Timeframe horizontal scrollbar on mobile */
    .timeframe-container {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .timeframe-container::-webkit-scrollbar {
        display: none;
    }
    
    .timeframe-pill {
        padding: 0.3rem 0.75rem !important;
        font-size: 0.75rem !important;
    }

    /* Tables mobile scroll */
    .table-responsive {
        border-radius: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table th, .table td {
        padding: 0.5rem 0.6rem !important;
        font-size: 0.82rem !important;
        white-space: nowrap;
    }

    /* Form inputs touch-friendly without zooming */
    .form-control, .form-select {
        font-size: 16px !important; /* Prevents auto-zoom on iOS */
        padding: 0.6rem 0.8rem !important;
    }

    /* Buttons spacing */
    .btn {
        font-size: 0.85rem !important;
        padding: 0.45rem 0.8rem !important;
    }

    /* Charts height on mobile */
    .chart-container-card {
        min-height: 280px !important;
    }

    /* Filter rows */
    .filter-row-mobile {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
}

@media (max-width: 576px) {
    .kpi-value-modern {
        font-size: 1.35rem !important;
    }

    h2, .h2 {
        font-size: 1.3rem !important;
    }
    
    h3, .h3 {
        font-size: 1.15rem !important;
    }

    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.4rem;
    }

    .btn-group-mobile .btn {
        width: 100% !important;
    }
}

/* ==========================================================================
   GLOBAL GLASSMORPHIC TABS & PILLS (Dark Theme)
   ========================================================================== */
.nav-tabs, .nav-tabs-ultra, .nav-tabs-modern {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    gap: 0.5rem;
}

.nav-tabs .nav-link, .nav-tabs-ultra .nav-link, .nav-tabs-modern .nav-link {
    background: rgba(255, 255, 255, 0.04) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    padding: 0.65rem 1.35rem !important;
    font-weight: 600 !important;
    font-size: 0.92rem !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-tabs .nav-link:hover, .nav-tabs-ultra .nav-link:hover, .nav-tabs-modern .nav-link:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    border-color: rgba(0, 242, 254, 0.3) !important;
    transform: translateY(-1px);
}

.nav-tabs .nav-link.active, .nav-tabs-ultra .nav-link.active, .nav-tabs-modern .nav-link.active {
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.16) 0%, rgba(157, 78, 221, 0.16) 100%) !important;
    color: #ffffff !important;
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 4px 18px rgba(0, 242, 254, 0.2) !important;
}

.nav-tabs .nav-link.active i, .nav-tabs-ultra .nav-link.active i {
    filter: drop-shadow(0 0 8px currentColor);
}

/* ==========================================================================
   Mobile Performance & Responsive Layout Optimizations
   ========================================================================== */
@media (max-width: 768px) {
    /* Disable heavy blur filters on mobile cards/panels for 60fps smooth scrolling (keep blur only on Header & Bottom Nav) */
    .glass-card, 
    .stat-card-modern, 
    .offcanvas-ultra,
    .modal-content-glass {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: #111827 !important;
    }
    
    .navbar-ultra {
        padding: 0 1rem !important;
        height: 56px !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
    }

    /* Prevent overflow on small screens */
    .navbar {
        white-space: nowrap;
    }
}

/* ==========================================================================
   MOBILE WEB APP DOCK & PWA NATIVE STYLES
   ========================================================================== */
.mobile-app-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(11, 15, 25, 0.95) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1040;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-dock-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-decoration: none !important;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 6px 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-dock-item i {
    font-size: 1.25rem;
    margin-bottom: 2px;
    transition: transform 0.2s ease, color 0.2s ease;
}

.mobile-dock-item:hover,
.mobile-dock-item:focus {
    color: #ffffff;
}

.mobile-dock-item.active {
    color: var(--accent-cyan) !important;
}

.mobile-dock-item.active i {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.6));
}

.mobile-dock-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 3px;
    background: var(--accent-cyan);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 0 8px var(--accent-cyan);
}

/* Floating Action Button (FAB Móvil) */
.btn-fab-mobile {
    position: fixed;
    right: 16px;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
    color: #0b0f19;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: bold;
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.45);
    z-index: 1035;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-fab-mobile:active {
    transform: scale(0.92);
}

/* Body spacing and standalone adjustments on mobile */
@media (max-width: 768px) {
    body {
        padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* PWA Standalone Mode (Cuando está instalada en el dispositivo) */
@media (display-mode: standalone) {
    body {
        user-select: none;
        -webkit-user-select: none;
        overscroll-behavior-y: contain;
    }
    
    .navbar-ultra {
        padding-top: calc(6px + env(safe-area-inset-top, 0px)) !important;
    }

    #btnInstalarNavbar, #btnInstalarPWA {
        display: none !important;
    }
}

/* ==========================================================================
   UNIFIED DYNAMIC APPLICATION LAYOUT (Offcanvas Drawer Central)
   ========================================================================== */
.app-desktop-sidebar {
    display: none !important;
}

.navbar-ultra {
    margin-left: 0 !important;
    width: 100% !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-main-content {
    margin-left: 0 !important;
    width: 100% !important;
    min-height: calc(100vh - 70px);
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.65rem 0.9rem;
    border-radius: 12px;
    color: #94a3b8;
    text-decoration: none !important;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 3px;
    border: 1px solid transparent;
}

.sidebar-nav-item i {
    font-size: 1.15rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.sidebar-nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateX(3px);
}

.sidebar-nav-item.active {
    color: var(--accent-cyan) !important;
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.12) 0%, rgba(157, 78, 221, 0.1) 100%);
    border-color: rgba(0, 242, 254, 0.35);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.15);
}

.sidebar-nav-item.active i {
    color: var(--accent-cyan);
    filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.6));
}

/* Timeframe Segmented Control */
.timeframe-segmented-control {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 3px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.tf-seg-item {
    padding: 0.35rem 0.85rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #94a3b8;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.tf-seg-item:hover {
    color: #ffffff;
}

.tf-seg-item.active {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
    color: #0b0f19 !important;
    box-shadow: 0 2px 10px rgba(0, 242, 254, 0.35);
}

/* App Quick Action Touch Cards */
.app-quick-btn {
    background: rgba(18, 24, 38, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 1rem 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.app-quick-btn:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 242, 254, 0.4);
    box-shadow: 0 10px 25px rgba(0, 242, 254, 0.15);
    color: #ffffff;
}

.app-quick-btn:active {
    transform: scale(0.97);
}

.app-quick-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 8px;
    transition: transform 0.25s ease;
}

.app-quick-btn:hover .app-quick-icon-wrap {
    transform: scale(1.1);
}

/* ==========================================================================
   MOBILE NATIVE PWA REFINEMENTS (REVOLUT / BINANCE STYLE)
   ========================================================================== */

/* Service Brand Badges */
.badge-service-netflix {
    background: rgba(229, 9, 20, 0.16) !important;
    color: #ff4d58 !important;
    border: 1px solid rgba(229, 9, 20, 0.35) !important;
}
.badge-service-disney {
    background: rgba(17, 60, 207, 0.22) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
}
.badge-service-max, .badge-service-hbo {
    background: rgba(99, 102, 241, 0.22) !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(99, 102, 241, 0.35) !important;
}
.badge-service-prime, .badge-service-amazon {
    background: rgba(0, 168, 225, 0.20) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(0, 168, 225, 0.35) !important;
}
.badge-service-spotify {
    background: rgba(29, 185, 84, 0.20) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(29, 185, 84, 0.35) !important;
}
.badge-service-youtube {
    background: rgba(239, 68, 68, 0.20) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
}
.badge-service-magis, .badge-service-iptv {
    background: rgba(245, 158, 11, 0.20) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}
.badge-service-paramount {
    background: rgba(0, 100, 255, 0.20) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(0, 100, 255, 0.35) !important;
}
.badge-service-crunchyroll {
    background: rgba(244, 117, 33, 0.20) !important;
    color: #fb923c !important;
    border: 1px solid rgba(244, 117, 33, 0.35) !important;
}
.badge-service-apple {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #f1f5f9 !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
}
.badge-service-star {
    background: rgba(236, 72, 153, 0.20) !important;
    color: #f472b6 !important;
    border: 1px solid rgba(236, 72, 153, 0.35) !important;
}

/* Quick Filter Chips (Scroll Horizontal Táctil) */
.quick-chip {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 6px 14px;
    white-space: nowrap;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.quick-chip:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
}
.quick-chip:active {
    transform: scale(0.95);
}
.quick-chip.active {
    background: rgba(0, 242, 254, 0.16) !important;
    color: var(--accent-cyan) !important;
    border-color: rgba(0, 242, 254, 0.45) !important;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
}

/* Utility No-Scrollbar */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Profile Slot Indicators (Inventario) */
.profile-slots-wrap {
    display: inline-flex;
    align-items: center;
    gap: 3.5px;
}
.profile-slot-dot {
    width: 7.5px;
    height: 7.5px;
    border-radius: 50%;
    display: inline-block;
    transition: transform 0.2s ease;
}
.profile-slot-dot.free {
    background-color: var(--accent-green);
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.6);
}
.profile-slot-dot.occupied {
    background-color: rgba(255, 255, 255, 0.22);
}

/* Mobile Spacing Protection */
@media (max-width: 768px) {
    .app-main-content {
        padding-bottom: 115px !important;
    }
}

/* ==========================================================================
   STREAMCORE CLEAN DARK SAAS DESIGN SYSTEM (LINEAR / REVOLUT / RAYCAST)
   ========================================================================== */

/* 1. Reset Táctil y Mobile-First */
html, body {
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
    overscroll-behavior: none !important;
}

/* 2. Elevación en 3 Capas */
:root {
    --capa-0: #07090E;
    --capa-1: #0E131F;
    --capa-2: #161C2E;
}

body {
    background-color: var(--capa-0) !important;
}

/* Capa 1: Tarjetas, Paneles, Sheets con borde de luz cenital */
.layer-card-1, .app-card-linear {
    background-color: var(--capa-1) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.10) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.03) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.03) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.50) !important;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

/* Capa 2: Inputs, Sub-bloques internos, Píldoras */
.layer-box-2 {
    background-color: var(--capa-2) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px;
}

/* Physical Press response (active:scale-[0.98]) */
.touch-press, .btn, .card-press, .mobile-dock-item, .quick-chip, .cliente-row-card, .btn-sheet-action, .slot-box, .bento-tile {
    transition: transform 0.1s ease-out !important;
}
.touch-press:active, .btn:active, .card-press:active, .cliente-row-card:active, .btn-sheet-action:active, .slot-box:active, .bento-tile:active {
    transform: scale(0.98) !important;
}

/* Card unified action row (Strict 1-row layout) */
.card-action-row {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-top: 0.75rem !important;
    padding-top: 0.625rem !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
}
.card-btn-primary-action {
    flex: 1 1 0% !important;
    height: 36px !important;
    padding: 0 0.75rem !important;
    border-radius: 0.5rem !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    color: #cbd5e1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.375rem !important;
    transition: all 0.15s ease-out !important;
    cursor: pointer !important;
    text-decoration: none !important;
}
.card-btn-primary-action:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}
.card-btn-menu-action {
    width: 36px !important;
    height: 36px !important;
    border-radius: 0.5rem !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    transition: all 0.15s ease-out !important;
    cursor: pointer !important;
}
.card-btn-menu-action:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Header Brand & Badge strict centering helpers */
.header-brand-logo {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
}
.header-brand-text {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    letter-spacing: -0.025em !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
}
.header-avatar-badge {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    background: rgba(6, 182, 212, 0.10) !important;
    border: 1px solid rgba(6, 182, 212, 0.20) !important;
    color: #22d3ee !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
}

.mobile-app-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    min-height: 58px;
    background: rgba(7, 9, 14, 0.88) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1040;
    padding-top: 6px;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0.75rem)) !important;
}

.mobile-dock-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-decoration: none !important;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 0;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.mobile-dock-item:active {
    transform: scale(0.92);
}
.mobile-dock-item.active {
    color: #ffffff !important;
}
.mobile-dock-item.active i {
    transform: translateY(-1px);
    color: #ffffff !important;
}
.mobile-dock-item.active .dock-active-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
    position: absolute;
    bottom: -1px;
}

/* Functional Accents */
.btn-primary-action {
    background-color: #ffffff !important;
    color: #07090E !important;
    font-weight: 700 !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.15) !important;
}
.btn-primary-action:hover, .btn-primary-action:focus {
    background-color: #f1f5f9 !important;
    color: #07090E !important;
}

/* Botones Secundarios e Internos (Estilo Cristal Neutro Obligatorio) */
.btn-neutral-glass {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
    font-weight: 600;
    transition: all 0.15s ease-out;
}
.btn-neutral-glass:hover, .btn-neutral-glass:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Fintech Tabular Typography */
.font-mono-tabular {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
    font-variant-numeric: tabular-nums !important;
    letter-spacing: -0.02em !important;
}

/* Contact List Row (Clientes) */
.cliente-row-card {
    transition: all 0.15s ease-out;
}
.cliente-row-card:active {
    background: #141c2c !important;
}

.avatar-contact {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.88rem;
}

.btn-wa-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
    color: #10B981 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: all 0.15s ease-out;
    text-decoration: none !important;
}
.btn-wa-icon:hover {
    background: rgba(16, 185, 129, 0.25) !important;
    color: #10B981 !important;
}

.btn-options-neutral {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: all 0.15s ease-out;
}
.btn-options-neutral:hover {
    background: rgba(255, 255, 255, 0.10) !important;
    color: #ffffff !important;
}

/* Bottom Sheet Native Touch */
.offcanvas-bottom {
    background: #0E131F !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 20px 20px 0 0 !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7) !important;
}
.btn-sheet-action {
    min-height: 48px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.15s ease-out;
    text-decoration: none !important;
}
.btn-sheet-action:hover, .btn-sheet-action:focus {
    background: rgba(255, 255, 255, 0.07);
}

/* Visual Slots for Account Profiles (Inventario) */
.slot-box {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.15s ease-out;
    user-select: none;
    flex-shrink: 0;
}
.slot-box.occupied {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
}
.slot-box.free {
    background: rgba(16, 185, 129, 0.10);
    border: 1.5px dashed rgba(16, 185, 129, 0.45);
    color: #10B981;
    cursor: pointer;
}
.slot-box.free:hover {
    background: rgba(16, 185, 129, 0.22);
    border-color: #10B981;
    color: #10B981;
}

/* Bento Grid Drawer */
.bento-grid-drawer {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.bento-tile {
    background: #0E131F;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 1px solid rgba(255, 255, 255, 0.03);
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.4);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none !important;
    color: #f1f5f9 !important;
}
.bento-tile:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: #141c2c;
    color: #ffffff !important;
}
.bento-tile-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 8px;
}

/* ==========================================================================
   DESKTOP RESPONSIVE GRID & PC CENTERING (EVITAR ESTIRAMIENTO 1920PX)
   ========================================================================== */
.max-w-7xl {
    max-width: 80rem !important; /* 1280px */
}

.mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

.app-container-max {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* Grilla adaptable de tarjetas (Linear / Raycast) */
.grid-cards-responsive {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
}

@media (min-width: 640px) {
    .grid-cards-responsive {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .grid-cards-responsive {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .grid-cards-responsive {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ==========================================================================
   INTERACCIÓN RATÓN VS TÁCTIL: ADAPTACIÓN MODAL DIALOG EN ESCRITORIO
   ========================================================================== */
@media (min-width: 768px) {
    /* Convierte los Bottom Sheets en Dialog Modals Centrados en PC */
    .offcanvas-bottom {
        bottom: auto !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 440px !important;
        max-width: 92vw !important;
        height: auto !important;
        max-height: 85vh !important;
        border-radius: 20px !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.85), 0 0 40px rgba(0, 242, 254, 0.08) !important;
        background: rgba(17, 24, 39, 0.98) !important;
        transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
        visibility: hidden;
    }

    .offcanvas-bottom.showing, .offcanvas-bottom.show {
        transform: translate(-50%, -50%) !important;
        visibility: visible !important;
    }

    .offcanvas-bottom .drag-handle-pill {
        display: none !important;
    }

    /* Dropdown pegado al botón en tarjetas de escritorio */
    .card-actions-dropdown .dropdown-menu {
        background: rgba(17, 24, 39, 0.98);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 14px;
        box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.7);
        padding: 0.4rem;
        min-width: 220px;
    }

    .card-actions-dropdown .dropdown-item {
        border-radius: 8px;
        padding: 0.5rem 0.75rem;
        font-size: 0.82rem;
        font-weight: 500;
        color: #e2e8f0;
        transition: all 0.12s ease;
    }

    .card-actions-dropdown .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.06);
        color: #ffffff;
    }
}

/* ==========================================================================
   ESTADOS HOVER SUTILES PARA ESCRITORIO (MOUSE / POINTER: FINE)
   ========================================================================== */
@media (hover: hover) and (pointer: fine) {
    .layer-card-1 {
        transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    }

    .layer-card-1:hover {
        border-color: rgba(255, 255, 255, 0.20) !important;
        background-color: rgba(255, 255, 255, 0.04) !important;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
        cursor: pointer;
    }

    .cliente-row-card {
        transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    }

    .cliente-row-card:hover {
        border-color: rgba(255, 255, 255, 0.20) !important;
        background-color: rgba(255, 255, 255, 0.04) !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        cursor: pointer;
    }

    .btn-options-neutral:hover {
        background: rgba(255, 255, 255, 0.14) !important;
        border-color: rgba(255, 255, 255, 0.25) !important;
        color: #ffffff !important;
    }

    .btn-neutral-glass:hover {
        background: rgba(255, 255, 255, 0.08) !important;
        border-color: rgba(255, 255, 255, 0.20) !important;
        color: #ffffff !important;
    }

    .slot-box:hover {
        transform: scale(1.08);
        border-color: rgba(255, 255, 255, 0.35);
    }

    .slot-box.free:hover {
        background: rgba(16, 185, 129, 0.22) !important;
        border-color: #10B981 !important;
    }
}

/* ==========================================================================
   MODO CLARO INTEGRAL ("Clean Pearl SaaS" - Stripe / Linear Light)
   Paleta Ejecutiva: Fondo #F8FAFC, Tarjetas Blancas #FFFFFF, Texto Slate
   ========================================================================== */
html.light-theme,
body.light-theme {
    --bg-dark-deep: #F8FAFC;
    --bg-dark-surface: #FFFFFF;
    --glass-bg: #FFFFFF;
    --glass-border: rgba(226, 232, 240, 0.85);
    --glass-border-focus: #3B82F6;
    
    --capa-0: #F8FAFC;
    --capa-1: #FFFFFF;
    --capa-2: #F1F5F9;
    
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    
    --accent-cyan: #0284C7;
    --accent-blue: #2563EB;
    --accent-purple: #7C3AED;
    --accent-green: #10B981;
    --accent-yellow: #D97706;
    --accent-red: #EF4444;
    
    background: #F8FAFC !important;
    background-color: #F8FAFC !important;
    color: #0F172A !important;
}

/* Tipografía de Alto Contraste */
html.light-theme h1, html.light-theme h2, html.light-theme h3, 
html.light-theme h4, html.light-theme h5, html.light-theme h6,
html.light-theme .h1, html.light-theme .h2, html.light-theme .h3, 
html.light-theme .h4, html.light-theme .h5, html.light-theme .h6,
html.light-theme .text-white {
    color: #0F172A !important;
}
html.light-theme p, html.light-theme .text-secondary {
    color: #475569 !important;
}
html.light-theme .text-slate-400, html.light-theme .text-muted {
    color: #64748B !important;
}

/* Header & Barra Superior */
html.light-theme .navbar-ultra {
    background: rgba(255, 255, 255, 0.94) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04) !important;
}
html.light-theme .header-brand-text {
    color: #0F172A !important;
}
html.light-theme .header-avatar-badge {
    background: rgba(2, 132, 199, 0.10) !important;
    border-color: rgba(2, 132, 199, 0.25) !important;
    color: #0284C7 !important;
}

/* Sidebar Ejecutiva Escritorio */
html.light-theme .app-desktop-sidebar {
    background: #FFFFFF !important;
    border-right: 1px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: 1px 0 4px 0 rgba(0, 0, 0, 0.02) !important;
}
html.light-theme .sidebar-nav-item {
    color: #475569 !important;
}
html.light-theme .sidebar-nav-item:hover {
    background: #F1F5F9 !important;
    color: #0F172A !important;
}
html.light-theme .sidebar-nav-item.active {
    background: #0F172A !important;
    color: #FFFFFF !important;
}
html.light-theme .sidebar-nav-item.active i {
    color: #FFFFFF !important;
}

/* Barra Inferior Móvil (Dock) */
html.light-theme .mobile-app-dock {
    background: rgba(255, 255, 255, 0.95) !important;
    border-top: 1px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05) !important;
}
html.light-theme .mobile-dock-item {
    color: #64748B !important;
}
html.light-theme .mobile-dock-item.active {
    color: #0F172A !important;
}
html.light-theme .mobile-dock-item.active i {
    color: #0F172A !important;
}
html.light-theme .mobile-dock-item.active .dock-active-dot {
    background: #0F172A !important;
    box-shadow: 0 0 6px rgba(15, 23, 42, 0.4) !important;
}

/* Tarjetas y Paneles (Capa 1 & Glass Cards) */
html.light-theme .layer-card-1,
html.light-theme .app-card-linear,
html.light-theme .glass-card,
html.light-theme .bento-tile,
html.light-theme .app-action-card,
html.light-theme .app-vence-card {
    background: #FFFFFF !important;
    background-color: #FFFFFF !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05) !important;
    color: #0F172A !important;
}
html.light-theme .layer-card-1:hover,
html.light-theme .glass-card:hover,
html.light-theme .app-action-card:hover,
html.light-theme .app-vence-card:hover {
    border-color: #CBD5E1 !important;
    box-shadow: 0 6px 18px 0 rgba(0, 0, 0, 0.07) !important;
}
html.light-theme .app-hero-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%) !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05) !important;
    color: #0F172A !important;
}
html.light-theme .app-hero-glow {
    display: none !important;
}

/* Inputs, Selects y Formularios */
html.light-theme .form-control,
html.light-theme .form-select,
html.light-theme input[type="text"],
html.light-theme input[type="search"],
html.light-theme input[type="number"],
html.light-theme select,
html.light-theme textarea {
    background-color: #FFFFFF !important;
    border: 1px solid #CBD5E1 !important;
    color: #0F172A !important;
}
html.light-theme .form-control:focus,
html.light-theme .form-select:focus,
html.light-theme input:focus,
html.light-theme select:focus,
html.light-theme textarea:focus {
    border-color: #3B82F6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
    background-color: #FFFFFF !important;
}
html.light-theme .form-control::placeholder,
html.light-theme input::placeholder {
    color: #94A3B8 !important;
    opacity: 1 !important;
}
html.light-theme input[type="date"],
html.light-theme input[type="datetime-local"] {
    color-scheme: light !important;
}
html.light-theme input[type="date"]::-webkit-calendar-picker-indicator,
html.light-theme input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: none !important;
}

/* Botones Principales y de Acción */
html.light-theme .btn-primary-action {
    background-color: #0F172A !important;
    color: #FFFFFF !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18) !important;
}
html.light-theme .btn-primary-action:hover {
    background-color: #1E293B !important;
    color: #FFFFFF !important;
}
html.light-theme .btn-neutral-glass {
    background: #F1F5F9 !important;
    border: 1px solid #E2E8F0 !important;
    color: #334155 !important;
}
html.light-theme .btn-neutral-glass:hover {
    background: #E2E8F0 !important;
    color: #0F172A !important;
}
html.light-theme .btn-options-neutral {
    background: #F1F5F9 !important;
    border: 1px solid #E2E8F0 !important;
    color: #475569 !important;
}
html.light-theme .btn-options-neutral:hover {
    background: #E2E8F0 !important;
    color: #0F172A !important;
}
html.light-theme .card-btn-primary-action {
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    color: #334155 !important;
}
html.light-theme .card-btn-primary-action:hover {
    background: #F1F5F9 !important;
    color: #0F172A !important;
}
html.light-theme .card-btn-menu-action {
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    color: #64748B !important;
}
html.light-theme .card-btn-menu-action:hover {
    background: #F1F5F9 !important;
    color: #0F172A !important;
}

/* Quick Filter Chips */
html.light-theme .quick-chip {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    color: #475569 !important;
}
html.light-theme .quick-chip:hover {
    background: #F8FAFC !important;
    color: #0F172A !important;
}
html.light-theme .quick-chip.active {
    background: #0F172A !important;
    color: #FFFFFF !important;
    border-color: #0F172A !important;
}

/* Tablas Ejecutivas */
html.light-theme .table-responsive {
    background: #FFFFFF !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
}
html.light-theme .table {
    color: #0F172A !important;
}
html.light-theme .table thead th {
    background: #F8FAFC !important;
    color: #475569 !important;
    border-bottom: 1px solid #E2E8F0 !important;
}
html.light-theme .table tbody tr {
    background: #FFFFFF !important;
    border-bottom: 1px solid #F1F5F9 !important;
}
html.light-theme .table tbody tr:hover {
    background: #F8FAFC !important;
}
html.light-theme .table td {
    color: #334155 !important;
    border-bottom: 1px solid #F1F5F9 !important;
}

/* Modales y Bottom Sheets */
html.light-theme .modal-content,
html.light-theme .offcanvas-ultra,
html.light-theme .offcanvas-bottom {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    color: #0F172A !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1) !important;
}
html.light-theme .modal-header,
html.light-theme .offcanvas-header {
    background: #F8FAFC !important;
    border-bottom: 1px solid #E2E8F0 !important;
    color: #0F172A !important;
}
html.light-theme .modal-footer {
    background: #F8FAFC !important;
    border-top: 1px solid #E2E8F0 !important;
}
html.light-theme .btn-close-white {
    filter: none !important;
    opacity: 0.6;
}

/* Badges Semánticos Claros */
html.light-theme .badge-active {
    background-color: #ECFDF5 !important;
    color: #065F46 !important;
    border: 1px solid #A7F3D0 !important;
}
html.light-theme .badge-warning-modern {
    background-color: #FFFBEB !important;
    color: #92400E !important;
    border: 1px solid #FDE68A !important;
}
html.light-theme .badge-danger-modern {
    background-color: #FFF1F2 !important;
    color: #9F1239 !important;
    border: 1px solid #FECDD3 !important;
}
html.light-theme .badge-neutral {
    background-color: #F1F5F9 !important;
    color: #475569 !important;
    border: 1px solid #E2E8F0 !important;
}
html.light-theme .badge-pin {
    background-color: #F5F3FF !important;
    color: #6D28D9 !important;
    border: 1px solid #DDD6FE !important;
}

/* Slots de Inventario y Tarjetas de Contacto */
html.light-theme .slot-box.occupied {
    background: #F1F5F9 !important;
    border: 1px solid #CBD5E1 !important;
    color: #334155 !important;
}
html.light-theme .slot-box.free {
    background: #ECFDF5 !important;
    border: 1.5px dashed #10B981 !important;
    color: #059669 !important;
}
html.light-theme .avatar-contact {
    background: #F1F5F9 !important;
    border: 1px solid #E2E8F0 !important;
    color: #0F172A !important;
}
html.light-theme .cliente-row-card {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
}
html.light-theme .cliente-row-card:hover {
    background: #F8FAFC !important;
}
html.light-theme .card-action-row {
    border-top: 1px solid #F1F5F9 !important;
}

/* Refinamiento de Contraste y Eliminación de Neones Chillones */
html.light-theme .header-status-badge {
    background: #ECFDF5 !important;
    border: 1px solid #A7F3D0 !important;
    color: #065F46 !important;
    font-size: 0.68rem !important;
    font-weight: 600 !important;
}
html.light-theme .header-brand-logo {
    border: 1px solid #E2E8F0 !important;
    background: #000 !important;
}
html.light-theme #btnThemeToggle {
    background: #FFFFFF !important;
    border: 1px solid #CBD5E1 !important;
    color: #0F172A !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    font-weight: 600 !important;
}
html.light-theme .navbar-ultra .btn-neutral-glass {
    background: #F8FAFC !important;
    border: 1px solid #CBD5E1 !important;
    color: #334155 !important;
}
html.light-theme .navbar-ultra .btn-neutral-glass:hover {
    background: #F1F5F9 !important;
    border-color: #94A3B8 !important;
    color: #0F172A !important;
}
html.light-theme .navbar-ultra .btn-neutral-glass i {
    color: #0284C7 !important;
}
html.light-theme .navbar-ultra kbd {
    background: #FFFFFF !important;
    color: #64748B !important;
    border: 1px solid #CBD5E1 !important;
}
html.light-theme .text-info,
html.light-theme .text-cyan-400,
html.light-theme .text-cyan-500 {
    color: #0284C7 !important;
}
html.light-theme .bg-info.bg-opacity-10 {
    background-color: #F0F9FF !important;
    color: #0369A1 !important;
    border: 1px solid #BAE6FD !important;
}
html.light-theme .badge.bg-info {
    background-color: #F0F9FF !important;
    color: #0369A1 !important;
    border: 1px solid #BAE6FD !important;
    font-weight: 700 !important;
}
html.light-theme .badge.bg-danger {
    background-color: #FFF1F2 !important;
    color: #9F1239 !important;
    border: 1px solid #FECDD3 !important;
    font-weight: 700 !important;
}
html.light-theme .badge.bg-warning {
    background-color: #FFFBEB !important;
    color: #92400E !important;
    border: 1px solid #FDE68A !important;
    font-weight: 700 !important;
}
html.light-theme .badge.bg-success {
    background-color: #ECFDF5 !important;
    color: #065F46 !important;
    border: 1px solid #A7F3D0 !important;
    font-weight: 700 !important;
}
html.light-theme .layer-box-2 {
    background-color: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
}
html.light-theme .card-service-badge {
    background: #F1F5F9 !important;
    color: #0F172A !important;
    border: 1px solid #CBD5E1 !important;
    font-weight: 700 !important;
}
html.light-theme .badge-pin-clean {
    color: #0F172A !important;
    background: #F1F5F9 !important;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid #CBD5E1 !important;
    font-weight: 800 !important;
    font-family: monospace !important;
}

/* ========================================================= */
/* MEJORAS DE CONTRASTE Y TEMAS CLAROS: INVENTARIO, DRAWER Y PORTAL */
/* ========================================================= */

/* 1. Offcanvas Drawer Lateral (#menuLateral) */
#menuLateral.offcanvas-ultra {
    background: #07090E !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #F8FAFC !important;
}
#menuLateral .offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
}

html.light-theme #menuLateral.offcanvas-ultra {
    background: #FFFFFF !important;
    border-right: 1px solid #E2E8F0 !important;
    color: #0F172A !important;
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.08) !important;
}
html.light-theme #menuLateral .offcanvas-header {
    background: #F8FAFC !important;
    border-bottom: 1px solid #E2E8F0 !important;
}
html.light-theme #menuLateral .avatar-contact {
    background: #F1F5F9 !important;
    border-color: #CBD5E1 !important;
    color: #0F172A !important;
}
html.light-theme #menuLateral .nav-link {
    color: #334155 !important;
}
html.light-theme #menuLateral .nav-link:hover {
    background: #F1F5F9 !important;
    color: #0F172A !important;
}
html.light-theme #menuLateral .nav-link.bg-white.bg-opacity-10 {
    background: #F1F5F9 !important;
    color: #0F172A !important;
    font-weight: 700 !important;
}
html.light-theme #menuLateral .bento-tile {
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    color: #0F172A !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}
html.light-theme #menuLateral .bento-tile:hover {
    background: #FFFFFF !important;
    border-color: #CBD5E1 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
    transform: translateY(-2px);
}
html.light-theme #menuLateral .bento-tile .text-white {
    color: #0F172A !important;
}
html.light-theme #menuLateral .bento-tile .text-secondary {
    color: #64748B !important;
}
.bento-tile.active {
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 0 14px rgba(0, 242, 254, 0.25) !important;
}
html.light-theme #menuLateral .bento-tile.active {
    background: #FFFFFF !important;
    border: 1.5px solid #0F172A !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12) !important;
}
html.light-theme #menuLateral .bento-tile.active .text-white {
    color: #0F172A !important;
    font-weight: 800 !important;
}
html.light-theme #menuLateral .text-slate-400 {
    color: #64748B !important;
}
html.light-theme #menuLateral .text-slate-300 {
    color: #475569 !important;
}
html.light-theme #menuLateral .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(20%) !important;
    opacity: 0.7 !important;
}
html.light-theme #menuLateral .superadmin-drawer-box,
html.light-theme #menuLateral .rounded-3.p-3.mt-1 {
    background: #FFFBEB !important;
    border: 1px solid #FDE68A !important;
    color: #92400E !important;
}
html.light-theme #menuLateral .superadmin-drawer-box a,
html.light-theme #menuLateral .rounded-3.p-3.mt-1 a {
    background: #F59E0B !important;
    color: #FFFFFF !important;
    border: none !important;
}
html.light-theme #menuLateral .btn-logout-drawer {
    background: #FFF1F2 !important;
    border: 1px solid #FECDD3 !important;
    color: #E11D48 !important;
    font-weight: 600 !important;
}
html.light-theme #menuLateral .btn-logout-drawer:hover {
    background: #FFE4E6 !important;
    color: #BE123C !important;
}
html.light-theme #menuLateral .border-white.border-opacity-10 {
    border-color: #E2E8F0 !important;
}

/* 2. Badges de Servicios de Alto Contraste en Modo Claro (Inventario y Dashboard) */
html.light-theme .badge-service-netflix {
    background: #FEF2F2 !important;
    color: #B91C1C !important;
    border: 1px solid #FECACA !important;
    font-weight: 700 !important;
}
html.light-theme .badge-service-disney {
    background: #EFF6FF !important;
    color: #1D4ED8 !important;
    border: 1px solid #BFDBFE !important;
    font-weight: 700 !important;
}
html.light-theme .badge-service-max,
html.light-theme .badge-service-hbo {
    background: #EEF2FF !important;
    color: #4338CA !important;
    border: 1px solid #C7D2FE !important;
    font-weight: 700 !important;
}
html.light-theme .badge-service-prime,
html.light-theme .badge-service-amazon {
    background: #F0F9FF !important;
    color: #0369A1 !important;
    border: 1px solid #BAE6FD !important;
    font-weight: 700 !important;
}
html.light-theme .badge-service-spotify {
    background: #ECFDF5 !important;
    color: #047857 !important;
    border: 1px solid #A7F3D0 !important;
    font-weight: 700 !important;
}
html.light-theme .badge-service-youtube {
    background: #FEF2F2 !important;
    color: #DC2626 !important;
    border: 1px solid #FECACA !important;
    font-weight: 700 !important;
}
html.light-theme .badge-service-magis,
html.light-theme .badge-service-iptv {
    background: #FFFBEB !important;
    color: #B45309 !important;
    border: 1px solid #FDE68A !important;
    font-weight: 700 !important;
}
html.light-theme .badge-service-paramount {
    background: #EFF6FF !important;
    color: #1D4ED8 !important;
    border: 1px solid #BFDBFE !important;
    font-weight: 700 !important;
}
html.light-theme .badge-service-crunchyroll {
    background: #FFF7ED !important;
    color: #C2410C !important;
    border: 1px solid #FFEDD5 !important;
    font-weight: 700 !important;
}
html.light-theme .badge-service-apple {
    background: #F1F5F9 !important;
    color: #0F172A !important;
    border: 1px solid #CBD5E1 !important;
    font-weight: 700 !important;
}
html.light-theme .badge-service-star {
    background: #FDF2F8 !important;
    color: #BE185D !important;
    border: 1px solid #FBCFE8 !important;
    font-weight: 700 !important;
}
html.light-theme .badge-neutral {
    background: #F8FAFC !important;
    color: #334155 !important;
    border: 1px solid #CBD5E1 !important;
    font-weight: 700 !important;
}

/* 3. Ranuras Visuales de Inventario (Slots) & Precios */
html.light-theme .slot-box.free {
    background: #ECFDF5 !important;
    border: 1.5px dashed #059669 !important;
    color: #059669 !important;
    font-weight: 700 !important;
}
html.light-theme .slot-box.free:hover {
    background: #D1FAE5 !important;
    border-color: #047857 !important;
    color: #047857 !important;
}
html.light-theme .slot-box.occupied {
    background: #F1F5F9 !important;
    border: 1px solid #CBD5E1 !important;
    color: #1E293B !important;
    font-weight: 700 !important;
}
html.light-theme .quick-chip {
    background: #FFFFFF !important;
    border: 1px solid #CBD5E1 !important;
    color: #475569 !important;
}
html.light-theme .quick-chip.active {
    background: #0F172A !important;
    color: #FFFFFF !important;
    border-color: #0F172A !important;
}
html.light-theme .sidebar-brand-img {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid #E2E8F0 !important;
}
html.light-theme .text-emerald-400 {
    color: #059669 !important;
}
html.light-theme .card-btn-primary-action {
    background: #F8FAFC !important;
    border: 1px solid #CBD5E1 !important;
    color: #334155 !important;
}
html.light-theme .card-btn-primary-action:hover {
    background: #F1F5F9 !important;
    border-color: #94A3B8 !important;
    color: #0F172A !important;
}
html.light-theme .card-btn-menu-action {
    background: #F8FAFC !important;
    border: 1px solid #CBD5E1 !important;
    color: #64748B !important;
}
html.light-theme .card-btn-menu-action:hover {
    background: #F1F5F9 !important;
    border-color: #94A3B8 !important;
    color: #0F172A !important;
}

/* 4. Botones Outline, Fondos Oscuros Residuales y Dropdowns en Modo Claro */
html.light-theme .btn-outline-glass {
    background: #FFFFFF !important;
    border: 1px solid #CBD5E1 !important;
    color: #334155 !important;
}
html.light-theme .btn-outline-glass:hover {
    background: #F1F5F9 !important;
    border-color: #94A3B8 !important;
    color: #0F172A !important;
}

html.light-theme .dropdown-menu,
html.light-theme .dropdown-menu-dark {
    background: #FFFFFF !important;
    background-color: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.14), 0 4px 10px -2px rgba(15, 23, 42, 0.06) !important;
    color: #0F172A !important;
}
html.light-theme .dropdown-menu .dropdown-item,
html.light-theme .dropdown-menu-dark .dropdown-item,
html.light-theme .dropdown-menu .dropdown-item.text-white,
html.light-theme .dropdown-menu-dark .dropdown-item.text-white {
    color: #334155 !important;
    font-weight: 500;
}
html.light-theme .dropdown-menu .dropdown-item:hover,
html.light-theme .dropdown-menu-dark .dropdown-item:hover,
html.light-theme .dropdown-menu .dropdown-item:focus,
html.light-theme .dropdown-menu-dark .dropdown-item:focus {
    background-color: #F1F5F9 !important;
    color: #0F172A !important;
}
html.light-theme .dropdown-menu .dropdown-item.text-danger,
html.light-theme .dropdown-menu-dark .dropdown-item.text-danger {
    color: #DC2626 !important;
}
html.light-theme .dropdown-menu .dropdown-item.text-info,
html.light-theme .dropdown-menu-dark .dropdown-item.text-info {
    color: #0284C7 !important;
}
html.light-theme .dropdown-menu .dropdown-item.text-success,
html.light-theme .dropdown-menu-dark .dropdown-item.text-success {
    color: #059669 !important;
}
html.light-theme .dropdown-menu .dropdown-divider,
html.light-theme .dropdown-menu-dark .dropdown-divider {
    border-color: #E2E8F0 !important;
    opacity: 1 !important;
}

html.light-theme .bg-dark.bg-opacity-50,
html.light-theme .bg-dark.bg-opacity-25 {
    background-color: #F8FAFC !important;
    border-color: #E2E8F0 !important;
    color: #0F172A !important;
}
html.light-theme .badge.bg-dark {
    background-color: #F1F5F9 !important;
    color: #0F172A !important;
    border: 1px solid #CBD5E1 !important;
}
html.light-theme .badge.bg-secondary {
    background-color: #F1F5F9 !important;
    color: #475569 !important;
    border: 1px solid #E2E8F0 !important;
}

/* 5. Tabla Ejecutiva Compacta sin Scroll Lateral en Escritorio */
@media (min-width: 768px) {
    .table-compact {
        width: 100% !important;
        table-layout: auto;
    }
    .table-compact th {
        padding: 12px 10px !important;
        font-size: 0.72rem !important;
        letter-spacing: 0.04em !important;
        white-space: nowrap !important;
    }
    .table-compact td {
        padding: 11px 10px !important;
        font-size: 0.85rem !important;
    }
}
@media (min-width: 992px) {
    .table-responsive-fit {
        overflow: visible !important;
        max-height: none !important;
    }
}

/* 6. Vista Lista de Perfiles en Detalle de Cuenta Maestra */
.perfil-list-row {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}
.perfil-list-row:hover {
    border-color: rgba(0, 242, 254, 0.25);
    background: rgba(255, 255, 255, 0.04);
}
.perfil-list-row-free {
    background: rgba(0, 255, 136, 0.04);
    border: 1px dashed rgba(16, 185, 129, 0.45);
    border-radius: 12px;
    padding: 0.65rem 1rem;
}

html.light-theme .perfil-list-row {
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
html.light-theme .perfil-list-row:hover {
    background: #F8FAFC !important;
    border-color: #CBD5E1 !important;
}
html.light-theme .perfil-list-row-free {
    background: #ECFDF5 !important;
    border: 1px dashed #10B981 !important;
}

/* ==========================================================================
   7. GPU 60 FPS SCROLL, CONTENT-VISIBILITY & PAGINATION / INSTANT LOADER
   ========================================================================== */
.venta-card:not(:has(.dropdown-menu.show)),
.cuenta-card:not(:has(.dropdown-menu.show)),
.cliente-card:not(:has(.dropdown-menu.show)),
.app-vence-card,
.feed-item,
.sc-cv-card,
#tab-content-clientes > .col,
#tab-content-inventario > .col {
    content-visibility: auto;
    contain-intrinsic-size: 1px 140px;
}

.sc-paged-hidden {
    display: none !important;
}

/* Barra de progreso superior ultra rápida (estilo YouTube / GitHub) */
#scTopNavLoader {
    position: fixed;
    top: 0;
    left: 0;
    height: 2.5px;
    width: 0%;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(90deg, #00f2fe 0%, #3b82f6 55%, #10b981 100%);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.75);
    transition: width 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.16s ease;
    transform: translateZ(0);
    will-change: width, opacity;
}
#scTopNavLoader.active {
    opacity: 1;
}
html.light-theme #scTopNavLoader {
    background: linear-gradient(90deg, #0284C7 0%, #2563EB 60%, #10B981 100%);
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.45);
}

/* Botón ligero Cargar más (Paginación DOM) */
.sc-load-more-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.9rem 0 0.35rem 0;
}
.sc-load-more-btn {
    border-radius: 9999px !important;
    padding: 0.5rem 1.35rem !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
