@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   VARIABLES CSS PERSONALIZABLES POR CLIENTE
   ============================================ */
:root {
    /* Colores Principales */
    --primary: #FF6B35;
    --secondary: #F7931E;
    --accent: #FDB833;
    
    /* Colores de Fondo */
    --dark: #1A1A2E;
    --darker: #0F0F1E;
    --dark-blue: #16213E;
    
    /* Colores de Texto */
    --light: #FFF5E6;
    --white: #FFFFFF;
    --gray: #9CA3AF;
    --gray-dark: #6B7280;
    --gray-light: #D1D5DB;
    
    /* Colores de Estado */
    --success: #10B981;
    --success-dark: #059669;
    --warning: var(--secondary);
    --warning-dark: var(--accent);
    --danger: #DC2626;
    --danger-dark: #991B1B;
    --info: #3B82F6;
    --info-dark: #1D4ED8;
    
    /* Opacidades y Transparencias */
    --opacity-05: 0.05;
    --opacity-08: 0.08;
    --opacity-10: 0.1;
    --opacity-12: 0.12;
    --opacity-15: 0.15;
    --opacity-20: 0.2;
    --opacity-25: 0.25;
    --opacity-30: 0.3;
    --opacity-40: 0.4;
    --opacity-50: 0.5;
    --opacity-60: 0.6;
    --opacity-80: 0.8;
    --opacity-95: 0.95;
    --opacity-98: 0.98;
    
    /* Bordes y Radios */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    --border-radius-2xl: 24px;
    --border-radius-full: 30px;
    
    /* Espaciados */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-2xl: 24px;
    --spacing-3xl: 32px;
    
    /* Sombras */
    --shadow-sm: 0 4px 15px;
    --shadow-md: 0 8px 25px;
    --shadow-lg: 0 10px 30px;
    --shadow-xl: 0 15px 40px;
    --shadow-2xl: 0 20px 60px;
    --shadow-3xl: 0 30px 80px;
    
    /* Transiciones */
    --transition-fast: 0.2s;
    --transition-normal: 0.3s;
    --transition-slow: 0.4s;
    --transition-slower: 0.6s;
    
    /* Blur */
    --blur-sm: 10px;
    --blur-md: 20px;
    
    /* Tamaños de Fuente */
    --font-xs: 11px;
    --font-sm: 12px;
    --font-md: 14px;
    --font-lg: 16px;
    --font-xl: 28px;
    --font-2xl: 32px;
    
    /* Pesos de Fuente */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    
    /* Colores Derivados */
    --primary-light: rgba(255, 107, 53, var(--opacity-15));
    --primary-lighter: rgba(255, 107, 53, var(--opacity-10));
    --primary-lightest: rgba(255, 107, 53, var(--opacity-05));
    --primary-shadow: rgba(255, 107, 53, var(--opacity-40));
    --primary-glow: rgba(255, 107, 53, var(--opacity-60));
    
    --secondary-light: rgba(247, 147, 30, var(--opacity-15));
    --secondary-lighter: rgba(247, 147, 30, var(--opacity-10));
    
    --white-transparent-05: rgba(255, 255, 255, var(--opacity-05));
    --white-transparent-08: rgba(255, 255, 255, var(--opacity-08));
    --white-transparent-10: rgba(255, 255, 255, var(--opacity-10));
    --white-transparent-12: rgba(255, 255, 255, var(--opacity-12));
    --white-transparent-15: rgba(255, 255, 255, var(--opacity-15));
    --white-transparent-20: rgba(255, 255, 255, var(--opacity-20));
    --white-transparent-30: rgba(255, 255, 255, var(--opacity-30));
    --white-transparent-40: rgba(255, 255, 255, var(--opacity-40));
    
    --black-transparent-30: rgba(0, 0, 0, var(--opacity-30));
    --black-transparent-40: rgba(0, 0, 0, var(--opacity-40));
    --black-transparent-50: rgba(0, 0, 0, var(--opacity-50));
    --black-transparent-80: rgba(0, 0, 0, var(--opacity-80));
    
    /* Colores para Editor de Código */
    --code-bg: #1e1e1e;
    --code-text: #d4d4d4;
}

/* ============================================
   ESTILOS GLOBALES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 50%, var(--dark-blue) 100%);
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   FONDO ANIMADO
   ============================================ */
.bg-animated {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.bg-animated::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 50%, var(--primary-light) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, var(--secondary-light) 0%, transparent 50%);
    animation: moveBackground 20s ease infinite;
}

@keyframes moveBackground {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-50px, -50px); }
}

/* ============================================
   EFECTOS DE VIDRIO (GLASS)
   ============================================ */
.glass-effect {
    background: var(--white-transparent-05);
    backdrop-filter: blur(var(--blur-md));
    border: 1px solid var(--white-transparent-10);
    box-shadow: var(--shadow-md) var(--black-transparent-30);
}

.glass-card {
    background: var(--white-transparent-08);
    backdrop-filter: blur(var(--blur-md));
    border: 1px solid var(--white-transparent-15);
    border-radius: var(--border-radius-2xl);
    box-shadow: var(--shadow-2xl) var(--black-transparent-40);
    transition: all var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-3xl) var(--primary-light);
    border-color: var(--primary-light);
}

/* ============================================
   SIDEBAR - CONSOLIDADO
   ============================================ */
.sidebar {
    width: 288px;
    background: linear-gradient(180deg, var(--primary-lighter) 0%, rgba(26, 26, 46, var(--opacity-95)) 100%);
    backdrop-filter: blur(var(--blur-md));
    border-right: 1px solid var(--white-transparent-10);
    box-shadow: 4px 0 40px var(--black-transparent-50);
    position: relative;
    overflow: visible !important;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 40;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-lighter) 0%, transparent 70%);
    animation: rotateBg 30s linear infinite;
    pointer-events: none;
}

@keyframes rotateBg {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.sidebar-content {
    position: relative;
    z-index: 1;
    overflow: visible !important;
}

/* Ajustar el header del sidebar para dar espacio al botón */
.sidebar .p-6.border-b {
    position: relative;
    padding-right: 40px !important;
}

/* El nav interno sí puede tener scroll */
.sidebar nav {
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sidebar colapsado */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .sidebar-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-item {
    justify-content: center;
    padding: 1rem;
}

.sidebar.collapsed .sidebar-item i {
    margin-right: 0;
}

.sidebar.collapsed .nocomp {
    display: none;
}
.sidebar.collapsed .icon-preview {
    
    margin: 0 auto;
    margin-left: -15px;
    display: contents;
    color: var(--accent);
}

.sidebar.collapsed nav h3 {
    display: none;
}

.sidebar.collapsed .logo-text {
    font-size: 0;
}

.sidebar.collapsed .p-4.border-t .flex {
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar.collapsed .action-btn {
    margin: 0;
    width: 40px;
    height: 40px;
}

/* ============================================
   SIDEBAR ITEMS
   ============================================ */
.sidebar-item {
    position: relative;
    transition: all var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    padding: 0.45rem 1rem;
}

.sidebar-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    transform: scaleY(0);
    transition: transform var(--transition-normal) ease;
}

.sidebar-item:hover {
    background: var(--primary-light);
    transform: translateX(var(--spacing-sm));
}

.sidebar-item:hover::before {
    transform: scaleY(1);
}

.sidebar-item.active {
    background: linear-gradient(90deg, var(--primary-light), var(--secondary-light));
    border: 1px solid var(--primary-light);
}

.sidebar-item.active::before {
    transform: scaleY(1);
}

/* Texto del sidebar */
.sidebar-text {
    transition: opacity 0.3s ease, width 0.3s ease;
    white-space: nowrap;
}

/* ============================================
   BOTÓN DE COLAPSAR SIDEBAR
   ============================================ */
.sidebar-collapse-btn {
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: 3px solid var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.sidebar-collapse-btn:hover {
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.6);
}
.iconmenu {
    display: block;
    text-align: center;
}
.labelmenu {
    font-size: 8px;
    margin-top: -5px;
}
.sidebar-collapse .sidebar-item .iconmenu {
    margin-right:0px;
}
.sidebar-collapse-btn i {
    transition: transform 0.3s ease;
    font-size: 14px;
    color: white;
    font-weight: bold;
}

.sidebar.collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

/* ============================================
   TOOLTIPS PARA SIDEBAR COLAPSADO
   ============================================ */
.sidebar.collapsed .sidebar-item {
    position: relative;
    padding: 0px;
    background: none;
    border: none;

}

.sidebar.collapsed .sidebar-item:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(26, 26, 46, 0.98);
    color: white;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000;
    border: 1px solid rgba(255, 107, 53, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease;
}

.sidebar.collapsed .sidebar-item:hover::before {
    content: '';
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid rgba(26, 26, 46, 0.98);
    z-index: 1001;
    pointer-events: none;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* ============================================
   SIDEBAR OVERLAY (MÓVIL)
   ============================================ */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 30;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   BOTONES
   ============================================ */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-slow) ease;
    box-shadow: var(--shadow-lg) var(--primary-shadow);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--white-transparent-30), transparent);
    transition: left var(--transition-slower) ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-xl) var(--primary-glow);
}

.btn-secondary {
    background: var(--white-transparent-10);
    border: 1px solid var(--white-transparent-20);
    transition: all var(--transition-normal) ease;
}

.btn-secondary:hover {
    background: var(--white-transparent-20);
    border-color: var(--primary);
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal) ease;
    cursor: pointer;
    background: var(--white-transparent-10);
    border: 1px solid var(--white-transparent-20);
}

.action-btn:hover {
    transform: scale(1.1) rotate(5deg);
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: var(--shadow-md) var(--primary-shadow);
}

/* ============================================
   INPUTS Y FORMULARIOS
   ============================================ */
.form-input {
    background: var(--white-transparent-08);
    border: 2px solid var(--white-transparent-10);
    color: var(--white);
    transition: all var(--transition-normal) ease;
    border-radius: var(--border-radius-md);
}

.form-input:focus {
    background: var(--white-transparent-12);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-lighter);
    outline: none;
}

.form-input::placeholder {
    color: var(--white-transparent-40);
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--spacing-md) center;
    background-size: var(--spacing-lg);
    padding-right: 40px;
}

select.form-input option {
    background: var(--dark);
    color: var(--white);
}

/* ============================================
   HEADER
   ============================================ */
.header-bar {
    background: rgba(26, 26, 46, var(--opacity-80));
    backdrop-filter: blur(var(--blur-md));
    border-bottom: 1px solid var(--white-transparent-10);
    box-shadow: 0 4px 30px var(--black-transparent-30);
}

/* ============================================
   TABLAS
   ============================================ */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 var(--spacing-md);
}

thead th {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: var(--spacing-xl);
    text-align: left;
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    font-size: var(--font-sm);
    letter-spacing: 1px;
    border: none;
}

thead th:first-child {
    border-radius: var(--border-radius-md) 0 0 var(--border-radius-md);
}

thead th:last-child {
    border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
}

tbody tr {
    background: var(--white-transparent-05);
    backdrop-filter: blur(var(--blur-sm));
    transition: all var(--transition-normal) ease;
    border-radius: var(--border-radius-md);
}

tbody tr:hover {
    background: var(--primary-light);
    transform: scale(1.02);
    box-shadow: var(--shadow-md) var(--primary-light);
}

tbody td {
    padding: var(--spacing-xl);
    border-top: 1px solid var(--white-transparent-05);
    border-bottom: 1px solid var(--white-transparent-05);
}

tbody td:first-child {
    border-left: 1px solid var(--white-transparent-05);
    border-radius: var(--border-radius-md) 0 0 var(--border-radius-md);
}

tbody td:last-child {
    border-right: 1px solid var(--white-transparent-05);
    border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--border-radius-full);
    font-size: var(--font-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-success {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    box-shadow: var(--shadow-sm) rgba(16, 185, 129, var(--opacity-40));
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning), var(--warning-dark));
    box-shadow: var(--shadow-sm) rgba(247, 147, 30, var(--opacity-40));
}

.badge-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-dark));
    box-shadow: var(--shadow-sm) rgba(220, 38, 38, var(--opacity-40));
}

.badge-info {
    background: linear-gradient(135deg, var(--info), var(--info-dark));
    box-shadow: var(--shadow-sm) rgba(59, 130, 246, var(--opacity-40));
}

/* ============================================
   ICONOS
   ============================================ */
.icon-preview {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--border-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-2xl);
    box-shadow: var(--shadow-md) var(--primary-shadow);
    transition: all var(--transition-normal) ease;
}

.icon-preview:hover {
    transform: rotate(10deg) scale(1.1);
}

/* ============================================
   LOGO
   ============================================ */
.logo-text {
    font-size: var(--font-xl);
    font-weight: var(--font-extrabold);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    transition: all 0.3s ease;
}

/* ============================================
   TARJETAS Y GRIDS
   ============================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-2xl);
}

.stat-card {
    background: var(--white-transparent-05);
    backdrop-filter: blur(var(--blur-md));
    border: 1px solid var(--white-transparent-10);
    border-radius: var(--border-radius-xl);
    padding: var(--spacing-2xl);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-slow) ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-lighter) 0%, transparent 70%);
    transition: all var(--transition-slower) ease;
}

.stat-card:hover::before {
    transform: scale(1.5) rotate(45deg);
}

.stat-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: var(--shadow-2xl) var(--primary-light);
}

/* ============================================
   ZONA DE UPLOAD
   ============================================ */
.upload-zone {
    border: 3px dashed rgba(255, 107, 53, var(--opacity-50));
    background: var(--primary-lightest);
    border-radius: var(--border-radius-xl);
    transition: all var(--transition-normal) ease;
    cursor: pointer;
}

.upload-zone:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: scale(1.02);
}

/* ============================================
   CHECKBOX PERSONALIZADO
   ============================================ */
.checkbox-custom {
    width: var(--spacing-2xl);
    height: var(--spacing-2xl);
    accent-color: var(--primary);
    cursor: pointer;
}

/* ============================================
   EDITOR DE CÓDIGO
   ============================================ */
.code-editor {
    font-family: 'Fira Code', 'Monaco', monospace;
    background: var(--code-bg);
    color: var(--code-text);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-2xl);
    min-height: 400px;
    overflow: auto;
    border: 1px solid var(--primary-light);
    box-shadow: inset 0 4px 20px var(--black-transparent-50);
}

/* ============================================
   ANIMACIONES
   ============================================ */
.pulse-animation {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: var(--opacity-50); }
}

.glow-effect {
    box-shadow: 0 0 40px var(--primary-glow);
}

/* ============================================
   SCROLL PERSONALIZADO
   ============================================ */
.scroll-container {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--white-transparent-10);
    overflow-x: hidden !important;
}

.scroll-container::-webkit-scrollbar {
    width: var(--spacing-sm);
}

.scroll-container::-webkit-scrollbar-track {
    background: var(--white-transparent-05);
    border-radius: var(--spacing-lg);
}

.scroll-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: var(--spacing-lg);
}

/* ============================================
   MODALES
   ============================================ */
.modal-content,
.swal2-popup {
    background: rgba(26, 26, 46, var(--opacity-98)) !important;
    backdrop-filter: blur(var(--blur-md));
    border: 1px solid var(--white-transparent-10);
    color: var(--white) !important;
}

.swal2-title,
.swal2-html-container {
    color: var(--white) !important;
}

/* ============================================
   DRAG & DROP
   ============================================ */
.drag-item {
    cursor: move;
    transition: all var(--transition-normal) ease;
    padding: var(--spacing-lg);
    background: var(--white-transparent-05);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-sm);
    border: 1px solid var(--white-transparent-10);
}

.drag-item:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.dragging {
    opacity: var(--opacity-40);
    transform: scale(0.95);
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--black-transparent-80);
    backdrop-filter: blur(var(--blur-sm));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--white-transparent-10);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .sidebar-collapse-btn {
        display: none;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 288px !important;
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        width: 288px !important;
    }
    
    .sidebar.collapsed .sidebar-text {
        opacity: 1;
        width: auto;
    }
    
    .sidebar .p-6.border-b {
        padding-right: 1.5rem !important;
    }
    
    .flex.h-screen {
        display: block;
    }
}

@media (min-width: 1025px) {
    #sidebar-toggle {
        display: none;
    }
    
    .sidebar-overlay {
        display: none;
    }
}

@media (max-width: 768px) {
    table {
        font-size: 0.875rem;
    }
    
    thead th, tbody td {
        padding: 0.75rem;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* Animación del botón hamburguesa */
#sidebar-toggle i {
    transition: transform 0.3s ease;
}

#sidebar-toggle.active i {
    transform: rotate(90deg);
}

/* Toggle de tema con animación */
#theme-toggle {
    position: relative;
    overflow: hidden;
}

#theme-toggle i {
    transition: transform 0.3s ease;
}

#theme-toggle:hover i {
    transform: scale(1.2) rotate(20deg);
}

/* ============================================
   MODO CLARO - MEJORADO
   ============================================ */
[data-theme="light"] {
    /* Colores principales */
    --primary: #FF6B35;
    --secondary: #F7931E;
    --accent: #FDB833;
    
    /* Fondos claros */
    --dark: #FFFFFF;
    --darker: #F8F9FA;
    --dark-blue: #F0F0F0;
    
    /* Textos oscuros con buen contraste */
    --light: #1A1A2E;
    --white: #2D3748;
    --gray: #4A5568;
    --gray-dark: #2D3748;
    --gray-light: #718096;
    
    /* Transparencias invertidas */
    --white-transparent-05: rgba(0, 0, 0, 0.03);
    --white-transparent-08: rgba(0, 0, 0, 0.06);
    --white-transparent-10: rgba(0, 0, 0, 0.08);
    --white-transparent-12: rgba(0, 0, 0, 0.1);
    --white-transparent-15: rgba(0, 0, 0, 0.12);
    --white-transparent-20: rgba(0, 0, 0, 0.15);
    --white-transparent-30: rgba(0, 0, 0, 0.25);
    --white-transparent-40: rgba(0, 0, 0, 0.35);
    
    --black-transparent-30: rgba(0, 0, 0, 0.15);
    --black-transparent-40: rgba(0, 0, 0, 0.2);
    --black-transparent-50: rgba(0, 0, 0, 0.25);
    --black-transparent-80: rgba(0, 0, 0, 0.4);
    
    /* Editor de código claro */
    --code-bg: #F7FAFC;
    --code-text: #2D3748;
}

/* ============================================
   FIX: SELECTORES EN MODO CLARO
   ============================================ */

/* Select en modo claro */
[data-theme="light"] select,
[data-theme="light"] .form-input[type="select"],
[data-theme="light"] .epcis-filter-select {
    background-color: #FFFFFF !important;
    color: #2D3748 !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
}

/* Opciones del select en modo claro */
[data-theme="light"] select option {
    background-color: #FFFFFF !important;
    color: #2D3748 !important;
    padding: 10px;
}

/* Hover en opciones */
[data-theme="light"] select option:hover,
[data-theme="light"] select option:checked {
    background-color: #F0F0F0 !important;
    color: #1A1A2E !important;
}

/* Focus del select */
[data-theme="light"] select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1) !important;
}

/* ============================================
   FIX: SELECTORES EN MODO CLARO
   ============================================ */

[data-theme="light"] select,
[data-theme="light"] .form-input select {
    background-color: #FFFFFF !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232D3748' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 12px !important;
    color: #2D3748 !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    padding-right: 35px !important;
}

[data-theme="light"] select option {
    background-color: #FFFFFF !important;
    color: #2D3748 !important;
}

[data-theme="light"] select:focus {
    border-color: var(--primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15) !important;
}

[data-theme="light"] body {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8F9FA 50%, #F0F0F0 100%);
    color: #2D3748;
}

[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, rgba(255, 107, 53, 0.08) 0%, rgba(255, 255, 255, 0.98) 100%);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 4px 0 40px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .sidebar::before {
    background: radial-gradient(circle, rgba(255, 107, 53, 0.05) 0%, transparent 70%);
}

[data-theme="light"] .bg-animated::before {
    background: radial-gradient(circle at 20% 50%, rgba(255, 107, 53, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(247, 147, 30, 0.05) 0%, transparent 50%);
}

[data-theme="light"] .sidebar-collapse-btn {
    border-color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.25);
}

[data-theme="light"] .sidebar.collapsed .sidebar-item:hover::after {
    background: rgba(255, 255, 255, 0.98);
    color: #2D3748;
    border-color: rgba(255, 107, 53, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .sidebar.collapsed .sidebar-item:hover::before {
    border-right-color: rgba(255, 255, 255, 0.98);
}

[data-theme="light"] .header-bar {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .form-input {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.12);
    color: #2D3748;
}

[data-theme="light"] .form-input::placeholder {
    color: #A0AEC0;
}

[data-theme="light"] select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%232D3748' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
}

[data-theme="light"] select.form-input option {
    background: #FFFFFF;
    color: #2D3748;
}

[data-theme="light"] tbody tr {
    background: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] tbody tr:hover {
    background: rgba(255, 107, 53, 0.08);
}

[data-theme="light"] .modal-content,
[data-theme="light"] .swal2-popup {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #2D3748 !important;
}

[data-theme="light"] .swal2-title,
[data-theme="light"] .swal2-html-container {
    color: #2D3748 !important;
}

/* Mejorar contraste de textos grises en modo claro */
[data-theme="light"] .text-gray-400 {
    color: #718096 !important;
}

[data-theme="light"] .text-gray-500 {
    color: #4A5568 !important;
}