/* ElevateWeb - Custom Styles */

html {
    scrollbar-gutter: stable;
}

[x-cloak] {
    display: none !important;
}


/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #0F172A;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Card glow effect */
.card-glow {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.1);
    transition: box-shadow 0.3s ease;
}

.card-glow:hover {
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.2);
}

/* Page header gradient */
.page-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #2563eb 100%);
}

/* Badge animations */
.badge-pulse {
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Table row hover */
.table-row-hover:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

/* Modal backdrop */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Payment method buttons */
.payment-method {
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.payment-method:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.payment-method.active {
    border-color: #10B981;
    background-color: rgba(16, 185, 129, 0.1);
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-in {
    animation: slideIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fadeIn 0.2s ease forwards;
}

/* Input focus glow */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Stock badge colors */
.stock-normal {
    background-color: #10B981;
}

.stock-low {
    background-color: #EF4444;
}

.stock-high {
    background-color: #3B82F6;
}

/* Money highlight */
.money-green {
    color: #10B981;
}

.money-red {
    color: #EF4444;
}

.money-blue {
    color: #3B82F6;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* Hide number input spinners globally */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Horizontal scroll without bar */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Desktop horizontal scroll hints */
@media (min-width: 1024px) {
    .no-scrollbar:hover::-webkit-scrollbar {
        display: block;
        height: 4px;
    }
}

/* Date input calendar picker indicator - light color for dark backgrounds */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* ==========================================================================
   MODO DÍA (LIGHT MODE) THEME SYSTEM
   ========================================================================== */
html.light,
html.light body {
    background-color: #f8fafc !important;
    color: #0f172a !important;
}

html.light .bg-mainbg {
    background-color: #f8fafc !important;
}

html.light .bg-cardbg {
    background-color: #ffffff !important;
}

/* 1. Page Header Banners & Solid Colored Headers (Must ALWAYS be Crisp PURE WHITE) */
html.light .page-header,
html.light .page-header *,
html.light .page-header .text-white,
html.light .page-header span,
html.light .page-header h1,
html.light .page-header svg {
    color: #ffffff !important;
}

html.light .page-header {
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 50%, #2563eb 100%) !important;
}

/* 2. Top Navigation Bar */
html.light header.bg-sidebar\/80 {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-color: #e2e8f0 !important;
}

/* 3. Menú Lateral (Sidebar) - Modo Día */
html.light aside#sidebar {
    background-color: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
}

/* Fondo del área de sucursal y borde separador */
html.light aside#sidebar [class*="border-gray-700"] {
    border-color: #e2e8f0 !important;
}

/* Texto del logo y sucursal en sidebar */
html.light aside#sidebar .text-white { color: #0f172a !important; }
html.light aside#sidebar .text-gray-400 { color: #64748b !important; }
html.light aside#sidebar .text-gray-300 { color: #475569 !important; }
html.light aside#sidebar .text-gray-500 { color: #94a3b8 !important; }

/* Dropdown de sucursal (botón selector) */
html.light aside#sidebar button.text-gray-300 {
    color: #374151 !important;
}
html.light aside#sidebar button.text-gray-300:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

/* Items de menú inactivos */
html.light aside#sidebar nav a.text-gray-400 {
    color: #374151 !important;
}
html.light aside#sidebar nav a.text-gray-400:hover {
    background-color: #f1f5f9 !important;
    color: #0284c7 !important;
}

/* Item de menú ACTIVO — mantiene azul con letras blancas */
html.light aside#sidebar nav a.bg-primary {
    background-color: #2563eb !important;
    color: #ffffff !important;
}
html.light aside#sidebar nav a.bg-primary * { color: #ffffff !important; }

/* Insignias de atajos de teclado inactivos (F1, F5, F11...) */
html.light aside#sidebar nav a:not(.bg-primary) span[class*="bg-gray-7"],
html.light aside#sidebar nav a:not(.bg-primary) span[class*="bg-gray-8"] {
    background-color: #e2e8f0 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}

/* Insignia de atajo en item activo */
html.light aside#sidebar nav a.bg-primary span[class*="bg-white"] {
    background-color: rgba(255,255,255,0.25) !important;
    color: #ffffff !important;
    border: none !important;
}

/* Botones inferiores (Contraer menú, Salir) */
html.light aside#sidebar .text-gray-400.hover\:text-white {
    color: #475569 !important;
}

/* 4. Reportes & Summary Metric Cards (VALOR INVENTARIO, MARGEN, ETC.) */
html.light .bg-gradient-to-br[class*="from-cardbg"],
html.light .bg-gradient-to-br[class*="from-gray-800"] {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

html.light .bg-gradient-to-br[class*="from-cardbg"] .text-white,
html.light .bg-gradient-to-br[class*="from-gray-800"] .text-white {
    color: #0f172a !important;
}

html.light .bg-gradient-to-br[class*="from-cardbg"] .text-gray-400,
html.light .bg-gradient-to-br[class*="from-gray-800"] .text-gray-400 {
    color: #64748b !important;
}

/* 5. General Cards, Borders & Inputs */
html.light .border-gray-700\/50,
html.light .border-gray-700,
html.light .border-gray-600 {
    border-color: #e2e8f0 !important;
}

/* bg-sidebar es el color oscuro usado en muchas tarjetas/secciones */
html.light .bg-sidebar,
html.light .bg-gray-800,
html.light .bg-gray-800\/50,
html.light .bg-gray-800\/80,
html.light .bg-gray-800\/40,
html.light .bg-gray-800\/20,
html.light .bg-gray-900,
html.light .bg-slate-900,
html.light .bg-slate-800,
html.light .bg-gray-700 {
    background-color: #ffffff !important;
}

html.light .text-gray-200,
html.light .text-gray-300 {
    color: #1e293b !important;
}

html.light .text-gray-400,
html.light .text-gray-500 {
    color: #64748b !important;
}

html.light input:not([type="checkbox"]):not([type="radio"]),
html.light select,
html.light textarea {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

/* Dynamic Theme Text (Pure White in Dark Mode, Pure Dark Slate in Light Mode) */
.text-theme-main {
    color: #ffffff !important;
}
html.light .text-theme-main,
html:not(.dark) .text-theme-main {
    color: #0f172a !important;
}

.text-theme-muted {
    color: #94a3b8 !important;
}
html.light .text-theme-muted,
html:not(.dark) .text-theme-muted {
    color: #475569 !important;
}

html.light input::placeholder,
html.light textarea::placeholder {
    color: #94a3b8 !important;
}

html.light table th {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    border-color: #e2e8f0 !important;
}

html.light table td {
    border-color: #f1f5f9 !important;
    color: #1e293b !important;
}

html.light table tr:hover {
    background-color: #f8fafc !important;
}

html.light .bg-mainbg\/30 {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

html.light .bg-cyan-950\/40 {
    background-color: #ecfeff !important;
    border-color: #a5f3fc !important;
    color: #0891b2 !important;
}

html.light .bg-cyan-950\/40 .text-white {
    color: #0e7490 !important;
}

/* Buttons & Secondary Action Controls in Light Mode */
html.light .bg-gray-700,
html.light .bg-slate-700,
html.light .bg-gray-700\/50,
html.light .bg-slate-700\/50,
html.light .bg-slate-800\/60,
html.light .bg-gray-800\/60,
html.light .bg-slate-800\/80 {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

html.light button.bg-gray-700,
html.light button.bg-slate-700,
html.light button.bg-gray-800,
html.light button.bg-slate-800,
html.light a.bg-gray-700,
html.light a.bg-slate-700,
html.light a.bg-gray-800,
html.light a.bg-slate-800,
html.light button.bg-cardbg,
html.light a.bg-cardbg {
    background-color: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}

html.light button.bg-gray-700:hover,
html.light button.bg-slate-700:hover,
html.light a.bg-gray-700:hover,
html.light a.bg-slate-700:hover,
html.light button.bg-cardbg:hover,
html.light a.bg-cardbg:hover {
    background-color: #f8fafc !important;
    color: #0284c7 !important;
    border-color: #0284c7 !important;
}

/* Ensure solid primary, green, red, amber buttons ALWAYS keep crisp PURE WHITE text */
html.light .bg-blue-600,
html.light .bg-primary,
html.light .bg-emerald-600,
html.light .bg-green-600,
html.light .bg-red-600,
html.light .bg-danger,
html.light .bg-blue-500,
html.light .bg-indigo-600,
html.light .bg-amber-600 {
    color: #ffffff !important;
}

html.light .bg-blue-600 *,
html.light .bg-primary *,
html.light .bg-emerald-600 *,
html.light .bg-green-600 *,
html.light .bg-red-600 *,
html.light .bg-danger *,
html.light .bg-indigo-600 *,
html.light .bg-amber-600 * {
    color: #ffffff !important;
}

/* Light Mode Dashboard Enhancements */
html.light .drop-shadow-\[0_2px_4px_rgba\(0\,0\,0\,0\.5\)\] {
    filter: none !important;
}

html.light h1.text-theme-main {
    color: #0f172a !important;
}