/* 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;
}

.nr-confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 23, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1.25rem;
}

.nr-confirm-backdrop.hidden {
    display: none;
}

.nr-confirm-modal {
    background: #0e111f;
    border-radius: 1.25rem;
    width: min(500px, 100%);
    padding: 1.75rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 35px 60px rgba(3, 6, 23, 0.8);
    text-align: left;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

.nr-confirm-body {
    margin-left: 1rem;
    flex: 1;
}

.nr-confirm-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nr-confirm-icon i {
    color: #ef4444;
    font-size: 1.3rem;
}

.nr-confirm-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f8fafc;
}

.nr-confirm-description {
    margin-top: 0.35rem;
    color: #cbd5f5;
    font-size: 0.95rem;
    line-height: 1.5;
}

.nr-confirm-lines {
    margin-top: 0.85rem;
    color: #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.nr-confirm-lines-list {
    margin-top: 0.4rem;
    list-style: disc inside;
    padding-left: 0;
    color: #cbd5f5;
    font-size: 0.9rem;
}

.nr-confirm-warning-box {
    margin-top: 0.9rem;
    border: 1px solid #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 0.65rem;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.nr-confirm-warning-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nr-confirm-warning-icon i {
    color: #ef4444;
    font-size: 0.8rem;
}

.nr-confirm-warning-text {
    flex: 1;
    color: #f87171;
    font-size: 0.9rem;
    font-weight: 600;
}

.nr-confirm-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.nr-confirm-btn {
    min-width: 110px;
    text-align: center;
    padding: 0.65rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 150ms ease, box-shadow 150ms ease;
    cursor: pointer;
    border: none;
}

.nr-confirm-btn-primary {
    background: #ef4444;
    color: #fff;
    box-shadow: none;
}

.nr-confirm-btn-secondary {
    background: rgba(15, 23, 42, 0.8);
    color: #cbd5f5;
    border: 1px solid rgba(148, 163, 184, 0.5);
}

.nr-confirm-btn:hover {
    transform: translateY(-1px);
}

/* 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;
}
