body {
            box-sizing: border-box;
        }
        
       /* Custom Color Palette */
:root {
    --primary-blue: #1e40af;
    --primary-blue-light: #3b82f6;
    --primary-blue-dark: #1e3a8a;
    --accent-gold: #f59e0b;
    --accent-gold-light: #fbbf24;
    --accent-gold-dark: #d97706;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo-preview {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

/* ===== Botón Primary (Mantener) ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-light) 100%);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-blue-dark) 0%, var(--primary-blue) 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.3);
}

/* ===== Botón Gold → Reemplazar con Secondary Blue ===== */
.btn-gold {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%); /* Azul claro profesional */
    color: white;
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-gold:hover {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

/* ===== Botón Success (Mantener) ===== */
.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
    color: white;
}

/* ===== Botón Danger (Mantener) ===== */
.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #f87171 100%);
    color: white;
}


/* 📱 Corregir inputs de color en móviles */
@media (max-width: 640px) {
    /* Inputs de color más pequeños */
    input[type="color"] {
        width: 36px !important;
        height: 32px !important;
    }
    
    /* Ajustar padding en móviles */
    .px-2\.5 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .py-1\.5 {
        padding-top: 0.375rem !important;
        padding-bottom: 0.375rem !important;
    }
}

/* 🎨 Mejorar inputs de color */
input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

input[type="color"]:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input[type="color"]:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}





/* Enhanced Typography */
.text-primary {
    color: var(--primary-blue-dark);
}
.text-primary-light {
    color: var(--primary-blue);
}
.text-contrast {
    color: var(--gray-800);
}
.text-contrast-light {
    color: var(--gray-600);
}
.text-contrast-lighter {
    color: var(--gray-500);
}




/* ===== Navigation Items - Sin Dorado ===== */
.nav-item-enhanced {
    position: relative;
    transition: all 0.3s ease;
}

.nav-item-enhanced:hover {
    background: linear-gradient(90deg, var(--primary-blue) 0%, var(--primary-blue-light) 100%);
    color: white;
    transform: translateX(4px);
}

/*  */
.nav-item-enhanced.active {
    background: linear-gradient(90deg, var(--primary-blue) 0%, var(--primary-blue-light) 100%);
    color: white;
    font-weight: 600;
}

/* INDICADOR AZUL EN VEZ DE DORADO */
.nav-item-enhanced.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #3b82f6 0%, #60a5fa 100%);
}

/* ===== 1. Sistema de Borde Degradado Unificado ===== */
/* Clases utilitarias para el borde superior */
.border-gradient-top {
    position: relative;
    overflow: hidden; /* Contiene el pseudo-elemento */
}

.border-gradient-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    /* Usa la variable --border-color si existe, sino el degradado azul por defecto */
    background: var(--border-color, linear-gradient(90deg, #1e40af 0%, #93c5fd 100%));
    z-index: 10;
}

/* ===== 2. Estilos Base y Modo Oscuro por Componente ===== */

/* A. Login Card */
.card-premium {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
@media (prefers-color-scheme: dark) {
    .card-premium {
        background: var(--gray-800, #1f2937);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    }
    /* Ajuste de inputs y textos en login para modo oscuro */
    .card-premium input, 
    .card-premium label {
        background: var(--gray-700, #374151);
        border-color: var(--gray-600, #4b5563);
        color: white;
    }
}

/* ===== Login Screen Background con Modo Oscuro ===== */
#loginScreen {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #dbeafe 100%);
    transition: background 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    #loginScreen {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1e3a8a 100%);
    }
}




/* C. Main Content & Dashboard Section */
.main-content-section, 
#dashboard {
    background: transparent; /* El fondo lo maneja el body o contenedor padre */
}

.dashboard-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
@media (prefers-color-scheme: dark) {
    .dashboard-card {
        background: var(--gray-800, #1f2937);
    }
}

/* ===== 3. Corrección Crítica: Metric Cards ===== */
.metric-card {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Borde degradado dinámico para métricas */
.metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--border-color, linear-gradient(90deg, #1e40af 0%, #93c5fd 100%));
}

/* Variantes por atributo data-border */
.metric-card[data-border="success"]::before {
    background: linear-gradient(90deg, #059669 0%, #6ee7b7 100%);
}
.metric-card[data-border="danger"]::before {
    background: linear-gradient(90deg, #dc2626 0%, #fca5a5 100%);
}
.metric-card[data-border="warning"]::before {
    background: linear-gradient(90deg, #d97706 0%, #fcd34d 100%);
}

/* Hover effect */
.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

/* Modo Oscuro para Metric Cards */
@media (prefers-color-scheme: dark) {
    .metric-card {
        background: var(--gray-800, #1f2937);
        border: 1px solid var(--gray-700, #374151);
    }
    /* Ajuste de colores de texto e iconos en modo oscuro */
    .metric-card .text-primary { color: #60a5fa !important; }
    .metric-card .text-contrast-light { color: #9ca3af !important; }
}




/* =============================================================================
   SIDEBAR TOGGLEABLE - DESKTOP Y MÓVIL (AGREGAR ESTO)
   ============================================================================= */

/* Sidebar - Oculto por defecto en todos los dispositivos */
#mobileSidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 50;
}

/* Sidebar Abierto */
#mobileSidebar.open {
    transform: translateX(0);
}

/* Overlay - Oscurece el contenido cuando sidebar está abierto */
#mobileOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

/* Overlay Activo */
#mobileOverlay.active {
    opacity: 1;
    visibility: visible;
}

/* Main Content - Con transición suave */
.mobile-main-content {
    transition: margin-left 0.3s ease;
}

/* Desktop: Sidebar comportamiento */
@media (min-width: 769px) {
    #mobileSidebar {
        transform: translateX(-100%);
    }
    #mobileSidebar.open {
        transform: translateX(0);
    }
    
    /* Main content se ajusta cuando sidebar está abierto */
    .mobile-main-content {
        margin-left: 0;
    }
    .mobile-main-content.sidebar-open {
        margin-left: 256px; /* w-64 = 256px */
    }
}

/* =============================================================================
   SCROLLBARS - MODO OSCURO (AGREGAR ESTO)
   ============================================================================= */

/* Sidebar Navigation Scrollbar */
.sidebar-gradient nav::-webkit-scrollbar {
    width: 6px;
}
.sidebar-gradient nav::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}
.sidebar-gradient nav::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
    transition: background 0.3s ease;
}
.sidebar-gradient nav::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

@media (prefers-color-scheme: dark) {
    .sidebar-gradient nav::-webkit-scrollbar-thumb {
        background: #4b5563;
    }
    .sidebar-gradient nav::-webkit-scrollbar-thumb:hover {
        background: #6b7280;
    }
    .sidebar-gradient nav::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* Firefox Support */
.sidebar-gradient nav {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

@media (prefers-color-scheme: dark) {
    .sidebar-gradient nav {
        scrollbar-color: #4b5563 transparent;
    }
}

/* ===== Scrollbar: Lista de Productos e Historial ===== */
#productsList,
#productHistoryList {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

#productsList::-webkit-scrollbar,
#productHistoryList::-webkit-scrollbar {
    width: 6px;
}

#productsList::-webkit-scrollbar-track,
#productHistoryList::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

#productsList::-webkit-scrollbar-thumb,
#productHistoryList::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
    transition: background 0.2s ease;
}

#productsList::-webkit-scrollbar-thumb:hover,
#productHistoryList::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

@media (prefers-color-scheme: dark) {
    #productsList,
    #productHistoryList {
        scrollbar-color: #334155 #0f172a;
    }

    #productsList::-webkit-scrollbar-track,
    #productHistoryList::-webkit-scrollbar-track {
        background: #0f172a;
    }

    #productsList::-webkit-scrollbar-thumb,
    #productHistoryList::-webkit-scrollbar-thumb {
        background: #334155;
    }

    #productsList::-webkit-scrollbar-thumb:hover,
    #productHistoryList::-webkit-scrollbar-thumb:hover {
        background: #475569;
    }
}

/* =============================================================================
   SIDEBAR GRADIENT - VERSIÓN CONSOLIDADA (REEMPLAZAR)
   ============================================================================= */

.sidebar-gradient {
    background: linear-gradient(180deg, var(--white) 0%, var(--gray-50) 100%);
    border-right: 2px solid var(--gray-100);
    position: relative;
    overflow: hidden;
}

.sidebar-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e40af 0%, #93c5fd 100%);
    z-index: 20;
}

@media (prefers-color-scheme: dark) {
    .sidebar-gradient {
        background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
        border-right-color: var(--gray-700);
    }
    .sidebar-gradient::before {
        background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
    }
    .sidebar-gradient .nav-item-enhanced {
        color: var(--gray-300);
    }
    .sidebar-gradient .nav-item-enhanced:hover {
        background: linear-gradient(90deg, var(--gray-700) 0%, var(--gray-600) 100%);
        color: white;
    }
}



/* Botón cerrar sidebar - Desktop */
.sidebar-close-btn {
    display: none;
}

@media (min-width: 769px) {
    .sidebar-close-btn {
        display: flex;
    }
}

/* Efecto hover para el botón cerrar */
.sidebar-close-btn:hover {
    background: var(--gray-100) !important;
    transform: scale(1.05);
}

@media (prefers-color-scheme: dark) {
    .sidebar-close-btn:hover {
        background: var(--gray-700) !important;
    }
}


/* ===== Estilo para gráficos y secciones con borde azul degradado ===== */
.chart-section,
.recent-activity-section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}
.chart-section::before,
.recent-activity-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e40af 0%, #93c5fd 100%);
}
.chart-section:hover,
.recent-activity-section:hover {
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.25);
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
    .chart-section,
    .recent-activity-section {
        background: var(--gray-800);
    }
}


/* ===== ESTRUCTURA UNIFICADA PARA TODOS LOS GRÁFICOS ===== */
.chart-main-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    height: calc(100% - 24px); /* Espacio reservado para tarjetas inferiores */
    gap: 12px;
}

/* Contenido principal del gráfico */
.chart-content {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Contenedores de canvas - TAMAÑO LIGERAMENTE MAYOR */
.chart-section canvas {
    width: 100%;
    height: 100%;
    display: block;
    min-height: 0;
    min-width: 0;
}

/* 🎯 AJUSTE PARA TORTAS LIGERAMENTE MÁS GRANDES */
.chart-content.distribution .relative {
    max-width: 92%; /* Aumentado de 85% a 92% */
    max-height: 92%; /* Aumentado de 85% a 92% */
    padding: 4%; /* Reducido de 8% a 4% */
}

/* 🎯 AJUSTE PARA TORTAS DE ROI E INGRESOS VS GASTOS */
.chart-content:not(.distribution) {
    max-width: 92%; /* Aumentado de 85% a 92% */
    max-height: 92%; /* Aumentado de 85% a 92% */
    padding: 4%; /* Reducido de 8% a 4% */
}

/* Distribución específica para gráficos de torta */
.chart-content.distribution {
    display: flex;
    gap: 12px;
}

/* En móviles: columnas para distribución */
@media (max-width: 768px) {
    .chart-content.distribution {
        flex-direction: column;
    }
    
    .chart-content.distribution > :first-child,
    .chart-content.distribution > :nth-child(2) {
        flex: 1;
        min-height: 0;
    }
    
    .chart-section {
        height: 18rem;
        padding: 0.75rem;
    }
    
    /* En móviles, mantener tamaño óptimo */
    .chart-content.distribution .relative {
        max-width: 95%;
        max-height: 95%;
        padding: 2.5%;
    }
    
    .chart-content:not(.distribution) {
        max-width: 95%;
        max-height: 95%;
        padding: 2.5%;
    }
}

/* En desktop: filas para distribución + AJUSTES DE PROPORCIÓN */
@media (min-width: 769px) {
    .chart-content.distribution {
        flex-direction: row;
    }
    
    .chart-content.distribution > :first-child {
        flex: 1;
        min-width: 0;
        /* Asegurar que ocupe más espacio */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .chart-content.distribution > :nth-child(2) {
        width: 160px; /* Reducido de 180px a 160px */
        flex: none;
        min-width: 160px;
        /* 👇 ALTURA LIMITADA PARA EVITAR SUPERPOSICIÓN 👇 */
        max-height: 120px; /* Altura máxima para la leyenda */
        overflow-y: auto;
    }
    
    /* Altura normal para gráficos ROI e Ingresos vs Gastos */
    .chart-section {
        height: 22rem;
    }
    
    /* Altura reducida SOLO para gráficos de distribución */
    .chart-section.distribution-chart {
        height: 20rem;
    }
}

/* 👇 CORRECCIÓN CLAVE: LIMITAR ALTURA DE LEYENDAS 👇 */
#incomeDistributionLegend,
#expensesDistributionLegend {
    overflow-y: auto;
    padding-right: 8px;
    min-height: 0;
    max-height: 120px; /* Altura máxima para evitar superposición */
}

/* Scrollbar personalizada */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
/* ===== NUEVO: Estilo para tarjetas de métricas con degradado en bordes ===== */
.metric-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    height: 100%;
}
.metric-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.25);
}
.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border-color, linear-gradient(90deg, #1e40af 0%, #93c5fd 100%));
    /* Si no se define --border-color, usa el degradado azul por defecto */
}

/* Degradados específicos para cada tipo de tarjeta */
.metric-card[data-border="success"]::before {
    background: linear-gradient(90deg, #065f46 0%, #6ee7b7 100%); /* from-green-800 to-green-300 */
}
.metric-card[data-border="danger"]::before {
    background: linear-gradient(90deg, #991b1b 0%, #fca5a5 100%); /* from-red-800 to-red-300 */
}

/* Modo oscuro para las tarjetas */
@media (prefers-color-scheme: dark) {
    .metric-card {
        background: var(--gray-800);
    }
}



        
/* Degradados específicos */
.metric-card[data-border="success"]::before {
    background: linear-gradient(90deg, #065f46 0%, #6ee7b7 100%);
}
.metric-card[data-border="danger"]::before {
    background: linear-gradient(90deg, #991b1b 0%, #fca5a5 100%);
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
    .metric-card {
        background: var(--gray-800);
    }
}
        


/* ===== Estilo para panel de filtros con borde azul degradado ===== */
.dashboard-filters-panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}
.dashboard-filters-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e40af 0%, #93c5fd 100%);
}
.dashboard-filters-panel:hover {
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.25);
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

/* Modo oscuro para el panel de filtros */
@media (prefers-color-scheme: dark) {
    .dashboard-filters-panel {
        background: var(--gray-800);
    }
}


/* ===== Estilo para los paneles de reportes con borde superior azul ===== */
.report-panel {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}
.report-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1e40af 0%, #93c5fd 100%);
}
.report-panel:hover {
  box-shadow: 0 8px 25px rgba(30, 64, 175, 0.25);
  transform: translateY(-1px);
  transition: all 0.3s ease;
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
  .report-panel {
    background: #1f2937;
  }
}


/* ===== ESTILOS MODO OSCURO: SECCIONES NEGOCIOS Y PRODUCTOS ===== */

/* Fondo general de las secciones */
@media (prefers-color-scheme: dark) {
  #business,
  #products {
    color: #f3f4f6;
  }

  /* Títulos principales */
  #business h2,
  #products h2 {
    color: #f9fafb !important;
  }

  /* Subtítulos y párrafos de descripción — excluir botones */
  #business p:not(button):not(button *),
  #products p:not(button):not(button *) {
    color: #9ca3af !important;
  }

  /* Contenedor principal de lista */
  #business .bg-white,
  #products .bg-white {
    background: var(--gray-800, #1f2937) !important;
    color: #f3f4f6 !important;
  }

  /* Títulos internos como "Lista de Negocios" / "Lista de Productos" */
  #business h3,
  #products h3 {
    color: #f3f4f6 !important;
  }

  /* Contadores de texto gris */
  #businessesCount,
  #productsCount {
    color: #9ca3af !important;
  }

  /* Labels de formularios en sección */
  #business label,
  #products label {
    color: #d1d5db !important;
  }

  /* Textos con clases de tailwind gray */
  #business .text-gray-800,
  #products .text-gray-800 {
    color: #f9fafb !important;
  }

  #business .text-gray-700,
  #products .text-gray-700 {
    color: #e5e7eb !important;
  }

  #business .text-gray-600,
  #products .text-gray-600 {
    color: #9ca3af !important;
  }

  #business .text-gray-500,
  #products .text-gray-500 {
    color: #9ca3af !important;
  }

  /* Inputs, selects y textareas */
  #business input,
  #business select,
  #business textarea,
  #products input,
  #products select,
  #products textarea {
    background: var(--gray-700, #374151) !important;
    border-color: var(--gray-600, #4b5563) !important;
    color: #f3f4f6 !important;
  }

  #business input::placeholder,
  #products input::placeholder {
    color: #6b7280 !important;
  }

  /* Filtros de productos */
  #productFiltersContainer {
    color: #f3f4f6;
  }

  /* Textos de ayuda — excluir botones */
  #products .text-xs:not(button):not(button *) {
    color: #9ca3af !important;
  }

  /* Proteger SIEMPRE el texto blanco de botones */
  #business button,
  #business button *,
  #business .btn-primary,
  #business .btn-primary *,
  #products button,
  #products button *,
  #products .btn-primary,
  #products .btn-primary * {
    color: #ffffff !important;
  }
}

/* ===== PANEL PRINCIPAL: Borde degradado azul superior (igual que dashboard) ===== */
.business-panel,
.products-panel {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.business-panel::before,
.products-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1e40af 0%, #93c5fd 100%);
  z-index: 10;
}

.business-panel:hover,
.products-panel:hover {
  box-shadow: 0 8px 25px rgba(30, 64, 175, 0.25);
  transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
  .business-panel,
  .products-panel {
    background: var(--gray-800, #1f2937) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .business-panel::before,
  .products-panel::before {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  }
}

/* =====================================================================
   PANELES — EMPLEADOS Y CLIENTES
   Idéntico a .business-panel / .products-panel
   ===================================================================== */
.employees-panel,
.clients-panel {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.employees-panel::before,
.clients-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1e40af 0%, #93c5fd 100%);
  z-index: 10;
}

.employees-panel:hover,
.clients-panel:hover {
  box-shadow: 0 8px 25px rgba(30, 64, 175, 0.25);
  transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
  .employees-panel,
  .clients-panel {
    background: var(--gray-800, #1f2937) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .employees-panel::before,
  .clients-panel::before {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  }
}

/* ===================================================================
   TARJETAS DE EMPLEADOS / CLIENTES — .employee-item-card
   Idéntico al patrón de .product-item-card
   =================================================================== */
.employee-item-card {
  background: white;
  border: none;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.employee-item-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1e40af 0%, #93c5fd 100%);
  border-radius: 16px 16px 0 0;
}
.employee-item-card:hover {
  box-shadow: 0 8px 24px rgba(30, 64, 175, 0.14);
  transform: translateY(-2px);
}

/* Textos semánticos — modo claro */
.employee-card-title  { color: #1f2937; }
.employee-card-body   { color: #4b5563; }
.employee-card-label  { color: #374151; }
.employee-card-meta   { color: #6b7280; }
.employee-card-border-top { border-top: 1px solid #e5e7eb; }

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
  .employee-item-card {
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  .employee-item-card::before {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  }
  .employee-item-card:hover {
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
  }
  .employee-card-title  { color: #f1f5f9 !important; }
  .employee-card-body   { color: #94a3b8 !important; }
  .employee-card-label  { color: #cbd5e1 !important; }
  .employee-card-meta   { color: #64748b !important; }
  .employee-card-border-top { border-top-color: #334155 !important; }
}

/* ===================================================================
   TARJETAS DE HISTORIAL DE EMPLEADOS / CLIENTES — .employee-history-card
   Idéntico al patrón de .product-history-card
   =================================================================== */
.employee-history-card {
  background: white;
  border: none;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.employee-history-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1e40af 0%, #93c5fd 100%);
  border-radius: 14px 14px 0 0;
}
.employee-history-card:hover {
  box-shadow: 0 8px 24px rgba(30, 64, 175, 0.14);
  transform: translateY(-1px);
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
  .employee-history-card {
    background: #1e293b !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
  }
  .employee-history-card::before {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  }
  .employee-history-card:hover {
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2) !important;
  }
}

/* ===================================================================
   TARJETA DE RESUMEN — .summary-card (Historial de Empleados/Clientes)
   =================================================================== */
.summary-card {
  background: #f8faff;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}
.summary-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1e40af 0%, #93c5fd 100%);
  border-radius: 14px 14px 0 0;
}

/* Textos semánticos — modo claro */
.summary-card-title { color: #1e40af; font-weight: 600; }
.summary-card-body  { color: #374151; }
.summary-card-label { color: #374151; font-weight: 600; }
.summary-card-meta  { color: #6b7280; }
.summary-card-border-top { border-top: 1px solid #dbeafe; }
.summary-debt-item  { background: #fefce8; border: 1px solid #fef08a; }

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
  .summary-card {
    background: #0f172a !important;
    border-color: #1e3a8a !important;
  }
  .summary-card::before {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  }
  .summary-card-title { color: #7dd3fc !important; }
  .summary-card-body  { color: #e2e8f0 !important; }
  .summary-card-label { color: #cbd5e1 !important; }
  .summary-card-meta  { color: #64748b !important; }
  .summary-card-border-top { border-top-color: #1e3a8a !important; }
  .summary-debt-item  { background: #1c1917 !important; border-color: #78350f !important; }
}

/* =====================================================================
   MODO OSCURO — ENCABEZADOS Y TEXTOS: Empleados, Clientes, Categorías
   ===================================================================== */

@media (prefers-color-scheme: dark) {
  /* Títulos principales de sección (h2) */
  #employees h2,
  #clients h2,
  #providers h2 {
    color: #f1f5f9 !important;
  }

  /* Subtítulos descriptivos (p) debajo del h2 */
  #employees > div > div > p,
  #clients > div > div > p,
  #providers > div > div > p {
    color: #94a3b8 !important;
  }

  /* Títulos de panel: Lista, Historial */
  .employees-panel h3,
  .clients-panel h3,
  .employees-panel h4,
  .clients-panel h4 {
    color: #f1f5f9 !important;
  }

  /* Contador de empleados/clientes */
  #employeesCount,
  #clientsCount {
    color: #94a3b8 !important;
  }

  /* Texto de resumen del historial */
  #employeeHistorySummary,
  #clientHistorySummary,
  #providerHistorySummary {
    color: #94a3b8 !important;
  }

  /* Labels de filtros */
  #employees label,
  #clients label,
  #providers label {
    color: #cbd5e1 !important;
  }

  /* Inputs y selects de filtros */
  #employees input,
  #employees select,
  #clients input,
  #clients select,
  #providers input,
  #providers select {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
  }

  /* Textos vacíos */
  #employeesList > p,
  #employeeHistoryList > p,
  #clientsList > p,
  #clientHistoryList > p,
  #providersList > p,
  #providerHistoryList > p {
    color: #64748b !important;
  }

  /* ── Textos Tailwind dentro de providers ── */
  #providers .text-gray-800 { color: #f1f5f9 !important; }
  #providers .text-gray-700 { color: #cbd5e1 !important; }
  #providers .text-gray-600 { color: #94a3b8 !important; }
  #providers .text-gray-500 { color: #64748b !important; }
  #providers .border-gray-200,
  #providers .border-gray-100 { border-color: #334155 !important; }

  /* ── Tarjetas generadas por JS en el historial ── */
  #employeeHistoryList > div,
  #clientHistoryList > div {
    background: #1e293b !important;
    border-color: #334155 !important;
  }
  #employeeHistoryList .text-sm.font-semibold.text-gray-800,
  #clientHistoryList .text-sm.font-semibold.text-gray-800 {
    color: #7dd3fc !important;
  }
  #employeeHistoryList .text-xs.text-gray-500,
  #clientHistoryList .text-xs.text-gray-500 {
    color: #94a3b8 !important;
  }
  #employeeHistoryList .text-xs.text-gray-600,
  #clientHistoryList .text-xs.text-gray-600 {
    color: #94a3b8 !important;
  }
  #employeeHistoryList .text-xs.text-red-700,
  #clientHistoryList .text-xs.text-red-700 {
    color: #fca5a5 !important;
  }

  /* ── Categorías creadas: subtítulos y listas ── */
  #categoriesList h4 {
    color: #7dd3fc !important;
  }
  #employeeCategoriesList li,
  #extraCategoriesList li,
  #benefitCategoriesList li,
  #discountCategoriesList li {
    color: #e2e8f0 !important;
    border-color: #334155 !important;
  }

  /* Textos con clases Tailwind dentro de empleados y clientes */
  #employees .text-gray-800,
  #clients .text-gray-800 { color: #f1f5f9 !important; }
  #employees .text-gray-700,
  #clients .text-gray-700 { color: #cbd5e1 !important; }
  #employees .text-gray-600,
  #clients .text-gray-600 { color: #94a3b8 !important; }
  #employees .text-gray-500,
  #clients .text-gray-500 { color: #64748b !important; }

  /* Bordes divisores */
  #employees .border-gray-200,
  #clients .border-gray-200,
  #employees .border-gray-100,
  #clients .border-gray-100 { border-color: #334155 !important; }

  /* Fondo del bloque "Crear categoría" desktop */
  #employees .bg-black\/10,
  #clients .bg-black\/10 { background: rgba(30, 41, 59, 0.7) !important; }

  /* ── Tarjetas de empleados/clientes generadas por JS ── */
  #employeesList > div,
  #clientsList > div {
    background: #1e293b !important;
    border-color: #334155 !important;
  }
  #employeesList .bg-white,
  #clientsList .bg-white { background: #1e293b !important; }
  #employeesList .bg-gray-50,
  #clientsList .bg-gray-50 { background: #0f172a !important; }
  #employeesList .text-gray-800,
  #employeesList .text-gray-900,
  #clientsList .text-gray-800,
  #clientsList .text-gray-900 { color: #7dd3fc !important; }
  #employeesList .text-gray-700,
  #employeesList .text-gray-600,
  #clientsList .text-gray-700,
  #clientsList .text-gray-600 { color: #94a3b8 !important; }
  #employeesList .text-gray-500,
  #clientsList .text-gray-500 { color: #64748b !important; }
}

/* =====================================================================
   SCROLLBARS — Lista y Historial de Empleados y Clientes
   Idéntico al de #productsList / #productHistoryList
   ===================================================================== */
#employeesList,
#employeeHistoryList,
#clientsList,
#clientHistoryList,
#providersList,
#providerHistoryList {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

#employeesList::-webkit-scrollbar,
#employeeHistoryList::-webkit-scrollbar,
#clientsList::-webkit-scrollbar,
#clientHistoryList::-webkit-scrollbar,
#providersList::-webkit-scrollbar,
#providerHistoryList::-webkit-scrollbar {
  width: 6px;
}

#employeesList::-webkit-scrollbar-track,
#employeeHistoryList::-webkit-scrollbar-track,
#clientsList::-webkit-scrollbar-track,
#clientHistoryList::-webkit-scrollbar-track,
#providersList::-webkit-scrollbar-track,
#providerHistoryList::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

#employeesList::-webkit-scrollbar-thumb,
#employeeHistoryList::-webkit-scrollbar-thumb,
#clientsList::-webkit-scrollbar-thumb,
#clientHistoryList::-webkit-scrollbar-thumb,
#providersList::-webkit-scrollbar-thumb,
#providerHistoryList::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #1e40af 0%, #93c5fd 100%);
  border-radius: 3px;
  transition: background 0.2s ease;
}

#employeesList::-webkit-scrollbar-thumb:hover,
#employeeHistoryList::-webkit-scrollbar-thumb:hover,
#clientsList::-webkit-scrollbar-thumb:hover,
#clientHistoryList::-webkit-scrollbar-thumb:hover,
#providersList::-webkit-scrollbar-thumb:hover,
#providerHistoryList::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #1e3a8a 0%, #60a5fa 100%);
}

@media (prefers-color-scheme: dark) {
  #employeesList,
  #employeeHistoryList,
  #clientsList,
  #clientHistoryList,
  #providersList,
  #providerHistoryList {
    scrollbar-color: #334155 #0f172a;
  }

  #employeesList::-webkit-scrollbar-track,
  #employeeHistoryList::-webkit-scrollbar-track,
  #clientsList::-webkit-scrollbar-track,
  #clientHistoryList::-webkit-scrollbar-track,
  #providersList::-webkit-scrollbar-track,
  #providerHistoryList::-webkit-scrollbar-track {
    background: #0f172a;
  }

  #employeesList::-webkit-scrollbar-thumb,
  #employeeHistoryList::-webkit-scrollbar-thumb,
  #clientsList::-webkit-scrollbar-thumb,
  #clientHistoryList::-webkit-scrollbar-thumb,
  #providersList::-webkit-scrollbar-thumb,
  #providerHistoryList::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1e3a8a 0%, #334155 100%);
  }

  #employeesList::-webkit-scrollbar-thumb:hover,
  #employeeHistoryList::-webkit-scrollbar-thumb:hover,
  #clientsList::-webkit-scrollbar-thumb:hover,
  #clientHistoryList::-webkit-scrollbar-thumb:hover,
  #providersList::-webkit-scrollbar-thumb:hover,
  #providerHistoryList::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #3b82f6 0%, #475569 100%);
  }
}

/* ===================================================================
   SECCIÓN TRANSACCIONES Y VENTAS — dark mode + scrollbar
   =================================================================== */

/* Títulos sección */
#transactions h2, #budgets h2 { color: #f1f5f9; }
#transactions > div > div > p, #budgets > div > div > p { color: #94a3b8; }

/* Labels, inputs, selects */
#transactions label, #budgets label { color: #cbd5e1; }
#transactions input, #transactions select,
#budgets input, #budgets select {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

/* Textos vacíos */
#transactionsList > p, #budgetsList > p { color: #64748b !important; }

/* Textos Tailwind dentro de secciones */
#transactions .text-gray-800, #budgets .text-gray-800 { color: #f1f5f9 !important; }
#transactions .text-gray-700, #budgets .text-gray-700 { color: #cbd5e1 !important; }
#transactions .text-gray-600, #budgets .text-gray-600 { color: #94a3b8 !important; }
#transactions .text-gray-500, #budgets .text-gray-500 { color: #64748b !important; }
#transactions .border-gray-200, #budgets .border-gray-200,
#transactions .border-gray-100, #budgets .border-gray-100 { border-color: #334155 !important; }

/* Panel de balance summary */
#transactions .bg-green-50, #budgets .bg-green-50 { background: rgba(16,185,129,0.1) !important; }
#transactions .bg-red-50, #budgets .bg-red-50 { background: rgba(239,68,68,0.1) !important; }
#transactions .bg-blue-50, #budgets .bg-blue-50 { background: rgba(59,130,246,0.1) !important; }
#transactions .bg-gray-50, #budgets .bg-gray-50 { background: #0f172a !important; }
#transactions .bg-white, #budgets .bg-white { background: #1e293b !important; }

/* Scrollbar transacciones y ventas */
#transactionsList, #budgetsList {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
#transactionsList::-webkit-scrollbar,
#budgetsList::-webkit-scrollbar { width: 6px; }
#transactionsList::-webkit-scrollbar-track,
#budgetsList::-webkit-scrollbar-track { background: transparent; border-radius: 3px; }
#transactionsList::-webkit-scrollbar-thumb,
#budgetsList::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #1e40af 0%, #93c5fd 100%);
  border-radius: 3px;
}
#transactionsList::-webkit-scrollbar-thumb:hover,
#budgetsList::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #1e3a8a 0%, #60a5fa 100%);
}

@media (prefers-color-scheme: dark) {
  #transactions h2, #budgets h2 { color: #f1f5f9 !important; }
  #transactions > div > div > p, #budgets > div > div > p { color: #94a3b8 !important; }
  #transactions label, #budgets label { color: #cbd5e1 !important; }
  #transactions input, #transactions select,
  #budgets input, #budgets select {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
  }
  #transactionsList > p, #budgetsList > p { color: #64748b !important; }
  #transactions .text-gray-800, #budgets .text-gray-800 { color: #f1f5f9 !important; }
  #transactions .text-gray-700, #budgets .text-gray-700 { color: #cbd5e1 !important; }
  #transactions .text-gray-600, #budgets .text-gray-600 { color: #94a3b8 !important; }
  #transactions .text-gray-500, #budgets .text-gray-500 { color: #64748b !important; }

  #transactionsList, #budgetsList {
    scrollbar-color: #334155 #0f172a;
  }
  #transactionsList::-webkit-scrollbar-track,
  #budgetsList::-webkit-scrollbar-track { background: #0f172a; }
  #transactionsList::-webkit-scrollbar-thumb,
  #budgetsList::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1e3a8a 0%, #334155 100%);
  }
  #transactionsList::-webkit-scrollbar-thumb:hover,
  #budgetsList::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #3b82f6 0%, #475569 100%);
  }
}

/* ===================================================================
   SECCIÓN PEDIDOS — dark mode + scrollbar
   =================================================================== */

#orders h2 { color: #f1f5f9; }
#orders > div > div > p { color: #94a3b8; }
#orders label { color: #cbd5e1; }
#orders input, #orders select {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}
#ordersList > div > p { color: #64748b !important; }

#orders .text-gray-800 { color: #f1f5f9 !important; }
#orders .text-gray-700 { color: #cbd5e1 !important; }
#orders .text-gray-600 { color: #94a3b8 !important; }
#orders .text-gray-500 { color: #64748b !important; }
#orders .text-gray-400 { color: #475569 !important; }
#orders .border-gray-200, #orders .border-gray-100 { border-color: #334155 !important; }
#orders .bg-white { background: #1e293b !important; }
#orders .bg-blue-50  { background: rgba(59,130,246,0.12) !important; }
#orders .bg-amber-50 { background: rgba(245,158,11,0.12) !important; }
#orders .bg-green-50 { background: rgba(16,185,129,0.12) !important; }
#orders .bg-purple-50 { background: rgba(139,92,246,0.12) !important; }

@media (prefers-color-scheme: dark) {
  #orders h2 { color: #f1f5f9 !important; }
  #orders > div > div > p { color: #94a3b8 !important; }
  #orders label { color: #cbd5e1 !important; }
  #orders input, #orders select {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
  }
  #orders .text-gray-800 { color: #f1f5f9 !important; }
  #orders .text-gray-700 { color: #cbd5e1 !important; }
  #orders .text-gray-600 { color: #94a3b8 !important; }
  #orders .text-gray-500 { color: #64748b !important; }
  #orders .text-gray-400 { color: #475569 !important; }
  #orders .border-gray-200, #orders .border-gray-100 { border-color: #334155 !important; }
  #orders .bg-blue-50  { background: rgba(59,130,246,0.12) !important; }
  #orders .bg-amber-50 { background: rgba(245,158,11,0.12) !important; }
  #orders .bg-green-50 { background: rgba(16,185,129,0.12) !important; }
  #orders .bg-purple-50 { background: rgba(139,92,246,0.12) !important; }
}

/* Scrollbar pedidos */
#ordersList {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
#ordersList::-webkit-scrollbar { width: 6px; }
#ordersList::-webkit-scrollbar-track { background: transparent; border-radius: 3px; }
#ordersList::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #1e40af 0%, #93c5fd 100%);
  border-radius: 3px;
}
#ordersList::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #1e3a8a 0%, #60a5fa 100%);
}
@media (prefers-color-scheme: dark) {
  #ordersList { scrollbar-color: #334155 #0f172a; }
  #ordersList::-webkit-scrollbar-track { background: #0f172a; }
  #ordersList::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #1e3a8a 0%, #334155 100%); }
  #ordersList::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #3b82f6 0%, #475569 100%); }
}

/* ===================================================================
   SECCIÓN REPORTES — dark mode textos
   =================================================================== */

#reports h2 { color: #f1f5f9; }
#reports h3 { color: #f1f5f9; }
#reports h4 { color: #e2e8f0; }
#reports p  { color: #94a3b8; }
#reports > div > div > p { color: #94a3b8; }
#reports label { color: #cbd5e1; }
#reports input, #reports select {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}
#reports .text-gray-800 { color: #f1f5f9 !important; }
#reports .text-gray-700 { color: #cbd5e1 !important; }
#reports .text-gray-600 { color: #94a3b8 !important; }
#reports .text-gray-500 { color: #64748b !important; }
#reports .border-gray-200, #reports .border-gray-300 { border-color: #334155 !important; }
#reports .bg-gray-50 { background: #0f172a !important; }
#reports .bg-green-50 { background: rgba(16,185,129,0.12) !important; }
#reports .bg-blue-50  { background: rgba(59,130,246,0.12) !important; }
#reports .bg-orange-50 { background: rgba(249,115,22,0.12) !important; }
#reports .bg-red-50   { background: rgba(239,68,68,0.12) !important; }
#reports .hover\:bg-gray-50:hover { background: #1e293b !important; }
#reports .text-green-700 { color: #4ade80 !important; }
#reports .text-green-800 { color: #86efac !important; }
#reports .text-blue-700  { color: #60a5fa !important; }
#reports .text-blue-800  { color: #93c5fd !important; }
#reports .text-orange-700 { color: #fb923c !important; }
#reports .text-orange-800 { color: #fdba74 !important; }
#reports .text-red-700   { color: #f87171 !important; }
#reports .text-red-800   { color: #fca5a5 !important; }

@media (prefers-color-scheme: dark) {
  #reports h2 { color: #f1f5f9 !important; }
  #reports h3 { color: #f1f5f9 !important; }
  #reports h4 { color: #e2e8f0 !important; }
  #reports p  { color: #94a3b8 !important; }
  #reports label { color: #cbd5e1 !important; }
  #reports input, #reports select {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
  }
  #reports .text-gray-800 { color: #f1f5f9 !important; }
  #reports .text-gray-700 { color: #cbd5e1 !important; }
  #reports .text-gray-600 { color: #94a3b8 !important; }
  #reports .text-gray-500 { color: #64748b !important; }
  #reports .border-gray-200, #reports .border-gray-300 { border-color: #334155 !important; }
  #reports .bg-green-50  { background: rgba(16,185,129,0.12) !important; }
  #reports .bg-blue-50   { background: rgba(59,130,246,0.12) !important; }
  #reports .bg-orange-50 { background: rgba(249,115,22,0.12) !important; }
  #reports .bg-red-50    { background: rgba(239,68,68,0.12) !important; }
  #reports .hover\:bg-gray-50:hover { background: #1e293b !important; }
  #reports .text-green-700 { color: #4ade80 !important; }
  #reports .text-green-800 { color: #86efac !important; }
  #reports .text-blue-700  { color: #60a5fa !important; }
  #reports .text-blue-800  { color: #93c5fd !important; }
  #reports .text-orange-700 { color: #fb923c !important; }
  #reports .text-orange-800 { color: #fdba74 !important; }
  #reports .text-red-700   { color: #f87171 !important; }
  #reports .text-red-800   { color: #fca5a5 !important; }
}

/* ===================================================================
   SECCIÓN CONFIGURACIÓN — dark mode completo
   =================================================================== */

/* Encabezado y textos generales */
#configuration h2 { color: #f1f5f9; }
#configuration h3 { color: #f1f5f9; }
#configuration h4 { color: #e2e8f0; }
#configuration h5 { color: #cbd5e1; }
#configuration h6 { color: #cbd5e1; }
#configuration > div > div > p { color: #94a3b8; }

/* Labels e inputs */
#configuration label { color: #cbd5e1; }
#configuration input[type="text"],
#configuration input[type="number"],
#configuration input[type="date"],
#configuration input[type="email"],
#configuration select {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}
#configuration input::placeholder { color: #64748b !important; }

/* Textos grises */
#configuration .text-gray-800 { color: #f1f5f9 !important; }
#configuration .text-gray-700 { color: #cbd5e1 !important; }
#configuration .text-gray-600 { color: #94a3b8 !important; }
#configuration .text-gray-500 { color: #64748b !important; }
#configuration .text-gray-400 { color: #475569 !important; }
#configuration .text-gray-300 { color: #334155 !important; }

/* Bordes */
#configuration .border-gray-200,
#configuration .border-gray-300,
#configuration .border-gray-100 { border-color: #334155 !important; }

/* Sub-paneles bg-white */
#configuration .bg-white { background: #1e293b !important; }

/* Sub-paneles bg-gray-50 / bg-gray-100 */
#configuration .bg-gray-50  { background: #0f172a !important; }
#configuration .bg-gray-100 { background: #0f172a !important; }
#configuration .bg-gray-200 { background: #1e293b !important; color: #cbd5e1 !important; }

/* bg-blue-50 / border-blue-* */
#configuration .bg-blue-50  { background: rgba(59,130,246,0.1) !important; }
#configuration .border-blue-100 { border-color: rgba(59,130,246,0.25) !important; }
#configuration .border-blue-200 { border-color: rgba(59,130,246,0.3) !important; }
#configuration .border-blue-300 { border-color: rgba(59,130,246,0.4) !important; }
#configuration .text-blue-700  { color: #60a5fa !important; }
#configuration .text-blue-800  { color: #93c5fd !important; }
#configuration .text-blue-900  { color: #bfdbfe !important; }
#configuration .text-blue-600  { color: #60a5fa !important; }

/* bg-green-50 */
#configuration .bg-green-50    { background: rgba(16,185,129,0.1) !important; }
#configuration .border-green-200 { border-color: rgba(16,185,129,0.3) !important; }
#configuration .text-green-700 { color: #4ade80 !important; }

/* hover states */
#configuration .hover\:bg-gray-50:hover  { background: #1e293b !important; }
#configuration .hover\:bg-gray-100:hover { background: #1e293b !important; }
#configuration .hover\:bg-blue-100:hover { background: rgba(59,130,246,0.15) !important; }
#configuration .hover\:bg-blue-200:hover { background: rgba(59,130,246,0.2) !important; }
#configuration .hover\:bg-gray-200:hover { background: #334155 !important; }
#configuration .hover\:bg-blue-50:hover  { background: rgba(59,130,246,0.12) !important; }
#configuration .hover\:bg-green-100:hover { background: rgba(16,185,129,0.15) !important; }
#configuration .hover\:bg-gray-50:hover span,
#configuration .hover\:bg-blue-100:hover span { color: inherit; }

/* Tabs de categorías */
#configuration #tabProducts,
#configuration #tabTransactions { color: #94a3b8; }
#configuration #tabProducts.border-b-2,
#configuration .border-b-2.border-blue-600 { color: #60a5fa !important; border-color: #60a5fa !important; }
#configuration .border-b.border-gray-200 { border-color: #334155 !important; }

/* Checkboxes label items */
#configuration label.flex.items-center { color: #cbd5e1; }
#configuration label.cursor-not-allowed span { color: #64748b !important; }
#configuration .text-xs.text-blue-700,
#configuration .text-xs.text-blue-800 { color: #60a5fa !important; }
#configuration .text-xs.text-green-700 { color: #4ade80 !important; }
#configuration p.text-xs.font-semibold.text-blue-700 { color: #60a5fa !important; }
#configuration p.text-xs.font-semibold.text-green-700 { color: #4ade80 !important; }

/* Scanner badge tags */
#configuration .bg-blue-100 { background: rgba(59,130,246,0.15) !important; }
#configuration .text-blue-800.bg-blue-100 { color: #93c5fd !important; }
#configuration .bg-gray-200.px-2\.5 { background: #334155 !important; color: #cbd5e1 !important; }

/* Vista previa del recibo */
#configuration #receiptPreviewWrapper {
  background: #0f172a !important;
  border-color: #334155 !important;
}
#configuration .bg-gray-100.rounded-lg { background: #0f172a !important; }
#configuration .text-gray-600.text-center { color: #64748b !important; }

/* Zoom / screen indicator */
#configuration #zoomLevel,
#configuration #screenSizeIndicator { color: #94a3b8 !important; }

/* Botones de paleta y zoom */
#configuration .bg-blue-100.border-blue-300  { background: rgba(59,130,246,0.15) !important; border-color: rgba(59,130,246,0.4) !important; color: #93c5fd !important; }
#configuration .bg-green-100.border-green-300 { background: rgba(16,185,129,0.12) !important; border-color: rgba(16,185,129,0.35) !important; color: #4ade80 !important; }
#configuration .bg-purple-100.border-purple-300 { background: rgba(139,92,246,0.12) !important; border-color: rgba(139,92,246,0.35) !important; color: #c4b5fd !important; }
#configuration .bg-blue-50.border-blue-300 { background: rgba(59,130,246,0.1) !important; border-color: rgba(59,130,246,0.35) !important; color: #93c5fd !important; }
#configuration .bg-blue-50.border-blue-200 { background: rgba(59,130,246,0.1) !important; border-color: rgba(59,130,246,0.25) !important; color: #93c5fd !important; }
#configuration .bg-green-50.border-green-300 { background: rgba(16,185,129,0.1) !important; border-color: rgba(16,185,129,0.3) !important; color: #4ade80 !important; }
#configuration .bg-purple-50.border-purple-300 { background: rgba(139,92,246,0.1) !important; border-color: rgba(139,92,246,0.3) !important; color: #c4b5fd !important; }

/* Inputs color picker labels */
#configuration input[type="color"] {
  background: #1e293b !important;
  border-color: #334155 !important;
}

/* Nota informativa "campos obligatorios" */
#configuration .bg-blue-50.border-blue-200 p { color: #93c5fd !important; }
#configuration .bg-blue-50.border-blue-200 strong { color: #bfdbfe !important; }

/* Employer signature status panel */
#configuration #employerSignatureStatus { color: #fbbf24 !important; }

/* Lista de checkboxes obligatorios (green-50) */
#configuration .bg-green-50.rounded-lg { background: rgba(16,185,129,0.08) !important; }
#configuration .bg-green-50 .text-gray-700 { color: #6b7280 !important; }

/* Separadores */
#configuration .border-t.border-gray-200 { border-color: #334155 !important; }

@media (prefers-color-scheme: dark) {
  #configuration h2 { color: #f1f5f9 !important; }
  #configuration h3 { color: #f1f5f9 !important; }
  #configuration h4 { color: #e2e8f0 !important; }
  #configuration h5 { color: #cbd5e1 !important; }
  #configuration h6 { color: #cbd5e1 !important; }
  #configuration label { color: #cbd5e1 !important; }
  #configuration input[type="text"],
  #configuration input[type="number"],
  #configuration input[type="date"],
  #configuration input[type="email"],
  #configuration select {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
  }
  #configuration .text-gray-800 { color: #f1f5f9 !important; }
  #configuration .text-gray-700 { color: #cbd5e1 !important; }
  #configuration .text-gray-600 { color: #94a3b8 !important; }
  #configuration .text-gray-500 { color: #64748b !important; }
  #configuration .text-gray-400 { color: #475569 !important; }
  #configuration .border-gray-200,
  #configuration .border-gray-300,
  #configuration .border-gray-100 { border-color: #334155 !important; }
  #configuration .bg-white  { background: #1e293b !important; }
  #configuration .bg-gray-50  { background: #0f172a !important; }
  #configuration .bg-gray-100 { background: #0f172a !important; }
  #configuration .bg-gray-200 { background: #1e293b !important; color: #cbd5e1 !important; }
  #configuration .bg-blue-50  { background: rgba(59,130,246,0.1) !important; }
  #configuration .bg-green-50 { background: rgba(16,185,129,0.1) !important; }
  #configuration .text-blue-700  { color: #60a5fa !important; }
  #configuration .text-blue-800  { color: #93c5fd !important; }
  #configuration .text-blue-900  { color: #bfdbfe !important; }
  #configuration .text-blue-600  { color: #60a5fa !important; }
  #configuration .text-green-700 { color: #4ade80 !important; }
  #configuration .hover\:bg-gray-50:hover  { background: #1e293b !important; }
  #configuration .hover\:bg-gray-100:hover { background: #1e293b !important; }
  #configuration .border-t.border-gray-200 { border-color: #334155 !important; }
  #configuration .border-b.border-gray-200 { border-color: #334155 !important; }
  #configuration #receiptPreviewWrapper { background: #0f172a !important; border-color: #334155 !important; }
  #configuration .bg-gray-100.rounded-lg   { background: #0f172a !important; }
  #configuration .bg-gray-200.px-2\.5 { background: #334155 !important; color: #cbd5e1 !important; }
  #configuration input[type="color"] { background: #1e293b !important; border-color: #334155 !important; }
  #configuration .bg-green-50.rounded-lg  { background: rgba(16,185,129,0.08) !important; }
  #configuration .bg-green-50 .text-gray-700 { color: #6b7280 !important; }
}

/* ===================================================================
   TARJETAS DE NEGOCIOS — .business-item-card
   =================================================================== */
.business-item-card {
  background: white;
  border: none;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.07);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.business-item-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1e40af 0%, #93c5fd 100%);
  border-radius: 14px 14px 0 0;
}

.business-item-card:hover {
  box-shadow: 0 8px 24px rgba(30, 64, 175, 0.15);
  transform: translateY(-2px);
}

/* Textos semánticos — modo claro */
.business-card-title  { color: #1f2937; }
.business-card-subtitle { color: #6b7280; }
.business-card-body   { color: #4b5563; }
.business-card-label  { color: #374151; }
.business-card-meta   { color: #9ca3af; }
.business-card-footer-border { border-top: 1px solid #f3f4f6; }

/* Modo oscuro — tarjetas de negocios */
@media (prefers-color-scheme: dark) {
  .business-item-card {
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  .business-item-card::before {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  }
  .business-item-card:hover {
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
  }
  .business-card-title   { color: #f1f5f9 !important; }
  .business-card-subtitle { color: #94a3b8 !important; }
  .business-card-body    { color: #94a3b8 !important; }
  .business-card-label   { color: #cbd5e1 !important; }
  .business-card-meta    { color: #64748b !important; }
  .business-card-footer-border { border-top-color: #334155 !important; }
  .dark-bg-icon { background: #334155 !important; color: #94a3b8 !important; }
  .dark-border-override { border-color: #334155 !important; }
}

/* ===================================================================
   TARJETAS DE PRODUCTOS — .product-item-card
   =================================================================== */
.product-item-card {
  background: white;
  border: none;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product-item-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1e40af 0%, #93c5fd 100%);
  border-radius: 16px 16px 0 0;
}

.product-item-card:hover {
  box-shadow: 0 8px 24px rgba(30, 64, 175, 0.14);
  transform: translateY(-2px);
}

/* Badge de marca/proveedor — modo claro */
.product-brand-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-weight: 500;
}

/* Textos semánticos — modo claro */
.product-card-title   { color: #1f2937; }
.product-card-body    { color: #4b5563; }
.product-card-label   { color: #374151; }
.product-card-meta    { color: #6b7280; }
.product-expanded-border { border-top: 1px solid #e5e7eb; }
.product-description-box {
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  color: #374151;
}

/* Modo oscuro — tarjetas de productos */
@media (prefers-color-scheme: dark) {
  .product-item-card {
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  .product-item-card::before {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  }
  .product-item-card:hover {
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
  }
  .product-brand-badge {
    background: #1e3a5f !important;
    color: #93c5fd !important;
    border-color: #2563eb !important;
  }
  .product-card-title   { color: #f1f5f9 !important; }
  .product-card-body    { color: #94a3b8 !important; }
  .product-card-label   { color: #cbd5e1 !important; }
  .product-card-meta    { color: #64748b !important; }
  .product-expanded-border { border-top-color: #334155 !important; }
  .product-description-box {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
  }
}

/* ===================================================================
   TARJETAS DE HISTORIAL — .product-history-card
   =================================================================== */
.product-history-card {
  background: white;
  border: none;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product-history-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1e40af 0%, #93c5fd 100%);
  border-radius: 14px 14px 0 0;
}

.product-history-card:hover {
  box-shadow: 0 8px 24px rgba(30, 64, 175, 0.14);
  transform: translateY(-1px);
}

/* Colores modo claro */
.history-card-title { color: #1d4ed8; font-weight: 600; }
.history-card-meta  { color: #6b7280; }
.history-card-body  { color: #374151; }
.history-card-label { color: #4b5563; }
.history-card-value { color: #1f2937; }
.history-card-row-border { border-bottom: 1px solid #e5e7eb; padding-top: 0.25rem; padding-bottom: 0.25rem; }

/* Modo oscuro — historial: mismo fondo que producto, texto BLANCO */
@media (prefers-color-scheme: dark) {
  .product-history-card {
    background: #1e293b !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
  }
  .product-history-card::before {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  }
  .product-history-card:hover {
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2) !important;
  }
  .history-card-title { color: #7dd3fc !important; }
  .history-card-meta  { color: #ffffff !important; }
  .history-card-body  { color: #ffffff !important; }
  .history-card-label { color: #ffffff !important; }
  .history-card-value { color: #ffffff !important; }
  .history-card-row-border { border-bottom-color: #334155 !important; }
}


/* ===================================================================
   SECCIÓN CATÁLOGO — Bordes degradados + Modo Oscuro (PC y mobile)
   =================================================================== */

/* Título y subtítulo del header de sección */
#catalog h2 {
  color: #1f2937;
}
#catalog > div > div > p {
  color: #4b5563;
}

/* Toggle header de configuración */
#catalogConfigToggleHeader {
  background: white;
  border-color: #e5e7eb;
  transition: background 0.2s, border-color 0.2s;
}

/* Todos los paneles "Paso X" — borde degradado azul en el top */
#catalog .bg-white.rounded-xl.shadow-lg {
  position: relative;
  overflow: hidden;
}
#catalog .bg-white.rounded-xl.shadow-lg::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1e40af 0%, #93c5fd 100%);
  z-index: 5;
}

/* Contenedor "Estilo del Botón Carrito" (bg-indigo-50) */
.catalog-cart-style-box {
  background: #eff6ff;
  border-color: #dbeafe;
}

/* ===== MODO OSCURO — CATÁLOGO (PC) ===== */
@media (prefers-color-scheme: dark) {

  /* Header de la sección */
  #catalog h2 {
    color: #f1f5f9 !important;
  }
  #catalog > div > div > p,
  #catalog .text-gray-600 {
    color: #94a3b8 !important;
  }

  /* Toggle header */
  #catalogConfigToggleHeader {
    background: #1e293b !important;
    border-color: #334155 !important;
  }
  #catalogConfigToggleHeader h3,
  #catalogConfigToggleHeader p {
    color: #f1f5f9 !important;
  }
  #catalogConfigToggleHeader #catalogConfigToggleArrow {
    color: #60a5fa !important;
  }

  /* Todos los paneles bg-white de catálogo */
  #catalog .bg-white.rounded-xl.shadow-lg {
    background: #1e293b !important;
    border-color: #334155 !important;
  }
  #catalog .bg-white.rounded-xl.shadow-lg::after {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  }

  /* Títulos y subtítulos dentro de paneles */
  #catalog h3.text-gray-800,
  #catalog .text-gray-800 {
    color: #f1f5f9 !important;
  }
  #catalog .text-gray-700 {
    color: #e2e8f0 !important;
  }
  #catalog .text-gray-500,
  #catalog .text-gray-400 {
    color: #94a3b8 !important;
  }

  /* Labels */
  #catalog label {
    color: #cbd5e1 !important;
  }

  /* Inputs y selects */
  #catalog input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
  #catalog select,
  #catalog textarea {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
  }
  #catalog input::placeholder,
  #catalog textarea::placeholder {
    color: #475569 !important;
  }

  /* Contenedor "Estilo del Botón Carrito" — bg-indigo-50 */
  #catalog .bg-indigo-50 {
    background: #1e293b !important;
    border-color: #334155 !important;
  }
  #catalog .bg-indigo-50 p,
  #catalog .bg-indigo-50 label {
    color: #f1f5f9 !important;
  }
  #catalog .bg-indigo-50 .text-gray-700,
  #catalog .bg-indigo-50 .text-gray-800 {
    color: #f1f5f9 !important;
  }

  /* Filas bg-gray-50 dentro de catálogo (ej: Botón Flotante, Borde Redondeado) */
  #catalog .bg-gray-50 {
    background: #0f172a !important;
    border-color: #334155 !important;
  }
  #catalog .bg-gray-50 p,
  #catalog .bg-gray-50 .text-gray-800 {
    color: #f1f5f9 !important;
  }
  #catalog .bg-gray-50 .text-gray-500 {
    color: #94a3b8 !important;
  }

  /* Bordes internos */
  #catalog .border-gray-200,
  #catalog .border-t.border-gray-200 {
    border-color: #334155 !important;
  }

  /* Textos de prefijo como "catalogo/" */
  #catalog .text-gray-500 {
    color: #64748b !important;
  }

  /* Botones guardar/restablecer — contenedor sticky */
  #catalog .bg-gray-100.p-4.rounded-xl,
  #catalog .sticky.bottom-4 {
    background: #1e293b !important;
  }
  #catalog .bg-gray-200.text-gray-700 {
    background: #334155 !important;
    color: #f1f5f9 !important;
  }
  #catalog .bg-gray-200.text-gray-700:hover {
    background: #475569 !important;
  }

  /* Información del Catálogo — bg-blue-50 */
  #catalog .bg-blue-50 {
    background: #172554 !important;
    border-color: #1e3a8a !important;
  }
  #catalog .bg-blue-50 .text-blue-900 { color: #93c5fd !important; }
  #catalog .bg-blue-50 .text-blue-700 { color: #bfdbfe !important; }

  /* Datos de clientes — gradiente indigo */
  #catalog .rounded-2xl.border.border-indigo-100 {
    background: #1e293b !important;
    border-color: #334155 !important;
  }
  #catalog .rounded-2xl.border.border-indigo-100 .text-gray-800 { color: #f1f5f9 !important; }
  #catalog .rounded-2xl.border.border-indigo-100 .text-gray-500 { color: #94a3b8 !important; }

  /* Tarjetas individuales de campos (bg-white dentro del grid) */
  #catalog .client-field-toggle {
    background: #0f172a !important;
    border-color: #334155 !important;
  }
  #catalog .client-field-toggle:hover {
    background: #1e293b !important;
    border-color: #3b82f6 !important;
  }
  #catalog .client-field-toggle p.text-gray-700 { color: #f1f5f9 !important; }
  #catalog .client-field-toggle p.text-gray-400 { color: #64748b !important; }
  #catalog .client-field-toggle .bg-indigo-100 {
    background: #1e3a5f !important;
    color: #93c5fd !important;
  }
  #catalog .client-field-toggle .text-indigo-600 { color: #93c5fd !important; }

  /* Íconos de color en el header del paso */
  #catalog .bg-blue-100  { background: #1e3a5f !important; }
  #catalog .bg-purple-100 { background: #3b1f5e !important; }
  #catalog .bg-green-100  { background: #14532d !important; }
  #catalog .bg-cyan-100   { background: #164e63 !important; }
  #catalog .bg-pink-100   { background: #500724 !important; }

  /* Modelos de catálogo (borde selector) */
  #catalog .border-gray-200.rounded-xl {
    border-color: #334155 !important;
    background: #0f172a !important;
  }
  #catalog .border-gray-200.rounded-xl p.text-gray-800 {
    color: #f1f5f9 !important;
  }
  #catalog .border-gray-200.rounded-xl p.text-gray-500 {
    color: #64748b !important;
  }

  /* Botones de paleta de colores — no tocar */
  #catalog .bg-blue-500,
  #catalog .bg-green-500,
  #catalog .bg-purple-500,
  #catalog .bg-red-500,
  #catalog .bg-orange-500,
  #catalog .bg-gray-800,
  #catalog .bg-pink-500,
  #catalog .bg-teal-500 {
    /* mantener sus colores originales */
  }

  /* ── Envío gratis (gradiente verde) ── */
  #catalog .border-green-100 {
    background: #052e16 !important;
    border-color: #166534 !important;
  }
  #catalog .border-green-100 .text-gray-800 { color: #f1f5f9 !important; }
  #catalog .border-green-100 .text-gray-500,
  #catalog .border-green-100 .text-gray-400 { color: #86efac !important; }
  #catalog .border-green-100 input {
    background: #0f172a !important;
    border-color: #166534 !important;
    color: #f1f5f9 !important;
  }
  #catalog .border-green-100 .text-gray-500.font-semibold { color: #86efac !important; }

  /* ── Retiro en local (bg-gray-50/60) ── */
  #catalog .border-gray-200.bg-gray-50\/60,
  #catalog [class*="bg-gray-50/60"] {
    background: #1e293b !important;
    border-color: #334155 !important;
  }
  #catalog .border-gray-200.bg-gray-50\/60 .text-gray-800,
  #catalog [class*="bg-gray-50/60"] .text-gray-800 { color: #f1f5f9 !important; }
  #catalog .border-gray-200.bg-gray-50\/60 .text-gray-500,
  #catalog [class*="bg-gray-50/60"] .text-gray-500 { color: #94a3b8 !important; }
  #catalog #pickupDetails {
    border-top-color: #334155 !important;
  }
  #catalog #pickupDetails label {
    color: #94a3b8 !important;
  }
  #catalog #pickupDetails input {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
  }
  #catalog #pickupDetails .text-gray-400 { color: #64748b !important; }
}


/* 🔥 Evita páginas en blanco al inicio — versión mejorada y completa */
@page {
  margin: 0.5cm;
  size: A4;
}
html, body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.2;
  color: #333;
  margin: 0;
  padding: 0;
  height: auto;
}
/* 🔑 Reglas críticas: permitir rupturas en TODOS los contenedores principales */
body > .container,
body > .container > *,
body > .container > :first-child,
body > .container > :nth-child(2),
.report-header,
.products-column,
.product-card,
.variant-item,
.section {
  page-break-inside: auto !important;
  break-inside: auto !important;
  page-break-before: auto !important;
  break-before: auto !important;
  page-break-after: auto !important;
  break-after: auto !important;
}
/* 🔑 Eliminar margen inicial en impresión */
body > .container {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
@media print {
  html, body {
    margin: 0 !important;
    padding: 0 !important;
  }
  * {
    orphans: 1;
    widows: 1;
  }
}



/* ===== ESTILOS COMPLETOS - CONSOLIDADOS Y OPTIMIZADOS ===== */

.preview-container-wrapper {
    flex: 1;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem;
    background-color: transparent;
    border-radius: 0.5rem;
    overflow: hidden;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
}

.sheet-background-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0;
    box-sizing: border-box;
    margin: 0;
}

.preview-sheet-container {
    width: calc(210mm * 1);
    min-height: calc(297mm * 0.88);
    max-width: 95%;
    max-height: 85vh;
    background: white;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    overflow: hidden;
    transform-origin: center center;
    transition: transform 0.3s ease;
    margin: 0;
    align-self: flex-start;
}

.label-preview-background {
    background-image: radial-gradient(circle, #BFDBFE 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 4px;
}

.label-sheet-content {
    position: relative;
    z-index: 1;
    padding: 8mm;
    min-height: calc(100% - 16mm);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.label-sheet-content.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    color: #475569;
    padding: 2rem;
}

.preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 1rem;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.update-highlight {
    animation: pulse 1.5s ease-in-out;
}

.custom-scroll::-webkit-scrollbar {
    width: 6px;
}
.custom-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}
.custom-scroll::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 3px;
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ── Modo oscuro: scrollbars globales para todos los modales y contenedores en PC ── */
@media (prefers-color-scheme: dark) {
    /* custom-scroll class */
    .custom-scroll::-webkit-scrollbar-track {
        background: #0f172a;
    }
    .custom-scroll::-webkit-scrollbar-thumb {
        background: #475569;
    }
    .custom-scroll::-webkit-scrollbar-thumb:hover {
        background: #64748b;
    }

    /* Scrollbar global — aplica a todos los overflow-y-auto en modales */
    .overflow-y-auto::-webkit-scrollbar,
    .overflow-y-scroll::-webkit-scrollbar,
    .overflow-x-auto::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
    .overflow-y-auto::-webkit-scrollbar-track,
    .overflow-y-scroll::-webkit-scrollbar-track,
    .overflow-x-auto::-webkit-scrollbar-track {
        background: #0f172a;
        border-radius: 3px;
    }
    .overflow-y-auto::-webkit-scrollbar-thumb,
    .overflow-y-scroll::-webkit-scrollbar-thumb,
    .overflow-x-auto::-webkit-scrollbar-thumb {
        background: #475569;
        border-radius: 3px;
    }
    .overflow-y-auto::-webkit-scrollbar-thumb:hover,
    .overflow-y-scroll::-webkit-scrollbar-thumb:hover,
    .overflow-x-auto::-webkit-scrollbar-thumb:hover {
        background: #64748b;
    }

    /* Firefox */
    .overflow-y-auto,
    .overflow-y-scroll,
    .overflow-x-auto {
        scrollbar-color: #475569 #0f172a;
        scrollbar-width: thin;
    }

    /* Contenedores de modales explícitos */
    #budgetModalContent::-webkit-scrollbar,
    #addStockModalContent::-webkit-scrollbar,
    #printLabelsModalContent::-webkit-scrollbar,
    #priceEditModalContent::-webkit-scrollbar,
    #transactionModal::-webkit-scrollbar,
    #profileModal::-webkit-scrollbar,
    #businessModal::-webkit-scrollbar {
        width: 6px;
    }
    #budgetModalContent::-webkit-scrollbar-track,
    #addStockModalContent::-webkit-scrollbar-track,
    #printLabelsModalContent::-webkit-scrollbar-track,
    #priceEditModalContent::-webkit-scrollbar-track,
    #transactionModal::-webkit-scrollbar-track,
    #profileModal::-webkit-scrollbar-track,
    #businessModal::-webkit-scrollbar-track {
        background: #0f172a;
    }
    #budgetModalContent::-webkit-scrollbar-thumb,
    #addStockModalContent::-webkit-scrollbar-thumb,
    #printLabelsModalContent::-webkit-scrollbar-thumb,
    #priceEditModalContent::-webkit-scrollbar-thumb,
    #transactionModal::-webkit-scrollbar-thumb,
    #profileModal::-webkit-scrollbar-thumb,
    #businessModal::-webkit-scrollbar-thumb {
        background: #475569;
        border-radius: 3px;
    }
}

/* ── Modo oscuro: btn-toggle (Unidad/Caja, Código de barras/QR/Ambos) ── */
@media (prefers-color-scheme: dark) {
    .btn-toggle {
        background-color: #1e293b !important;
        border-color: #475569 !important;
        color: #cbd5e1 !important;
    }
    .btn-toggle:hover {
        background-color: #263349 !important;
        color: #f1f5f9 !important;
    }
    .btn-toggle.active {
        background-color: #2563eb !important;
        border-color: #2563eb !important;
        color: #ffffff !important;
    }

    /* ── Tarjetas de productos en modal Generar Etiquetas ── */
    .label-product-card {
        background: #1e293b !important;
        border-color: #334155 !important;
    }
    .label-product-card:hover {
        background: #263349 !important;
        border-color: #3b82f6 !important;
    }
    .label-product-card .text-gray-800 { color: #f1f5f9 !important; }
    .label-product-card .text-gray-600 { color: #94a3b8 !important; }

    /* ── Botones de ordenamiento (Nombre/SKU/Fecha) ── */
    #sortByNameBtn, #sortBySkuBtn, #sortByDateBtn {
        background: #1e293b !important;
        border-color: #475569 !important;
        color: #cbd5e1 !important;
    }
    #sortByNameBtn:hover, #sortBySkuBtn:hover, #sortByDateBtn:hover {
        background: #263349 !important;
        color: #f1f5f9 !important;
    }
    #sortByNameBtn.active, #sortBySkuBtn.active, #sortByDateBtn.active {
        background: #1d4ed8 !important;
        border-color: #2563eb !important;
        color: #ffffff !important;
    }

    /* ── Panel de configuración (bg-gray-100 con radios) ── */
    #printLabelsModalContent .bg-gray-100.rounded-lg {
        background: #0f172a !important;
    }
    #printLabelsModalContent .text-gray-900,
    #printLabelsModalContent label[for="simpleMode"],
    #printLabelsModalContent label[for="customMode"] { color: #f1f5f9 !important; }
}

.modal-cancel-btn {
    background-color: #e5e7eb;
    color: #374151;
    font-weight: 500;
}
.modal-cancel-btn:hover {
    background-color: #d1d5db;
}

@media (prefers-color-scheme: dark) {
    .modal-cancel-btn {
        background-color: #334155 !important;
        color: #cbd5e1 !important;
    }
    .modal-cancel-btn:hover {
        background-color: #475569 !important;
        color: #f1f5f9 !important;
    }
}

.btn-toggle {
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    transition: all 0.2s;
}
.btn-toggle:hover {
    background-color: #e2e8f0;
}
.btn-toggle.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* ✅ QR Code Wrapper - MEJORADO */
.qrcode-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    overflow: hidden !important;
    box-sizing: border-box;
    background: transparent !important; /* ✅ Fondo transparente */
}

/* ✅ Estilos mejorados para descripción QR */
.qr-description {
    width: 100%;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2 !important; /* ✅ Ajustado para múltiples líneas */
    overflow: hidden !important;
    padding: 0 0.7mm !important;
    white-space: normal !important; /* ✅ Permitir saltos de línea */
    text-overflow: ellipsis !important;
    margin-top: 0.5mm !important;
    min-height: 2.5mm !important; /* ✅ Aumentado para dos líneas */
    max-height: 6.0mm !important; /* ✅ Aumentado para dos líneas */
    box-sizing: border-box;
    word-break: break-word !important; /* ✅ Romper palabras largas */
}

/* ✅ Estilos específicos para URLs largas */
.qr-description.url-long {
    font-size: 3.5pt !important; /* ✅ Aumentado de 3.0pt */
    padding: 0 0.5mm !important;
}

/* ✅ Contenedor QR mejorado */
.qrcode-container {
    position: relative;
    width: 100%;
    max-width: 95%;
    aspect-ratio: 1/1;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto !important;
    overflow: hidden !important;
    box-sizing: border-box;
    background: transparent !important;
}


.barcode-container {
    position: relative;
    width: 100%;
    max-width: 95%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden !important; /* ✅ Evitar desbordamientos */
    box-sizing: border-box;
}

.barcode-canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 25mm !important;
    display: block !important;
    margin: 0 auto !important;
    image-rendering: crisp-edges !important;
    image-rendering: pixelated !important;
    transform: scale(1.02);
}

.barcode-value {
    font-family: "Courier New", monospace !important;
    font-size: 3.5mm !important;
    text-align: center !important;
    letter-spacing: 0 !important;
    margin-top: 2px !important;
    color: #000 !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    padding: 2px 0 !important;
    text-shadow: 0 0 1px rgba(255,255,255,0.8);
}

.code-placeholder {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 10px;
    text-align: center;
    padding: 4px;
    width: 100%;
    height: 100%;
}

/* ✅ Label Preview - CONSOLIDADO */
.label-preview {
    position: absolute;
    background: white !important;
    border: 1px solid #cbd5e1;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    overflow: hidden !important; /* ✅ Contener todo el contenido */
    z-index: 2;
    box-sizing: border-box;
}


/* ✅ Responsive - CONTENEDOR COMPLETO SIN RECORTES */
@media (max-width: 868px) {
    .preview-container-wrapper {
        padding: 0;
        margin: 0;
        justify-content: flex-start;
        align-items: flex-start;
        overflow-x: auto; /* ✅ Permitir scroll horizontal si es necesario */
        overflow-y: hidden;
        max-height: 100vh;
        box-sizing: border-box;
        width: 100vw;
        min-width: 100vw;
    }
    
    .sheet-background-container {
        margin: 0;
        padding: 0;
        justify-content: flex-start;
        align-items: flex-start;
        width: fit-content; /* ✅ Ancho según contenido escalado */
        min-width: 100%; /* ✅ Mínimo ancho de viewport */
        max-width: none;
        min-height: 100vh;
        height: auto;
        box-sizing: border-box;
        position: relative;
        overflow: visible;
    }
    
    /* ✅ FONDO PUNTEADO COMO PSEUDO-ELEMENTO (evita recortes) */
    .sheet-background-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: calc(310mm * 1.0);
        height: calc(297mm * 0.95);
        background-image: radial-gradient(circle, #BFDBFE 1px, transparent 1px);
        background-size: 12px 12px;
        background-position: 0 0;
        background-repeat: repeat;
        transform: scale(0.58);
        transform-origin: top left;
        z-index: 0;
        pointer-events: none;
    }
    
    .preview-sheet-container {
        width: calc(180mm * 1.0);
        min-height: calc(297mm * 0.95);
        max-width: none;
        transform: scale(0.58); /* ✅ Escala óptima para etiquetas */
        transform-origin: top left; /* ✅ Anclado a esquina superior izquierda */
        margin: 0;
        padding: 0;
        align-self: flex-start;
        overflow: visible; /* ✅ Mostrar todo el contenido */
        max-height: none;
        height: auto;
        box-sizing: border-box;
        position: relative;
        z-index: 1; /* ✅ Por encima del fondo */
        background: white;
        box-shadow: none; /* ✅ Eliminar sombra que consume espacio */
        border-radius: 0;
    }
    
    /* ✅ OCULTAR FONDO ANTIGUO (evita duplicados) */
    .label-preview-background {
        display: none !important;
    }
    
    .label-sheet-content {
        padding: 8mm;
        box-sizing: border-box;
        min-height: calc(100% - 16mm);
        height: auto !important;
        position: relative;
        z-index: 2;
    }
    
    .label-preview {
        overflow: hidden !important;
        box-sizing: border-box;
    }
    
    .label-preview > div {
        overflow: hidden !important;
        box-sizing: border-box;
    }
    
    #printLabelsModalContent {
        overflow-x: visible !important;
        overflow-y: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}










/* ✅ Print Styles - CONSOLIDADO */
@media print {
    body * {
        visibility: hidden;
    }
    #print-modal,
    #print-modal * {
        visibility: visible;
    }
    #print-modal {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        background: white !important;
        overflow: visible !important;
    }
    .sheet {
        position: relative !important;
        page-break-after: always !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        min-height: auto !important;
        height: auto !important;
        box-sizing: border-box !important;
        background: white !important;
        overflow: visible !important;
        page-break-inside: avoid !important;
    }
    .label-preview {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        margin: 0 auto !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        background: white !important;
        border: none !important;
        box-shadow: none !important;
        overflow: visible !important;
        z-index: 1 !important;
        page-break-inside: avoid !important;
        width: auto !important;
        height: auto !important;
        min-width: ${labelWidth}mm !important;
        min-height: ${labelHeight}mm !important;
    }
    .label-preview > div {
        font-family: Arial, sans-serif !important;
        color: #000 !important;
        background: white !important;
        padding: 1.2mm !important;
        box-sizing: border-box !important;
        border: none !important;
        border-radius: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }
    img {
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
        margin: 0 auto !important;
        image-rendering: pixelated !important;
        image-rendering: crisp-edges !important;
    }
    canvas, svg {
        display: none !important;
    }
    .qr-description {
        font-family: 'Courier New', monospace !important;
        font-weight: bold !important;
        color: #555 !important;
        text-align: center !important;
        margin-top: 1mm !important;
        min-height: 3mm !important;
        padding: 0 1mm !important;
        white-space: normal !important;
        text-overflow: ellipsis !important;
        line-height: 1.3 !important;
        width: 100% !important;
        overflow: visible !important; /* ✅ Restaurar para impresión */
    }
    .barcode-value {
        display: block !important;
        visibility: visible !important;
    }
}











/* 📱 Estilos responsivos para vista previa - CORREGIDO PARA SCROLL VERTICAL */
#receiptPreviewWrapper {
    position: relative;
    touch-action: pan-y pan-x;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background-color: #f9fafb;
    overflow: auto;
    min-height: 300px;
    max-height: 80vh;
    border-radius: 8px;
    margin: 8px;
    padding-top: 12px;
    /* Evitar que el wrapper desborde el layout padre */
    max-width: 100%;
    box-sizing: border-box;
}

#receiptPreviewContainer {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), 
                min-width 0.3s ease, 
                min-height 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    transform-origin: top center;
    width: 100%;
}

/* Contenedor del recibo REAL */
.receipt-preview {
    transition: none !important;
    transform: none !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
    display: block !important;
    clear: both;
    margin-bottom: 20px;
}

/* Modo landscape para móviles */
.landscape-mode {
    max-width: 95vw !important;
}

/* Mejorar scroll en móviles */
@media (max-width: 768px) {
    #receiptPreviewWrapper {
        touch-action: pan-x pan-y pinch-zoom;
        overscroll-behavior: contain;
        margin: 4px;
        padding-top: 8px;
        /* Altura suficiente pero que no rompa el layout */
        min-height: 260px;
        max-height: 60vh;
    }
    
    #receiptPreviewContainer {
        margin: 0 auto;
        padding: 4px;
        /* El container puede ser más ancho que el wrapper — eso es el scroll */
        flex-shrink: 0;
    }
}

/* Estilos para touch devices - scroll suave */
@media (hover: none) and (pointer: coarse) {
    #receiptPreviewWrapper {
        scrollbar-width: thin;
        scrollbar-color: #999 #f1f1f1;
    }
    
    #receiptPreviewWrapper::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    
    #receiptPreviewWrapper::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    #receiptPreviewWrapper::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }
    
    #receiptPreviewWrapper::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
    
    /* Prevenir el zoom del navegador */
    #receiptPreviewWrapper {
        touch-action: pan-x pan-y;
    }
}

/* ✨ Efecto visual al hacer zoom */
#receiptPreviewContainer:active,
#receiptPreviewContainer:focus {
    outline: none;
}

/* Indicador de área de scroll visible */
#receiptPreviewWrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.9), transparent);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
}

#receiptPreviewWrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(to top, rgba(255,255,255,0.9), transparent);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Mostrar indicadores cuando hay scroll */
#receiptPreviewWrapper.overflowing::before,
#receiptPreviewWrapper.overflowing::after {
    opacity: 1;
}

/* Solución para iOS */
#receiptPreviewWrapper {
    -webkit-overflow-scrolling: touch;
}

/* Solución para Android */
#receiptPreviewWrapper {
    scroll-behavior: smooth;
}

/* Scrollbar personalizado para desktop */
@media (min-width: 769px) {
    #receiptPreviewWrapper::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }
    
    #receiptPreviewWrapper::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 5px;
    }
    
    #receiptPreviewWrapper::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 5px;
    }
    
    #receiptPreviewWrapper::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}






///modal nombre recibos de sueldo///


@keyframes fade-in {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}
.animate-fade-in { animation: fade-in 0.3s ease-out; }
.animate-fade-out { animation: fade-out 0.5s forwards; }




/* Estilos para la galería de previsualización */
.photo-preview-item {
  position: relative;
  aspect-ratio: 1; /* Cuadrado perfecto */
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview-item .remove-photo-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(255, 0, 0, 0.8);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  border: none;
}

.photo-preview-item .remove-photo-btn:hover {
  background: red;
}




        /* Form Enhancements */
        .form-input-enhanced {
            border: 2px solid var(--gray-200);
            border-radius: 12px;
            padding: 12px 16px;
            transition: all 0.3s ease;
            background: white;
            color: var(--gray-800);
        }
        .form-input-enhanced:focus {
            border-color: var(--primary-blue);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
            outline: none;
        }
        
        /* Modal Enhancements */
        .modal-enhanced {
            background: rgba(30, 64, 175, 0.1);
            backdrop-filter: blur(8px);
        }
        .modal-content-enhanced {
            background: white;
            border: 1px solid var(--gray-200);
            border-radius: 20px;
            box-shadow: 0 20px 60px rgba(30, 64, 175, 0.2);
        }
        

        
        /* Mobile Optimizations */
        @media (max-width: 768px) {
            /* Ensure full viewport usage */
            html, body {
                height: 100%;
                overflow-x: hidden;
            }
            
            body {
                padding-bottom: env(safe-area-inset-bottom);
            }
            
            .logo-preview {
                width: 60px;
                height: 60px;
            }
        }

        /* Mobile text contrast — SOLO modo claro */
        @media (max-width: 768px) and (prefers-color-scheme: light) {
            /* Enhanced mobile text contrast - Dark text on light backgrounds */
            .text-gray-600 {
                color: #1f2937 !important;
            }
            
            .text-gray-700 {
                color: #111827 !important;
            }
            
            .text-gray-500 {
                color: #374151 !important;
            }
            
            .text-gray-400 {
                color: #4b5563 !important;
            }
            
            .text-gray-300 {
                color: #6b7280 !important;
            }
            
            /* All light text colors become dark on mobile */
            .text-blue-600 {
                color: #1e40af !important;
            }
            
            .text-blue-500 {
                color: #1d4ed8 !important;
            }
            
            .text-green-600 {
                color: #059669 !important;
            }
            
            .text-red-600 {
                color: #dc2626 !important;
            }
            
            .text-purple-600 {
                color: #9333ea !important;
            }
            
            .text-yellow-600 {
                color: #d97706 !important;
            }
            
            .text-indigo-600 {
                color: #4f46e5 !important;
            }
            
            /* Chart titles and dashboard text improvements for mobile */
            .text-gray-800 {
                color: #111827 !important;
            }
            
            /* Specific chart title improvements */
            h3.text-base,
            h3.text-lg {
                color: #111827 !important;
            }
            
            /* Recent activity text improvements */
            .text-gray-700 {
                color: #111827 !important;
            }
        }

        @media (max-width: 768px) {
            /* Mobile user list specific improvements */
            .mobile-user-card {
                background: #f1f5f9;
                border: 2px solid #cbd5e1;
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
            }
            
            .mobile-user-card:hover {
                background: #e2e8f0;
                border-color: #3b82f6;
                box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
            }
            
            .dark .mobile-user-card {
                background: #1f2937;
                border-color: #374151;
            }
            
            .dark .mobile-user-card:hover {
                background: #111827;
                border-color: #60a5fa;
            }
            
            /* Mobile sidebar */
            .mobile-sidebar {
                transform: translateX(-100%);
                transition: transform 0.3s ease;
                height: 100vh;
                overflow-y: auto;
            }
            
            .mobile-sidebar.open {
                transform: translateX(0);
            }
            
            /* Mobile overlay */
            .mobile-overlay {
                position: fixed;
                inset: 0;
                background: rgba(0, 0, 0, 0.5);
                z-index: 40;
                opacity: 0;
                visibility: hidden;
                transition: all 0.3s ease;
            }
            
            .mobile-overlay.active {
                opacity: 1;
                visibility: visible;
            }
            
/* 🌐 Mobile Bottom Navigation - Fixed, scrollable */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
  z-index: 30;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Contenedor desplazable */
.mobile-bottom-nav .scroll-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  padding: 0 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mobile-bottom-nav .scroll-container::-webkit-scrollbar {
  display: none;
}

/* Ítems de navegación */
.mobile-nav-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #6b7280;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.3s ease;
  scroll-snap-align: start;
  min-width: 70px;
}
.mobile-nav-item.active {
  color: #2563eb;
  transform: scale(1.05);
}
.mobile-nav-item:hover {
  color: #1d4ed8;
}
.mobile-nav-icon {
  font-size: 22px;
  margin-bottom: 2px;
}

/* Indicador de desplazamiento */
.mobile-bottom-nav .scroll-hint {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 61;
}
.scroll-hint span {
  font-size: 20px;
  color: #9ca3af;
  opacity: 0.7;
  animation: pulse 1.5s infinite;
}

/* Ajuste del contenido principal — FIX ESPACIO EXTRA */
.mobile-main-content {
  min-height: auto;
  height: auto;
  padding-bottom: 80px; /* espacio justo para la barra inferior */
  overflow-x: hidden;
}

/* Secciones — sin hueco extra arriba o abajo */
.section {
  min-height: calc(100vh - 100px);
  padding-top: 1rem;
  padding-bottom: 0;
}

/* Compatibilidad con móviles con notch / safe-area */
@supports (padding: max(0px)) {
  .mobile-main-content {
    padding-bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
  }
}

/* Animación del indicador de desplazamiento */
@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(3px); }
}
            
            /* Mobile modal adjustments */
            .mobile-modal {
                margin: 8px;
                max-height: calc(100vh - 16px);
                overflow-y: auto;
                border-radius: 12px;
            }
            
            /* Mobile form adjustments */
            .mobile-form-grid {
                grid-template-columns: 1fr;
                gap: 16px;
            }
            
            /* Mobile card adjustments */
            .mobile-card {
                margin: 0 -4px;
                border-radius: 8px;
                background: #f1f5f9 !important;
                border: 1px solid #cbd5e1 !important;
            }
            
            /* Mobile background improvements — SOLO en modo claro */
            @media (prefers-color-scheme: light) {
                .bg-white {
                    background: #f8fafc !important;
                    border: 1px solid #e2e8f0 !important;
                }
                
                .bg-gray-50 {
                    background: #f1f5f9 !important;
                }
                
                .bg-gray-100 {
                    background: #e2e8f0 !important;
                }
                
                /* Specific mobile card improvements */
                .rounded-xl.shadow-lg {
                    background: #f8fafc !important;
                    border: 2px solid #cbd5e1 !important;
                    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
                }
                
                /* Mobile form backgrounds */
                .border.border-gray-200.rounded-lg {
                    background: #f1f5f9 !important;
                    border: 2px solid #94a3b8 !important;
                }
                
                /* Mobile hover states */
                .hover\:bg-gray-50:hover {
                    background: #e2e8f0 !important;
                }
            }

            /* Mobile stats grid - Better spacing */
            .mobile-stats-grid {
                grid-template-columns: 1fr 1fr;
                gap: 8px;
            }
            
            /* Mobile chart container - Responsive height */
            .mobile-chart-container {
                height: 250px;
                margin-bottom: 16px;
            }
            
            /* Mobile table */
            .mobile-table {
                font-size: 14px;
            }
            
            .mobile-table-row {
                padding: 12px 16px;
                border-bottom: 1px solid #f3f4f6;
            }
            
            /* Mobile button adjustments */
            .mobile-button {
                padding: 14px 16px;
                font-size: 16px;
                width: 100%;
                min-height: 48px;
            }
            
            /* Mobile input adjustments - Prevent zoom */
            .mobile-input {
                padding: 14px 16px;
                font-size: 16px;
                min-height: 48px;
            }
            
            /* All inputs and selects on mobile */
            input, select, textarea, button {
                font-size: 16px !important;
                min-height: 44px;
            }
            
            /* Mobile floating action button */
            .mobile-fab {
                position: fixed;
                bottom: calc(90px + env(safe-area-inset-bottom));
                right: 16px;
                width: 56px;
                height: 56px;
                border-radius: 50%;
                background: #3b82f6;
                color: black;
                border: none;
                box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
                z-index: 45;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 24px;
                transition: all 0.3s ease;
            }
            
            .mobile-fab:active {
                transform: scale(0.95);
            }
            
            /* Grid adjustments for mobile */
            .grid {
                gap: 12px;
            }
            
            .grid-cols-1 {
                grid-template-columns: 1fr;
            }
            
            .grid-cols-2 {
                grid-template-columns: repeat(2, 1fr);
            }
            
            /* Chart containers mobile optimization */
            .bg-white.rounded-xl.shadow-lg {
                margin-bottom: 16px;
                padding: 16px;
            }
            
            /* Scrollable areas */
            .overflow-y-auto {
                -webkit-overflow-scrolling: touch;
            }
            
            /* Text size adjustments */
            .text-3xl {
                font-size: 1.75rem;
            }
            
            .text-2xl {
                font-size: 1.5rem;
            }
            
            .text-xl {
                font-size: 1.25rem;
            }
            
            /* Padding adjustments */
            .p-6 {
                padding: 16px;
            }
            
            .p-4 {
                padding: 12px;
            }
            
            .px-8 {
                padding-left: 16px;
                padding-right: 16px;
            }
            
            .py-8 {
                padding-top: 24px;
                padding-bottom: 24px;
            }
            
            /* Margin adjustments */
            .mb-8 {
                margin-bottom: 24px;
            }
            
            .mb-6 {
                margin-bottom: 16px;
            }
            
            /* Safe area adjustments for newer phones */
            @supports (padding: max(0px)) {
                .mobile-bottom-nav {
                    padding-bottom: max(8px, env(safe-area-inset-bottom));
                }
                
                .mobile-main-content {
                    padding-bottom: max(100px, calc(100px + env(safe-area-inset-bottom)));
                }
                
                .mobile-fab {
                    bottom: max(90px, calc(90px + env(safe-area-inset-bottom)));
                }
            }
        }
        
        /* ============================================
           MODO OSCURO UNIVERSAL — Modales y toda la app
           Aplica en TODOS los tamaños de pantalla
           ============================================ */
        @media (prefers-color-scheme: dark) {
            /* Fondo raíz */
            html, body {
                background: #0f172a !important;
                color: #f1f5f9 !important;
            }

            /* Contenedor principal de la app */
            .mobile-main-content,
            #dashboard,
            #business,
            #products,
            .section {
                background: #0f172a !important;
                color: #f1f5f9 !important;
            }

            /* Todos los contenedores blancos — incluye modales en desktop */
            .bg-white,
            .rounded-xl.shadow-lg,
            .rounded-2xl.shadow-lg {
                background: #1e293b !important;
                border-color: #334155 !important;
                color: #f1f5f9 !important;
            }

            .bg-gray-50 { background: #0f172a !important; }
            .bg-gray-100 { background: #1e293b !important; }

            /* Paneles de sección */
            .business-panel,
            .products-panel,
            .dashboard-card,
            .chart-section,
            .report-panel,
            .dashboard-filters-panel,
            .recent-activity-section,
            .metric-card {
                background: #1e293b !important;
                border-color: #334155 !important;
                color: #f1f5f9 !important;
            }

            /* Tarjetas individuales */
            .business-item-card,
            .product-item-card,
            .product-history-card {
                background: #1e293b !important;
                color: #f1f5f9 !important;
            }

            /* Textos */
            h2, h3, h4, h5 {
                color: #f1f5f9 !important;
            }
            .text-gray-800, .text-gray-700 { color: #f1f5f9 !important; }
            .text-gray-600, .text-gray-500 { color: #94a3b8 !important; }
            .text-gray-400, .text-gray-300 { color: #64748b !important; }

            /* Proteger botones — texto siempre blanco */
            button, button *, .btn-primary, .btn-primary * {
                color: #ffffff !important;
            }
            /* Excepción iconos/botones de nav */
            .mobile-nav-item { color: #94a3b8 !important; }
            .mobile-nav-item.active { color: #60a5fa !important; }

            /* Inputs — modales en desktop también */
            input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
            select,
            textarea {
                background: #0f172a !important;
                border-color: #334155 !important;
                color: #f1f5f9 !important;
            }
            input::placeholder, textarea::placeholder {
                color: #475569 !important;
            }

            /* Labels */
            label { color: #cbd5e1 !important; }

            /* Bordes */
            .border-gray-200, .border-gray-100, .border-gray-300 {
                border-color: #334155 !important;
            }

            /* Barra de navegación inferior */
            .mobile-bottom-nav {
                background: #1e293b !important;
                border-top-color: #334155 !important;
            }

            /* Top bar */
            .top-bar {
                background: rgba(17, 24, 39, 0.97) !important;
                border-bottom-color: #334155 !important;
            }

            /* Badges */
            .bg-blue-100 { background: #1e3a5f !important; }
            .text-blue-800 { color: #93c5fd !important; }
            .bg-yellow-100 { background: #422006 !important; }
            .text-yellow-800 { color: #fcd34d !important; }
            .bg-gray-200, .bg-gray-100 { background: #334155 !important; }

            /* Catálogo — paneles y contenedores */
            #catalog .bg-white.rounded-xl.shadow-lg {
                background: #1e293b !important;
                border-color: #334155 !important;
            }
            #catalog .bg-indigo-50 {
                background: #1e293b !important;
                border-color: #334155 !important;
            }
            #catalog .bg-indigo-50 p,
            #catalog .bg-indigo-50 label,
            #catalog .bg-indigo-50 .text-gray-700,
            #catalog .bg-indigo-50 .text-gray-800 {
                color: #f1f5f9 !important;
            }
            #catalog .bg-gray-50 {
                background: #0f172a !important;
                border-color: #334155 !important;
            }
            #catalog .bg-gray-50 p,
            #catalog .bg-gray-50 .text-gray-800 { color: #f1f5f9 !important; }
            #catalog .bg-gray-50 .text-gray-500 { color: #94a3b8 !important; }
            #catalogConfigToggleHeader {
                background: #1e293b !important;
                border-color: #334155 !important;
            }
            #catalogConfigToggleHeader h3,
            #catalogConfigToggleHeader p { color: #f1f5f9 !important; }
            #catalog h3.text-gray-800,
            #catalog .text-gray-800 { color: #f1f5f9 !important; }
            #catalog .text-gray-500 { color: #94a3b8 !important; }
            #catalog label { color: #cbd5e1 !important; }
            #catalog input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
            #catalog select,
            #catalog textarea {
                background: #0f172a !important;
                border-color: #334155 !important;
                color: #f1f5f9 !important;
            }
            /* Info del catálogo (bg-blue-50) */
            #catalog .bg-blue-50 {
                background: #172554 !important;
                border-color: #1e3a8a !important;
            }
            #catalog .bg-blue-50 .text-blue-900 { color: #93c5fd !important; }
            #catalog .bg-blue-50 .text-blue-700 { color: #bfdbfe !important; }
            /* Botones guardar/restablecer */
            #catalog .bg-gray-100.p-4.rounded-xl,
            #catalog .sticky.bottom-4 {
                background: #1e293b !important;
            }
            #catalog .bg-gray-200.text-gray-700 {
                background: #334155 !important;
                color: #f1f5f9 !important;
            }
            /* Datos clientes (gradient indigo) */
            #catalog .bg-gradient-to-br.from-indigo-50\/60,
            #catalog [class*="from-indigo-50"] {
                background: #1e293b !important;
                border-color: #334155 !important;
            }
            #catalog .client-field-toggle {
                background: #0f172a !important;
                border-color: #334155 !important;
            }
            #catalog .client-field-toggle p.text-gray-700 { color: #f1f5f9 !important; }
            #catalog .client-field-toggle p.text-gray-400 { color: #64748b !important; }
            /* Envío gratis (gradiente verde) */
            #catalog .border-green-100 {
                background: #052e16 !important;
                border-color: #166534 !important;
            }
            #catalog .border-green-100 .text-gray-800 { color: #f1f5f9 !important; }
            #catalog .border-green-100 .text-gray-500,
            #catalog .border-green-100 .text-gray-400 { color: #86efac !important; }
            /* Retiro en local */
            #catalog .border-gray-200.bg-gray-50\/60,
            #catalog [class*="bg-gray-50/60"] {
                background: #1e293b !important;
                border-color: #334155 !important;
            }
            #catalog .border-gray-200.bg-gray-50\/60 .text-gray-800 { color: #f1f5f9 !important; }
            #catalog .border-gray-200.bg-gray-50\/60 .text-gray-500 { color: #94a3b8 !important; }
            #catalog #pickupDetails { border-top-color: #334155 !important; }
            #catalog #pickupDetails label { color: #94a3b8 !important; }
            #catalog #pickupDetails .text-gray-400 { color: #64748b !important; }
            /* Tabs de métodos de pago */
            #catalog .flex.gap-1.bg-gray-100.p-1.rounded-xl {
                background: #0f172a !important;
            }
            .pay-tab { color: #94a3b8 !important; }
            .pay-tab.active {
                background: #1e293b !important;
                color: #a78bfa !important;
            }
            /* Nota info azul (💡) */
            #catalog .bg-blue-50.border.border-blue-200 {
                background: #172554 !important;
                border-color: #1e3a8a !important;
            }
            #catalog .bg-blue-50.border.border-blue-200 .text-blue-800 { color: #bfdbfe !important; }
            #catalog .bg-blue-50.border.border-blue-200 strong { color: #93c5fd !important; }
            /* pm-card */
            .pm-card {
                background: #1e293b !important;
                border-color: #334155 !important;
            }
            .pm-card.inactive { background: #0f172a !important; }
            .pm-card .text-gray-800 { color: #f1f5f9 !important; }
            .pm-card .text-gray-400 { color: #64748b !important; }
            /* Quick pay buttons */
            .quick-pay-btn {
                background: #1e293b !important;
                color: #e2e8f0 !important;
            }
            #catalog .border-t.border-gray-100 { border-color: #334155 !important; }
            #catalog .border-t.border-gray-100 .text-gray-500 { color: #94a3b8 !important; }

            /* ── Modal Productos: sección Destacado ── */
            .bg-yellow-50 {
                background: #2d2006 !important;
                border-color: #854d0e !important;
            }
            .border-yellow-200 { border-color: #854d0e !important; }
            .bg-yellow-50 .text-gray-700,
            .bg-yellow-50 span.text-gray-700 { color: #fde68a !important; }
            .bg-yellow-50 .text-gray-500,
            .bg-yellow-50 p.text-gray-500 { color: #ca8a04 !important; }

            /* ── Modal Agregar Stock: sección Seleccionar Negocio ── */
            .bg-blue-50 {
                background: #172554 !important;
                border-color: #1e3a8a !important;
            }
            .border-blue-300 { border-color: #1e40af !important; }
            .bg-blue-50 h4.text-blue-800,
            .bg-blue-50 .text-blue-800 { color: #93c5fd !important; }
            .bg-blue-50 .text-blue-700,
            .bg-blue-50 p.text-blue-700 { color: #bfdbfe !important; }
            #stockBusinessSelect {
                background: #0f172a !important;
                border-color: #1e40af !important;
                color: #f1f5f9 !important;
            }

            /* ── Modal Generar Etiquetas: textos y contenedores ── */
            #printLabelsModalContent,
            #printLabelsModalContent .bg-white {
                background: #1e293b !important;
                color: #f1f5f9 !important;
            }
            #printLabelsModalHeader {
                background: #1e293b !important;
                border-color: #334155 !important;
            }
            #printLabelsModalContent .text-gray-800,
            #printLabelsModalContent .text-gray-700 { color: #f1f5f9 !important; }
            #printLabelsModalContent .text-gray-600,
            #printLabelsModalContent .text-gray-500 { color: #94a3b8 !important; }
            #printLabelsModalContent .bg-gray-50,
            #printLabelsModalContent .bg-gray-100 {
                background: #0f172a !important;
                border-color: #334155 !important;
                color: #f1f5f9 !important;
            }
            #printLabelsModalContent table thead th,
            #printLabelsModalContent .border-b { border-color: #334155 !important; }
            #printLabelsModalContent label { color: #cbd5e1 !important; }
            #printLabelsModalContent select,
            #printLabelsModalContent input:not([type="checkbox"]):not([type="radio"]) {
                background: #0f172a !important;
                border-color: #334155 !important;
                color: #f1f5f9 !important;
            }
            /* Filas de productos en etiquetas */
            #printLabelsModalContent .hover\:bg-gray-50:hover { background: #263349 !important; }
            #printLabelsModalContent .border-gray-200 { border-color: #334155 !important; }
            /* Botones tipo / tipo etiqueta */
            #printLabelsModalContent .bg-white.border { background: #1e293b !important; }

            /* ── Modal Modificar Precios ── */
            #priceEditModalContent,
            #priceEditModalContent .bg-white {
                background: #1e293b !important;
                color: #f1f5f9 !important;
            }
            #priceEditModalHeader {
                background: #1e293b !important;
                border-color: #334155 !important;
            }
            #priceEditModalContent .text-gray-800,
            #priceEditModalContent .text-gray-700 { color: #f1f5f9 !important; }
            #priceEditModalContent .text-gray-600,
            #priceEditModalContent .text-gray-500 { color: #94a3b8 !important; }
            #priceEditModalContent .bg-gray-50,
            #priceEditModalContent .bg-gray-100 {
                background: #0f172a !important;
                border-color: #334155 !important;
            }
            #priceEditModalContent label { color: #cbd5e1 !important; }
            #priceEditModalContent select,
            #priceEditModalContent input:not([type="checkbox"]):not([type="radio"]) {
                background: #0f172a !important;
                border-color: #334155 !important;
                color: #f1f5f9 !important;
            }
            #priceEditModalContent .border-gray-200,
            #priceEditModalContent .border-gray-100 { border-color: #334155 !important; }
            #priceEditModalContent .hover\:bg-gray-50:hover { background: #263349 !important; }
            #priceEditModalContent table thead { background: #0f172a !important; }
            #priceEditModalContent table thead th { color: #94a3b8 !important; }
            #priceEditModalContent table tbody tr { border-color: #334155 !important; }

            /* ── Botones de acción del modal Modificar Precios ── */
            #priceEditModalContent .bg-purple-100 {
                background: #3b0764 !important;
                border-color: #7e22ce !important;
            }
            #priceEditModalContent .text-purple-700 { color: #d8b4fe !important; }
            #priceEditModalContent .hover\:bg-purple-200:hover { background: #4c1d95 !important; }
            #priceEditModalContent button.bg-white {
                background: #1e293b !important;
                border-color: #475569 !important;
                color: #cbd5e1 !important;
            }
            #priceEditModalContent button.bg-white:hover,
            #priceEditModalContent button.hover\:bg-gray-50:hover {
                background: #263349 !important;
            }

            /* ── Dropdown de búsqueda: empleado / proveedor / contacto (hover visible) ── */
            #employeeSearchResults,
            #providerSearchResults,
            #contactSearchResults {
                background: #1e293b !important;
                border-color: #334155 !important;
                color: #f1f5f9 !important;
            }
            #employeeSearchResults > *,
            #providerSearchResults > *,
            #contactSearchResults > * {
                color: #f1f5f9 !important;
                background: #1e293b !important;
            }
            /* Hover sobre opción — fondo oscuro + texto claro */
            #employeeSearchResults > *:hover,
            #providerSearchResults > *:hover,
            #contactSearchResults > *:hover,
            #employeeSearchResults .hover\:bg-gray-100:hover,
            #providerSearchResults .hover\:bg-gray-100:hover,
            #contactSearchResults .hover\:bg-gray-100:hover {
                background: #334155 !important;
                color: #f1f5f9 !important;
            }
            /* Fix genérico para cualquier dropdown de autocomplete */
            [id$="SearchResults"],
            [id$="searchResults"] {
                background: #1e293b !important;
                border-color: #334155 !important;
                color: #f1f5f9 !important;
            }
            [id$="SearchResults"] > div,
            [id$="searchResults"] > div {
                color: #f1f5f9 !important;
            }
            [id$="SearchResults"] > div:hover,
            [id$="searchResults"] > div:hover {
                background: #334155 !important;
                color: #f1f5f9 !important;
            }

            /* ── Modal Ventas: lista de productos disponibles ── */
            .budget-products-list {
                /* hereda bg del modal, solo necesitamos el hover */
            }
            .budget-product-item {
                border-color: #334155 !important;
            }
            .budget-product-item:hover {
                background: #263349 !important;
            }
            .budget-product-item h5,
            .budget-product-item .text-gray-800 { color: #f1f5f9 !important; }
            .budget-product-item .text-gray-600 { color: #94a3b8 !important; }
            .budget-product-item .text-gray-500 { color: #64748b !important; }
            /* Variantes sub-items */
            #budgetProductsList .p-2.bg-gray-50,
            #budgetProductsList [class*="bg-gray-50"] {
                background: #0f172a !important;
                border-color: #334155 !important;
            }
            #budgetProductsList .text-gray-700 { color: #cbd5e1 !important; }

            /* ── Modal Ventas: sección productos seleccionados ── */
            #selectedProductsSection {
                border-color: #334155 !important;
                background: #1e293b !important;
            }
            #selectedProductsSection h4 { color: #f1f5f9 !important; }
            #selectedProductsEmpty { color: #64748b !important; }
            #addStockModalContent {
                background: #1e293b !important;
                color: #f1f5f9 !important;
            }
            #addStockModalHeader {
                background: #1e293b !important;
                border-color: #334155 !important;
            }
            #addStockModalContent .text-gray-800,
            #addStockModalContent .text-gray-700 { color: #f1f5f9 !important; }
            #addStockModalContent .text-gray-500 { color: #94a3b8 !important; }
            #addStockModalContent .border-gray-200,
            #addStockModalContent .border-r { border-color: #334155 !important; }

            /* ── Modal Add Stock: hover de tarjetas de producto — sin cambio de fondo ── */
            #addStockModalContent .hover\:bg-blue-50:hover,
            #stockProductsList .hover\:bg-blue-50:hover {
                background: transparent !important;
                border-color: #3b82f6 !important;
            }
        }

        /* Extra small screens (phones in portrait) */
        @media (max-width: 480px) {
            .grid-cols-2 {
                grid-template-columns: 1fr;
            }
            
            .mobile-stats-grid {
                grid-template-columns: 1fr;
                gap: 12px;
            }
            
            .text-lg {
                font-size: 1rem;
            }
            
            .text-base {
                font-size: 0.9rem;
            }
            
            .p-6 {
                padding: 12px;
            }
            
            .px-4 {
                padding-left: 12px;
                padding-right: 12px;
            }
        }
        
        /* Landscape orientation adjustments */
        @media (max-width: 768px) and (orientation: landscape) {
            .mobile-main-content {
                padding-bottom: 80px;
            }
            
            .mobile-fab {
                bottom: 70px;
            }
            
            .mobile-bottom-nav {
                padding: 4px 0;
            }
            
            .mobile-nav-item {
                padding: 4px 2px;
                font-size: 9px;
            }
            
            .mobile-nav-icon {
                font-size: 16px;
            }
        }
        
        /* Tablet adjustments */
        @media (min-width: 769px) and (max-width: 1024px) {
            .tablet-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            
            .tablet-sidebar {
                width: 200px;
            }
            
            .tablet-main-content {
                margin-left: 200px;
            }
        }
        
        /* Touch-friendly adjustments */
        @media (hover: none) and (pointer: coarse) {
            .touch-target {
                min-height: 44px;
                min-width: 44px;
            }
            
            button, .button, a {
                min-height: 44px;
                display: flex;
                align-items: center;
                justify-content: center;
            }
        }
/* 🔹 Transición suave */
#budgetModal .bg-white {
  transition: all 0.3s ease-in-out;
}

#budgetModal .bg-white {
  transition: all 0.3s ease-in-out;
}

#budgetModal.expanded .bg-white {
  width: 95vw !important;
  height: 90vh !important;
  max-width: none !important;
  max-height: none !important;
  display: flex;
  flex-direction: column;
}

#budgetModal.expanded form {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 0.9rem; /* 🔹 Menos espacio entre columnas y filas */
  align-content: start;
}

/* 🔹 Campos más compactos pero aún cómodos para escribir */
#budgetModal.expanded input,
#budgetModal.expanded select,
#budgetModal.expanded textarea {
  font-size: 0.95rem !important;
  padding: 0.6rem 0.7rem !important;
}

/* 🔹 Título un poco más proporcionado */
#budgetModal.expanded h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

/* 🔹 Scrollbar discreto */
#budgetModal.expanded::-webkit-scrollbar {
  width: 6px;
}
#budgetModal.expanded::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* 🔹 Ajuste general: menos separación entre bloques de secciones */
#budgetModal.expanded .space-y-4 > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0.75rem !important; /* antes era 1rem */
}


@page {
  size: 58mm 297mm; /* Ancho 58mm, alto máximo */
  margin: 0;
}






/* Tabs */
.pay-tab {
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
}
.pay-tab.active {
  background: white;
  color: #7c3aed;
  box-shadow: 0 1px 6px rgba(0,0,0,0.1);
}
.pay-tab:hover:not(.active) {
  background: white/60;
  color: #4b5563;
}

/* Método de pago card */
.pm-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  transition: all 0.2s;
}
.pm-card:hover {
  border-color: #ddd6fe;
  background: #faf5ff;
}
.pm-card.inactive {
  opacity: 0.55;
  background: #f9fafb;
}
.pm-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.pm-type-btn.selected {
  border-color: #7c3aed;
  background: #f5f3ff;
}

@media (prefers-color-scheme: dark) {
  /* ── Tabs contenedor (bg-gray-100) ── */
  #catalog .flex.gap-1.bg-gray-100.p-1.rounded-xl {
    background: #0f172a !important;
  }
  /* Tab inactivo */
  .pay-tab {
    color: #94a3b8;
  }
  /* Tab activo */
  .pay-tab.active {
    background: #1e293b !important;
    color: #a78bfa !important;
    box-shadow: 0 1px 6px rgba(0,0,0,0.4);
  }
  .pay-tab:hover:not(.active) {
    background: #1e293b !important;
    color: #e2e8f0 !important;
  }

  /* ── Nota informativa azul (💡) ── */
  #catalog .bg-blue-50.border.border-blue-200 {
    background: #172554 !important;
    border-color: #1e3a8a !important;
  }
  #catalog .bg-blue-50.border.border-blue-200 .text-blue-800 {
    color: #bfdbfe !important;
  }
  #catalog .bg-blue-50.border.border-blue-200 strong {
    color: #93c5fd !important;
  }

  /* ── pm-card — tarjetas de métodos de pago ── */
  .pm-card {
    background: #1e293b !important;
    border-color: #334155 !important;
  }
  .pm-card:hover {
    background: #263349 !important;
    border-color: #7c3aed !important;
  }
  .pm-card.inactive {
    background: #0f172a !important;
    opacity: 0.55;
  }
  .pm-card .text-gray-800 { color: #f1f5f9 !important; }
  .pm-card .text-gray-400 { color: #64748b !important; }
  .pm-card .text-gray-300 { color: #475569 !important; }
  .pm-card .hover\:text-gray-500:hover { color: #94a3b8 !important; }

  /* ── Sección "Agregar métodos rápidos" ── */
  #catalog .border-t.border-gray-100 {
    border-color: #334155 !important;
  }
  #catalog .border-t.border-gray-100 .text-gray-500 {
    color: #94a3b8 !important;
  }
  .quick-pay-btn {
    background: #1e293b !important;
    color: #e2e8f0 !important;
  }
  .quick-pay-btn:hover {
    background: #334155 !important;
  }
}

/* Regla badge */
.rule-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.rule-badge.surcharge {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.rule-badge.discount {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

/* Integration card */
.integration-card {
  border-color: #e0f2fe;
}
.integration-card.connected {
  border-color: #a7f3d0;
}

/* ══════════════════════════════════════════════════════════════
   MODO OSCURO — TAB INTEGRACIONES (Paso 13)
   ══════════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {

  /* ── Contenedor principal integration-card ── */
  .integration-card {
    border-color: #1e3a8a !important;
    background: #0f172a !important;
  }
  .integration-card.connected {
    border-color: #065f46 !important;
  }

  /* ── Panel desconectado ── */
  #mpDisconnectedPanel {
    background: #0f172a !important;
  }

  /* ── Beneficios (cards azules) ── */
  #mpDisconnectedPanel .bg-blue-50 {
    background: #172554 !important;
    border-color: #1e3a8a !important;
  }
  #mpDisconnectedPanel .bg-blue-50 .text-gray-700 {
    color: #e2e8f0 !important;
  }
  #mpDisconnectedPanel .bg-blue-50 .text-gray-400 {
    color: #94a3b8 !important;
  }

  /* ── Instrucciones: cómo obtener credenciales ── */
  #mpDisconnectedPanel .bg-blue-50.border.border-blue-200 .text-blue-800 {
    color: #bfdbfe !important;
  }
  #mpDisconnectedPanel .bg-blue-50.border.border-blue-200 strong {
    color: #93c5fd !important;
  }
  #mpDisconnectedPanel .bg-blue-50.border.border-blue-200 a {
    color: #60a5fa !important;
  }

  /* ── Labels texto gris ── */
  #mpDisconnectedPanel .text-gray-600 {
    color: #94a3b8 !important;
  }

  /* ── Selector de ambiente: Sandbox ── */
  #mpEnvSandboxLabel {
    background: #2d1f00 !important;
    border-color: #92400e !important;
  }
  #mpEnvSandboxLabel .text-gray-700 { color: #fde68a !important; }
  #mpEnvSandboxLabel .text-gray-400 { color: #d97706 !important; }

  /* ── Selector de ambiente: Producción ── */
  #mpEnvProdLabel {
    background: #052e16 !important;
    border-color: #166534 !important;
  }
  #mpEnvProdLabel .text-gray-700 { color: #bbf7d0 !important; }
  #mpEnvProdLabel .text-gray-400 { color: #4ade80 !important; }

  /* ── Inputs: Public Key / Access Token ── */
  #mpPublicKey,
  #mpAccessToken {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
  }
  #mpPublicKey::placeholder,
  #mpAccessToken::placeholder {
    color: #475569 !important;
  }
  #mpPublicKey:focus,
  #mpAccessToken:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2) !important;
  }

  /* ── Botón toggle contraseña ── */
  #mpDisconnectedPanel button[onclick="toggleMpTokenVisibility()"] {
    color: #64748b !important;
  }

  /* ── Texto pie: credenciales seguras en Firebase ── */
  #mpDisconnectedPanel .text-center.text-xs.text-gray-400 {
    color: #64748b !important;
  }

  /* ══ PANEL CONECTADO ══ */
  #mpConnectedPanel {
    background: #0f172a !important;
  }

  /* ── Card cuenta conectada (gradiente verde) ── */
  #mpConnectedPanel .from-green-50 {
    background: linear-gradient(to right, #052e16, #064e3b) !important;
    border-color: #065f46 !important;
  }
  #mpConnectedName {
    color: #f1f5f9 !important;
  }
  #mpConnectedEmail {
    color: #94a3b8 !important;
  }

  /* ── Badge ✅ Autorizado · Credenciales seguras en Firebase ── */
  #mpConnectedPanel .bg-green-50 {
    background: #052e16 !important;
    border-color: #065f46 !important;
  }
  #mpConnectedPanel .bg-green-50 .text-green-700 {
    color: #4ade80 !important;
  }

  /* ── Filas de opciones (BNPL, Tarjetas, Cuotas, Webhook) ── */
  #mpConnectedPanel .border.border-gray-200 {
    border-color: #334155 !important;
  }
  #mpConnectedPanel .bg-gray-50 {
    background: #1e293b !important;
  }
  #mpConnectedPanel .bg-gray-50 .text-gray-800 {
    color: #f1f5f9 !important;
  }
  #mpConnectedPanel .bg-gray-50 .text-gray-500 {
    color: #94a3b8 !important;
  }

  /* ── Cuotas disponibles: Ahora 3, Ahora 6, Ahora 12 ── */
  #mpBnplOptions {
    background: #1e293b !important;
    border-color: #334155 !important;
  }
  #mpBnplOptions .text-gray-500 {
    color: #94a3b8 !important;
  }
  #mpBnplOptions label {
    border-color: #334155 !important;
    color: #e2e8f0 !important;
  }
  #mpBnplOptions label:hover {
    border-color: #3b82f6 !important;
    background: #172554 !important;
  }

  /* ── Cuotas con tarjeta: panel de opciones ── */
  #mpInstallmentsOptions {
    background: #1e293b !important;
    border-color: #334155 !important;
  }
  #mpInstallmentsOptions .text-gray-500 {
    color: #94a3b8 !important;
  }

  /* ── Botón "+ Agregar cuota" ── */
  #mpInstallmentsOptions button[onclick="addMpInstallment()"] {
    color: #a5b4fc !important;
    border-color: #4f46e5 !important;
    background: transparent !important;
  }
  #mpInstallmentsOptions button[onclick="addMpInstallment()"]:hover {
    background: #1e1b4b !important;
  }

  /* ── Sección Webhook ── */
  #mpConnectedPanel .p-3.bg-gray-50.border.border-gray-200 {
    background: #1e293b !important;
    border-color: #334155 !important;
  }
  #mpConnectedPanel .text-gray-600 {
    color: #94a3b8 !important;
  }
  #mpConnectedPanel .text-gray-400 {
    color: #64748b !important;
  }
  #mpWebhookUrl {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
  }
  #mpConnectedPanel button[onclick="copyMpWebhook()"] {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
  }
  #mpConnectedPanel button[onclick="copyMpWebhook()"]:hover {
    background: #1e293b !important;
  }

  /* ── Botón Desconectar ── */
  #mpConnectedPanel button[onclick="disconnectMercadoPago()"] {
    background: #1e293b !important;
    color: #f87171 !important;
  }
  #mpConnectedPanel button[onclick="disconnectMercadoPago()"]:hover {
    background: #2d1515 !important;
  }

  /* ── Cards "Próximamente" (WhatsApp Pay, Uala / Naranja X) ── */
  #payPanelIntegrations .border-dashed.border-gray-200 {
    border-color: #334155 !important;
  }
  #payPanelIntegrations .border-dashed .text-gray-500 {
    color: #64748b !important;
  }
  #payPanelIntegrations .border-dashed .text-gray-400 {
    color: #475569 !important;
  }
}


.top-bar {
    position: relative;
    overflow: hidden;
}
.top-bar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e40af 0%, #93c5fd 100%);
    z-index: 50;
}
@media (prefers-color-scheme: dark) {
    .top-bar {
        background: rgba(17, 24, 39, 0.95) !important;
        border-bottom-color: var(--gray-700) !important;
    }
    .top-bar #currentSectionTitle {
        color: #60a5fa !important;
    }
}



/* ... tus estilos existentes ... */

/* =============================================================================
   SCROLLBARS - MODO OSCURO (AGREGAR AL FINAL)
   ============================================================================= */

/* Sidebar Navigation Scrollbar */
.sidebar-gradient nav::-webkit-scrollbar {
    width: 6px;
}
.sidebar-gradient nav::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}
.sidebar-gradient nav::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
    transition: background 0.3s ease;
}
.sidebar-gradient nav::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

@media (prefers-color-scheme: dark) {
    .sidebar-gradient nav::-webkit-scrollbar-thumb {
        background: #4b5563;
    }
    .sidebar-gradient nav::-webkit-scrollbar-thumb:hover {
        background: #6b7280;
    }
    .sidebar-gradient nav::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* Firefox Support */
.sidebar-gradient nav {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

@media (prefers-color-scheme: dark) {
    .sidebar-gradient nav {
        scrollbar-color: #4b5563 transparent;
    }
}

    
    /* Ocultar elementos fixed dentro de mainApp cuando está hidden */
    #mainApp.hidden, #mainApp.hidden * { display: none !important; }