/* New Reboot - CSS centralizado inicial */

:root {
    --nr-primary: #3b82f6;
    --nr-primary-rgb: 59, 130, 246;
    --nr-secondary: #8b5cf6;
    --nr-secondary-rgb: 139, 92, 246;
    --nr-accent: #06b6d4;
    --nr-accent-rgb: 6, 182, 212;
    --nr-success: #10b981;
    --nr-success-rgb: 16, 185, 129;
    --nr-warning: #f59e0b;
    --nr-warning-rgb: 245, 158, 11;
    --nr-error: #ef4444;
    --nr-error-rgb: 239, 68, 68;
    --nr-surface: rgba(30, 41, 59, 0.9);
    --nr-surface-light: rgba(30, 41, 59, 0.8);
    --nr-surface-border: rgba(59, 130, 246, 0.2);
    --nr-content: #e2e8f0;
    --nr-muted: #94a3b8;
    --nr-background: #0f172a;

    /* Variables específicas del panel admin, pero centralizadas */
    --nr-admin-primary: var(--nr-primary);
    --nr-admin-secondary: var(--nr-secondary);
    --nr-admin-accent: var(--nr-accent);
    --nr-admin-dark-bg: var(--nr-background);
    --nr-admin-card-bg: #1e293b;
    --nr-admin-sidebar-bg: var(--nr-admin-card-bg);
    --nr-admin-text-primary: #f8fafc;
    --nr-admin-text-secondary: #cbd5e1;
    --nr-admin-text-muted: #64748b;
    --nr-admin-border: #334155;
}

.gradient-text {
    background: var(--nr-admin-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

/* Utilidades comunes para filtros y formularios públicos */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.search-input {
    border-color: rgb(71, 85, 105) !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:hover {
    border-color: rgb(59, 130, 246) !important;
}

.search-input:focus,
.search-input:focus-visible {
    border-color: rgb(59, 130, 246) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

.product-card {
    transform: translate3d(0, 0, 0);
    transition:
        transform 220ms cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 220ms ease,
        border-color 220ms ease,
        background-color 200ms ease;
    will-change: transform, box-shadow;
}

.product-card:hover {
    transform: translate3d(0, -2px, 0);
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.45);
    border-color: rgba(59, 130, 246, 0.5);
    background-color: rgba(30, 41, 59, 0.95);
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--nr-primary);
    animation: nr-spin 1s ease-in-out infinite;
}

@keyframes nr-spin {
    to {
        transform: rotate(360deg);
    }
}

.client-card {
    background: #1f2937;
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.client-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(59, 130, 246, 0.4);
}

.client-surface {
    background: rgba(30, 41, 59, 0.65);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.client-surface:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.client-surface-blue {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.15);
}

.client-surface-pink {
    background: rgba(236, 72, 153, 0.12);
    border-color: rgba(236, 72, 153, 0.4);
    box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.15);
}

.client-surface-amber {
    background: rgba(234, 88, 12, 0.12);
    border-color: rgba(234, 88, 12, 0.4);
    box-shadow: inset 0 0 0 1px rgba(234, 88, 12, 0.15);
}

.btn-base {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-base:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: #3b82f6;
    color: #ffffff;
}

.btn-secondary {
    background: #6b7280;
    color: #ffffff;
}

.btn-success {
    background: #10b981;
    color: #ffffff;
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.client-button {
    background: #3b82f6;
    color: #ffffff;
}

.client-button:hover {
    background: #2563eb;
    box-shadow: none;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(30, 41, 59, 0.5);
    border: 2px dashed rgba(75, 85, 99, 0.5);
    border-radius: 1rem;
    margin: 2rem 0;
}

.empty-state-icon {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    opacity: 0.7;
}

.data-table {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 1rem;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.data-table th {
    background: rgba(59, 130, 246, 0.1);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #e5e7eb;
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(75, 85, 99, 0.2);
    color: #d1d5db;
}

.data-table tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

/* Utilidades comunes de seguridad/perfil cliente */
[x-cloak] {
    display: none;
}

.security-toggle-row {
    gap: 1.25rem;
}

.security-toggle-row + .security-toggle-row {
    margin-top: 0.75rem;
}

.security-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.security-status-chip {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
}

.security-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* Preferencias – pills y helpers móviles */
.preference-pill {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.mobile-helper {
    display: none;
    font-size: 0.75rem;
    color: #94a3b8;
}

.mobile-full-btn {
    width: auto;
}

@media (max-width: 639px) {
    .mobile-helper {
        display: block;
    }

    .mobile-full-btn {
        width: 100%;
    }
}

/* Pills de contacto (Información personal) */
.nr-contact-pill {
    border-radius: 9999px;
    padding: 0.25rem 0.9rem;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.nr-contact-pill-sky {
    background: rgba(56, 189, 248, 0.22);
    border-color: rgba(56, 189, 248, 0.45);
    color: #e0f7ff;
}

.nr-contact-pill-emerald {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.45);
    color: #d1fae5;
}

.nr-contact-pill-rose {
    background: rgba(244, 63, 94, 0.24);
    border-color: rgba(244, 63, 94, 0.5);
    color: #fee2e2;
}

.nr-contact-pill-indigo {
    background: rgba(79, 70, 229, 0.24);
    border-color: rgba(79, 70, 229, 0.5);
    color: #e0e7ff;
}

/* Contadores estilo pastilla del perfil */
.profile-stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.profile-stat-pill {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.9rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    min-width: 140px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.9);
}

.profile-stat-pill strong {
    font-size: 0.7rem;
    letter-spacing: 0.16em;
}

.profile-stat-pill span {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
}

.profile-stat-pill .number {
    font-size: 1rem;
    font-weight: 700;
}

.profile-stat-pill .percent-pill {
    border-radius: 9999px;
    padding: 0.1rem 0.45rem;
    font-size: 0.65rem;
}

.nr-profile-pill-blue {
    background: rgba(37, 99, 235, 0.22);
    border-color: rgba(59, 130, 246, 0.5);
    color: #dbeafe;
}

.nr-profile-pill-pink {
    background: rgba(236, 72, 153, 0.22);
    border-color: rgba(236, 72, 153, 0.5);
    color: #fce7f3;
}

.nr-profile-pill-amber {
    background: rgba(245, 158, 11, 0.24);
    border-color: rgba(245, 158, 11, 0.55);
    color: #fffbeb;
}

@media (max-width: 640px) {
    .profile-stats-row {
        gap: 0.5rem;
    }

    .profile-stat-pill {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.45rem 0.55rem;
        min-width: 0;
    }

    .profile-stat-pill strong {
        font-size: 0.6rem;
        margin-bottom: 0.1rem;
    }

    .profile-stat-pill span {
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }

    .profile-stat-pill .number {
        font-size: 0.9rem;
    }

    .profile-stat-pill .percent-pill {
        font-size: 0.6rem;
        padding-inline: 0.35rem;
    }

    .personal-edit-wrapper {
        margin-top: -1.75rem;
    }
}

/* Pills de filtros / etiquetas */
.nr-filter-pill {
    border-radius: 9999px;
    padding: 0.25rem 0.9rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-width: 1px;
    border-style: solid;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.nr-filter-pill-active {
    background: rgba(59, 130, 246, 0.22);
    border-color: rgba(59, 130, 246, 0.6);
    color: #dbeafe;
}

.nr-filter-pill-muted {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.4);
    color: #e2e8f0;
}

/* Ocultar scrollbar horizontal (manteniendo scroll) */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}


/* Skeleton Loaders - Para estados de carga */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(30, 41, 59, 0.5) 0%,
        rgba(51, 65, 85, 0.7) 50%,
        rgba(30, 41, 59, 0.5) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
}

.skeleton-card {
    padding: 1.5rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 1rem;
}

[x-cloak] {
    display: none !important;
}

/* =========================
   Tema claro (overrides)
   ========================= */
html.light {
    color-scheme: light;
}

html.light {
    --nr-surface: #ffffff;
    --nr-surface-light: #f1f5f9;
    --nr-surface-border: #e2e8f0;
    --nr-content: #0f172a;
    --nr-muted: #475569;
    --nr-background: #f8fafc;

    --nr-admin-dark-bg: #f1f5f9;
    --nr-admin-card-bg: #ffffff;
    --nr-admin-sidebar-bg: #ffffff;
    --nr-admin-text-primary: #0f172a;
    --nr-admin-text-secondary: #334155;
    --nr-admin-text-muted: #64748b;
    --nr-admin-border: #e2e8f0;
}

html.light body {
    background-color: #f8fafc;
    color: #0f172a;
}

html.light .app-bg,
html.light .app-bg-gradient,
html.light .app-bg-strong {
    background: #f8fafc;
    color: #0f172a;
}

html.light .glass-effect,
html.light .glass-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

html.light .glass-dark-effect {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e2e8f0;
}

html.light .card-base {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

html.light .card-header,
html.light .card-footer {
    border-color: rgba(148, 163, 184, 0.45);
}

html.light .product-card:hover {
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
    background-color: #ffffff;
}

html.light .client-card,
html.light .client-surface {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

html.light .client-card:hover,
html.light .client-surface:hover {
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

html.light .search-input {
    border-color: rgba(148, 163, 184, 0.8) !important;
    background-color: #ffffff;
    color: #0f172a;
}

html.light .search-input::placeholder {
    color: #94a3b8;
}

html.light .text-white { color: #0f172a !important; }
html.light .text-gray-100 { color: #0f172a !important; }
html.light .text-gray-200 { color: #1e293b !important; }
html.light .text-gray-300 { color: #334155 !important; }
html.light .text-gray-400 { color: #475569 !important; }
html.light .text-gray-500 { color: #64748b !important; }
html.light .text-gray-600 { color: #64748b !important; }
html.light .text-gray-700 { color: #475569 !important; }
html.light .text-gray-800 { color: #1e293b !important; }
html.light .text-gray-900 { color: #0f172a !important; }

html.light .bg-slate-900 { background-color: #f1f5f9 !important; }
html.light .bg-slate-900\/40 { background-color: rgba(241, 245, 249, 0.6) !important; }
html.light .bg-slate-900\/60 { background-color: rgba(241, 245, 249, 0.75) !important; }
html.light .bg-slate-900\/70 { background-color: rgba(241, 245, 249, 0.8) !important; }
html.light .bg-slate-900\/80 { background-color: rgba(241, 245, 249, 0.9) !important; }
html.light .bg-slate-800 { background-color: #ffffff !important; }
html.light .bg-slate-800\/50 { background-color: rgba(255, 255, 255, 0.85) !important; }
html.light .bg-slate-800\/60 { background-color: rgba(255, 255, 255, 0.9) !important; }
html.light .bg-slate-800\/80 { background-color: rgba(255, 255, 255, 0.95) !important; }
html.light .bg-slate-800\/95 { background-color: rgba(255, 255, 255, 0.98) !important; }
html.light .bg-slate-700 { background-color: #f8fafc !important; }
html.light .bg-slate-700\/40 { background-color: rgba(248, 250, 252, 0.75) !important; }
html.light .bg-slate-700\/50 { background-color: rgba(248, 250, 252, 0.85) !important; }
html.light .bg-slate-700\/80 { background-color: rgba(248, 250, 252, 0.95) !important; }
html.light .bg-slate-600 { background-color: #e2e8f0 !important; }
html.light .bg-slate-600\/60 { background-color: rgba(226, 232, 240, 0.85) !important; }
html.light .bg-slate-500\/20 { background-color: rgba(226, 232, 240, 0.5) !important; }
html.light .bg-background-strong\/80 { background-color: rgba(248, 250, 252, 0.9) !important; }

html.light .border-slate-900 { border-color: #e2e8f0 !important; }
html.light .border-slate-800 { border-color: #e2e8f0 !important; }
html.light .border-slate-700 { border-color: #e2e8f0 !important; }
html.light .border-slate-600 { border-color: #e2e8f0 !important; }
html.light .border-slate-600\/30 { border-color: rgba(226, 232, 240, 0.5) !important; }
html.light .border-slate-600\/40 { border-color: rgba(226, 232, 240, 0.6) !important; }
html.light .border-slate-600\/50 { border-color: rgba(226, 232, 240, 0.7) !important; }
html.light .border-slate-500 { border-color: #e2e8f0 !important; }

html.light .hover\:bg-slate-700:hover { background-color: #e2e8f0 !important; }
html.light .hover\:bg-slate-800:hover { background-color: #f1f5f9 !important; }
html.light .hover\:bg-slate-900:hover { background-color: #e2e8f0 !important; }
html.light .hover\:bg-slate-700\/50:hover { background-color: rgba(226, 232, 240, 0.8) !important; }
html.light .hover\:bg-slate-700\/60:hover { background-color: rgba(226, 232, 240, 0.85) !important; }
html.light .hover\:text-gray-300:hover { color: #1e293b !important; }

/* Header (tema claro) */
html.light .header-transparent,
html.light .header-scrolled {
    background: rgba(248, 250, 252, 0.92) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

html.light nav .text-gray-300 { color: #334155 !important; }
html.light nav .hover\:text-white:hover { color: #0f172a !important; }
html.light nav .hover\:text-blue-400:hover { color: #2563eb !important; }
html.light nav .border-slate-900 { border-color: #e2e8f0 !important; }

html.light nav .btn-secondary {
    background: #e2e8f0;
    color: #0f172a;
}

html.light nav .btn-secondary:hover {
    background: #cbd5e1;
}

html.light nav .btn-primary {
    background: #2563eb;
    color: #ffffff;
}

html.light nav .btn-primary:hover {
    background: #1d4ed8;
}

html.light nav i { color: inherit; }
html.light nav i.text-white { color: #ffffff !important; }

/* Iconos en tarjetas de productos (mantener blanco en claro) */
html.light .product-card .fa-heart,
html.light .product-card .fa-shopping-cart {
    color: #ffffff !important;
}

/* Alpine confirm modal (store) - overlay real */
.nr-alpine-confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.75);
}

.nr-alpine-confirm-modal {
    width: 100%;
    max-width: 28rem;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(71, 85, 105, 0.6);
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

html.light .nr-alpine-confirm-modal {
    background: #ffffff;
    border-color: #e2e8f0;
}
