/* ==========================================================================
 * Sistema Dual de Temas (Claro / Oscuro) para Sitio Web y Panel Leopardus AI
 * ========================================================================== */

:root {
    --lpd-bg: #020617;
    --lpd-surface: #0f172a;
    --lpd-surface-soft: #1e293b;
    --lpd-border: #1e293b;
    --lpd-text: #f8fafc;
    --lpd-text-muted: #94a3b8;
    --lpd-accent: #f59e0b;
}

/* Tema Claro (Light Mode) limpio y de alto contraste */
html.theme-light,
html.theme-light body {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    --lpd-bg: #f8fafc;
    --lpd-surface: #ffffff;
    --lpd-surface-soft: #f1f5f9;
    --lpd-border: #e2e8f0;
    --lpd-text: #0f172a;
    --lpd-text-muted: #475569;
}

html.theme-light header,
html.theme-light aside {
    background-color: rgba(255, 255, 255, 0.96) !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

html.theme-light main,
html.theme-light footer {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

/* Superficies oscuras de Tailwind (solo prefijo exacto de token, sin pisar hover:/focus:) */
html.theme-light [class^="bg-slate-950"],
html.theme-light [class*=" bg-slate-950"] {
    background-color: #f1f5f9 !important;
}

html.theme-light [class^="bg-slate-900"],
html.theme-light [class*=" bg-slate-900"] {
    background-color: #ffffff !important;
    box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.06);
}

html.theme-light [class^="bg-slate-800"],
html.theme-light [class*=" bg-slate-800"] {
    background-color: #e2e8f0 !important;
    color: #1e293b !important;
}

html.theme-light [class^="bg-slate-700"],
html.theme-light [class*=" bg-slate-700"] {
    background-color: #cbd5e1 !important;
    color: #0f172a !important;
}

/* Interruptores tipo toggle usando peer-checked (evita que bg-slate-800 pise el estado activo) */
html.theme-light .peer:checked ~ .peer-checked\:bg-amber-500 {
    background-color: #f59e0b !important;
}
html.theme-light .peer:checked ~ .peer-checked\:bg-emerald-500 {
    background-color: #10b981 !important;
}
html.theme-light .peer:checked ~ .peer-checked\:bg-purple-500 {
    background-color: #a855f7 !important;
}
html.theme-light .peer:checked ~ .peer-checked\:bg-fuchsia-500 {
    background-color: #d946ef !important;
}
html.theme-light .peer:checked ~ .peer-checked\:bg-sky-500 {
    background-color: #0ea5e9 !important;
}

/* Fondos de alertas y banners oscuros (-950/*) convertidos a tonos pastel limpios */
html.theme-light [class^="bg-amber-950"],
html.theme-light [class*=" bg-amber-950"] {
    background-color: #fffbeb !important;
}
html.theme-light [class^="bg-yellow-950"],
html.theme-light [class*=" bg-yellow-950"] {
    background-color: #fefce8 !important;
}
html.theme-light [class^="bg-emerald-950"],
html.theme-light [class*=" bg-emerald-950"] {
    background-color: #ecfdf5 !important;
}
html.theme-light [class^="bg-rose-950"],
html.theme-light [class*=" bg-rose-950"] {
    background-color: #fff1f2 !important;
}
html.theme-light [class^="bg-purple-950"],
html.theme-light [class*=" bg-purple-950"] {
    background-color: #f5f3ff !important;
}
html.theme-light [class^="bg-fuchsia-950"],
html.theme-light [class*=" bg-fuchsia-950"] {
    background-color: #fdf4ff !important;
}
html.theme-light [class^="bg-pink-950"],
html.theme-light [class*=" bg-pink-950"] {
    background-color: #fdf2f8 !important;
}
html.theme-light [class^="bg-sky-950"],
html.theme-light [class*=" bg-sky-950"],
html.theme-light [class^="bg-cyan-950"],
html.theme-light [class*=" bg-cyan-950"],
html.theme-light [class^="bg-teal-950"],
html.theme-light [class*=" bg-teal-950"] {
    background-color: #f0f9ff !important;
}
html.theme-light [class^="bg-indigo-950"],
html.theme-light [class*=" bg-indigo-950"] {
    background-color: #eef2ff !important;
}

/* Fondos translúcidos oscuros en modales y chips */
html.theme-light .bg-black\/80,
html.theme-light .bg-black\/75,
html.theme-light .bg-black\/70 {
    background-color: rgba(15, 23, 42, 0.52) !important;
    backdrop-filter: blur(4px);
}
html.theme-light .bg-black\/40,
html.theme-light .bg-black\/20 {
    background-color: rgba(15, 23, 42, 0.06) !important;
}

/* Degradados oscuros en Dashboard, Vinculación WhatsApp/Instagram y Asistente IA */
html.theme-light [class*="from-slate-9"],
html.theme-light [class*="via-slate-9"],
html.theme-light [class*="to-slate-9"] {
    background-image: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    background-color: #ffffff !important;
    box-shadow: 0 6px 24px -6px rgba(15, 23, 42, 0.08);
}

html.theme-light [class*="from-slate-9"][class*="to-amber-950"] {
    background-image: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%) !important;
    background-color: #fffbeb !important;
}

html.theme-light [class*="from-purple-950"][class*="to-amber-950"] {
    background-image: linear-gradient(135deg, #f5f3ff 0%, #ffffff 55%, #fffbeb 100%) !important;
    background-color: #ffffff !important;
}

html.theme-light [class*="via-purple-950"],
html.theme-light [class*="to-fuchsia-950"] {
    background-image: linear-gradient(135deg, #ffffff 0%, #faf5ff 50%, #fdf4ff 100%) !important;
    background-color: #ffffff !important;
}

/* Estados hover en listas, tablas y menús laterales */
html.theme-light [class*="hover:bg-slate-8"]:hover,
html.theme-light [class*="hover:bg-slate-7"]:hover,
html.theme-light [class*="hover:bg-slate-9"]:hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}
html.theme-light tr[class*="hover:bg-slate-800/30"]:hover {
    background-color: #f8fafc !important;
}
html.theme-light [class*="hover:text-white"]:hover,
html.theme-light [class*="hover:text-slate-200"]:hover {
    color: #0f172a !important;
}

/* Bordes y divisores */
html.theme-light [class^="border-slate-8"],
html.theme-light [class*=" border-slate-8"],
html.theme-light [class^="border-slate-7"],
html.theme-light [class*=" border-slate-7"] {
    border-color: #e2e8f0 !important;
}
html.theme-light [class*="divide-slate-8"] > :not([hidden]) ~ :not([hidden]) {
    border-color: #e2e8f0 !important;
}

/* Tipografía de alto contraste sobre fondos claros */
html.theme-light .text-white:not(.bg-clip-text),
html.theme-light .text-slate-100,
html.theme-light .text-slate-200 {
    color: #0f172a !important;
}

html.theme-light .text-slate-300 {
    color: #334155 !important;
}

html.theme-light .text-slate-400,
html.theme-light .text-slate-500 {
    color: #475569 !important;
}

html.theme-light [class^="text-amber-400"],
html.theme-light [class*=" text-amber-400"],
html.theme-light [class^="text-amber-300"],
html.theme-light [class*=" text-amber-300"],
html.theme-light [class^="text-amber-200"],
html.theme-light [class*=" text-amber-200"] {
    color: #b45309 !important;
}

html.theme-light [class^="text-yellow-400"],
html.theme-light [class*=" text-yellow-400"],
html.theme-light [class^="text-yellow-300"],
html.theme-light [class*=" text-yellow-300"] {
    color: #a16207 !important;
}

html.theme-light [class^="text-emerald-400"],
html.theme-light [class*=" text-emerald-400"],
html.theme-light [class^="text-emerald-300"],
html.theme-light [class*=" text-emerald-300"],
html.theme-light [class^="text-emerald-200"],
html.theme-light [class*=" text-emerald-200"] {
    color: #047857 !important;
}

html.theme-light [class^="text-sky-400"],
html.theme-light [class*=" text-sky-400"],
html.theme-light [class^="text-sky-300"],
html.theme-light [class*=" text-sky-300"],
html.theme-light [class^="text-sky-200"],
html.theme-light [class*=" text-sky-200"] {
    color: #0369a1 !important;
}

html.theme-light [class^="text-cyan-400"],
html.theme-light [class*=" text-cyan-400"],
html.theme-light [class^="text-cyan-300"],
html.theme-light [class*=" text-cyan-300"],
html.theme-light [class^="text-cyan-200"],
html.theme-light [class*=" text-cyan-200"],
html.theme-light [class^="text-teal-400"],
html.theme-light [class*=" text-teal-400"],
html.theme-light [class^="text-teal-300"],
html.theme-light [class*=" text-teal-300"] {
    color: #0e7490 !important;
}

html.theme-light [class^="text-indigo-400"],
html.theme-light [class*=" text-indigo-400"],
html.theme-light [class^="text-indigo-300"],
html.theme-light [class*=" text-indigo-300"],
html.theme-light [class^="text-indigo-200"],
html.theme-light [class*=" text-indigo-200"],
html.theme-light [class^="text-indigo-100"],
html.theme-light [class*=" text-indigo-100"] {
    color: #4338ca !important;
}

html.theme-light [class^="text-purple-400"],
html.theme-light [class*=" text-purple-400"],
html.theme-light [class^="text-purple-300"],
html.theme-light [class*=" text-purple-300"],
html.theme-light [class^="text-purple-200"],
html.theme-light [class*=" text-purple-200"] {
    color: #6d28d9 !important;
}

html.theme-light [class^="text-fuchsia-400"],
html.theme-light [class*=" text-fuchsia-400"],
html.theme-light [class^="text-fuchsia-300"],
html.theme-light [class*=" text-fuchsia-300"],
html.theme-light [class^="text-fuchsia-200"],
html.theme-light [class*=" text-fuchsia-200"] {
    color: #a21caf !important;
}

html.theme-light [class^="text-rose-400"],
html.theme-light [class*=" text-rose-400"],
html.theme-light [class^="text-rose-300"],
html.theme-light [class*=" text-rose-300"],
html.theme-light [class^="text-rose-200"],
html.theme-light [class*=" text-rose-200"] {
    color: #be123c !important;
}

html.theme-light [class^="text-pink-400"],
html.theme-light [class*=" text-pink-400"],
html.theme-light [class^="text-pink-300"],
html.theme-light [class*=" text-pink-300"],
html.theme-light [class^="text-pink-200"],
html.theme-light [class*=" text-pink-200"],
html.theme-light [class^="text-pink-100"],
html.theme-light [class*=" text-pink-100"] {
    color: #9d174d !important;
}

/* Mantener texto legible sobre botones y degradados con fondo sólido saturado */
html.theme-light .bg-emerald-600:not(.bg-clip-text),
html.theme-light .bg-emerald-500:not(.bg-clip-text),
html.theme-light .bg-purple-600:not(.bg-clip-text),
html.theme-light .bg-fuchsia-600:not(.bg-clip-text),
html.theme-light .bg-pink-600:not(.bg-clip-text),
html.theme-light .bg-pink-500:not(.bg-clip-text),
html.theme-light .bg-sky-600:not(.bg-clip-text),
html.theme-light .bg-cyan-600:not(.bg-clip-text),
html.theme-light .bg-cyan-500:not(.bg-clip-text),
html.theme-light .bg-teal-600:not(.bg-clip-text),
html.theme-light .bg-rose-500:not(.bg-clip-text),
html.theme-light .bg-rose-600:not(.bg-clip-text),
html.theme-light .bg-indigo-600:not(.bg-clip-text),
html.theme-light .bg-blue-600:not(.bg-clip-text),
html.theme-light [class*="from-fuchsia-600"]:not(.bg-clip-text),
html.theme-light [class*="from-purple-600"]:not(.bg-clip-text),
html.theme-light [class*="from-indigo-600"]:not(.bg-clip-text),
html.theme-light [class*="from-emerald-600"]:not(.bg-clip-text) {
    color: #ffffff !important;
}
html.theme-light .bg-emerald-600 *,
html.theme-light .bg-emerald-500 *,
html.theme-light .bg-purple-600 *,
html.theme-light .bg-fuchsia-600 *,
html.theme-light .bg-pink-600 *,
html.theme-light .bg-pink-500 *,
html.theme-light .bg-sky-600 *,
html.theme-light .bg-cyan-600 *,
html.theme-light .bg-cyan-500 *,
html.theme-light .bg-teal-600 *,
html.theme-light .bg-rose-500 *,
html.theme-light .bg-rose-600 *,
html.theme-light .bg-indigo-600 *,
html.theme-light .bg-blue-600 *,
html.theme-light [class*="from-fuchsia-600"]:not(.bg-clip-text) *,
html.theme-light [class*="from-purple-600"]:not(.bg-clip-text) *,
html.theme-light [class*="from-indigo-600"]:not(.bg-clip-text) *,
html.theme-light [class*="from-emerald-600"]:not(.bg-clip-text) * {
    color: #ffffff !important;
}

html.theme-light .bg-amber-500:not(.bg-clip-text),
html.theme-light .bg-amber-400:not(.bg-clip-text),
html.theme-light [class*="from-amber-400"]:not(.bg-clip-text),
html.theme-light [class*="from-amber-500"]:not(.bg-clip-text) {
    color: #0f172a !important;
}
html.theme-light .bg-amber-500 *,
html.theme-light .bg-amber-400 *,
html.theme-light [class*="from-amber-400"]:not(.bg-clip-text) *,
html.theme-light [class*="from-amber-500"]:not(.bg-clip-text) * {
    color: #0f172a !important;
}

/* Campos de formulario, selectores y barras de desplazamiento en Tema Claro */
html.theme-light input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
html.theme-light select,
html.theme-light textarea {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

html.theme-light select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

html.theme-light input::placeholder,
html.theme-light textarea::placeholder {
    color: #94a3b8 !important;
}

/* Mapa Geo-Delivery y barras de scroll en modo claro */
html.theme-light .delivery-dark-map .leaflet-tile-pane {
    filter: none !important;
}

html.theme-light ::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
}

html.theme-light ::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
}

html.theme-light ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8 !important;
}

/* Botón selector de tema (ícono Luna/Sol sin texto innecesario) */
.lpd-theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Bandera SVG nítida en todos los sistemas operativos (Windows / Mac / Linux) */
.lpd-flag-svg {
    display: inline-block;
    width: 18px;
    height: 13px;
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.2);
}
