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;
}

/* ===== Card Action Buttons (unificados en todas las listas) ===== */
.card-btn {
    display: block;
    width: 100%;
    padding: 8px 14px;
    border-radius: 7px;
    font-weight: 600;
    font-size: 13px;
    color: white;
    border: none;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-decoration: none;
    line-height: 1.5;
}
.card-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.card-btn-blue   { background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%); }
.card-btn-blue:hover   { background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%); }
.card-btn-indigo { background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%); }
.card-btn-indigo:hover { background: linear-gradient(135deg, #312e81 0%, #4338ca 100%); }
.card-btn-red    { background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%); }
.card-btn-red:hover    { background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%); }
.card-btn-purple { background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%); }
.card-btn-purple:hover { background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%); }
.card-btn-green  { background: linear-gradient(135deg, #059669 0%, #10b981 100%); }
.card-btn-green:hover  { background: linear-gradient(135deg, #047857 0%, #059669 100%); }
.card-btn-amber  { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); }
.card-btn-amber:hover  { background: linear-gradient(135deg, #b45309 0%, #d97706 100%); }
.card-btn-gray   { background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%); }
.card-btn-gray:hover   { background: linear-gradient(135deg, #374151 0%, #4b5563 100%); }
.card-btn-disabled { background: linear-gradient(135deg, #9ca3af 0%, #d1d5db 100%) !important; color: rgba(255,255,255,0.6) !important; cursor: not-allowed !important; }
.card-btn-disabled:hover { transform: none !important; box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important; }

.card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 110px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    gap: 0.5rem;
}

@media (max-width: 639px) {
    .card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .card-footer-meta {
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(0,0,0,0.07);
    }
    .card-actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 5px;
        min-width: 0;
    }
    /* ≤3 botones: todos en una fila */
    .card-btn {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        padding: 7px 4px;
        font-size: 12px;
    }
    /* Exactamente 4 botones → 2 por fila (2+2) */
    .card-actions .card-btn:nth-last-child(4):nth-child(1),
    .card-actions .card-btn:nth-last-child(4):nth-child(1) ~ .card-btn {
        flex: 1 1 calc(50% - 3px);
    }
    /* 5 o más botones → 3 por fila (3+2, 3+3, …) */
    .card-actions .card-btn:nth-last-child(n+5):nth-child(1),
    .card-actions .card-btn:nth-last-child(n+5):nth-child(1) ~ .card-btn {
        flex: 1 1 calc(33.33% - 4px);
    }
}

@media (max-width: 400px) {
    .card-btn {
        padding: 6px 3px;
        font-size: 11.5px;
    }
    .card-actions {
        gap: 4px;
    }
    .employee-item-card,
    .business-item-card,
    .product-item-card {
        padding: 12px !important;
        overflow: hidden;
    }
}

html.dark .card-footer-meta {
    border-bottom-color: rgba(255,255,255,0.08);
}

.modal-cancel-btn {
    border: 1px solid #e5e7eb;
    color: #374151;
    background: transparent;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.modal-cancel-btn:hover {
    background: #f9fafb;
    color: #111827;
}
html.dark .modal-cancel-btn {
    border-color: #4b5563;
    color: #e5e7eb;
    background: transparent;
}
html.dark .modal-cancel-btn:hover {
    background: #374151;
    color: #f9fafb;
}


/* 📱 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;
    }
}

/* Modo oscuro por toggle (.dark en html) — espejo del media query de arriba */
html.dark #productsList,
html.dark #productHistoryList { scrollbar-color: #334155 #0f172a; }
html.dark #productsList::-webkit-scrollbar-track,
html.dark #productHistoryList::-webkit-scrollbar-track { background: #0f172a; }
html.dark #productsList::-webkit-scrollbar-thumb,
html.dark #productHistoryList::-webkit-scrollbar-thumb { background: #334155; }
html.dark #productsList::-webkit-scrollbar-thumb:hover,
html.dark #productHistoryList::-webkit-scrollbar-thumb:hover { background: #475569; }

/* =============================================================================
   SCROLLBARS GLOBALES — DARK MODE por clase .dark
   ============================================================================= */
.dark, .dark body {
    scrollbar-width: thin;
    scrollbar-color: #475569 #0f172a;
}
.dark *::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
.dark *::-webkit-scrollbar-track {
    background: #0f172a;
}
.dark *::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 5px;
    border: 2px solid #0f172a;
}
.dark *::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}
.dark *::-webkit-scrollbar-corner {
    background: #0f172a;
}

/* =============================================================================
   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%);
  }
}

/* Modo oscuro por toggle (.dark en html) — espejo del media query de arriba */
html.dark #employeesList,
html.dark #employeeHistoryList,
html.dark #clientsList,
html.dark #clientHistoryList,
html.dark #providersList,
html.dark #providerHistoryList {
  scrollbar-color: #334155 #0f172a;
}
html.dark #employeesList::-webkit-scrollbar-track,
html.dark #employeeHistoryList::-webkit-scrollbar-track,
html.dark #clientsList::-webkit-scrollbar-track,
html.dark #clientHistoryList::-webkit-scrollbar-track,
html.dark #providersList::-webkit-scrollbar-track,
html.dark #providerHistoryList::-webkit-scrollbar-track {
  background: #0f172a;
}
html.dark #employeesList::-webkit-scrollbar-thumb,
html.dark #employeeHistoryList::-webkit-scrollbar-thumb,
html.dark #clientsList::-webkit-scrollbar-thumb,
html.dark #clientHistoryList::-webkit-scrollbar-thumb,
html.dark #providersList::-webkit-scrollbar-thumb,
html.dark #providerHistoryList::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #1e3a8a 0%, #334155 100%);
}
html.dark #employeesList::-webkit-scrollbar-thumb:hover,
html.dark #employeeHistoryList::-webkit-scrollbar-thumb:hover,
html.dark #clientsList::-webkit-scrollbar-thumb:hover,
html.dark #clientHistoryList::-webkit-scrollbar-thumb:hover,
html.dark #providersList::-webkit-scrollbar-thumb:hover,
html.dark #providerHistoryList::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #3b82f6 0%, #475569 100%);
}


/* ===================================================================
   BUDGET SUMMARY PANEL — Cards minimalistas con modo claro/oscuro
   =================================================================== */

.bsp-card {
  position: relative;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  /* Light mode base */
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: box-shadow .2s;
}
.bsp-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }

/* Accent left border per variant */
.bsp-card--blue  { border-left: 3px solid #3b82f6; }
.bsp-card--green { border-left: 3px solid #22c55e; }
.bsp-card--amber { border-left: 3px solid #f59e0b; }

/* Header row: icon + label */
.bsp-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

/* Icon pill */
.bsp-card__icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bsp-card__icon--blue  { background: #eff6ff; color: #2563eb; }
.bsp-card__icon--green { background: #f0fdf4; color: #16a34a; }
.bsp-card__icon--amber { background: #fffbeb; color: #d97706; }

.bsp-card__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #64748b;
}

/* Thin divider */
.bsp-card__divider {
  height: 1px;
  background: #f1f5f9;
  margin: 8px 0;
}

/* Main amount */
.bsp-card__amount {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.bsp-card__amount--blue  { color: #1d4ed8; }
.bsp-card__amount--green { color: #15803d; }
.bsp-card__amount--amber { color: #b45309; }

/* Note under amount */
.bsp-card__note {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
  min-height: 14px;
}

/* Sub line at bottom */
.bsp-card__sub {
  font-size: 11px;
  color: #64748b;
  min-height: 14px;
}

/* ── Dark mode ─────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .bsp-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
  }
  .bsp-card--blue  { border-left-color: #60a5fa; }
  .bsp-card--green { border-left-color: #4ade80; }
  .bsp-card--amber { border-left-color: #fbbf24; }

  .bsp-card__icon--blue  { background: rgba(59,130,246,.15); color: #93c5fd; }
  .bsp-card__icon--green { background: rgba(34,197,94,.15);  color: #86efac; }
  .bsp-card__icon--amber { background: rgba(245,158,11,.15); color: #fcd34d; }

  .bsp-card__label { color: #94a3b8; }

  .bsp-card__divider { background: #334155; }

  .bsp-card__amount--blue  { color: #93c5fd; }
  .bsp-card__amount--green { color: #86efac; }
  .bsp-card__amount--amber { color: #fcd34d; }

  .bsp-card__note { color: #64748b; }
  .bsp-card__sub  { color: #475569; }
}

/* ===================================================================
   SECCIÓN TRANSACCIONES Y VENTAS — dark mode + scrollbar (solo aplica en oscuro)
   =================================================================== */

@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; }
  #transactions .border-gray-200, #budgets .border-gray-200,
  #transactions .border-gray-100, #budgets .border-gray-100 { border-color: #334155 !important; }
  #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
   =================================================================== */

@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;
  }
  #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; }
}

/* 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%); }
}
html.dark #ordersList { scrollbar-color: #334155 #0f172a; }
html.dark #ordersList::-webkit-scrollbar-track { background: #0f172a; }
html.dark #ordersList::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #1e3a8a 0%, #334155 100%); }
html.dark #ordersList::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #3b82f6 0%, #475569 100%); }

/* ===================================================================
   SECCIÓN REPORTES — dark mode textos (solo aplica en oscuro)
   =================================================================== */

@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 > div > div > 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-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; }
}

/* ===================================================================
   SECCIÓN CONFIGURACIÓN — dark mode completo
   =================================================================== */

/* Encabezado y textos generales */
@media (prefers-color-scheme: dark) {
  #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; }

  /* bg-red-50 — botones Eliminar en categorías */
  #configuration .bg-red-50   { background: rgba(239,68,68,0.1) !important; }
  #configuration .text-red-600 { color: #f87171 !important; }
  #configuration .border-red-200 { border-color: rgba(239,68,68,0.3) !important; }
  #configuration .hover\:bg-red-100:hover { background: rgba(239,68,68,0.18) !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; }

@media (max-width: 500px) {
  .form-grid-2col {
    grid-template-columns: 1fr !important;
  }
}

/* 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);
}

/* Bump de 2 steps en el tamaño de fuente dentro de las cards de productos
   (los botones .card-btn conservan su tamaño propio por su CSS). */
.product-item-card .text-\[0\.65rem\] { font-size: 0.8125rem; line-height: 1.15rem; }
.product-item-card .text-\[0\.7rem\]  { font-size: 0.875rem;  line-height: 1.25rem; }
.product-item-card .text-xs           { font-size: 0.875rem;  line-height: 1.25rem; }
.product-item-card .text-sm           { font-size: 1rem;      line-height: 1.45rem; }
.product-item-card .text-base         { font-size: 1.125rem;  line-height: 1.6rem;  }
.product-item-card .text-lg           { font-size: 1.3rem;    line-height: 1.75rem; }
/* Asegurar que los botones de acción mantengan su tamaño original */
.product-item-card .card-btn { font-size: 13px; }

/* 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" — sin overlay azul; usar solo border-t-4 del paso */
#catalog .bg-white.rounded-xl.shadow-lg {
  position: relative;
  overflow: hidden;
}

/* 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;
  }

  /* Barra compacta de Vista Previa */
  #catalogRightCol .border-b.border-gray-100 {
    border-color: #334155 !important;
    background: #1e293b !important;
  }
  #catalogRightCol .text-gray-700 { color: #e2e8f0 !important; }
  #catalogRightCol .text-gray-400 { color: #64748b !important; }

  /* 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; }

  /* ── Sello / Logo fiscal ── */
  #fiscalSealContainer {
    background: rgba(245,158,11,0.1) !important;
    border-color: rgba(245,158,11,0.3) !important;
  }
  #fiscalSealOptions { border-color: rgba(245,158,11,0.2) !important; }
  #fiscalSealContainer .bg-amber-100,
  #fiscalSealContainer label.cursor-pointer {
    background: rgba(245,158,11,0.18) !important;
    color: #fde68a !important;
  }

  /* ── También te puede interesar ── */
  #relatedProductsContainer {
    background: rgba(168,85,247,0.1) !important;
    border-color: rgba(168,85,247,0.3) !important;
  }

  /* ── Paso 14 — Colores de la sección (formulario de contacto) ── */
  #contactFormColorsContainer {
    background: rgba(20,184,166,0.1) !important;
    border-color: rgba(20,184,166,0.3) !important;
  }

  /* ── Paso 15 FAQ — Posición + editor ── */
  #faqPositionContainer {
    background: rgba(139,92,246,0.1) !important;
    border-color: rgba(139,92,246,0.3) !important;
  }
  #faqPositionContainer .bg-white {
    background: #1e293b !important;
    border-color: #334155 !important;
  }
  #faqPositionContainer .text-violet-700 { color: #a78bfa !important; }
  #faqAddBtn {
    border-color: rgba(139,92,246,0.4) !important;
    color: #a78bfa !important;
    background: transparent !important;
  }
  #faqAddBtn:hover {
    background: rgba(139,92,246,0.15) !important;
    color: #a78bfa !important;
  }
  #faqEditorPanel {
    background: rgba(139,92,246,0.1) !important;
    border-color: rgba(139,92,246,0.3) !important;
  }

  /* ── FAQ item list — botones editar/eliminar/mover (paso 15) ── */
  #faqItemsList > div {
    background: #1e293b !important;
    border-color: #334155 !important;
  }
  #faqItemsList > div:hover { border-color: #a78bfa !important; }
  #faqItemsList .text-gray-800 { color: #f1f5f9 !important; }
  #faqItemsList .text-gray-500 { color: #94a3b8 !important; }
  #faqItemsList .text-gray-300 { color: #475569 !important; }
  #faqItemsList .border-gray-200 { border-color: #334155 !important; }
  #faqItemsList button.bg-violet-50 {
    background: rgba(139,92,246,0.15) !important;
    border-color: rgba(139,92,246,0.3) !important;
    color: #a78bfa !important;
  }
  #faqItemsList button.bg-violet-50:hover { background: rgba(139,92,246,0.25) !important; }
  #faqItemsList button.bg-red-50 {
    background: rgba(239,68,68,0.12) !important;
    border-color: rgba(239,68,68,0.25) !important;
    color: #f87171 !important;
  }
  #faqItemsList button.bg-red-50:hover { background: rgba(239,68,68,0.22) !important; }

  /* ── Scrollbar col izquierdo ── */
  #catalogLeftCol::-webkit-scrollbar-thumb { background: #334155; }
}


/* 🔥 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) ── */
html.dark .btn-toggle {
    background-color: #1e293b !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}
html.dark .btn-toggle:hover {
    background-color: #263349 !important;
    color: #f1f5f9 !important;
}
html.dark .btn-toggle.active {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

@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;
}

/* ── pm-card responsive: evita que textos/elementos se aplasten en móvil ── */
@media (max-width: 480px) {
  .pm-card { gap: 8px; padding: 10px 12px; }
  /* Drag handle: poco usable en touch; se oculta para liberar ancho */
  .pm-card > .cursor-grab { display: none; }
  .pm-card-icon { width: 34px; height: 34px; font-size: 17px; }
  .pm-card .rule-badge { font-size: 10px; padding: 1px 5px; }
  .pm-card label.cursor-pointer { transform: scale(0.9); }
}

@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 (neutro, sin tinte verde) ── */
  #mpConnectedCard {
    background: #1e293b !important;
    border-color: #334155 !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);
    }
}

/* Dark mode controlado por toggle (.dark en <html>) — gana al @media porque
   tiene mayor especificidad y refleja el selector claro/oscuro del sidebar */
.dark .sidebar-gradient nav::-webkit-scrollbar-thumb {
    background: #475569;
    border: none;
}
.dark .sidebar-gradient nav::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}
.dark .sidebar-gradient nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}

/* Firefox Support */
.sidebar-gradient nav {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

@media (prefers-color-scheme: dark) {
    .sidebar-gradient nav {
        scrollbar-color: #4b5563 transparent;
    }
}
.dark .sidebar-gradient nav {
    scrollbar-color: #475569 transparent;
}

    
    /* Ocultar elementos fixed dentro de mainApp cuando está hidden */
    #mainApp.hidden, #mainApp.hidden * { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   CHART CARDS MODERNIZADOS (panel.html)
   ═══════════════════════════════════════════════════════════ */

/* Altura automática — el contenido define el tamaño */
.chart-section {
    height: auto !important;
}

/* El borde degradado superior ya viene del ::before existente */

/* Layout interno: header / canvas / footer como filas */
.chart-section > div[class*="px-5"] {
    flex-shrink: 0;
}

/* Canvas dentro del flex-1 ocupa todo el espacio disponible */
.chart-section canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Distribución: leyenda lateral compacta */
#incomeDistributionLegend,
#expensesDistributionLegend {
    overflow-y: auto;
    max-height: 200px;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}
#incomeDistributionLegend::-webkit-scrollbar,
#expensesDistributionLegend::-webkit-scrollbar {
    width: 4px;
}
#incomeDistributionLegend::-webkit-scrollbar-thumb,
#expensesDistributionLegend::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

/* Dark mode para los nuevos chart cards */
@media (prefers-color-scheme: dark) {
    .chart-section {
        background: #1e293b !important;
    }
}
/* Clase .dark (Tailwind) también */
.dark .chart-section {
    background: #1e293b !important;
}
.dark .chart-section [class*="border-gray-100"],
.dark .chart-section [class*="border-gray-700\/60"] {
    border-color: rgba(51, 65, 85, 0.6) !important;
}
/* Anular alturas fijas heredadas de chart-section */
@media (min-width: 769px) {
  .chart-section {
    height: auto !important;
  }
  .chart-section.distribution-chart {
    height: auto !important;
  }
}
@media (max-width: 768px) {
  .chart-section {
    height: auto !important;
  }
}
/* =====================================================
   SCROLLBARS — Actividad Reciente + Top Productos
   (usa .dark class, igual que el resto del proyecto)
   ===================================================== */

/* ── #recentActivity ── */
#recentActivity {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
#recentActivity::-webkit-scrollbar {
    width: 5px;
}
#recentActivity::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}
#recentActivity::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
    transition: background 0.2s ease;
}
#recentActivity::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
.dark #recentActivity {
    scrollbar-color: #334155 transparent;
}
.dark #recentActivity::-webkit-scrollbar-track {
    background: transparent;
}
.dark #recentActivity::-webkit-scrollbar-thumb {
    background: #334155;
}
.dark #recentActivity::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ── #topProductsList (card dashboard) ── */
#topProductsList {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
#topProductsList::-webkit-scrollbar {
    width: 5px;
}
#topProductsList::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}
#topProductsList::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
    transition: background 0.2s ease;
}
#topProductsList::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
.dark #topProductsList {
    scrollbar-color: #334155 transparent;
}
.dark #topProductsList::-webkit-scrollbar-track {
    background: transparent;
}
.dark #topProductsList::-webkit-scrollbar-thumb {
    background: #334155;
}
.dark #topProductsList::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ── #allProductsModal — lista interior ── */
#allProductsModalList {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
#allProductsModalList::-webkit-scrollbar {
    width: 5px;
}
#allProductsModalList::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}
#allProductsModalList::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
    transition: background 0.2s ease;
}
#allProductsModalList::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
.dark #allProductsModalList {
    scrollbar-color: #334155 transparent;
}
.dark #allProductsModalList::-webkit-scrollbar-track {
    background: transparent;
}
.dark #allProductsModalList::-webkit-scrollbar-thumb {
    background: #334155;
}
.dark #allProductsModalList::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ── Botón "Agregar pregunta" hover ── */
#faqAddBtn:hover { background: rgb(245,243,255); }

/* ── Scrollbar del col izquierdo ── */
#catalogLeftCol::-webkit-scrollbar { width: 5px; }
#catalogLeftCol::-webkit-scrollbar-track { background: transparent; }

/* ── Botón ⓘ de configuración de catálogo ── */
.catalog-info-btn {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    background: transparent;
    border: 1px solid #d1d5db;
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.catalog-info-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}
@media (prefers-color-scheme: dark) {
    .catalog-info-btn {
        border-color: #374151;
        color: #6b7280;
    }
    .catalog-info-btn:hover {
        background: #1f2937;
        border-color: #6b7280;
        color: #d1d5db;
    }
}

/* ── Paneles informativos (ⓘ) de configuración de catálogo ── */
.catalog-info-panel {
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-size: 0.75rem;
    line-height: 1.6;
    color: #4b5563;
    margin-bottom: 1rem;
}
@media (prefers-color-scheme: dark) {
    .catalog-info-panel {
        border-color: #374151;
        color: #9ca3af;
    }
}

/* =====================================================================
   MODO OSCURO — CATALOG EDITOR (html.dark class)
   ===================================================================== */

/* Página */
html.dark body {
    background: linear-gradient(135deg, #0a1628 0%, #0f172a 50%, #0a1628 100%) !important;
}

/* Top bar */
html.dark .top-bar {
    background: rgba(10, 22, 40, 0.97) !important;
    border-bottom-color: #1e3a5f !important;
}
html.dark .top-bar .text-primary { color: #60a5fa !important; }
html.dark .top-bar .text-gray-500 { color: #94a3b8 !important; }
html.dark .top-bar .bg-gray-50  { background: #1e293b !important; }
html.dark .top-bar .bg-gray-50:hover  { background: #243447 !important; }
html.dark .top-bar #currentUserName { color: #e2e8f0 !important; }
html.dark #darkModeToggle:hover { background: #1e293b !important; }

/* Sidebar */
html.dark .sidebar-gradient {
    background: linear-gradient(180deg, #0a1628 0%, #0f172a 100%) !important;
    border-right-color: #1e3a5f !important;
}
html.dark .sidebar-gradient .text-primary { color: #60a5fa !important; }
html.dark .sidebar-gradient p.text-xs.text-blue-600 { color: #818cf8 !important; }
html.dark .sidebar-gradient .nav-item-enhanced { color: #94a3b8 !important; }
html.dark .sidebar-gradient .nav-item-enhanced.active { color: #fff !important; }
html.dark .sidebar-gradient .nav-item-enhanced:hover { color: #fff !important; }

/* Encabezado de la sección */
html.dark #catalog > div:first-child .text-gray-800 { color: #e2e8f0 !important; }
html.dark #catalog > div:first-child .text-gray-600 { color: #94a3b8 !important; }

/* Botón Restablecer */
html.dark #resetCatalogBtn {
    background: #1e293b !important;
    color: #94a3b8 !important;
}
html.dark #resetCatalogBtn:hover { background: #243447 !important; color: #cbd5e1 !important; }

/* Botón Despublicar */
html.dark #unpublishCatalogBtn {
    background: #1f0d0d !important;
    border-color: #7f1d1d !important;
    color: #fca5a5 !important;
}

/* Toggle header de configuración */
html.dark #catalogConfigToggleHeader {
    background: #1e293b !important;
    border-color: #334155 !important;
}
html.dark #catalogConfigToggleHeader .text-gray-800 { color: #e2e8f0 !important; }
html.dark #catalogConfigToggleHeader .text-gray-500 { color: #64748b !important; }
html.dark #catalogConfigToggleHeader .bg-blue-100 { background: #1e3a8a !important; }
html.dark #catalogConfigToggleHeader .text-gray-500 svg { color: #60a5fa !important; }

/* ── Paso cards (bg-white) ── */
html.dark #catalogConfigPanel .bg-white {
    background: #0f1f35 !important;
}
html.dark #catalogConfigPanel .shadow-lg {
    box-shadow: 0 4px 24px rgba(0,0,0,0.5) !important;
}

/* Sub-secciones con fondo de color */
html.dark #catalogConfigPanel .bg-gray-50  { background: #0c1929 !important; }
html.dark #catalogConfigPanel .bg-gray-100 { background: #0e1f32 !important; }
html.dark #catalogConfigPanel [class~="bg-amber-50"]  { background: #180f00 !important; }
html.dark #catalogConfigPanel [class~="bg-purple-50"] { background: #140c24 !important; }
html.dark #catalogConfigPanel [class~="bg-green-50"]  { background: #071810 !important; }
html.dark #catalogConfigPanel [class~="bg-yellow-50"] { background: #180f00 !important; }
html.dark #catalogConfigPanel [class~="bg-blue-50"]   { background: #071526 !important; }
html.dark #catalogConfigPanel [class~="bg-red-50"]    { background: #1f0808 !important; }
html.dark #catalogConfigPanel [class~="bg-orange-50"] { background: #180a00 !important; }
html.dark #catalogConfigPanel [class~="bg-cyan-50"]   { background: #031820 !important; }
html.dark #catalogConfigPanel [class~="bg-teal-50"]   { background: #03181a !important; }
html.dark #catalogConfigPanel [class~="bg-indigo-50"] { background: #070d28 !important; }
html.dark #catalogConfigPanel [class~="bg-pink-50"]   { background: #1f0818 !important; }

/* Bordes dentro del panel */
html.dark #catalogConfigPanel .border-gray-200,
html.dark #catalogConfigPanel .border-gray-300  { border-color: #1e3a5f !important; }
html.dark #catalogConfigPanel .border-t          { border-top-color: #1e3a5f !important; }
html.dark #catalogConfigPanel [class~="border-amber-100"]  { border-color: #92400e66 !important; }
html.dark #catalogConfigPanel [class~="border-amber-200"]  { border-color: #92400e !important; }
html.dark #catalogConfigPanel [class~="border-purple-100"] { border-color: #4c1d9566 !important; }
html.dark #catalogConfigPanel [class~="border-green-100"]  { border-color: #14532d66 !important; }
html.dark #catalogConfigPanel [class~="border-blue-200"]   { border-color: #1e3a8a66 !important; }
html.dark #catalogConfigPanel [class~="border-red-100"]    { border-color: #7f1d1d66 !important; }
html.dark #catalogConfigPanel [class~="border-yellow-200"] { border-color: #78350f66 !important; }

/* Textos dentro del panel */
html.dark #catalogConfigPanel .text-gray-800 { color: #e2e8f0 !important; }
html.dark #catalogConfigPanel .text-gray-700 { color: #cbd5e1 !important; }
html.dark #catalogConfigPanel .text-gray-600 { color: #94a3b8 !important; }
html.dark #catalogConfigPanel .text-gray-500 { color: #64748b !important; }
html.dark #catalogConfigPanel .text-gray-400 { color: #475569 !important; }

/* Inputs, selects, textareas */
html.dark #catalogConfigPanel input:not([type="color"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html.dark #catalogConfigPanel select,
html.dark #catalogConfigPanel textarea {
    background: #07111e !important;
    border-color: #1e3a5f !important;
    color: #e2e8f0 !important;
}
html.dark #catalogConfigPanel input::placeholder,
html.dark #catalogConfigPanel textarea::placeholder { color: #334155 !important; }
html.dark #catalogConfigPanel select option { background: #0f172a; color: #e2e8f0; }

/* Range inputs — track claro y visible sobre los contenedores azul oscuro */
html.dark #catalogConfigPanel input[type="range"] {
    background: #94a3b8 !important;
}

/* Tarjetas de modelo (Moderno / Clásico) */
html.dark #modelModern,
html.dark #modelClassic {
    background: #0c1929 !important;
    border-color: #1e3a5f !important;
}
html.dark #modelModern .text-gray-800,
html.dark #modelClassic .text-gray-800 { color: #e2e8f0 !important; }
html.dark #modelModern .text-gray-500,
html.dark #modelClassic .text-gray-500 { color: #64748b !important; }

/* Info del negocio seleccionado */
html.dark #selectedBusinessInfo { background: #0c1929 !important; }
html.dark #selectedBusinessName { color: #e2e8f0 !important; }
html.dark #selectedBusinessType { color: #64748b !important; }

/* Opciones radio (footer / distribución) */
html.dark #catalogConfigPanel label > div.border-2,
html.dark #catalogConfigPanel label .rounded-xl.border-2 {
    background: #0c1929 !important;
    border-color: #1e3a5f !important;
}
html.dark #catalogConfigPanel .peer:checked ~ div.border-2,
html.dark #catalogConfigPanel .peer:checked ~ .rounded-xl.border-2 {
    background: #071526 !important;
}

/* Tarjetas de redes sociales */
html.dark .social-link-row {
    background: #0f1f35 !important;
    border-color: #0d3320 !important;
}
html.dark .social-link-row select,
html.dark .social-link-row input[type="url"],
html.dark .social-link-row input[type="text"] {
    background: #07111e !important;
    border-color: #1e3a5f !important;
    color: #e2e8f0 !important;
}
html.dark .social-link-row input::placeholder { color: #334155 !important; }
html.dark .social-link-row .text-red-400  { color: #f87171 !important; }
html.dark .social-link-row .text-red-400:hover { color: #ef4444 !important; }

/* Botón "Agregar red social" */
html.dark #catalogConfigPanel button.border-dashed {
    border-color: #1e3a5f !important;
    color: #94a3b8 !important;
}
html.dark #catalogConfigPanel button.border-dashed:hover {
    background: #0f1f35 !important;
    color: #cbd5e1 !important;
}

/* Info panels (ⓘ) */
html.dark .catalog-info-panel {
    background: rgba(255,255,255,0.03) !important;
    border-color: #1e3a5f !important;
    color: #94a3b8 !important;
}
html.dark .catalog-info-btn {
    border-color: #1e3a5f !important;
    color: #64748b !important;
}
html.dark .catalog-info-btn:hover {
    background: #0f1f35 !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

/* ── Columna derecha: Vista previa ── */
html.dark #catalogRightCol .bg-white {
    background: #0f1f35 !important;
}
html.dark #catalogRightCol .border-b.border-gray-100 { border-color: #1e3a5f !important; }
html.dark #catalogRightCol .text-gray-700 { color: #cbd5e1 !important; }
html.dark #catalogRightCol .text-gray-400 { color: #475569 !important; }
html.dark #catalogRightCol .bg-gray-100 { background: #0c1929 !important; }
html.dark #catalogRightCol .bg-gray-100:hover { background: #0e1f32 !important; }

/* Info del catálogo (bg-blue-50) */
html.dark #catalogRightCol .bg-blue-50 {
    background: #071526 !important;
    border-color: #1e3a8a !important;
}
html.dark #catalogRightCol .text-blue-900 { color: #93c5fd !important; }
html.dark #catalogRightCol .text-blue-700 { color: #60a5fa !important; }

/* Tips section (bg-amber-50 border-amber-200) */
html.dark #catalogRightCol .bg-amber-50 {
    background: #180f00 !important;
}
html.dark #catalogRightCol [class~="border-amber-200"] { border-color: #92400e !important; }
html.dark #catalogRightCol .text-amber-800 { color: #fbbf24 !important; }
html.dark #catalogRightCol .text-amber-900 { color: #fde68a !important; }
html.dark #catalogRightCol .hover\:bg-amber-100:hover { background: #1c1200 !important; }
html.dark #catalogRightCol .bg-white.border.border-amber-300 {
    background: #0f1f35 !important;
    border-color: #92400e !important;
    color: #fbbf24 !important;
}

/* Modal de perfil */
html.dark #profileModal .bg-white {
    background: #0f1f35 !important;
}
html.dark #profileModal h3.text-gray-800 { color: #e2e8f0 !important; }
html.dark #profileModal p.text-gray-600 { color: #94a3b8 !important; }
html.dark #profileModal .text-gray-400 { color: #475569 !important; }
html.dark #profileModal .bg-gray-100 { background: #0c1929 !important; color: #cbd5e1 !important; }

/* Modal de salir sin guardar */
html.dark #unsavedChangesModal .bg-white {
    background: #0f1f35 !important;
}
html.dark #unsavedChangesModal .text-gray-900 { color: #e2e8f0 !important; }
html.dark #unsavedChangesModal .text-gray-500 { color: #94a3b8 !important; }
html.dark #unsavedChangesModal .bg-gray-100  { background: #0c1929 !important; }
html.dark #unsavedChangesModal .text-gray-700 { color: #cbd5e1 !important; }
html.dark #unsavedChangesModal .hover\:bg-gray-200:hover { background: #162032 !important; }

/* =====================================================================
   DARK MODE — SECCIONES FALTANTES (html.dark)
   ===================================================================== */

/* ── Selectores con modificador de opacidad (bg-*-50/60, bg-*-50/50…) ── */
html.dark #catalogConfigPanel [class~="bg-violet-50"],
html.dark #catalogConfigPanel [class*="bg-violet-50/"] { background: #14082a !important; }
html.dark #catalogConfigPanel [class~="bg-violet-100"],
html.dark #catalogConfigPanel [class*="bg-violet-100/"] { background: #1a0d30 !important; }
html.dark #catalogConfigPanel [class~="border-violet-100"] { border-color: #4c1d9555 !important; }
html.dark #catalogConfigPanel [class~="border-violet-200"] { border-color: #4c1d95 !important; }

html.dark #catalogConfigPanel [class~="bg-emerald-50"],
html.dark #catalogConfigPanel [class*="bg-emerald-50/"] { background: #051a0e !important; }
html.dark #catalogConfigPanel [class~="border-emerald-200"] { border-color: #065f4666 !important; }
html.dark #catalogConfigPanel [class~="border-emerald-100"],
html.dark #catalogConfigPanel [class*="divide-emerald-"] { border-color: #065f4633 !important; }
html.dark #catalogConfigPanel .text-emerald-800 { color: #6ee7b7 !important; }
html.dark #catalogConfigPanel .bg-emerald-100 { background: #064e3b !important; }

html.dark #catalogConfigPanel [class~="bg-gray-50"],
html.dark #catalogConfigPanel [class*="bg-gray-50/"] { background: #0c1929 !important; }

html.dark #catalogConfigPanel [class*="from-green-50"],
html.dark #catalogConfigPanel [class*="to-emerald-50"] { background: #051a0e !important; }
html.dark #catalogConfigPanel [class~="border-green-100"] { border-color: #14532d55 !important; }

/* ── Paso 5 — Botón de inicio de sesión (bg-violet-50/50) ── */
html.dark #catalogConfigPanel .border-violet-200 {
    background: #14082a !important;
    border-color: #4c1d95 !important;
}

/* ── Paso 11 — Tarjetas de campos de cliente ── */
html.dark .client-field-toggle {
    background: #0f1f35 !important;
    border-color: #1e3a5f !important;
}
html.dark .client-field-toggle:hover { background: #162032 !important; }
html.dark .client-field-toggle .text-gray-700  { color: #cbd5e1 !important; }
html.dark .client-field-toggle .text-gray-400  { color: #475569 !important; }
html.dark .client-field-toggle .bg-indigo-100  { background: #1e3a8a !important; }
html.dark .client-field-toggle .text-indigo-600 { color: #818cf8 !important; }
html.dark .client-field-toggle svg.text-gray-400 { color: #475569 !important; }

/* ── Paso 12 — Envíos ── */
html.dark #shippingMainPanel [class*="from-green-50"],
html.dark #shippingMainPanel [class*="to-emerald-50"] { background: #051a0e !important; }
html.dark #shippingMainPanel [class*="border-green-100"] { border-color: #14532d55 !important; }
html.dark #shippingMainPanel [class~="bg-gray-50"],
html.dark #shippingMainPanel [class*="bg-gray-50/"] { background: #0c1929 !important; border-color: #1e3a5f !important; }
html.dark #shippingMainPanel .text-gray-800  { color: #e2e8f0 !important; }
html.dark #shippingMainPanel .text-gray-500  { color: #64748b !important; }
html.dark #shippingMainPanel .text-gray-400  { color: #475569 !important; }
html.dark #shippingMainPanel .border-gray-200 { border-color: #1e3a5f !important; }
html.dark #shippingMainPanel input:not([type="checkbox"]):not([type="radio"]) {
    background: #07111e !important;
    border-color: #1e3a5f !important;
    color: #e2e8f0 !important;
}
html.dark #shippingMainPanel input::placeholder { color: #334155 !important; }
html.dark #shippingMainPanel label { color: #94a3b8 !important; }
html.dark #shippingMainPanel .text-gray-400.text-sm { color: #334155 !important; }

/* ── Paso 13 — Tabs de métodos de pago ── */
html.dark #catalogConfigPanel .flex.gap-1.bg-gray-100.p-1.rounded-xl,
html.dark #catalogConfigPanel .flex.gap-1.bg-gray-100.p-1 {
    background: #07111e !important;
}
html.dark .pay-tab { color: #94a3b8 !important; }
html.dark .pay-tab.active {
    background: #0f1f35 !important;
    color: #a78bfa !important;
    box-shadow: 0 1px 6px rgba(0,0,0,0.4) !important;
}
html.dark .pay-tab:hover:not(.active) {
    background: #0f1f35 !important;
    color: #e2e8f0 !important;
}

/* ── Paso 13 — pm-card ── */
html.dark .pm-card {
    background: #0f1f35 !important;
    border-color: #1e3a5f !important;
}
html.dark .pm-card:hover {
    background: #162032 !important;
    border-color: #7c3aed !important;
}
html.dark .pm-card.inactive { background: #07111e !important; opacity: 0.6; }
html.dark .pm-card .text-gray-800  { color: #e2e8f0 !important; }
html.dark .pm-card .text-gray-400  { color: #64748b !important; }
html.dark .pm-card .text-gray-300  { color: #475569 !important; }
html.dark .pm-card .hover\:text-gray-500 { color: #94a3b8 !important; }

/* ── Paso 13 — acciones rápidas ── */
html.dark .quick-pay-btn {
    background: #0f1f35 !important;
    color: #e2e8f0 !important;
}
html.dark .quick-pay-btn:hover { background: #162032 !important; }
html.dark #catalogConfigPanel .border-t.border-gray-100 { border-color: #1e3a5f !important; }

/* ── Paso 13 — nota info azul ── */
html.dark #catalogConfigPanel .bg-blue-50.border.border-blue-200 {
    background: #071526 !important;
    border-color: #1e3a8a !important;
}
html.dark #catalogConfigPanel .bg-blue-50.border.border-blue-200 .text-blue-800 { color: #93c5fd !important; }

/* ── Paso 13 — bg-gray-50 info manuales ── */
html.dark #catalogConfigPanel .bg-gray-50.border.border-gray-200 {
    background: #0c1929 !important;
    border-color: #1e3a5f !important;
}
html.dark #catalogConfigPanel .bg-gray-50.border.border-gray-200 .text-gray-700 { color: #cbd5e1 !important; }
html.dark #catalogConfigPanel .bg-gray-50.border.border-gray-200 .text-gray-600 { color: #94a3b8 !important; }

/* ── Paso 15 — FAQ posición ── */
html.dark #faqPositionContainer {
    background: #14082a !important;
    border-color: #4c1d9566 !important;
}
html.dark #faqPositionContainer .text-gray-700  { color: #cbd5e1 !important; }
html.dark #faqPositionContainer .text-gray-400  { color: #475569 !important; }
html.dark #faqPositionContainer label.flex.items-center {
    background: #0f1f35 !important;
    border-color: #1e3a5f !important;
}
html.dark #faqPositionContainer label .text-gray-800 { color: #e2e8f0 !important; }
html.dark #faqPositionContainer label .text-gray-500 { color: #64748b !important; }

/* ── Paso 15 — FAQ editor ── */
html.dark #faqEditorPanel {
    background: #14082a !important;
    border-color: #4c1d9566 !important;
}
html.dark #faqEditorPanel .text-gray-700 { color: #cbd5e1 !important; }
html.dark #faqEditorPanel .text-gray-500 { color: #64748b !important; }
html.dark #faqEditorPanel input,
html.dark #faqEditorPanel textarea {
    background: #07111e !important;
    border-color: #1e3a5f !important;
    color: #e2e8f0 !important;
}

/* ── Paso 17 — Confirmación de Pedido ── */
html.dark #catalogConfigPanel .border-emerald-200.rounded-xl {
    background: #051a0e !important;
    border-color: #065f46 !important;
}
html.dark #catalogConfigPanel .border-emerald-200 .text-emerald-800 { color: #6ee7b7 !important; }
html.dark #catalogConfigPanel .border-emerald-200 .text-gray-600 { color: #94a3b8 !important; }
html.dark #catalogConfigPanel .border-emerald-200 .text-gray-400 { color: #475569 !important; }
html.dark #catalogConfigPanel .border-emerald-200 .border-gray-300 { border-color: #1e3a5f !important; }
html.dark #catalogConfigPanel .border-emerald-200 input:not([type="color"]) {
    background: #07111e !important;
    border-color: #1e3a5f !important;
    color: #e2e8f0 !important;
}

#catalogLeftCol::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ════════════════════════════════════════════════════════
   GLOBAL html.dark — Todas las pantallas (incluye móvil)
   Estas reglas van DESPUÉS de todos los @media para ganar
   la cascada frente a los bloques prefers-color-scheme:light
   ════════════════════════════════════════════════════════ */

/* — Fondo general — */
html.dark body {
    background: linear-gradient(135deg, #0a1628 0%, #0f172a 50%, #0a1628 100%) !important;
    color: #f1f5f9 !important;
}
html.dark .mobile-main-content { background: transparent !important; color: #f1f5f9 !important; }
html.dark .section             { background: transparent !important; color: #f1f5f9 !important; }

/* — Top bar / sidebar — */
html.dark .top-bar {
    background: rgba(10, 22, 40, 0.97) !important;
    border-bottom-color: #1e3a5f !important;
}
html.dark .sidebar-gradient {
    background: linear-gradient(180deg, #0a1628 0%, #0f172a 100%) !important;
    border-right-color: #1e3a5f !important;
}

/* — Blancos y grises de fondo — */
html.dark .bg-white {
    background: #1e293b !important;
    border-color: #334155 !important;
}
html.dark .bg-gray-50,
html.dark [class*="bg-gray-50/"] { background: #0f172a !important; }
html.dark .bg-gray-100           { background: #1e293b !important; }
html.dark .bg-gray-200           { background: #334155 !important; }

/* — Tarjetas redondeadas — */
html.dark .rounded-xl.shadow-lg,
html.dark .rounded-2xl.shadow-lg,
html.dark .rounded-xl.shadow-md,
html.dark .rounded-2xl.shadow-md {
    background: #1e293b !important;
    border-color: #334155 !important;
}
html.dark .mobile-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

/* — Textos — */
html.dark .text-gray-800 { color: #f1f5f9 !important; }
html.dark .text-gray-700 { color: #e2e8f0 !important; }
html.dark .text-gray-600 { color: #cbd5e1 !important; }
html.dark .text-gray-500 { color: #94a3b8 !important; }
html.dark .text-gray-400 { color: #64748b !important; }
html.dark .text-gray-300 { color: #475569 !important; }
html.dark label          { color: #cbd5e1 !important; }
html.dark h1, html.dark h2, html.dark h3, html.dark h4, html.dark h5 { color: #f1f5f9 !important; }
html.dark p              { color: #cbd5e1 !important; }

/* — Bordes — */
html.dark .border-gray-100,
html.dark .border-gray-200,
html.dark .border-gray-300 { border-color: #334155 !important; }
html.dark .border.border-gray-200.rounded-lg {
    background: #1e293b !important;
    border-color: #334155 !important;
}
html.dark .divide-gray-100 > * + *,
html.dark .divide-gray-200 > * + * { border-top-color: #334155 !important; }

/* — Inputs / selects / textareas — */
html.dark input:not([type="color"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html.dark select,
html.dark textarea {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

/* — Colores de secciones por temática — */
html.dark [class~="bg-violet-50"],
html.dark [class*="bg-violet-50/"]  { background: #14082a !important; }
html.dark [class~="bg-purple-50"],
html.dark [class*="bg-purple-50/"]  { background: #18122a !important; }
html.dark [class~="bg-emerald-50"],
html.dark [class*="bg-emerald-50/"],
html.dark [class*="from-green-50"],
html.dark [class*="to-emerald-50"]  { background: #051a0e !important; }
html.dark [class~="bg-green-50"],
html.dark [class*="bg-green-50/"]   { background: #0a1f0e !important; }
html.dark [class~="bg-amber-50"],
html.dark [class*="bg-amber-50/"]   { background: #180f00 !important; }
html.dark [class~="bg-blue-50"],
html.dark [class*="bg-blue-50/"]    { background: #0a1628 !important; }
html.dark [class~="bg-red-50"],
html.dark [class*="bg-red-50/"]     { background: #1f0808 !important; }
html.dark [class~="bg-rose-50"],
html.dark [class*="bg-rose-50/"]    { background: #1f0a0a !important; }
html.dark [class~="bg-orange-50"],
html.dark [class*="bg-orange-50/"]  { background: #180800 !important; }

/* — Componentes específicos — */
html.dark .pm-card {
    background: #0f1f35 !important;
    border-color: #1e3a5f !important;
}
html.dark .pay-tab.active {
    background: #0f1f35 !important;
    color: #a78bfa !important;
}
html.dark .quick-pay-btn {
    background: #0f1f35 !important;
    color: #e2e8f0 !important;
}
html.dark .client-field-toggle {
    background: #0f1f35 !important;
    border-color: #1e3a5f !important;
    color: #e2e8f0 !important;
}
html.dark .social-link-row {
    background: #0f1f35 !important;
    border-color: #0d3320 !important;
}

/* — Scrollbar — */
html.dark ::-webkit-scrollbar-track { background: #0f172a; }
html.dark ::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

/* ─── html.dark: equivalentes class-based para elementos que solo tenían @media ─── */
html.dark .metric-card {
    background: var(--gray-800, #1f2937) !important;
    border: 1px solid var(--gray-700, #374151) !important;
}
html.dark .metric-card .text-primary { color: #60a5fa !important; }
html.dark .metric-card .text-contrast-light { color: #9ca3af !important; }
html.dark .metric-card h3,
html.dark .metric-card p { color: #e2e8f0 !important; }

html.dark .dashboard-filters-panel {
    background: var(--gray-800, #1f2937) !important;
    border: 1px solid var(--gray-700, #374151) !important;
}
html.dark .dashboard-filters-panel p,
html.dark .dashboard-filters-panel span:not([class*="bg-"]),
html.dark .dashboard-filters-panel label { color: #e2e8f0 !important; }

html.dark .dashboard-card {
    background: var(--gray-800, #1f2937) !important;
    border: 1px solid var(--gray-700, #374151) !important;
}
html.dark .report-panel {
    background: var(--gray-800, #1f2937) !important;
    border: 1px solid var(--gray-700, #374151) !important;
}
html.dark .chart-section,
html.dark .recent-activity-section {
    background: var(--gray-800, #1f2937) !important;
}
html.dark .sidebar-close-btn:hover {
    background: var(--gray-700, #374151) !important;
}
html.dark .business-item-card {
    background: #1e293b !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
html.dark .business-item-card:hover { box-shadow: 0 8px 24px rgba(59,130,246,0.2) !important; }
html.dark .business-card-title   { color: #f1f5f9 !important; }
html.dark .business-card-subtitle { color: #94a3b8 !important; }
html.dark .business-card-body    { color: #94a3b8 !important; }
html.dark .business-card-label   { color: #cbd5e1 !important; }
html.dark .business-card-meta    { color: #64748b !important; }
html.dark .business-card-footer-border { border-top-color: #334155 !important; }
html.dark .dark-bg-icon { background: #334155 !important; color: #94a3b8 !important; }
html.dark .dark-border-override { border-color: #334155 !important; }
html.dark .product-item-card {
    background: #1e293b !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
html.dark .product-item-card:hover { box-shadow: 0 8px 24px rgba(59,130,246,0.2) !important; }
html.dark .product-brand-badge { background: #1e3a5f !important; color: #93c5fd !important; border-color: #2563eb !important; }
html.dark .product-card-title   { color: #f1f5f9 !important; }
html.dark .product-card-body    { color: #94a3b8 !important; }
html.dark .product-card-label   { color: #cbd5e1 !important; }
html.dark .product-card-meta    { color: #64748b !important; }
html.dark .product-expanded-border { border-top-color: #334155 !important; }
html.dark .product-description-box { background: #0f172a !important; border-color: #334155 !important; color: #94a3b8 !important; }
html.dark .product-history-card {
    background: #1e293b !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
html.dark .product-history-card:hover { box-shadow: 0 8px 24px rgba(59,130,246,0.2) !important; }
html.dark .history-card-title { color: #7dd3fc !important; }
html.dark .history-card-meta  { color: #ffffff !important; }
html.dark .history-card-body  { color: #ffffff !important; }
html.dark .history-card-label { color: #ffffff !important; }
html.dark .history-card-value { color: #ffffff !important; }
html.dark .history-card-row-border { border-bottom-color: #334155 !important; }

/* ── empleados / clientes: panels ── */
html.dark .employees-panel,
html.dark .clients-panel {
    background: var(--gray-800, #1f2937) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}
/* ── employee-item-card ── */
html.dark .employee-item-card {
    background: #1e293b !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
html.dark .employee-item-card:hover { box-shadow: 0 8px 24px rgba(59,130,246,0.2) !important; }
html.dark .employee-card-title  { color: #f1f5f9 !important; }
html.dark .employee-card-body   { color: #94a3b8 !important; }
html.dark .employee-card-label  { color: #cbd5e1 !important; }
html.dark .employee-card-meta   { color: #64748b !important; }
html.dark .employee-card-border-top { border-top-color: #334155 !important; }
/* ── employee-history-card ── */
html.dark .employee-history-card {
    background: #1e293b !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
html.dark .employee-history-card:hover { box-shadow: 0 8px 24px rgba(59,130,246,0.2) !important; }
/* ── summary-card ── */
html.dark .summary-card { background: #0f172a !important; border-color: #1e3a8a !important; }
html.dark .summary-card-title { color: #7dd3fc !important; }
html.dark .summary-card-body  { color: #e2e8f0 !important; }
html.dark .summary-card-label { color: #cbd5e1 !important; }
html.dark .summary-card-meta  { color: #64748b !important; }
html.dark .summary-card-border-top { border-top-color: #1e3a8a !important; }
html.dark .summary-debt-item  { background: #1c1917 !important; border-color: #78350f !important; }
/* ── textos sección #employees / #clients / #providers ── */
html.dark #employees h2, html.dark #clients h2, html.dark #providers h2 { color: #f1f5f9 !important; }
html.dark #employees > div > div > p, html.dark #clients > div > div > p, html.dark #providers > div > div > p { color: #94a3b8 !important; }
html.dark .employees-panel h3, html.dark .clients-panel h3,
html.dark .employees-panel h4, html.dark .clients-panel h4 { color: #f1f5f9 !important; }
html.dark #employeesCount, html.dark #clientsCount { color: #94a3b8 !important; }
html.dark #employeeHistorySummary, html.dark #clientHistorySummary, html.dark #providerHistorySummary { color: #94a3b8 !important; }
html.dark #employees label, html.dark #clients label, html.dark #providers label { color: #cbd5e1 !important; }
html.dark #employees input, html.dark #employees select,
html.dark #clients input, html.dark #clients select,
html.dark #providers input, html.dark #providers select {
    background: #1e293b !important; border-color: #334155 !important; color: #f1f5f9 !important;
}
html.dark #employeesList > p, html.dark #employeeHistoryList > p,
html.dark #clientsList > p, html.dark #clientHistoryList > p,
html.dark #providersList > p, html.dark #providerHistoryList > p { color: #64748b !important; }
html.dark #providers .text-gray-800 { color: #f1f5f9 !important; }
html.dark #providers .text-gray-700 { color: #cbd5e1 !important; }
html.dark #providers .text-gray-600 { color: #94a3b8 !important; }
html.dark #providers .text-gray-500 { color: #64748b !important; }
html.dark #providers .border-gray-200, html.dark #providers .border-gray-100 { border-color: #334155 !important; }
html.dark #employeeHistoryList > div, html.dark #clientHistoryList > div { background: #1e293b !important; border-color: #334155 !important; }
html.dark #employeeHistoryList .text-sm.font-semibold.text-gray-800,
html.dark #clientHistoryList .text-sm.font-semibold.text-gray-800 { color: #7dd3fc !important; }
html.dark #employeeHistoryList .text-xs.text-gray-500, html.dark #clientHistoryList .text-xs.text-gray-500 { color: #94a3b8 !important; }
html.dark #employeeHistoryList .text-xs.text-gray-600, html.dark #clientHistoryList .text-xs.text-gray-600 { color: #94a3b8 !important; }
html.dark #employeeHistoryList .text-xs.text-red-700, html.dark #clientHistoryList .text-xs.text-red-700 { color: #fca5a5 !important; }
html.dark #categoriesList h4 { color: #7dd3fc !important; }
html.dark #employeeCategoriesList li, html.dark #extraCategoriesList li,
html.dark #benefitCategoriesList li, html.dark #discountCategoriesList li { color: #e2e8f0 !important; border-color: #334155 !important; }
html.dark #employees .text-gray-800, html.dark #clients .text-gray-800 { color: #f1f5f9 !important; }
html.dark #employees .text-gray-700, html.dark #clients .text-gray-700 { color: #cbd5e1 !important; }
html.dark #employees .text-gray-600, html.dark #clients .text-gray-600 { color: #94a3b8 !important; }
html.dark #employees .text-gray-500, html.dark #clients .text-gray-500 { color: #64748b !important; }
html.dark #employees .border-gray-200, html.dark #clients .border-gray-200,
html.dark #employees .border-gray-100, html.dark #clients .border-gray-100 { border-color: #334155 !important; }
html.dark #employees .bg-black\/10, html.dark #clients .bg-black\/10 { background: rgba(30,41,59,0.7) !important; }
/* ── usuarios.html: modal method cards & permissions header ── */
html.dark #subuserRegMethodBlock label {
    background: #1e293b !important;
    border-color: #334155 !important;
}
html.dark #subuserRegMethodBlock label:has(:checked) {
    background: #1e1b2e !important;
    border-color: #7c3aed !important;
}
html.dark #subuserRegMethodBlock label:has([value="invite"]:checked) {
    background: #0c1a2e !important;
    border-color: #3b82f6 !important;
}
html.dark #subuserRegMethodBlock .text-gray-800 { color: #f1f5f9 !important; }
html.dark #subuserRegMethodBlock .text-gray-500 { color: #94a3b8 !important; }
html.dark #permissionsTable > div > div:first-child {
    background: #374151 !important;
    border-bottom-color: #4b5563 !important;
}
html.dark #permissionsTable .text-gray-500 { color: #94a3b8 !important; }
html.dark #permissionsTable .text-gray-400 { color: #6b7280 !important; }
/* ── #transactions / #budgets ── */
/* ── bsp-card (ventas summary) ── */
html.dark .bsp-card { background: #1e293b !important; border-color: #334155 !important; box-shadow: 0 1px 3px rgba(0,0,0,.3) !important; }
html.dark .bsp-card--blue  { border-left-color: #60a5fa !important; }
html.dark .bsp-card--green { border-left-color: #4ade80 !important; }
html.dark .bsp-card--amber { border-left-color: #fbbf24 !important; }
html.dark .bsp-card__icon--blue  { background: rgba(59,130,246,.15) !important; color: #93c5fd !important; }
html.dark .bsp-card__icon--green { background: rgba(34,197,94,.15) !important;  color: #86efac !important; }
html.dark .bsp-card__icon--amber { background: rgba(245,158,11,.15) !important; color: #fcd34d !important; }
html.dark .bsp-card__label { color: #94a3b8 !important; }
html.dark .bsp-card__divider { background: #334155 !important; }
html.dark .bsp-card__amount--blue  { color: #93c5fd !important; }
html.dark .bsp-card__amount--green { color: #86efac !important; }
html.dark .bsp-card__amount--amber { color: #fcd34d !important; }
html.dark .bsp-card__note { color: #64748b !important; }
html.dark .bsp-card__sub  { color: #475569 !important; }
/* ── #transactions / #budgets ── */
/* ── #configuration ── */
html.dark #configuration h2 { color: #f1f5f9 !important; }
html.dark #configuration h3 { color: #f1f5f9 !important; }
html.dark #configuration h4 { color: #e2e8f0 !important; }
html.dark #configuration h5 { color: #cbd5e1 !important; }
html.dark #configuration h6 { color: #cbd5e1 !important; }
html.dark #configuration label { color: #cbd5e1 !important; }
html.dark #configuration input[type="text"], html.dark #configuration input[type="number"],
html.dark #configuration input[type="date"], html.dark #configuration input[type="email"],
html.dark #configuration select { background: #1e293b !important; border-color: #334155 !important; color: #f1f5f9 !important; }
html.dark #configuration .text-gray-800 { color: #f1f5f9 !important; }
html.dark #configuration .text-gray-700 { color: #cbd5e1 !important; }
html.dark #configuration .text-gray-600 { color: #94a3b8 !important; }
html.dark #configuration .text-gray-500 { color: #64748b !important; }
html.dark #configuration .text-gray-400 { color: #475569 !important; }
html.dark #configuration .border-gray-200, html.dark #configuration .border-gray-300,
html.dark #configuration .border-gray-100 { border-color: #334155 !important; }
html.dark #configuration .bg-white  { background: #1e293b !important; }
html.dark #configuration .bg-gray-50  { background: #0f172a !important; }
html.dark #configuration .bg-gray-100 { background: #0f172a !important; }
html.dark #configuration .bg-gray-200 { background: #1e293b !important; color: #cbd5e1 !important; }
html.dark #configuration .bg-blue-50  { background: rgba(59,130,246,0.1) !important; }
html.dark #configuration .bg-green-50 { background: rgba(16,185,129,0.1) !important; }
html.dark #configuration .text-blue-700  { color: #60a5fa !important; }
html.dark #configuration .text-blue-800  { color: #93c5fd !important; }
html.dark #configuration .text-blue-900  { color: #bfdbfe !important; }
html.dark #configuration .text-blue-600  { color: #60a5fa !important; }
html.dark #configuration .text-green-700 { color: #4ade80 !important; }
html.dark #configuration .hover\:bg-gray-50:hover  { background: #1e293b !important; }
html.dark #configuration .hover\:bg-gray-100:hover { background: #1e293b !important; }
html.dark #configuration .border-t.border-gray-200 { border-color: #334155 !important; }
html.dark #configuration .border-b.border-gray-200 { border-color: #334155 !important; }
html.dark #configuration #receiptPreviewWrapper { background: #0f172a !important; border-color: #334155 !important; }
html.dark #configuration .bg-gray-100.rounded-lg   { background: #0f172a !important; }
html.dark #configuration .bg-gray-200.px-2\.5 { background: #334155 !important; color: #cbd5e1 !important; }
html.dark #configuration input[type="color"] { background: #1e293b !important; border-color: #334155 !important; }
html.dark #configuration .bg-green-50.rounded-lg  { background: rgba(16,185,129,0.08) !important; }
html.dark #configuration .bg-green-50 .text-gray-700 { color: #6b7280 !important; }
/* paletas predefinidas */
html.dark #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; }
html.dark #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; }
html.dark #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; }
html.dark #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; }
html.dark #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; }
html.dark #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; }
html.dark #configuration .bg-blue-50.border-blue-200 p { color: #93c5fd !important; }
html.dark #configuration .bg-blue-50.border-blue-200 strong { color: #bfdbfe !important; }
html.dark #configuration #employerSignatureStatus { color: #fbbf24 !important; }
html.dark #configuration #screenSizeIndicator { color: #94a3b8 !important; }
/* ── #transactions / #budgets ── */
html.dark #transactions h2, html.dark #budgets h2 { color: #f1f5f9 !important; }
html.dark #transactions > div > div > p, html.dark #budgets > div > div > p { color: #94a3b8 !important; }
html.dark #transactions label, html.dark #budgets label { color: #cbd5e1 !important; }
html.dark #transactions input, html.dark #transactions select,
html.dark #budgets input, html.dark #budgets select { background: #1e293b !important; border-color: #334155 !important; color: #f1f5f9 !important; }
html.dark #transactionsList > p, html.dark #budgetsList > p { color: #64748b !important; }
html.dark #transactions .text-gray-800, html.dark #budgets .text-gray-800 { color: #f1f5f9 !important; }
html.dark #transactions .text-gray-700, html.dark #budgets .text-gray-700 { color: #cbd5e1 !important; }
html.dark #transactions .text-gray-600, html.dark #budgets .text-gray-600 { color: #94a3b8 !important; }
html.dark #transactions .text-gray-500, html.dark #budgets .text-gray-500 { color: #64748b !important; }
html.dark #transactions .border-gray-200, html.dark #budgets .border-gray-200,
html.dark #transactions .border-gray-100, html.dark #budgets .border-gray-100 { border-color: #334155 !important; }
html.dark #transactions .bg-gray-50, html.dark #budgets .bg-gray-50 { background: #0f172a !important; }
html.dark #transactions .bg-white, html.dark #budgets .bg-white { background: #1e293b !important; }
html.dark #employeesList > div, html.dark #clientsList > div { background: #1e293b !important; border-color: #334155 !important; }
html.dark #employeesList .bg-white, html.dark #clientsList .bg-white { background: #1e293b !important; }
html.dark #employeesList .bg-gray-50, html.dark #clientsList .bg-gray-50 { background: #0f172a !important; }
html.dark #employeesList .text-gray-800, html.dark #employeesList .text-gray-900,
html.dark #clientsList .text-gray-800, html.dark #clientsList .text-gray-900 { color: #7dd3fc !important; }
html.dark #employeesList .text-gray-700, html.dark #employeesList .text-gray-600,
html.dark #clientsList .text-gray-700, html.dark #clientsList .text-gray-600 { color: #94a3b8 !important; }
html.dark #employeesList .text-gray-500, html.dark #clientsList .text-gray-500 { color: #64748b !important; }

/* ─── LIGHT-OVERRIDE: suprime OS dark-mode cuando el usuario eligió light ─── */
@media (prefers-color-scheme: dark) {
  html.light-override .top-bar { background: rgba(255,255,255,.95) !important; border-bottom-color: #f3f4f6 !important; }
  html.light-override .top-bar #currentSectionTitle { color: #1e40af !important; }
  html.light-override .sidebar-gradient { background: linear-gradient(180deg,#fff 0%,#f9fafb 100%) !important; border-right-color: #f3f4f6 !important; }
  html.light-override .sidebar-gradient::before { background: linear-gradient(90deg,#1e40af 0%,#93c5fd 100%) !important; }
  html.light-override .sidebar-gradient .nav-item-enhanced { color: #374151 !important; }
  html.light-override .sidebar-gradient .nav-item-enhanced:hover { background: linear-gradient(90deg,#f3f4f6 0%,#e5e7eb 100%) !important; color: #111827 !important; }
}

/* ─── Distribución de ingresos / gastos: layout responsivo ─── */
.dist-chart-wrap {
  display: flex;
  gap: 12px;
  height: 210px;
  padding: 12px 16px 8px;
  align-items: center;
}
.dist-chart-canvas {
  position: relative;
  width: 190px;
  height: 190px;
  flex-shrink: 0;
}
.dist-chart-legend {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  max-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@media (max-width: 420px) {
  .dist-chart-wrap {
    flex-direction: column;
    height: auto;
    align-items: center;
    padding: 12px 16px;
    gap: 10px;
  }
  .dist-chart-canvas {
    width: 150px;
    height: 150px;
  }
  .dist-chart-legend {
    max-height: none;
    overflow-y: visible;
    width: 100%;
  }
}
html.dark ::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ── Modal Modificar Precios: tabla más visible en mobile ── */
@media (max-width: 640px) {
  #priceEditModal .overflow-x-auto {
    min-height: 35vh;
  }
}

/* ── Preview etiquetas: sin scroll horizontal en pantallas < 400px ── */
@media (max-width: 400px) {
  #printLabelsModalContent {
    overflow-x: hidden !important;
  }
  #labelPreviewSheet {
    max-width: 100% !important;
    overflow: hidden !important;
  }
}

/* ===== MODAL IMPORTAR PRODUCTOS — RESPONSIVE + SCROLLBAR DARK MODE ===== */

/* Botones "Ver guía" y "Plantilla": columna en pantallas muy pequeñas */
@media (max-width: 450px) {
  #importGuideButtons {
    flex-direction: column;
  }
  #importGuideButtons button {
    width: 100%;
  }
}

/* Scrollbar del body del modal importar — dark mode */
html.dark #importModalBody,
html.dark #importProductsModal .overflow-y-auto {
  scrollbar-color: #4b5563 #1f2937;
}
html.dark #importModalBody::-webkit-scrollbar,
html.dark #importProductsModal .overflow-y-auto::-webkit-scrollbar { width: 6px; }
html.dark #importModalBody::-webkit-scrollbar-track,
html.dark #importProductsModal .overflow-y-auto::-webkit-scrollbar-track { background: #1f2937; }
html.dark #importModalBody::-webkit-scrollbar-thumb,
html.dark #importProductsModal .overflow-y-auto::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 3px; }
html.dark #importModalBody::-webkit-scrollbar-thumb:hover,
html.dark #importProductsModal .overflow-y-auto::-webkit-scrollbar-thumb:hover { background: #6b7280; }

@media (prefers-color-scheme: dark) {
  #importModalBody,
  #importProductsModal .overflow-y-auto { scrollbar-color: #4b5563 #1f2937; }
  #importModalBody::-webkit-scrollbar,
  #importProductsModal .overflow-y-auto::-webkit-scrollbar { width: 6px; }
  #importModalBody::-webkit-scrollbar-track,
  #importProductsModal .overflow-y-auto::-webkit-scrollbar-track { background: #1f2937; }
  #importModalBody::-webkit-scrollbar-thumb,
  #importProductsModal .overflow-y-auto::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 3px; }
  #importModalBody::-webkit-scrollbar-thumb:hover,
  #importProductsModal .overflow-y-auto::-webkit-scrollbar-thumb:hover { background: #6b7280; }
}

/* ===== MODAL CREAR/EDITAR PRODUCTO — DARK MODE ===== */
html.dark #productModalContent label { color: #d1d5db; }
html.dark #productModalContent p { color: #9ca3af; }
html.dark #productModalContent h4 { color: #e5e7eb; }

html.dark #productModalContent input:not([type="checkbox"]):not([type="file"]):not([type="hidden"]):not([type="radio"]),
html.dark #productModalContent select,
html.dark #productModalContent textarea {
  background-color: #1f2937 !important;
  border-color: #374151 !important;
  color: #f3f4f6 !important;
}
html.dark #productModalContent input[readonly] {
  background-color: #111827 !important;
  color: #9ca3af !important;
}
html.dark #productModalContent input::placeholder,
html.dark #productModalContent textarea::placeholder { color: #6b7280 !important; }

html.dark #productModalContent .border-gray-200 { border-color: #374151 !important; }
html.dark #productModalContent .border-gray-300 { border-color: #374151 !important; }
html.dark #productModalContent .border-gray-100 { border-color: #374151 !important; }

html.dark #productModalContent .bg-gray-50 { background-color: #111827 !important; }
html.dark #productModalContent .bg-white { background-color: #1f2937 !important; }
html.dark #productModalContent .bg-blue-50 { background-color: #1e3a5f33 !important; border-color: #1d4ed8 !important; }
html.dark #productModalContent .bg-yellow-50 { background-color: #2d230a !important; border-color: #92400e !important; }
html.dark #productModalContent .bg-indigo-50 { background-color: #1e1b4b33 !important; border-color: #4338ca !important; }
html.dark #productModalContent .bg-blue-100 { background-color: #1e3a8a !important; }
html.dark #productModalContent .text-gray-700 { color: #d1d5db !important; }
html.dark #productModalContent .text-gray-600 { color: #9ca3af !important; }
html.dark #productModalContent .text-gray-500 { color: #6b7280 !important; }
html.dark #productModalContent .text-gray-800 { color: #f3f4f6 !important; }
html.dark #productModalContent .text-blue-700 { color: #93c5fd !important; }
html.dark #productModalContent .text-blue-800 { color: #bfdbfe !important; }
html.dark #productModalContent .text-indigo-800 { color: #c7d2fe !important; }
html.dark #productModalContent .text-green-600 { color: #6ee7b7 !important; }
html.dark #productModalContent .border-dashed { border-color: #374151 !important; }
html.dark #productModalContent .bg-gray-200 { background-color: #374151 !important; }

html.dark #productModalContent .bg-gray-100:not(.peer-focus\:ring-green-300) {
  background-color: #374151 !important;
  color: #d1d5db !important;
}
html.dark #productModalContent .hover\:bg-gray-200:hover { background-color: #4b5563 !important; }

/* Misma regla para prefers-color-scheme */
@media (prefers-color-scheme: dark) {
  #productModalContent { background-color: #1f2937 !important; }
  #productModalContent .sticky.top-0 { background-color: #1f2937 !important; border-color: #374151 !important; }
  #productModalContent label { color: #d1d5db; }
  #productModalContent p { color: #9ca3af; }
  #productModalContent h4 { color: #e5e7eb; }
  #productModalContent input:not([type="checkbox"]):not([type="file"]):not([type="hidden"]):not([type="radio"]),
  #productModalContent select,
  #productModalContent textarea {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    color: #f3f4f6 !important;
  }
  #productModalContent input[readonly] { background-color: #111827 !important; color: #9ca3af !important; }
  #productModalContent .bg-gray-50 { background-color: #111827 !important; }
  #productModalContent .bg-white { background-color: #1f2937 !important; }
  #productModalContent .bg-blue-50 { background-color: #1e3a5f33 !important; border-color: #1d4ed8 !important; }
  #productModalContent .bg-yellow-50 { background-color: #2d230a !important; border-color: #92400e !important; }
  #productModalContent .bg-indigo-50 { background-color: #1e1b4b33 !important; border-color: #4338ca !important; }
  #productModalContent .bg-blue-100 { background-color: #1e3a8a !important; }
  #productModalContent .border-gray-200,
  #productModalContent .border-gray-300,
  #productModalContent .border-gray-100 { border-color: #374151 !important; }
  #productModalContent .text-gray-700 { color: #d1d5db !important; }
  #productModalContent .text-gray-600 { color: #9ca3af !important; }
  #productModalContent .text-gray-500 { color: #6b7280 !important; }
  #productModalContent .text-gray-800 { color: #f3f4f6 !important; }
  #productModalContent .text-blue-700 { color: #93c5fd !important; }
  #productModalContent .text-blue-800 { color: #bfdbfe !important; }
  #productModalContent .text-indigo-800 { color: #c7d2fe !important; }
  #productModalContent .text-green-600 { color: #6ee7b7 !important; }
  #productModalContent .border-dashed { border-color: #374151 !important; }
  #productModalContent .bg-gray-200 { background-color: #374151 !important; }
  #productModalContent .bg-gray-100 { background-color: #374151 !important; color: #d1d5db !important; }
  #productModalContent .hover\:bg-gray-200:hover { background-color: #4b5563 !important; }
}

/* ── Cards de resumen en Reportes: Ventas / Inventario (mejor contraste) ── */
.report-panel .bg-green-50,
.report-panel .bg-blue-50,
.report-panel .bg-orange-50,
.report-panel .bg-red-50 { border: 1px solid transparent; }
.report-panel .bg-green-50  { background-color: #dcfce7 !important; border-color: #86efac; }
.report-panel .bg-blue-50   { background-color: #dbeafe !important; border-color: #93c5fd; }
.report-panel .bg-orange-50 { background-color: #ffedd5 !important; border-color: #fdba74; }
.report-panel .bg-red-50    { background-color: #fee2e2 !important; border-color: #fca5a5; }
.report-panel .bg-green-50  .text-green-700  { color: #166534 !important; font-weight: 600; }
.report-panel .bg-green-50  .text-green-800  { color: #14532d !important; }
.report-panel .bg-blue-50   .text-blue-700   { color: #1d4ed8 !important; font-weight: 600; }
.report-panel .bg-blue-50   .text-blue-800   { color: #1e3a8a !important; }
.report-panel .bg-orange-50 .text-orange-700 { color: #c2410c !important; font-weight: 600; }
.report-panel .bg-orange-50 .text-orange-800 { color: #9a3412 !important; }
.report-panel .bg-red-50    .text-red-700    { color: #b91c1c !important; font-weight: 600; }
.report-panel .bg-red-50    .text-red-800    { color: #7f1d1d !important; }

html.dark .report-panel .bg-green-50  { background-color: #022c22 !important; border-color: #14532d !important; }
html.dark .report-panel .bg-blue-50   { background-color: #0c1b3a !important; border-color: #1e3a8a !important; }
html.dark .report-panel .bg-orange-50 { background-color: #2a1106 !important; border-color: #7c2d12 !important; }
html.dark .report-panel .bg-red-50    { background-color: #2a0a0a !important; border-color: #7f1d1d !important; }
html.dark .report-panel .bg-green-50  .text-green-700  { color: #86efac !important; }
html.dark .report-panel .bg-green-50  .text-green-800  { color: #bbf7d0 !important; }
html.dark .report-panel .bg-blue-50   .text-blue-700   { color: #93c5fd !important; }
html.dark .report-panel .bg-blue-50   .text-blue-800   { color: #bfdbfe !important; }
html.dark .report-panel .bg-orange-50 .text-orange-700 { color: #fdba74 !important; }
html.dark .report-panel .bg-orange-50 .text-orange-800 { color: #fed7aa !important; }
html.dark .report-panel .bg-red-50    .text-red-700    { color: #fca5a5 !important; }
html.dark .report-panel .bg-red-50    .text-red-800    { color: #fecaca !important; }

/* ── Botones de tipo de reporte (reportes.html) ── */
.report-type-card {
  background-color: #ffffff;
  color: #1f2937;
}
.report-type-card:hover { background-color: #f9fafb; }
.report-type-card .text-gray-800 { color: #1f2937; }
.report-type-card .text-gray-500 { color: #6b7280; }

html.dark .report-type-card {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html.dark .report-type-card:hover { background-color: #334155 !important; }
html.dark .report-type-card .text-gray-800 { color: #f1f5f9 !important; }
html.dark .report-type-card .text-gray-500 { color: #94a3b8 !important; }

/* ── Lista de negocios con checkboxes (productos / proveedores) ── */
.biz-cbx-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background-color 120ms ease;
}
.biz-cbx-row:hover { background-color: #f3f4f6; }
html.dark .biz-cbx-row:hover { background-color: #334155 !important; }
.biz-cbx-row .biz-cbx-label { color: #374151; }
html.dark .biz-cbx-row .biz-cbx-label { color: #e2e8f0 !important; }
#productBusinessCheckboxes,
#providerBusinessCheckboxes { background-color: #ffffff; }
html.dark #productBusinessCheckboxes,
html.dark #providerBusinessCheckboxes {
  background-color: #0f172a !important;
  border-color: #334155 !important;
}

/* ════════════════════════════════════════════════════════════════
   FIXES Catálogo Online — overflow campos color, slider, badge,
   radios y toggle del sello fiscal
   ════════════════════════════════════════════════════════════════ */

/* 1) Inputs flex-1 (hex de color, URL personalizada, dominio) no deben
      desbordar el contenedor en pantallas angostas */
#catalogConfigPanel input.flex-1 { min-width: 0; }

/* 2) Badge de estado del dominio ("Activo"/etc.) legible en modo oscuro */
html.dark #domainStatusBadge.bg-green-100  { background: #064e3b !important; color: #6ee7b7 !important; }
html.dark #domainStatusBadge.bg-yellow-100 { background: #422006 !important; color: #fde68a !important; }
html.dark #domainStatusBadge.bg-blue-100   { background: #0c2d4f !important; color: #bfdbfe !important; }

/* 3) Slider de rango (transparencia, etc.): track visible en ambos modos
      y thumb redondo consistente */
#catalogConfigPanel input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 9999px;
  background: transparent;
  /* Evita cambios accidentales al scrollear en móvil: el gesto vertical
     scrollea la página y solo el arrastre horizontal mueve el slider. */
  touch-action: pan-y;
}
/* El color del riel va en el pseudo-track: muchos navegadores solo pintan
   el track, NO el fondo del <input>. Si el track es transparente, se ve el
   contenedor oscuro detrás (parece "invisible"). */
#catalogConfigPanel input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 9999px; background: #cbd5e1; }
#catalogConfigPanel input[type="range"]::-moz-range-track { height: 6px; border-radius: 9999px; background: #cbd5e1; }
#catalogConfigPanel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; margin-top: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #3b82f6; border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.35); cursor: pointer;
}
#catalogConfigPanel input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: #3b82f6; border: 2px solid #fff; cursor: pointer;
}
html.dark #catalogConfigPanel input[type="range"]::-webkit-slider-runnable-track { background: #94a3b8; }
html.dark #catalogConfigPanel input[type="range"]::-moz-range-track { background: #94a3b8; }

/* 4) Radios "URL externa / Subir imagen" del sello fiscal: círculo perfecto
      con el punto pintado vía radial-gradient (los <input> NO soportan
      ::before/::after, por eso no se usan pseudo-elementos) */
input[name="fiscalSealSource"] {
  -webkit-appearance: none; appearance: none;
  box-sizing: border-box;
  width: 18px !important; height: 18px !important;
  min-width: 18px !important; max-width: 18px !important;
  min-height: 18px !important; max-height: 18px !important;
  flex: 0 0 18px !important; aspect-ratio: 1 / 1;
  margin: 0; padding: 0;
  border: 2px solid #9ca3af; border-radius: 50%;
  background: #fff; cursor: pointer;
}
input[name="fiscalSealSource"]:checked {
  border-color: #f59e0b;
  background: radial-gradient(circle at center, #f59e0b 0 42%, #fff 46% 100%);
}
html.dark input[name="fiscalSealSource"] { background: #07111e; border-color: #475569; }
html.dark input[name="fiscalSealSource"]:checked {
  border-color: #fbbf24;
  background: radial-gradient(circle at center, #fbbf24 0 42%, #07111e 46% 100%);
}

/* 5) Toggle "Sello / Logo Fiscal": píldora y perilla redonda garantizadas
      (no se deforma aunque el texto lo apriete en pantallas angostas) */
#catalogShowFiscalSeal + div {
  width: 44px !important; height: 24px !important;
  border-radius: 9999px !important; flex-shrink: 0;
}
#catalogShowFiscalSeal + div::after {
  width: 20px !important; height: 20px !important;
  border-radius: 9999px !important;
}

/* 6) "Orden de categorías" (modo banners de categoría): modo oscuro + responsive.
      Antes usaba estilos inline con colores fijos que no se adaptaban al dark. */
.cat-order-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; background: #fff;
  border: 1px solid #e5e7eb; border-radius: 10px;
}
.cat-order-avatar {
  width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  object-fit: cover; font-size: 11px; font-weight: 700;
}
.cat-order-avatar-letter { background: #e0e7ff; color: #6366f1; }
.cat-order-name {
  flex: 1; min-width: 0; font-size: 13px; font-weight: 500; color: #374151;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-order-btns { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.cat-order-btn {
  font-size: 10px; line-height: 1; padding: 2px 6px; cursor: pointer;
  border: 1px solid #e5e7eb; border-radius: 4px; background: #fff; color: #6366f1;
}
.cat-order-btn:disabled { cursor: not-allowed; opacity: .3; }

html.dark .cat-order-row { background: #0f1f35 !important; border-color: #1e3a5f !important; }
html.dark .cat-order-name { color: #e2e8f0 !important; }
html.dark .cat-order-avatar-letter { background: #1e293b !important; color: #a5b4fc !important; }
html.dark .cat-order-btn { background: #0b1727 !important; border-color: #1e3a5f !important; color: #a5b4fc !important; }

/* Móvil: botones en fila (no apilados) para que la fila no crezca de alto */
@media (max-width: 639px) {
  .cat-order-btns { flex-direction: row; }
  .cat-order-row { padding: 6px 8px; }
}